From 1675300153348e8de3ba8b40b470e0d04b6286af Mon Sep 17 00:00:00 2001 From: gord Date: Mon, 29 May 2000 16:32:57 +0000 Subject: [PATCH] Add Pavel Roskin's improvements to grub-install.in. --- ChangeLog | 8 ++++++++ util/grub-install.in | 14 +++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40249b88c..51a78cc2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-05-29 Pavel Roskin + + * util/grub-install.in: Fix a typo that prevented error messages + from appearing. + 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. + 2000-04-19 Gordon Matzigkeit * stage2/cmdline.c (enter_cmdline): Don't give errors on empty diff --git a/util/grub-install.in b/util/grub-install.in index e10cb9bc1..b6d46a719 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -240,7 +240,7 @@ grubdir_device=`df ${grubdir} | grep /dev/ \ | sed 's%.*\(/dev/[a-z0-9]*\).*%\1%'` if test "x$grubdir_device" != "x$root_device"; then # For now, cannot deal with this situation. - cat <2 + cat <&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 @@ EOF 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 @@ setup $force_lba $install_drive 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