* util/grub-install.in: Fix handling of prefix containing spaces.
This commit is contained in:
parent
6f5d5ee865
commit
4f8e368fc0
2 changed files with 20 additions and 8 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2012-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* util/grub-install.in: Fix handling of prefix containing spaces.
|
||||||
|
|
||||||
2012-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-05-04 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/squash4.c (grub_squash_inode): Fix offset field.
|
* grub-core/fs/squash4.c (grub_squash_inode): Fix offset field.
|
||||||
|
|
|
@ -613,13 +613,13 @@ if [ "x${relative_grubdir}" = "x" ] ; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prefix_drive=
|
prefix_drive=
|
||||||
config_opt=
|
config_opt_file=
|
||||||
|
|
||||||
rm -f "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
rm -f "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
||||||
|
|
||||||
if [ "x${debug_image}" != x ]; then
|
if [ "x${debug_image}" != x ]; then
|
||||||
echo "set debug='${debug_image}'" >> "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
echo "set debug='${debug_image}'" >> "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
||||||
config_opt="-c ${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg "
|
config_opt_file="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x${devabstraction_module}" = "x" ] ; then
|
if [ "x${devabstraction_module}" = "x" ] ; then
|
||||||
|
@ -668,8 +668,8 @@ if [ "x${devabstraction_module}" = "x" ] ; then
|
||||||
echo "search.file '${relfile}' root $hints " >> "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
echo "search.file '${relfile}' root $hints " >> "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
||||||
search_module=search_fs_file
|
search_module=search_fs_file
|
||||||
fi
|
fi
|
||||||
echo 'set prefix=($root)'"${relative_grubdir}" >> "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
echo 'set prefix=($root)'"$(echo "${relative_grubdir}" | sed "s,\\([ \"'\\\\]\\),\\\\\\1,g")" >> "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
||||||
config_opt="-c ${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg "
|
config_opt_file="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
||||||
modules="$modules $search_module"
|
modules="$modules $search_module"
|
||||||
else
|
else
|
||||||
# we need to hardcode the partition number in the core image's prefix.
|
# we need to hardcode the partition number in the core image's prefix.
|
||||||
|
@ -685,7 +685,7 @@ else
|
||||||
for uuid in "`echo "${grub_device}" | xargs "${grub_probe}" --target=cryptodisk_uuid --device`"; do
|
for uuid in "`echo "${grub_device}" | xargs "${grub_probe}" --target=cryptodisk_uuid --device`"; do
|
||||||
echo "cryptomount -u $uuid" >> "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
echo "cryptomount -u $uuid" >> "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
||||||
done
|
done
|
||||||
config_opt="-c ${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg "
|
config_opt_file="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/load.cfg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prefix_drive=`"$grub_probe" --device-map="${device_map}" --target=drive --device "${grub_device}"` || exit 1
|
prefix_drive=`"$grub_probe" --device-map="${device_map}" --target=drive --device "${grub_device}"` || exit 1
|
||||||
|
@ -704,8 +704,11 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
|
||||||
*) imgext=img ;;
|
*) imgext=img ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ x"$config_opt_file" = x ]; then
|
||||||
"$grub_mkimage" ${config_opt} -d "${source_dir}" -O ${mkimage_target} --output="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" --prefix="${prefix_drive}${relative_grubdir}" $modules || exit 1
|
"$grub_mkimage" -d "${source_dir}" -O "${mkimage_target}" --output="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" --prefix="${prefix_drive}${relative_grubdir}" $modules || exit 1
|
||||||
|
else
|
||||||
|
"$grub_mkimage" -c "${config_opt_file}" -d "${source_dir}" -O "${mkimage_target}" --output="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" --prefix="${prefix_drive}${relative_grubdir}" $modules || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Backward-compatibility kludges
|
# Backward-compatibility kludges
|
||||||
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "mipsel-loongson" ]; then
|
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "mipsel-loongson" ]; then
|
||||||
|
@ -713,7 +716,12 @@ if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "mipsel-loongson" ]
|
||||||
elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "powerpc-ieee1275" ]; then
|
elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "powerpc-ieee1275" ]; then
|
||||||
cp "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" "${grubdir}/grub"
|
cp "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" "${grubdir}/grub"
|
||||||
elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-efi" ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "x86_64-efi" ]; then
|
elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-efi" ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "x86_64-efi" ]; then
|
||||||
"$grub_mkimage" ${config_opt} -d "${source_dir}" -O ${mkimage_target} --output="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/grub.efi" --prefix="" $modules || exit 1
|
|
||||||
|
if [ x"$config_opt_file" = x ]; then
|
||||||
|
"$grub_mkimage" -d "${source_dir}" -O "${mkimage_target}" --output="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/grub.efi" --prefix="" $modules || exit 1
|
||||||
|
else
|
||||||
|
"$grub_mkimage" -c "${config_opt_file}" -d "${source_dir}" -O "${mkimage_target}" --output="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/grub.efi" --prefix="" $modules || exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue