]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-install.in: Ignore install device on platforms
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 22 Jan 2011 14:10:29 +0000 (15:10 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 22 Jan 2011 14:10:29 +0000 (15:10 +0100)
where it doesn't make sense. Always use UUIDs except on pc, efi and
sparc64.
Reported by: Daniel Kahn Gillmor.

ChangeLog
util/grub-install.in

index f44a91c6be96faec07ee9f5e2625cd44fbcfdfa9..ce6b6f7cf5291c610190fe2aa4909f532457d1a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-22  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-install.in: Ignore install device on platforms
+       where it doesn't make sense. Always use UUIDs except on pc, efi and
+       sparc64.
+       Reported by: Daniel Kahn Gillmor.
+
 2011-01-22  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/bus/bonito.c (write_bases): Fix direction of the shift.
index 90360c279853785b9c7ebc4ae01ccf9268c92cce..1ae00b2fdb58ec108789ccf8e5fd5b15855adbe4 100644 (file)
@@ -270,6 +270,11 @@ if test "x$install_device" = x && ([ "${target_cpu}-${platform}" = "i386-pc" ] \
     exit 1
 fi
 
+if ! ([ "${target_cpu}-${platform}" = "i386-pc" ] \
+    || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]); then
+    install_device=
+fi
+
 # If the debugging feature is enabled, print commands.
 setup_verbose=
 if test x"$debug" = xyes; then
@@ -516,27 +521,24 @@ if [ "x${devabstraction_module}" = "x" ] ; then
     # Strip partition number
     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
+    if [ "$disk_module" = ata ] || [ "x${grub_drive}" != "x${install_drive}" ] || ([ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${target_cpu}-${platform}" != x"sparc64-ieee1275" ]) ; then
         # generic method (used on coreboot and ata mod)
         uuid="`"$grub_probe" --device-map="${device_map}" --target=fs_uuid --device "${grub_device}"`"
         if [ "x${uuid}" = "x" ] ; then
-          echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
+          if [ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${target_cpu}-${platform}" != x"sparc64-ieee1275" ]; then
+             echo "UUID needed with $platform, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
+          elif [ "$disk_module" = ata ]; then
+             echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
+          else
+             echo "UUID needed with cross-disk installs, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
+          fi
+             
           exit 1
         fi
         echo "search.fs_uuid ${uuid} root " >> "${grubdir}/load.cfg"
        echo 'set prefix=($root)'"${relative_grubdir}" >> "${grubdir}/load.cfg"
        config_opt="-c ${grubdir}/load.cfg "
         modules="$modules search_fs_uuid"
-    elif [ "x${grub_drive}" != "x${install_drive}" ] ; then
-        uuid="`"$grub_probe" --device-map="${device_map}" --target=fs_uuid --device "${grub_device}"`"
-        if [ "x${uuid}" = "x" ] ; then
-          echo "You attempted a cross-disk install, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
-          exit 1
-        fi
-        echo "search.fs_uuid ${uuid} root " >> ${grubdir}/load.cfg
-       echo 'set prefix=($root)'"${relative_grubdir}" >> ${grubdir}/load.cfg
-       config_opt="-c ${grubdir}/load.cfg "
-        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.
        if [ x"$grub_partition" = x ]; then