don't assume that a device file name consists of only alphanums.

This commit is contained in:
okuji 2000-10-10 06:09:55 +00:00
parent 14b7a703a9
commit 1301164d4c
2 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2000-10-10 OKUJI Yoshinori <okuji@gnu.org>
From Alessandro Rubini:
* util/grub-install.in (root_device): Use the regular expression
's%.*\(/dev/[^ ]*\).*%\1%' instead of
's%.*\(/dev/[a-z0-9]*\).*%\1%'.
(bootdir_device): Likewise.
(grubdir_device): Likewise.
2000-10-10 OKUJI Yoshinori <okuji@gnu.org>
* stage2/start.S (copy_buffer): Use pusha and popa instead of

View file

@ -233,9 +233,9 @@ esac
# 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/[^ ]*\).*%\1%'`
bootdir_device=`df ${bootdir} | grep /dev/ \
| sed 's%.*\(/dev/[a-z0-9]*\).*%\1%'`
| sed 's%.*\(/dev/[^ ]*\).*%\1%'`
# Check if the boot directory is in the same device as the root directory.
if test "x$root_device" != "x$bootdir_device"; then
@ -253,7 +253,7 @@ fi
# 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/[^ ]*\).*%\1%'`
if test "x$grubdir_device" != "x$root_device"; then
# For now, cannot deal with this situation.
cat <<EOF 1>&2