]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2007-05-11 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Fri, 11 May 2007 15:53:02 +0000 (15:53 +0000)
committerrobertmh <robertmh@localhost>
Fri, 11 May 2007 15:53:02 +0000 (15:53 +0000)
* util/update-grub.in: Create device.map if it doesn't already exist,
before attempting to run grub-probe.
Check for grub-probe and grub-mkdevicemap with the same code
grub-install is using.
Remove test mode.

ChangeLog
util/update-grub.in

index aea205f17e9e03c153863fd37acd510ab0c5c0a0..7b5cef72d69efb95b61d12270fab8f7db31980e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-05-11  Robert Millan  <rmh@aybabtu.com>
+
+       * util/update-grub.in: Create device.map if it doesn't already exist,
+       before attempting to run grub-probe.
+       Check for grub-probe and grub-mkdevicemap with the same code
+       grub-install is using.
+       Remove test mode.
+
 2007-05-09  Jeroen Dekkers  <jeroen@dekkers.cx>
 
        * Makefile.in: Add the datarootdir autoconf variable.
index c9f1601f7f12215737abbfa06049975a96cf6bc7..7a8fe77368fa512ba2b6df7796acef96e9a9e30d 100644 (file)
 
 transform="@program_transform_name@"
 
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+sbindir=@sbindir@
 sysconfdir=@sysconfdir@
 grub_prefix=`echo /boot/grub | sed ${transform}`
 grub_cfg=${grub_prefix}/grub.cfg
 update_grub_dir=${sysconfdir}/grub.d
-test_mode=false
+
+grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
+grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 
 if [ "x$UID" = "x" ] ; then
   UID=`id -u`
@@ -38,34 +43,31 @@ if [ "$1" = "-y" ] ; then
   echo "$0: warning: Ignoring -y option (no longer needed)." >&2
 fi
 
-if test -d ${update_grub_dir} ; then : ; else
-  if test -d ./grub.d ; then
-    update_grub_dir=./grub.d
-    test_mode=true
-  fi
+set $grub_mkdevicemap dummy
+if test -f "$1"; then
+    :
+else
+    echo "$1: Not found." 1>&2
+    exit 1
 fi
 
-found=false
-old_IFS="$IFS"
-IFS=:
-for i in $PATH ; do
-  if test -x "$i/grub-probe" ; then
-    found=true
-    break
-  fi
-done
-IFS="$old_IFS"
-if ${found} ; then : ; else
-  echo "$0: grub-probe not found in PATH." >&2
-  exit 1
+set $grub_probe dummy
+if test -f "$1"; then
+    :
+else
+    echo "$1: Not found." 1>&2
+    exit 1
 fi
 
-if ${test_mode} ; then : ; else
-  mkdir -p ${grub_prefix}
-  exec > ${grub_cfg}.new
-  chmod 444 ${grub_cfg}.new
+mkdir -p ${grub_prefix}
+
+if test -e ${grub_prefix}/device.map ; then : ; else
+  grub-mkdevicemap
 fi
 
+exec > ${grub_cfg}.new
+chmod 444 ${grub_cfg}.new
+
 if test -f ${sysconfdir}/default/grub ; then
   . ${sysconfdir}/default/grub
 fi
@@ -100,8 +102,6 @@ for i in ${update_grub_dir}/* ; do
 done
 
 # none of the children aborted with error, install the new grub.cfg
-if ${test_mode} ; then : ; else
-  mv ${grub_cfg}.new ${grub_cfg}
-fi
+mv ${grub_cfg}.new ${grub_cfg}
 
 echo "done" >&2