Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 636244 - sys-kernel/genkernel-3.5.2.1 doesn't handle rootfs ZFS pool import failure nicely
Summary: sys-kernel/genkernel-3.5.2.1 doesn't handle rootfs ZFS pool import failure ni...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-02 08:18 UTC by Anton Gubarkov
Modified: 2019-07-15 15:55 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Gubarkov 2017-11-02 08:18:02 UTC
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)
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2019-07-15 15:55:19 UTC
> 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?