Switch to new grub-mkimage syntax

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-04-26 21:27:41 +02:00
parent 8ea6ecb36d
commit 88d046d01e
5 changed files with 18 additions and 15 deletions

View file

@ -35,11 +35,7 @@ pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${t
localedir=@datadir@/locale
grub_setup=${sbindir}/`echo grub-setup | sed ${transform}`
if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] || [ "${target_cpu}-${platform}" = "mips-yeeloong" ] ; then
grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
else
grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}`
fi
grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
@ -346,16 +342,23 @@ else
prefix_drive=`$grub_probe --target=drive --device ${grub_device}` || exit 1
fi
case "${target_cpu}-${platform}"
i386-pc) mkimage_target=i386-pc ;;
sparc64-ieee1275) mkimage_target=sparc64-ieee1275-raw ;;
mips-yeeloong) mkimage_target=mipsel-yeeloong-elf ;;
*) mkimage_target=i386-coreboot;
esac
if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then
$grub_mkimage ${config_opt} --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
$grub_mkimage ${config_opt} -O ${mkimage_target} --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
# Now perform the installation.
$grub_setup ${setup_verbose} ${setup_force} --directory=${grubdir} --device-map=${device_map} \
${install_device} || exit 1
elif [ "${target_cpu}-${platform}" = "mips-yeeloong" ] ; then
$grub_mkimage ${config_opt} -f ${font} -d ${pkglibdir} -O elf --output=/boot/grub.elf --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
$grub_mkimage ${config_opt} -f ${font} -d ${pkglibdir} -O ${mkimage_target} --output=/boot/grub.elf --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
else
$grub_mkimage ${config_opt} -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
$grub_mkimage -O ${mkimage_target} ${config_opt} -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
fi
echo "Installation finished. No error reported."

View file

@ -160,7 +160,7 @@ EOF
tar -C ${memdisk_dir} -cf ${memdisk_img} boot
rm -rf ${memdisk_dir}
grub-mkelfimage -d ${coreboot_dir}/ -m ${memdisk_img} -o ${iso9660_dir}/boot/multiboot.img \
grub-mkimage -O i386-coreboot -d ${coreboot_dir}/ -m ${memdisk_img} -o ${iso9660_dir}/boot/multiboot.img \
memdisk tar search iso9660 configfile sh \
ata at_keyboard
rm -f ${memdisk_img}
@ -171,7 +171,7 @@ fi
if test -e "${pc_dir}" ; then
echo "Enabling BIOS support ..."
core_img=`mktemp "$MKTEMP_TEMPLATE"`
grub-mkimage -d ${pc_dir}/ -O i386-pc -o ${core_img} --prefix=/boot/grub/i386-pc \
grub-mkimage -O i386-pc -d ${pc_dir}/ -O i386-pc -o ${core_img} --prefix=/boot/grub/i386-pc \
iso9660 biosdisk
cat ${pc_dir}/cdboot.img ${core_img} > ${iso9660_dir}/boot/grub/i386-pc/eltorito.img

View file

@ -213,7 +213,7 @@ devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_ma
# The order in this list is critical. Be careful when modifying it.
modules="$modules $fs_module $partmap_module $devabstraction_module"
$grub_mkimage --output=${grubdir}/grub.efi $modules || exit 1
$grub_mkimage -O ${target_cpu}-efi --output=${grubdir}/grub.efi $modules || exit 1
# Prompt the user to check if the device map is correct.
echo "Installation finished. No error reported."

View file

@ -34,7 +34,7 @@ target_cpu=@target_cpu@
platform=@platform@
pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}`
grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
@ -189,7 +189,7 @@ devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_ma
modules="$modules $fs_module $partmap_module $devabstraction_module"
# Now perform the installation.
"$grub_mkimage" --directory=${pkglibdir} --output=${grubdir}/grub $modules || exit 1
"$grub_mkimage" -O ${target_cpu}-ieee1275 --directory=${pkglibdir} --output=${grubdir}/grub $modules || exit 1
if test $update_nvram = yes; then
set $ofpathname dummy

View file

@ -30,7 +30,7 @@ target_cpu=@target_cpu@
platform=@platform@
pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}`
grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
# Usage: usage
# Print the usage.
@ -104,7 +104,7 @@ boot_dir=${iso_dir}/boot/grub
mkdir ${iso_dir}/boot
mkdir ${boot_dir}
core_img=${boot_dir}/grub.img
${grub_mkimage} -n -d ${input_dir}/ -o ${core_img} ${modules}
${grub_mkimage} -O powerpc-ieee1275 -n -d ${input_dir}/ -o ${core_img} ${modules}
genisoimage -hfs -part -no-desktop -r -J -o ${output_image} \
-map ${map_file} -hfs-bless ${boot_dir} -chrp-boot -sysid PPC \
${iso_dir}