I encountered a problem when hostid in initramfs produced by genkernel during install mismatched the hostid generated by the booted Gentoo. I don't know when/how it happened. The initramfs contains /etc/hostid with 00000000, the roots doesn't have /etc/hostid and hostid command produces some random value. when I run genkernel to generate a new initramfs, the current outout of hostid is copied into initramfs image and the rootfs pool can't be imported on subsequent boot due to hostid mismatch. the init script does detect the import failure, however it doesn't drop me into a shell but starts an infinite loop instead: (start of boot removed) [ 3.486923] sr 2:0:0:0: [sr0] scsi3-mmc drive: 4x/4x cd/rw xa/form2 tray [ 3.487638] cdrom: Unifom CD-ROM driver Revision: 3.20 [ 3.488486] sr 2:0:0:0: Attached scsi generic sg1 type 5 [ 3.490182] Freeing unused kernel memory: 1288K [ 3.490650] Write protecting the kernel read-only data: 14336k [ 3.491951] Freeing unused kernel memory: 1580K [ 3.495934] Freeing unused kernel memory: 1492K >> Activating mdev >> Loading modules :: Loading frm nvme: :: Loadin from pata: :: Loading from sata: :: Loading fom scsi: :: Loading from usb: :: Loading from firewire: : Loading from waitscan: :: Loading from dmraid: :: Loading from mdadm: :: Loading from fs: zfs efivarfs :: Loading from net: :: Loading fro crypto: >> Importing ZFS pools cannot import 'main': pool was previously in use from another system. Last accessed by <unknown> (hostid=0) at Thu Nov 2 08:05:2 2017 The pool can be mported, use 'zpool import -f' to import the pool. !! Imported ZFS pools faild >>Determining root device ... sh: 1: unknown operand sh: 1: unknown operand sh: 1: unkno operand sh: 1:unknown operand sh: 1: unknown operand sh: 1: unknown opd sh: 1: unknown operand (continues forever)
> sh: 1: unknown operand I have seen errors like this due to non-POSIX compatible value checks. I have fixed code style in multiple commits like https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9daa9b77165339495dd4cb35bd57237bd9ca9206 and https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=e3c95e1455aff6e47ceebb58e4c5886e4d53255e and hope that I have addressed that problem. Can you please test again with genkernel-4.0.0-beta2 or newer?