bugGNU GRUB - Bugs: bug #42392, Build failure when ZFS support is...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #42392: Build failure when ZFS support is enabled

Submitted by:  René Bertin <rjvb>
Submitted on:  Tue 20 May 2014 03:09:38 PM UTC  
Votes:  1  
 
Category: CompilationSeverity: Major
Priority: 5 - NormalItem Group: None
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: René Bertin
Open/Closed: OpenRelease: 
Release: 2.02~beta1Reproducibility: Every Time
Planned Release: None

Mon 07 Jul 2014 03:29:12 PM UTC, comment #4:

I can confirm this bug and that the supplied patch works as intended.

Michael Raitza <spacefrogg>
Sun 22 Jun 2014 10:06:03 PM UTC, comment #3:

On a test Kubuntu-on-btrfs set-up with grub "2.02~beta2-9" (rebuilt from source with my patch), "grub-mkrelpath /PoolMountPoint" says "/@" .

"grub-mkrelpath/" with grub "2.01-22debian1+zfs3-0.6.3-2~wheezy" which I use on my production Kubuntu-on-ZFS system says the same thing, "/@", which suggests that that is the correct output.

René Bertin <rjvb>
Sun 22 Jun 2014 01:41:26 AM UTC, comment #2:

Wrong path is a problem. What does "sudo grub-mkrelpath /" say? As for lack of ZFS=? parameters they vary between distributions

Vladimir Serbinenko <phcoder>
Project Administrator
Sat 24 May 2014 01:44:57 PM UTC, comment #1:

Note that even with the posted patch that allows the build to succeed, not all FS tests succeed, in particular zfs_test. It fails with a TIME_FAIL error (which is probably benign as it appears to concern a subsecond difference).

Worse, update-grub2 will not generate a proper grub.cfg for ZFS roots:

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b927688a3f8a6e13' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod btrfs
set root='hd2,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos4 --hint-efi=hd2,msdos4 --hint-baremetal=ahci2,msdos4 2def3c9f-2a12-41e0-911f-7de7cc142a99
else
search --no-floppy --fs-uuid --set=root 2def3c9f-2a12-41e0-911f-7de7cc142a99
fi
linux /vmlinuz-3.13.9-ck1-kubuntu-ck-amdf10-rjvb root=ZFS=zPatux/ ro
initrd /initrd.img-3.13.9-ck1-kubuntu-ck-amdf10-rjvb
}
}}}

In other words, the required zfs modules are not loaded, and the kernel isn't informed about the fact it's booting off ZFS. A more correct entry should read:

{{{
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b927688a3f8a6e13' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod zfsinfo
zfs-bootfs ($root) bootfs
insmod part_msdos
insmod btrfs
set root='hd2,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos4 --hint-efi=hd2,msdos4 --hint-baremetal=ahci2,msdos4 2def3c9f-2a12-41e0-911f-7de7cc142a99
else
search --no-floppy --fs-uuid --set=root 2def3c9f-2a12-41e0-911f-7de7cc142a99
fi
linux /vmlinuz-3.13.9-ck1-kubuntu-ck-amdf10-rjvb root=ZFS=zPatux/ ro boot=zfs $bootfs
initrd /initrd.img-3.13.9-ck1-kubuntu-ck-amdf10-rjvb
}
}}}

but even that gives an "invalid label" error upon boot and then tries to import the default pool name, rpool, instead of the right one.

For reference, here's a menuentry from a different system (using the exact same kernel) which boots OK:

{{{
menuentry 'LinuxMint GNU/Linux' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-7c11ad880751a42a' {
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod zfsinfo
zfs-bootfs ($root) bootfs
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 39ff79e1-e153-490f-b302-4ba8e71fe643
else
search --no-floppy --fs-uuid --set=root 39ff79e1-e153-490f-b302-4ba8e71fe643
fi
linux /vmlinuz-3.13.9-ck1-kubuntu-ck-amdf10-rjvb root=ZFS=Patux/ ro boot=zfs $bootfs
initrd /initrd.img-3.13.9-ck1-kubuntu-ck-amdf10-rjvb
}
}}}

René Bertin <rjvb>
Tue 20 May 2014 03:09:38 PM UTC, original submission:

I downloaded the GRUB2 sources from Ubuntu's Launchpad, version 2.02~beta2 for "Trusty", in order to understand why grub-probe would not deal correctly with ZFS pools.

It turns out that even the original source, without the Ubuntu patches, fails to build when libzfs is present (and/or --enable-zfs is used) because the zfs libraries are missing from the grub-ofpathname utility's link command.

After correcting Makefile.util.def, everything builds OK and grub-probe correctly reports that ZFS pools are of type zfs .

A patchfile for the correction is attached.

I'm currently building an updated set of Ubuntu/Debian packages; I'll modify this ticket (or file a new one) if there are additional issues booting off a ZFS root.

René Bertin <rjvb>

 

Attached Files
file #31404:  patch-Makefile_util_def-for-zfs added by rjvb (399B - application/octet-stream - patchfile for Makefile.util.def)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by spacefrogg (Posted a comment)
  • -unavailable- added by spacefrogg (Voted in favor of this item)
  • -unavailable- added by phcoder (Posted a comment)
  • -unavailable- added by rjvb (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 1 encouragement so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 07 Jul 2014 03:25:16 PM UTCspacefroggCarbon-Copy-=>Added spacefrogg
    Tue 20 May 2014 03:09:38 PM UTCrjvbAttached File-=>Added patch-Makefile_util_def-for-zfs, #31404

    Back to the top


    Powered by Savane 3.1-cleanup