On Saturday 09 December 2000 11:12, OKUJI Yoshinori wrote:
> From: Leendert Meyer <[EMAIL PROTECTED]>
> Subject: Re: grub-install: expr complains with "non-numeric argument"
> Date: Sat, 9 Dec 2000 03:52:22 +0100
>
> > I'm not that experienced so this was a tough one for me! But I succeeded
> > to install grub on a floppy disk. See attached patch for "grub-install".
>
> Thanks. I've checked in your patch.
The problem and the solution was already reported by Erik Schoenfelder, see:
http://mail.gnu.org/pipermail/bug-grub/2000-November/003960.html
That message addresses and supplies patches to two problems, both already
solved in cvs:
1. Two forgotten line continuation characters "\"
2. expr complains with "non-numeric argument"
Erik's patch is the more elegant and made me understand sed's syntax better.
I made one small change to make the fd[0-9]* case more consistent with the
[sh]d[a-z][0-9]* case: in the assignment of "tmp_dsk", "/dev/" should not be
removed.
Note: both my previous patch and Erik's patch solve the expr problem and
don't break anything AFAIK, but IMHO the attached patch is the more correct
one. Successfully tested "grub-install --root-directory=/mnt/floppy '(fd0)'".
--
Leendert Meyer
E-mail : [EMAIL PROTECTED]
ICQ : 38341890
SuSE Linux 7.0 (i386) - Kernel 2.4.0-test9
--- grub-install.in-cvs Sat Dec 9 11:29:02 2000
+++ grub-install.in Sat Dec 9 20:25:22 2000
@@ -77,11 +77,11 @@
case "$host_os" in
linux*)
tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \
+ -e 's%\(fd[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%.*/fd[0-9]*$%%' \
-e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%'`
- # floppy drives don't have partitions:
- tmp_part=`echo "$tmp_part" | sed -e 's%.*/fd[0-9]*%%'`
;;
gnu*)
tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`