]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-install.in: Account for possible escaped comma in device
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 24 Dec 2011 01:50:30 +0000 (02:50 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 24 Dec 2011 01:50:30 +0000 (02:50 +0100)
name.

ChangeLog
util/grub-install.in

index 15ce35207908e206e66a51ba19a999dcf3986eef..529ab3d7132a20b3ebd3d9e4714bb0a9821bf136 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index ea8699a441b6769f97dbeec84aae8610f7124796..78a7fed74ba83d88f6f55357a29e52834b32b092 100644 (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