]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-install.in: Handle partitionless disks.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 16 Oct 2010 22:28:19 +0000 (00:28 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 16 Oct 2010 22:28:19 +0000 (00:28 +0200)
ChangeLog
util/grub-install.in

index 731abcb0f14b190097d29c68081b07a9db5310e2..b5c091ee185b6a62f3cd557062af0f5a04bdb3a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-10-17  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-install.in: Handle partitionless disks.
+
 2010-10-17  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/grub-setup.c (setup): Don't clean blocklists before readability
index cace825935ac29acd21823242f26b6e33bb65db4..21ac20f8d44da7830fb6393e6653953fe4e507a6 100644 (file)
@@ -512,7 +512,7 @@ if [ "x${devabstraction_module}" = "x" ] ; then
     grub_drive="`$grub_probe --target=drive --device ${grub_device}`" || exit 1
 
     # Strip partition number
-    grub_partition="`echo ${grub_drive} | sed -e 's/^[^,]*,//; s/)$//'`"
+    grub_partition="`echo ${grub_drive} | sed -e 's/^[^,]*[,)]//; s/)$//'`"
     grub_drive="`echo ${grub_drive} | sed -e s/,[a-z0-9,]*//g`"
     if [ "$disk_module" = ata ] ; then
         # generic method (used on coreboot and ata mod)
@@ -537,7 +537,11 @@ if [ "x${devabstraction_module}" = "x" ] ; then
         modules="$modules search_fs_uuid"
     elif [ "x$platform" = xefi ] || [ "x$platform" = xpc ]; then
         # we need to hardcode the partition number in the core image's prefix.
-        prefix_drive="(,$grub_partition)"
+       if [ x"$grub_partition" = x ]; then
+            prefix_drive="()"
+       else
+            prefix_drive="(,$grub_partition)"
+       fi
     fi
 else
     prefix_drive=`$grub_probe --target=drive --device ${grub_device}` || exit 1