Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 598914 - =sys-kernel/genkernel-3.5.0.6 to generate initramfs, will break booting from zfs root
Summary: =sys-kernel/genkernel-3.5.0.6 to generate initramfs, will break booting from ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Richard Yao (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-04 09:58 UTC by Yixun Lan
Modified: 2017-09-04 05:45 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix the zfs boot issue (genkernel_zfs.patch,376 bytes, patch)
2016-11-09 10:00 UTC, Yixun Lan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yixun Lan archtester gentoo-dev 2016-11-04 09:58:27 UTC
using =sys-kernel/genkernel-3.5.0.6 to generate initramfs will break booting from zfs root [1], while downgrade to 3.4.52.4-r2 fix the problem


I've tried with dozfs=force, still failed.
but when I enter into the initramfs shell, found zpool already imported, had no problem to run "zpool export dpool" or "zpool import -f -R /dpool dpool"

[1] failture log
http://dev.gentoo.org/~dlan/misc/zfs_root0.jpg 
http://dev.gentoo.org/~dlan/misc/zfs_root1.jpg

[2] addtional info
$ qlist -ICv gentoo-sources
sys-kernel/gentoo-sources-4.8.6
$ qlist -ICv zfs spl
sys-fs/zfs-0.6.5.8
sys-fs/zfs-kmod-0.6.5.8
sys-kernel/spl-0.6.5.8
Comment 1 Yixun Lan archtester gentoo-dev 2016-11-09 10:00:34 UTC
Created attachment 452780 [details, diff]
fix the zfs boot issue

make it a nop if boot from zfs ..

otherwise even zfs filesystem found, it will still run into line 599 [1], and fail 


[1] code of 599 /usr/share/genkernel/defaults/linuxrc
                # Check for a block device or /dev/nfs
                elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
Comment 2 Yixun Lan archtester gentoo-dev 2016-11-09 10:02:33 UTC
http://dev.gentoo.org/~dlan/misc/zfs_root0.jpg  -> this isn't a problem, and can be fixed with dozfs=force

http://dev.gentoo.org/~dlan/misc/zfs_root1.jpg  -> this is the problem, and what the patch from comment#c1 try to fix ..
Comment 3 Yixun Lan archtester gentoo-dev 2016-11-09 13:44:52 UTC
this is fixed, so I'm closing it

commit 8660bd6529394dc38975dd8ef0d6a2a80013ffd2
Author: Rick Farina (Zero_Chaos) <zerochaos@gentoo.org>
Date:   Mon Nov 7 23:53:10 2016 -0500

    fix for bug #597154

    I was unable to boot my zfs system without this and able to boot with
    it.

diff --git a/defaults/linuxrc b/defaults/linuxrc
index df2272b..965d28f 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -596,7 +596,7 @@ do
                        got_good_root=0

                # Check for a block device or /dev/nfs
-               elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
+               elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ] || [ "${ROOTFSTYPE}" = "zfs" ]
                then
                        got_good_root=1
Comment 4 Yixun Lan archtester gentoo-dev 2016-11-15 10:15:12 UTC
I realised that I shouldn't close this bug until we fixed the ebuild in tree.

so @genkernel team, please ..

1) push out a new release? say sys-kernel/genkernel-3.5.0.7
2) a revision bump 3.5.0.6-r1, I could help on this if you like?

3) force user to use live ebuild genkernel-9999
Comment 5 Carl W. Harlow 2016-11-19 02:41:58 UTC
I am having this issue on two machines using genkernel-3.4.52.4-r2, but it started when I upgraded zfs,zfs-kmod,spl to 0.6.5.8 from 0.6.5.4-ish. Initially both of them booted ok one or two times
Comment 6 Michal Jakubowski 2017-01-10 08:27:46 UTC
I have the same issue on gentoo-sources-4.8.17 using genkernel-next
Comment 7 Michal Jakubowski 2017-01-11 08:17:23 UTC
(In reply to Michal Jakubowski from comment #6)
> I have the same issue on gentoo-sources-4.8.17 using genkernel-next

fixed the boot issue:
https://github.com/fearedbliss/bliss-initramfs
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-09-04 05:45:45 UTC
3.5.0.7 came out back in January already.