grub-devel
[Top][All Lists]
Advanced

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

[PATCH] Abort grub-install if prefix cannot be determined


From: Christian Franke
Subject: [PATCH] Abort grub-install if prefix cannot be determined
Date: Thu, 24 Jul 2008 07:39:24 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7

grub-install does not check error return from make_system_path_relative_to_its_root() fails.

BTW: Unlike the other scripts, grub-install does not 'set -e'. Is this intentional or historic ?-)

Christian


2008-07-24      Christian Franke  <address@hidden>        
        
        * util/i386/pc/grub-install.in: If `--debug' is specified,
        pass `--verbose' to grub-setup.
        Abort script if make_system_path_relative_to_its_root() fails.


diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in
index 1b2bccb..d7966d5 100644
--- a/util/i386/pc/grub-install.in
+++ b/util/i386/pc/grub-install.in
@@ -127,8 +127,10 @@ if test "x$install_device" = x; then
 fi
 
 # If the debugging feature is enabled, print commands.
+setup_verbose=
 if test $debug = yes; then
     set -x
+    setup_verbose="--verbose"
 fi
 
 # Initialize these directories here, since ROOTDIR was initialized.
@@ -240,12 +242,12 @@ fi
 # The order in this list is critical.  Be careful when modifying it.
 modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module"
 
-$grub_mkimage --output=${grubdir}/core.img \
-    --prefix=${prefix_drive}`make_system_path_relative_to_its_root 
${grubdir}`/ \
-    $modules || exit 1
+grub_prefix="${prefix_drive}`make_system_path_relative_to_its_root 
${grubdir}`" || exit 1
+
+$grub_mkimage --output=${grubdir}/core.img --prefix=${grub_prefix}/ $modules 
|| exit 1
 
 # Now perform the installation.
-$grub_setup --directory=${grubdir} --device-map=${device_map} \
+$grub_setup ${setup_verbose} --directory=${grubdir} --device-map=${device_map} 
\
     ${install_device} || exit 1
 
 # Prompt the user to check if the device map is correct.

reply via email to

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