bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug#74740: grub-install doesn't work when using devfs


From: Roderich Schupp
Subject: Bug#74740: grub-install doesn't work when using devfs
Date: Sat, 14 Oct 2000 15:37:46 +0200

Package: grub
Version: 0.5.96

grub-install doesn't work on a Linux kernel with devfs enabled if you
use
the "native" devfs device names (in /etc/fstab etc). Reasons:
- incorrect parsing of output of "df" (assumes that the device namespace
  is flat below /dev)
- incorrect extraction of device name for whole disk and partition
number
  from partition's device name.
See below for a fix.

Background:
devfs uses names like "/dev/scsi/host0/bus0/target10/lun0/part2" for
partitions (similar for IDE disks) and
"/dev/scsi/host0/bus0/target10/lun0/disc"
for the corresponding whole disk.

Cheers, Roderich

--- ORIG/util/grub-install.in   Sat Sep 30 03:35:21 2000
+++ ./util/grub-install.in      Sat Oct 14 14:01:45 2000
@@ -73,8 +73,10 @@
     # Break the device name into the disk part and the partition part.
     case "$host_os" in
     linux*)
-       tmp_disk=`echo "$1" | sed 's%\([sh]d[a-z]\)[0-9]*$%\1%'`
-       tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
+       tmp_disk=`echo "$1" | sed -e 's%\(/[sh]d[a-z]\)[0-9]*$%\1%'
+                                 -e 's%/part[0-9]*$%/disc%'`
+       tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%'
+                                 -e
's%.*/\(disc\|part\([0-9]*\)\)$%\2%'` ;;
     gnu*)
        tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`
        tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
@@ -232,9 +234,9 @@
 # For now, this uses the program `df' to get the device name, but is
 # this really portable?
 root_device=`df ${rootdir}/ | grep /dev/ \
-    | sed 's%.*\(/dev/[a-z0-9]*\).*%\1%'`
+    | sed 's%.*\(/dev/[a-z0-9/]*\).*%\1%'`
 bootdir_device=`df ${bootdir} | grep /dev/ \
-    | sed 's%.*\(/dev/[a-z0-9]*\).*%\1%'`
+    | sed 's%.*\(/dev/[a-z0-9/]*\).*%\1%'`
 
 # Check if the boot directory is in the same device as the root
directory.
@@ -252,7 +254,7 @@
 # Check if the root directory exists in the same device as the grub
 # directory.
 grubdir_device=`df ${grubdir} | grep /dev/ \
-    | sed 's%.*\(/dev/[a-z0-9]*\).*%\1%'`
+    | sed 's%.*\(/dev/[a-z0-9/]*\).*%\1%'`
 if test "x$grubdir_device" != "x$root_device"; then
     # For now, cannot deal with this situation.
     cat <<EOF 1>&2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]