* util/grub-install.in: Account for possible escaped comma in device

name.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-12-24 02:50:30 +01:00
parent 165099ea42
commit e77e325f6f
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2011-12-24 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-install.in: Account for possible escaped comma in device
name.
2011-12-24 Vladimir Serbinenko <phcoder@gmail.com>
* util/ieee1275/ofpath.c (of_path_of_ide): Fix address for secondary

View file

@ -538,13 +538,13 @@ if [ "x${devabstraction_module}" = "x" ] ; then
else
install_drive="`"$grub_probe" --device-map="${device_map}" --target=drive --device "${install_device}"`" || exit 1
fi
install_drive="`echo "${install_drive}" | sed -e s/,[a-z0-9,]*//g`"
install_drive="`echo "${install_drive}" | sed -e 's/^(\(\([^,\\\\]\|\\\\\\\\\|\\\\,\)*\)\(\(,[a-zA-Z0-9]*\)*\))$/\1/'`"
fi
grub_drive="`"$grub_probe" --device-map="${device_map}" --target=drive --device "${grub_device}"`" || exit 1
# Strip partition number
grub_partition="`echo "${grub_drive}" | sed -e 's/^[^,]*[,)]//; s/)$//'`"
grub_drive="`echo "${grub_drive}" | sed -e s/,[a-z0-9,]*//g`"
grub_partition="`echo "${grub_drive}" | sed -e 's/^(\(\([^,\\\\]\|\\\\\\\\\|\\\\,\)*\)\(\(,[a-zA-Z0-9]*\)*\))$/\3/'`"
grub_drive="`echo "${grub_drive}" | sed -e 's/^(\(\([^,\\\\]\|\\\\\\\\\|\\\\,\)*\)\(\(,[a-zA-Z0-9]*\)*\))$/\1/'`"
if ([ "x$disk_module" != x ] && [ "x$disk_module" != xbiosdisk ]) || [ "x${grub_drive}" != "x${install_drive}" ] || ([ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${platform}" != x"ieee1275" ]); then
# generic method (used on coreboot and ata mod)
uuid="`"$grub_probe" --device-map="${device_map}" --target=fs_uuid --device "${grub_device}"`"
@ -569,7 +569,8 @@ if [ "x${devabstraction_module}" = "x" ] ; then
if [ x"$grub_partition" = x ]; then
prefix_drive="()"
else
prefix_drive="(,$grub_partition)"
# Comma is already there
prefix_drive="($grub_partition)"
fi
fi
else