bug-grub
[Top][All Lists]
Advanced

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

Bug#79515: grub-install fails with floppy


From: Bastian Kleineidam
Subject: Bug#79515: grub-install fails with floppy
Date: Wed, 13 Dec 2000 14:22:03 +0100 (CET)

Package: grub
Version: 0.5.96.1


Hi Gordon,

running grub-install with a floppy target fails (/floppy ismounted on
/dev/fd0)
[...]
address@hidden://usr/sbin> grub-install --root-directory=/floppy '(fd0)'
/usr/sbin/grub-install: -e: command not found
/usr/sbin/grub-install: -e: command not found
expr: non-numeric argument

    GRUB  version 0.5.96.1  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> root (fd0,)

Error 12: Invalid device requested

grub> setup  --stage2=/floppy/boot/grub/stage2 --prefix=/boot/grub (fd0)

Error 12: Invalid device requested

grub> quit
address@hidden://usr/sbin> 
[...]

I have an uptodate woody system, running on 2.2.17 Intel architecture.

The following patch makes two things:
a) insert set -e because if something goes wrong, the following grub
   command can be very dangerous.
b) correct 'sed' statements when stripping device parts

--- grub-install.orig   Wed Dec 13 13:25:21 2000
+++ grub-install        Wed Dec 13 14:03:35 2000
@@ -1,5 +1,5 @@
 #! /bin/sh
-
+set -e
 # Install GRUB on your drive.
 #   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
 #
@@ -76,10 +76,11 @@
     # Break the device name into the disk part and the partition part.
     case "$host_os" in
     linux*)
-       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%'`
+       tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \
+                           | sed -e 's%/part[0-9]*$%/disc%'`
+       tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \
+                           | sed -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \
+                           | sed -e "s%$tmp_disk%%"`
        ;;
     gnu*)
        tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`



Greetings, Bastian





reply via email to

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