* util/grub-mkrescue.in: Sync up with grub-install in terms of how

we handle finding grub-mkimage.  Default to finding grub-mkimage in
${bindir} with program_transform_name applied, and provide a
--grub-mkimage option to override this.
This commit is contained in:
Colin Watson 2010-05-18 11:51:37 +01:00
parent 1d3293d67d
commit 7fb5c25fd0
2 changed files with 21 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2010-05-18 Colin Watson <cjwatson@ubuntu.com>
* util/grub-mkrescue.in: Sync up with grub-install in terms of how
we handle finding grub-mkimage. Default to finding grub-mkimage in
${bindir} with program_transform_name applied, and provide a
--grub-mkimage option to override this.
2010-05-17 Vladimir Serbinenko <phcoder@gmail.com>
Remove grub-mkisofs.

View file

@ -37,6 +37,7 @@ pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-pc
efi32_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-efi
efi64_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi
rom_directory=
grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
# Usage: usage
# Print the usage.
@ -50,6 +51,7 @@ Make GRUB rescue image.
--output=FILE save output in FILE [required]
--modules=MODULES pre-load specified modules MODULES
--rom-directory=DIR save rom images in DIR [optional]
--grub-mkimage=FILE use FILE as grub-mkimage
$0 generates a bootable rescue image with specified source files or directories.
@ -78,6 +80,8 @@ for option in "$@"; do
PATH=${override_dir}:$PATH
export PATH
;;
--grub-mkimage=*)
grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;;
-*)
echo "Unrecognized option \`$option'" 1>&2
usage
@ -94,6 +98,14 @@ if [ "x${output_image}" = x ] ; then
exit 1
fi
set $grub_mkimage dummy
if test -f "$1"; then
:
else
echo "$1: Not found." 1>&2
exit 1
fi
if test "x$TMP" != x; then
MKTEMP_TEMPLATE="$TMP/grub-mkrescue.XXXXXXXXXX"
elif test "x$TEMP" != x; then
@ -157,7 +169,7 @@ EOF
tar -C ${memdisk_dir} -cf ${memdisk_img} boot
rm -rf ${memdisk_dir}
grub-mkimage -O ${platform} -d "${source_directory}" -m "${memdisk_img}" -o "$3" --prefix='(memdisk)/boot/grub' \
$grub_mkimage -O ${platform} -d "${source_directory}" -m "${memdisk_img}" -o "$3" --prefix='(memdisk)/boot/grub' \
search iso9660 configfile normal sh memdisk tar $4
rm -rf ${memdisk_img}
}
@ -207,7 +219,7 @@ grub_mkisofs_arguments="${grub_mkisofs_arguments} --modification-date=$(echo ${i
if test -e "${pc_dir}" ; then
echo "Enabling BIOS support ..."
core_img=`mktemp "$MKTEMP_TEMPLATE"`
grub-mkimage -O i386-pc -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