# # This is disabled by default, as GRUB does good job by itself # # This is rather a proof-of-concept example how such things can be implemented # here. # ENABLED=no LABEL=GRUB ARCH=x86_64 BINARY=grub.efi GRUB_EXTRA_MODULES="" install_files() { local target local module local modules local final_modules local drive local prefix modules="" modules="$modules $(/sbin/grub-probe --target=fs /boot)" modules="$modules $(/sbin/grub-probe --target=abstraction /boot)" modules="$modules part_$(/sbin/grub-probe --target=partmap /boot)" modules="$modules search_fs_file search_fs_uuid" modules="$modules $GRUB_EXTRA_MODULES" drive="$(/sbin/grub-probe --target=drive /boot)" if [ "$ARCH" = "x86_64" ] ; then target="x86_64-efi" else target="i386-efi" fi if /bin/mountpoint -q /boot ; then prefix="$drive/grub" else prefix="$drive/boot/grub" fi final_modules="" for module in $modules ; do [ -e "/lib/grub/$target/$module.mod" ] && final_modules="$final_modules $module" done is_yes $VERBOSE && set -x /sbin/grub-mkimage -O "$target" -d /lib/grub/$target \ --output=$DESTDIR/grub.efi \ --prefix="$prefix" $final_modules } # vi: ft=sh