Originally reported here: https://github.com/zfsonlinux/zfs/issues/5197 bunder2015 commented 15 days ago • edited could not boot latest head (as of 09/27) with newer genkernel (which should have the fix for the libgcc_s bug). pool gets imported but doesn't get mounted anywhere. Reproducible: Always Steps to Reproduce: 1. emerge -av -1 sys-kernel/genkernel-9999 to obtain genkernel --version 3.5.0.5-1-gc985584-git 2. Using genkernel build a initramfs to boot a Gentoo system with its root filesystem on ZFS. 3. Booting from the initramfs fails: Actual Results: Importing ZFS pool mypool Import of mypool succeeded Determining block device Block device mypool/ds is not a valid block device Could not find the root block device in . Please specify a new value (blah blah blah) Expected Results: It should not test if mypool/ds is a block device, it is just a string specifying the ZFS root filesystem. My theory is that some continue statements in the ZFS logic do not exit out of the loop around the timing loop introduced here: commit 67893b749b83fd716e55fa7c865f4c924454ee24 Author: Robin H. Johnson <robbat2@gentoo.org> Date: Sun May 15 23:40:43 2016 -0700 defaults/linuxrc: bug #232733: implement rootwait. Based on patch from John Klug <ski.brimson@gmail.com>. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> diff --git a/defaults/linuxrc b/defaults/linuxrc index ac8f215..72e1543 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -133,6 +133,12 @@ do scandelay) SDELAY=3 ;; + rootdelay=*|rootwait=*) + ROOTDELAY=${x#*=} + ;; + rootdelay|rootwait) + ROOTDELAY=5 + ;; # Module no-loads doload=*) MDOLIST=${x#*=} @@ -485,10 +491,14 @@ fi # Determine root device good_msg 'Determining root device ...' +ROOTDELAY_100MSEC=1 +[ -n "${ROOTDELAY}" ] && ROOTDELAY_100MSEC=$(($ROOTDELAY * 10)) while true do while [ "${got_good_root}" != '1' ] do + # Start of sleep loop waiting on root + while [ ${ROOTDELAY_100MSEC} -ge 0 -a "${got_good_root}" != '1' ] ; do case "${REAL_ROOT}" in LABEL=*|UUID=*) @@ -574,6 +584,11 @@ do ;; esac + if [ "${got_good_root}" != '1' ] ; then + let ROOTDELAY_100MSEC=${ROOTDELAY_100MSEC}-1 + usleep 100 + fi + done # End of sleep loop waiting on root if [ "${REAL_ROOT}" = '' ] then # No REAL_ROOT determined/specified. Prompt user for root block device. Which then results in this now bogus for zfs if statement being executed: # Check for a block device or /dev/nfs elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ] Where for ZFS "${REAL_ROOT}" is not a block device, it is just a string indicating where the ZFS root file system is.
Created attachment 450244 [details, diff] genkernel-9999-zfs-rootfs-is-not-a-block-device.patch A workaround is to save my proposed patch file here: /etc/portage/patches/sys-kernel/genkernel-9999/genkernel-9999-zfs-rootfs-is-not-a-block-device.patch
Thanks for looking into this, I will try to test it on Monday.
Patch tested and working. Thanks again.
(In reply to Mark Wright from comment #1) > Created attachment 450244 [details, diff] [details, diff] > genkernel-9999-zfs-rootfs-is-not-a-block-device.patch > > A workaround is to save my proposed patch file here: > > /etc/portage/patches/sys-kernel/genkernel-9999/genkernel-9999-zfs-rootfs-is- > not-a-block-device.patch This patch looks good to me. I'll put it through my standard test and then commit it after my plane lands in Shanghai. I'll be hacking from there for a month. If anyone wants to do this sooner, feel free.
fixed in genkernel-9999, thanks for the patch (tested, etc)