* [PATCH] Abort grub-install if prefix cannot be determined
@ 2008-07-24 5:39 Christian Franke
2008-07-24 19:04 ` Christian Franke
2008-07-25 20:37 ` Robert Millan
0 siblings, 2 replies; 4+ messages in thread
From: Christian Franke @ 2008-07-24 5:39 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 421 bytes --]
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 <franke@computer.org>
* 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.
[-- Attachment #2: grub-install-prefix.patch --]
[-- Type: text/x-diff, Size: 1240 bytes --]
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.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Abort grub-install if prefix cannot be determined
2008-07-24 5:39 [PATCH] Abort grub-install if prefix cannot be determined Christian Franke
@ 2008-07-24 19:04 ` Christian Franke
2008-07-25 20:37 ` Robert Millan
1 sibling, 0 replies; 4+ messages in thread
From: Christian Franke @ 2008-07-24 19:04 UTC (permalink / raw)
To: The development of GRUB 2
Christian Franke wrote:
> 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 <franke@computer.org>
>
> * 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.
>
>
Committed.
Christian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Abort grub-install if prefix cannot be determined
2008-07-24 5:39 [PATCH] Abort grub-install if prefix cannot be determined Christian Franke
2008-07-24 19:04 ` Christian Franke
@ 2008-07-25 20:37 ` Robert Millan
2008-07-25 21:49 ` Pavel Roskin
1 sibling, 1 reply; 4+ messages in thread
From: Robert Millan @ 2008-07-25 20:37 UTC (permalink / raw)
To: The development of GRUB 2
On Thu, Jul 24, 2008 at 07:39:24AM +0200, Christian Franke wrote:
> 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 ?-)
I think it's historic. Wouldn't mind moving it to 'set -e' (although one
would have to check which grub-probe calls are allowed to fail). What
do others think?
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What good is a phone call… if you are unable to speak?
(as seen on /.)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Abort grub-install if prefix cannot be determined
2008-07-25 20:37 ` Robert Millan
@ 2008-07-25 21:49 ` Pavel Roskin
0 siblings, 0 replies; 4+ messages in thread
From: Pavel Roskin @ 2008-07-25 21:49 UTC (permalink / raw)
To: The development of GRUB 2
On Fri, 2008-07-25 at 22:37 +0200, Robert Millan wrote:
> On Thu, Jul 24, 2008 at 07:39:24AM +0200, Christian Franke wrote:
> > 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 ?-)
>
> I think it's historic. Wouldn't mind moving it to 'set -e' (although one
> would have to check which grub-probe calls are allowed to fail). What
> do others think?
I agree with you. It's better to add explicit "|| :" to a few commands
that can fail than to allow every command to fail.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-25 21:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-24 5:39 [PATCH] Abort grub-install if prefix cannot be determined Christian Franke
2008-07-24 19:04 ` Christian Franke
2008-07-25 20:37 ` Robert Millan
2008-07-25 21:49 ` Pavel Roskin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.