Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Initramfs systemd: error loading shared libraries (luks+zfs)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
bender86
Guru
Guru


Joined: 18 Mar 2005
Posts: 475

PostPosted: Sun Jun 02, 2019 3:27 pm    Post subject: Initramfs systemd: error loading shared libraries (luks+zfs) Reply with quote

Hello,
I have a problem booting my system.

Setup: GRUB via EFI, LUKS, ZFS, SystemD

/dev/nvme0n1p1 is the EFI boot partition, which contains Grub, the kernel and the initramfs.
/dev/nvme0n1p5 is a LUKS encrypted drive, which contains a ZFS pool "gentoo"
"gentoo/root" is the dataset to be mounted as /

The system originally used LVM, and everything was working fine, but I enlarged the encrypted partition because I needed more space, and I took the chance to move to ZFS.

I created the ZFS pool using Ubuntu livedvd, following the guide https://wiki.gentoo.org/wiki/Dell_XPS_15_9560 (which is, coincidentally, my exact laptop), and I also read the other ZFS guides:
- https://wiki.gentoo.org/wiki/ZFS/root
- https://wiki.gentoo.org/wiki/User:Fearedbliss/Installing_Gentoo_Linux_On_ZFS
- https://wiki.gentoo.org/wiki/User:Monsieurp/Gentoo_Linux_on_ZFS

I think I did everything according to the instructions, except setting the option "bootfs" (because Grub is on the EFI partition outside the ZFS pool).
However, I have weird missing library errors when (I think) the initramfs calls SystemD.

Code:

...
>> Initializing root device
>> Detected zfs root: gentoo/root
>> Mounting gentoo/root as root
>> Detected fstype: zfs_member
>> Using mount fstype: zfs
>> using mount options: -o ro,zfsutils
>> booting (initramfs)
/lib/systemd/systemd: error while loading shared libraries: libseccomp.so.2: cannot open shared object file: No such file or directory

Kernel panic - attempted to kill init


I even tried to reemerge systemd without the use flag "seccomp" (and recreating the initramfs), and now I got the same error with libgcrypt.so, so it seems independent on the actual library.

I tried both with genkernel-next and bliss-initramfs, and I get the same behaviour (bliss-initramfs also hangs for about 4 minutes on "Starting udev", but after that it unlocks the LUKS volume and crashes with error loading shard libraries).

I have not found any information about similar errors.
I will post the Grub configuration file later (I am writing from another machine now), but all parameters should be correct (it was working fine with LVM, I only changed the root filesystem to ZFS, which seems to be detected correctly according to the initramfs messages.)

Any ideas?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15294

PostPosted: Sun Jun 02, 2019 4:51 pm    Post subject: Reply with quote

Instead of disabling seccomp, and gcrypt, and whatever you will hit after that, why not just include the required libraries in the initramfs? If you use dynamically linked executables in the initramfs, you must provide in the initramfs the shared objects upon which those executables depend.
Back to top
View user's profile Send private message
bender86
Guru
Guru


Joined: 18 Mar 2005
Posts: 475

PostPosted: Sun Jun 02, 2019 9:48 pm    Post subject: Reply with quote

Hu wrote:
Instead of disabling seccomp, and gcrypt, and whatever you will hit after that, why not just include the required libraries in the initramfs? If you use dynamically linked executables in the initramfs, you must provide in the initramfs the shared objects upon which those executables depend.


Sorry, I should definitely have mentioned this because it is one of the confusing parts.
The initramfs does contain the missing libraries.

Genkernel-next's initramfs
Code:

gentoo ~/a # xzcat /boot/initramfs-genkernel-x86_64-4.19.44-gentoo | cpio -id
104566 blocks
gentoo ~/a # find . -iname "*seccomp*"
./usr/lib/libseccomp.so.2
gentoo ~/a #
gentoo ~/a # find . -iname "*gcrypt*"
./usr/lib/libgcrypt.so.20




Working Genkernel-next's initramfs (this was used with the LVM installation and was working perfectly fine)
Code:

gentoo ~/a # xzcat /var/tmp/genkernel/initramfs-4.19.37-gentoo | cpio -id
104566 blocks
gentoo ~/a # find . -iname "*seccomp*"
./usr/lib/libseccomp.so.2
gentoo ~/a # find . -iname "*gcrypt*"
./usr/lib/libgcrypt.so.20




Bliss initramfs
Code:

gentoo ~/a # zcat /boot/initrd-4.19.44-gentoo | cpio -id
85858 blocks
gentoo ~/a # find . -iname "*seccomp*"
./lib64/libseccomp.so.2
./usr/lib64/libseccomp.so.2
gentoo ~/a # find . -iname "*gcrypt*"
./lib64/libgcrypt.so.20
./usr/lib64/libgcrypt.so.20




On the root filesystem
Code:

gentoo / # find . -iname "libseccomp.so*"
./usr/lib32/libseccomp.so.2
./usr/lib32/libseccomp.so
./usr/lib32/libseccomp.so.2.4.0
./usr/lib64/libseccomp.so.2.4.0
./usr/lib64/libseccomp.so
./usr/lib64/libseccomp.so.2
gentoo / # find . -iname "libgcrypt.so*"
./usr/lib32/libgcrypt.so.20
./usr/lib32/libgcrypt.so
./usr/lib32/libgcrypt.so.20.2.3
./usr/lib64/libgcrypt.so.20.2.3
./usr/lib64/libgcrypt.so.20
./usr/lib64/libgcrypt.so





I am not creating the initramfs manually, and I would expect both Genkernel-next and Bliss-initramfs to include the relevant dynamic libraries (and it seems they do that).
I create the initramfs with
Code:
genkernel --luks --zfs initramfs
bliss-initramfs luks,zfs 4.19.44-gentoo


The only changes in Genkernel's configuration file are the following:

Code:

# Run 'make clean' before compilation?
# If set to NO, implies MRPROPER WILL NOT be run
# Also, if clean is NO, it won't copy over any configuration
# file, it will use what's there.
CLEAN="no"

# Add in Luks support. Needs sys-fs/cryptsetup with -dynamic installed.
LUKS="yes"




I also got Grub's configuration, but I don't think there are any mistakes here.
Code:

font=/grub/DejaVuSansMono.pf2
loadfont $font
set gfxmode=auto
insmod all_video
insmod gfxterm
terminal_output gfxterm

set gfxpayload=keep

menuentry "Gentoo Genkernel-next" --class gentoo --class gnu-linux --class gnu --unrestricted --class os 4.19.44-gentoo genkernel {
    insmod gzio
    insmod part_gpt
    insmod fat
    set root='hd0,gpt1'
    linux /vmlinuz-4.19.44-gentoo crypt_root=/dev/nvme0n1p5 dozfs=force real_root=ZFS=gentoo/root rootfstype=zfs real_init=/lib/systemd/systemd systemd.unit=multi-user.target keymap=it refresh
    initrd /initramfs-genkernel-x86_64-4.19.44-gentoo
}

menuentry "Gentoo Bliss" --class gentoo --class gnu-linux --class gnu --unrestricted --class os 4.19.44-gentoo bliss {
    insmod gzio
    insmod part_gpt
    insmod fat
    set root='hd0,gpt1'
    linux /vmlinuz-4.19.44-gentoo root=gentoo/root enc_drives=/dev/nvme0n1p5 enc_type=pass triggers=luks,zfs refresh
    initrd /initrd-4.19.44-gentoo
}
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15294

PostPosted: Sun Jun 02, 2019 11:38 pm    Post subject: Reply with quote

In the initramfs, what paths does the dynamic loader search to resolve paths? Perhaps it is not inspecting the libraries you provided.
Back to top
View user's profile Send private message
bender86
Guru
Guru


Joined: 18 Mar 2005
Posts: 475

PostPosted: Mon Jun 03, 2019 6:41 am    Post subject: Reply with quote

Hu wrote:
In the initramfs, what paths does the dynamic loader search to resolve paths? Perhaps it is not inspecting the libraries you provided.


I am not sure about this. As I said, I generate a "default" initramfs with genkernel-next (or bliss). How can I check? Is it possible to get a shell on an initramfs?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum