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

Re: Bug#730145: grub-probe fails to accept zfs



On 22/11/2013 20:44, Steven Chamberlain wrote:
> On 22/11/13 19:25, Robert Millan wrote:
>> grub-mkconfig aborts on errors, or at least used to. When that happens
>> it prefers to avoid messing your grub.cfg rather than risk creating an
>> incomplete/unusable file.
> 
> grub-mkconfig creates a new grub.cfg with ".new" suffix, overwriting the
> original only if it reaches the end of the script without a fatal error.

I know. I wrote that part of the script ;-)

> Failure to detect the filesystem holding GRUB files is not fatal though:
> 
>> GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`"

Well, this is embarassing... GRUB_FS is not the filesystem holding GRUB
files but the filesystem holding our userland. I know the name isn't
appropiate. This confusion has to do with how the code evolved from
assuming everything was in the same filesystem to gradually splitting
things (/, /boot and /boot/grub may all be different filesystems).

However by looking at how 10_kfreebsd uses this variable, it really
ought to be fatal here.

Christoph, please can you verify that the following assert works as
expected? If it does, I can check this in upstream.

-- 
Robert Millan
diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in
index a524762..71d7296 100644
--- a/util/grub.d/10_kfreebsd.in
+++ b/util/grub.d/10_kfreebsd.in
@@ -170,6 +170,8 @@ while [ "x$list" != "x" ] ; do
     devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname`
   fi
 
+  [ "x${GRUB_FS}" != "xunknown" ]
+
   case ${GRUB_FS} in
     ufs1 | ufs2)	kfreebsd_fs=ufs ;;
     ext2)		kfreebsd_fs=ext2fs ;;

Reply to: