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

 
 

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

bug #42392: Build failure when ZFS support is enabled

Submitter:  René Bertin <rjvb>
Submitted:  Tue 20 May 2014 03:09:38 PM UTC
Votes: 1
 
Category:  Compilation Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  René Bertin
Open/Closed:  Closed Release:  2.02~beta1
Release:  Reproducibility:  Every Time
Planned Release:  None

Sun 01 Mar 2015 01:01:24 PM UTC, comment #5: 

boot=zfs is Ubuntu-specific. If there is a common way to pass that info to Linux we can support it upstream but boot=zfs is way Ubuntu-specific. As for ofpathname it's already fixed. Closing the bug.

Vladimir Serbinenko <phcoder>
Group administrator
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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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
  • -email is unavailable- added by spacefrogg (Posted a comment)
  • -email is unavailable- added by spacefrogg (Voted in favor of this item)
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by rjvb (Submitted the item)
  •  

    There is 1 vote so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-01 phcoder StatusNone Fixed
        Open/ClosedOpen Closed
    2014-07-07 spacefrogg Carbon-Copy- Added spacefrogg
    2014-05-20 rjvb Attached File- Added patch-Makefile_util_def-for-zfs, #31404

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code