Skip to contentSkip to conversation

Make grub-mkconfig fail if GRUB_FS cannot be determined

PATCH In review Colin Watson 1 participant 2 messages Dec 6, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make grub-mkconfig fail if GRUB_FS cannot be determined

Commit c0f90770b89e05730919e7d97cc9abeb84232777 caused grub-mkconfig to carry on anyway if "grub-probe --target=fs /" fails. However, this was in 2007 when GRUB's filesystem support was much less complete. Nowadays this can be expected to only fail in bad situations, and will almost certainly lead to the generated grub.cfg being useless, so it makes no sense for grub-mkconfig to succeed.

Fixes the last part of Debian bug #707831.

---
 ChangeLog             | 6 ++++++
 util/grub-mkconfig.in | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
ChangeLog +6 -0
index c680ba1..ae0ef4e 100644
@@ -1,3 +1,9 @@
+2013-12-06  Colin Watson  <[email protected]>
+
+	* util/grub-mkconfig.in: Fail if GRUB_FS cannot be determined.
+	Nowadays this indicates a rather bad failure and almost certainly an
+	unusable grub.cfg; it makes no sense for grub-mkconfig to succeed.
+
 2013-12-05  Mike Gilbert  <[email protected]>
 
 	* INSTALL: Raise minimum python version to 2.6.
util/grub-mkconfig.in +1 -1
index 016ee82..a160c83 100644
@@ -137,7 +137,7 @@ GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_u
 
 # Filesystem for the device containing our userland.  Used for stuff like
 # choosing Hurd filesystem module.
-GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`"
+GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs`"
 
 if test -f ${sysconfdir}/default/grub ; then
   . ${sysconfdir}/default/grub
Signature · 1 line
1.8.4.4
#1 lore raw
Quoted 6 lines · Colin Watson

Commit c0f90770b89e05730919e7d97cc9abeb84232777 caused grub-mkconfig to carry on anyway if "grub-probe --target=fs /" fails. However, this was in 2007 when GRUB's filesystem support was much less complete. Nowadays this can be expected to only fail in bad situations, and will almost certainly lead to the generated grub.cfg being useless, so it makes no sense for grub-mkconfig to succeed.

Vladimir makes the reasonable argument on IRC that this will break if you have a / that GRUB doesn't understand but a /boot that it does, which in general is supposed to be supported. I withdraw this patch.

Signature · 1 line
Colin Watson                                       [[email protected]]