]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
fix a bug in grub-install, which affected only GNU/Hurd.
authorokuji <okuji@localhost>
Sat, 30 Sep 2000 01:35:21 +0000 (01:35 +0000)
committerokuji <okuji@localhost>
Sat, 30 Sep 2000 01:35:21 +0000 (01:35 +0000)
ChangeLog
util/grub-install.in

index ac230f4256cc9d59990555bbe2fc0aaec27e3a0c..050cdb8d26d854aedc9a98153e7901a6a197b33b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-09-30  OKUJI Yoshinori  <okuji@gnu.org>
+
+       * util/grub-install.in (convert): The code for gnu* (i.e.
+       GNU/Hurd) was rewritten, since it didn't work for BSD
+       partitions.
+       Use "$tmp_disk *$" instead of "$tmp_disk" to get the drive name.
+       
 2000-09-30  OKUJI Yoshinori  <okuji@gnu.org>
 
        * stage2/fsys_reiserfs.c (reiserfs_mount): Check if the length
index cf782cb0d8b693d9ca0ec7c41f216d7521046ea8..8ed097a7a0db71425b2564e7337dc652f32b4171 100644 (file)
@@ -76,7 +76,7 @@ convert () {
        tmp_disk=`echo "$1" | sed 's%\([sh]d[a-z]\)[0-9]*$%\1%'`
        tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
     gnu*)
-       tmp_disk=`echo "$1" | sed 's%s[0-9]*[a-g]?%%'`
+       tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`
        tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
     *)
        echo "grub-install does not support your OS yet." 1>&2
@@ -84,7 +84,7 @@ convert () {
     esac
 
     # Get the drive name.
-    tmp_drive=`grep -v '^#' $device_map | grep "$tmp_disk" \
+    tmp_drive=`grep -v '^#' $device_map | grep "$tmp_disk *$" \
        | sed 's%.*\(([hf]d[0-9][a-g0-9,]*)\).*%\1%'`
 
     # If not found, print an error message and exit.
@@ -100,14 +100,17 @@ convert () {
        linux*)
            echo "$tmp_drive" | sed "s%)$%,`expr $tmp_part - 1`)%" ;;
        gnu*)
-           tmp_pc_slice=`echo "$tmp_part" | sed "s%s\([0-9]*\)[a-g]?%\1%"`
-           tmp_bsd_partition=`echo "$tmp_part" \
-               | sed "s%s[0-9]*\([a-g]?\)%\1%"`
-           tmp_drive=`echo "$tmp_drive" \
-               | sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"`
-           if test "x$tmp_bsd_partition" != x; then
+           if echo $tmp_part | grep "^s" >/dev/null; then
+               tmp_pc_slice=`echo $tmp_part \
+                   | sed "s%s\([0-9]*\)[a-g]*$%\1%"`
                tmp_drive=`echo "$tmp_drive" \
-                   | sed "s%)%,\`sed y%abcdefg%0123456%\`)%"`
+                   | sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"`
+           fi
+           if echo $tmp_part | grep "[a-g]$" >/dev/null; then
+               tmp_bsd_partition=`echo "$tmp_part" \
+                   | sed "s%[^a-g]*\([a-g]\)$%\1%"`
+               tmp_drive=`echo "$tmp_drive" \
+                   | sed "s%)%,$tmp_bsd_partition)%"`
            fi
            echo "$tmp_drive" ;;
        esac