Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdbootutil produces unbootable initrds #44

Closed
aafeijoo-suse opened this issue Feb 7, 2024 · 3 comments
Closed

sdbootutil produces unbootable initrds #44

aafeijoo-suse opened this issue Feb 7, 2024 · 3 comments

Comments

@aafeijoo-suse
Copy link
Contributor

While using http://download.opensuse.org/tumbleweed/appliances/openSUSE-Tumbleweed-Minimal-VM.x86_64-kvm-and-xen-sdboot.qcow2, we found that the initrds generated using sdbootutil are missing some required kernel drivers (at least), and the system fails to boot. E.g.:

localhost:~ # sdbootutil --no-reuse-initrd add-all-kernels 14
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
gzip: /var/tmp/dracut.DxxDym/initramfs/.snapshots/14/snapshot/usr/share/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory
gzip: /var/tmp/dracut.DxxDym/initramfs/.snapshots/14/snapshot/usr/share/kbd/keymaps/xkb/us.map.gz: No such file or directory
localhost:~ # grep initrd /boot/efi/loader/entries/opensuse-tumbleweed-6.7.2-1-default-14.conf 
initrd     /opensuse-tumbleweed/6.7.2-1-default/initrd-72af8ab3c66e303ba9f1fe0d7a4f12fac0842d2a
localhost:~ # lsinitrd /boot/efi/opensuse-tumbleweed/6.7.2-1-default/initrd-72af8ab3c66e303ba9f1fe0d7a4f12fac0842d2a 2>&1 | awk '{ print $9 }' > initrd-14.txt
localhost:~ # dracut -f --stdlog 3 test.img
localhost:~ # lsinitrd test.img 2>&1 | awk '{ print $9 }' > test.txt
localhost:~ # diff test.txt initrd-14.txt 
33d32
< 
35,39c34,38
< 14:47
< 14:47
< 14:47
< 14:47
< 14:47
---
> 01:09
> 01:09
> 01:09
> 01:09
> 01:09
44,45d42
< etc/cmdline.d/00-btrfs.conf
< etc/cmdline.d/95root-dev.conf
65,66d61
< etc/systemd/system/dev-disk-by\x2duuid-BE1A\x2dE603.device.d
< etc/systemd/system/dev-disk-by\x2duuid-BE1A\x2dE603.device.d/timeout.conf
72d66
< etc/systemd/system/initrd.target.wants/dev-disk-by\x2duuid-BE1A\x2dE603.device
198d191
< usr/lib/dracut/hooks/emergency/80-\x2fdev\x2fdisk\x2fby-uuid\x2fBE1A-E603.sh
201d193
< usr/lib/dracut/hooks/initqueue/finished/devexists-\x2fdev\x2fdisk\x2fby-uuid\x
2fBE1A-E603.sh
390d381
< usr/lib/modules/6.7.2-1-default/kernel/drivers/block/loop.ko.zst
442,443d432
< usr/lib/modules/6.7.2-1-default/kernel/fs/btrfs
< usr/lib/modules/6.7.2-1-default/kernel/fs/btrfs/btrfs.ko.zst
462d450
< usr/lib/modules/6.7.2-1-default/kernel/lib/libcrc32c.ko.zst
628d615
< usr/lib/udev/rules.d/64-btrfs-dm.rules
736d722
< usr/sbin/btrfsck
742,744d727
< usr/sbin/fsck.btrfs
< usr/sbin/fsck.fat
< usr/sbin/fsck.vfat
774,779d756
< usr/share/kbd/keymaps/i386/include
< usr/share/kbd/keymaps/i386/include/compose.inc
< usr/share/kbd/keymaps/i386/include/euro1.map
< usr/share/kbd/keymaps/i386/include/linux-keys-bare.inc
< usr/share/kbd/keymaps/i386/include/linux-with-alt-and-altgr.inc
< usr/share/kbd/keymaps/i386/include/qwerty-layout.inc
781,795c758
< usr/share/kbd/keymaps/i386/qwerty/us.map
< usr/share/kbd/keymaps/include
< usr/share/kbd/keymaps/include/compose.8859_7
< usr/share/kbd/keymaps/include/compose.8859_8
< usr/share/kbd/keymaps/include/compose.ctrlperiod
< usr/share/kbd/keymaps/include/compose.latin
< usr/share/kbd/keymaps/include/compose.latin1
< usr/share/kbd/keymaps/include/compose.latin1.add
< usr/share/kbd/keymaps/include/compose.latin1.cedilla
< usr/share/kbd/keymaps/include/compose.latin2
< usr/share/kbd/keymaps/include/compose.latin3
< usr/share/kbd/keymaps/include/compose.latin4
< usr/share/kbd/keymaps/include/compose.shiftctrl
< usr/share/kbd/keymaps/include/compose.utf8
< usr/share/kbd/keymaps/include/compose.winkeys
---
> usr/share/kbd/keymaps/i386/qwerty/us.map.gz
797c760
< usr/share/kbd/keymaps/xkb/us.map
---
> usr/share/kbd/keymaps/xkb/us.map.gz

The keymaps are not included due to a bug in dracut, fixed with dracutdevs/dracut#2618. After applying this patch, the keymaps are included correctly:

localhost:~ # sdbootutil --no-reuse-initrd add-all-kernels 15
localhost:~ # grep initrd /boot/efi/loader/entries/opensuse-tumbleweed-6.7.2-1-default-15.conf 
initrd     /opensuse-tumbleweed/6.7.2-1-default/initrd-9ae5879b38af4d7236e682d5f
889b252e0f85cde
localhost:~ # lsinitrd /boot/efi/opensuse-tumbleweed/6.7.2-1-default/initrd-9ae5879b38af4d7236e682d5f889b252e0f85cde 2>&1 | awk '{ print $9 }' > initrd-15.txt
localhost:~ # diff test.txt initrd-15.txt 
33d32
< 
35,39c34,38
< 14:47
< 14:47
< 14:47
< 14:47
< 14:47
---
> 01:09
> 01:09
> 01:09
> 01:09
> 01:09
44,45d42
< etc/cmdline.d/00-btrfs.conf
< etc/cmdline.d/95root-dev.conf
65,66d61
< etc/systemd/system/dev-disk-by\x2duuid-BE1A\x2dE603.device.d
< etc/systemd/system/dev-disk-by\x2duuid-BE1A\x2dE603.device.d/timeout.conf
72d66
< etc/systemd/system/initrd.target.wants/dev-disk-by\x2duuid-BE1A\x2dE603.device
198d191
< usr/lib/dracut/hooks/emergency/80-\x2fdev\x2fdisk\x2fby-uuid\x2fBE1A-E603.sh
201d193
< usr/lib/dracut/hooks/initqueue/finished/devexists-\x2fdev\x2fdisk\x2fby-uuid\x
2fBE1A-E603.sh
390d381
< usr/lib/modules/6.7.2-1-default/kernel/drivers/block/loop.ko.zst
442,443d432
< usr/lib/modules/6.7.2-1-default/kernel/fs/btrfs
< usr/lib/modules/6.7.2-1-default/kernel/fs/btrfs/btrfs.ko.zst
462d450
< usr/lib/modules/6.7.2-1-default/kernel/lib/libcrc32c.ko.zst
628d615
< usr/lib/udev/rules.d/64-btrfs-dm.rules
736d722
< usr/sbin/btrfsck
742,744d727
< usr/sbin/fsck.btrfs
< usr/sbin/fsck.fat
< usr/sbin/fsck.vfat
@aafeijoo-suse
Copy link
Contributor Author

dracut_args=('--sysroot' "${snapshot_dir}" '--tmpdir' '/var/tmp')

With --sysroot, dracut needs to know the root device to automatically get the filesystem drivers, so appending '--add-device' '/dev/vda3' to the list of options would fix the issue. Another option is to explicitly add the missing drivers via --add-drivers.

aafeijoo-suse added a commit to aafeijoo-suse/sdbootutil that referenced this issue Feb 9, 2024
With `--sysroot`, dracut needs to know the root device to automatically get its
filesystem drivers. Otherwise, they are missing from the initramfs and the
system cannot boot.

Fixes openSUSE#44
@TobiPeterG
Copy link
Collaborator

This should already be fixed, please verify and close :)

@aafeijoo-suse
Copy link
Contributor Author

This should already be fixed, please verify and close :)

Yes, working. No need to ping me to verify :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants