* Ross Boylan <[EMAIL PROTECTED]> [050406, 13:03]: > > 3. Add --boot-device and --root-device arguments. If present, these > will be used at the appropriate places. I believe that the code still > requires the directory names for other operations (e.g., checking that > appropriate files are present.) This has the advantage over 2) of > being more transparent to someone reading the man page. It has the > disadvantage of requiring the arguments to be specified every time > (whereas in 2 when you update device.map you're set), and of involving > more extensive code changes.
Well, I don't think that --root-device is necessary. The attached patch introduces a --boot-device option that should resolve the problem. It's easy to add also --root-device if you think it's needed.
--- /root/grub-install 2006-08-29 19:57:08.000000000 +0200 +++ /sbin/grub-install 2006-08-30 09:49:24.000000000 +0200 @@ -65,6 +65,7 @@ -v, --version print the version information and exit --root-directory=DIR install GRUB images under the directory DIR instead of the root directory + --boot-device=DEVICE specify the device which contains /boot directory --grub-shell=FILE use FILE as the grub shell --no-floppy do not probe any floppy drive --force-lba force GRUB to use LBA mode even for a buggy @@ -149,7 +150,8 @@ -e 's%\(fd[0-9]*\)$%\1%' \ -e 's%/part[0-9]*$%/disc%' \ -e 's%\(c[0-7]d[0-9]*\).*$%\1%' \ - -e 's%\(e[0-9]\.[0-9]*\).*$%\1%'` + -e 's%\(e[0-9]\.[0-9]*\).*$%\1%' \ + -e 's%evms/%%'` tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \ -e 's%.*d[0-9]*p%%' \ -e 's%.*/fd[0-9]*$%%' \ @@ -289,6 +291,9 @@ exit 0 ;; --root-directory=*) rootdir=`echo "$option" | sed 's/--root-directory=//'` ;; + --boot-device=*) + bootdev=`echo "$option" | sed 's/--boot-device=//'` + test -b $bootdev || echo "boot device *must* be a block special file" ;; --grub-shell=*) grub_shell=`echo "$option" | sed 's/--grub-shell=//'` ;; --no-floppy) @@ -431,8 +436,13 @@ esac # Get the root drive. - root_device=`find_device ${rootdir}` - bootdir_device=`find_device ${bootdir}` + if test -n "$bootdev"; then + root_device=${bootdev} + bootdir_device=${bootdev} + else + root_device=`find_device ${rootdir}` + bootdir_device=`find_device ${bootdir}` + fi # Check if the boot directory is in the same device as the root directory. if test "x$root_device" != "x$bootdir_device"; then @@ -449,13 +459,17 @@ # Check if the root directory exists in the same device as the grub # directory. -grubdir_device=`find_device ${grubdir}` +if test -n "$bootdev"; then + grubdir_device=${bootdev} +else + grubdir_device=`find_device ${grubdir}` +fi if test "x$grubdir_device" != "x$root_device"; then # For now, cannot deal with this situation. cat <<EOF 1>&2 -You must set the root directory by the option --root-directory, because -$grubdir does not exist in the root device $root_device. +You must set the root directory by the option --root-directory or +--boot-device, because $grubdir does not exist in the root device $root_device. EOF exit 1 fi
pgp1sedieciZP.pgp
Description: PGP signature