From e77e325f6f9ea8c3d4e777ed010e8e021d486abc Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 24 Dec 2011 02:50:30 +0100 Subject: [PATCH] * util/grub-install.in: Account for possible escaped comma in device name. --- ChangeLog | 5 +++++ util/grub-install.in | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15ce35207..529ab3d71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-12-24 Vladimir Serbinenko + + * util/grub-install.in: Account for possible escaped comma in device + name. + 2011-12-24 Vladimir Serbinenko * util/ieee1275/ofpath.c (of_path_of_ide): Fix address for secondary diff --git a/util/grub-install.in b/util/grub-install.in index ea8699a44..78a7fed74 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -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