Hello!
Changelog:
* util/grub-install.in: fixed a typo that caused some error
messages not to appear.
Copy and remove files individually and exit with an error as
soon as it fails.
Show $log_file if --debug was given on the command line.
Problems found but not fixed:
- We probably should check that at least one Stage 1.5 exist. The
"setup" command depends on it for hard drives.
- Installation on /dev/fd0 fails on GNU/Linux.
grub-install '(fd0)' tries to run "embed /boot/grub/e2fs_stage1_5 (fd0)"
grub-install /dev/fd0 tries to run "setup (fd0,-1)"
- We probably should warn if menu.lst doesn't exist in the target
directory.
Regards,
Pavel Roskin
==== cut here ====
--- util/grub-install.in Sat May 13 21:38:27 2000
+++ util/grub-install.in Wed May 24 00:33:44 2000
@@ -240,7 +240,7 @@
| 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
+ 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.
EOF
@@ -248,9 +248,13 @@
fi
# Copy the GRUB images to the GRUB directory.
-rm -f ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5
-cp ${pkgdatadir}/stage1 ${pkgdatadir}/stage2 ${pkgdatadir}/*stage1_5 \
- ${grubdir} || exit 1
+for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
+ rm -f $file || exit 1
+done
+for file in \
+ ${pkgdatadir}/stage1 ${pkgdatadir}/stage2 ${pkgdatadir}/*stage1_5; do
+ cp -f $file ${grubdir} || exit 1
+done
# Create a safe temporary file.
test -x /bin/tempfile && log_file=`tempfile --prefix=grub`
@@ -262,7 +266,7 @@
quit
EOF
-if grep "Error: " $log_file >/dev/null; then
+if grep "Error: " $log_file >/dev/null || test $debug = yes; then
cat $log_file 1>&2
exit 1
fi
==== cut here ====