fix(dracut): protect existing output file against build errors
If dracut fails to build the initrd image or EFI binary for any reason (e.g., if
`cp` fails because there is no space left on the device), it removes the
existing output file before exiting, which may result in an unbootable system.
Instead of copying the initrd image directly to the output, copy it alongside it
to the same output directory, and if the copy succeeds, replace it.
James Le Cuirot [Fri, 14 Mar 2025 14:08:00 +0000 (14:08 +0000)]
fix: add $dracutsysrootdir to paths where it should be present
inst_simpl is sometimes called with the sysroot (particular via moddir)
and sometimes without. dracut-install knows how to handle this, so the
inst_simpl existence check needs to handle it too.
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Not only are the specific encryption modules not being installed on s390/s390x
in non-hostonly mode, but also it's failing the detection of the kernel modules
needed to decrypt PAES-encrypted volumes in hostonly mode via dmsetup. So,
since the increase in size is not that much (~ 150K), always add all the drivers
under s390/crypto in this architecture.
On usrmerge systems, /lib is a symlink to /usr/lib, so the real path of the
kernel directory is /usr/lib/modules/<kver>. The issue on these systems is that
a kernel module can be added to the initrd (via dracut-install) by different
dracut modules using both paths, and that causes libkmod to display the
following type of errors in the middle of the dracut build:
fix(nfs): libnfsidmap plugins not added in some distributions
`nfs-utils` can be configured using `--with-pluginpath` to avoid using the
default `/usr/lib/libnfsidmap`. For example, Fedora sets
`--with-pluginpath=%{_libdir}/libnfsidmap`, which is covered by the current
glob, but openSUSE sets `--with-pluginpath=%{_libdir}/libnfsidmap-1.0.0`.
Also, remove reference to the old `libnfsidmap_<plugin>.so` path.
Benjamin Drung [Thu, 3 Apr 2025 12:14:07 +0000 (14:14 +0200)]
feat: add simpledrm module (as subset of drm module)
Plymouth doesn't always show a splash screen if DRM drivers are
installed in initrd.
Provide a `simpledrm` module that only installs the SimpleDRM module
and the potentially needed privacy screen providers. This `simpledrm`
module is a subset of the `drm` module. It could be used instead of
`drm` to avoid pulling in drivers like amdgpu, nouveau, or nvidia-drm.
fix(multipath): skip default multipath.conf with mpathconf
Commit 1e802f15f creates a default multipath.conf file with
"find_multipaths strict" when run in non-hostonly mode if there are no
multipath devices and no multipath.conf. Unfortunately for systems that
want to use mpathconf to create a multipath.conf file (e.g. Fedora and
Centos) either through multipathd-configure.service or multipathd.sh,
this default file keeps that from occurring. To make sure mpathconf is
called to create the config file, do not install a default config file
if mpathconf is installed.
Fixes: ("fix(multipath): include module with find_multipaths strict") Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Xinhui Yang [Fri, 28 Feb 2025 16:54:31 +0000 (00:54 +0800)]
fix(90kernel-modules): explicitly include xhci-pci-renesas
Since Linux v6.12-rc1 (commit 25f51b76f90f), xhci-pci no longer depends
on xhci-pci-renesas, causing the Renesas driver to be omitted during
initramfs generation (when built as a module).
This makes platforms with such xHCI controllers unavailable during
initrd, and unable to boot from a USB drive. There are SuperSpeed ports
routed through such controller on some platforms, too, which also
renders the USB keyboard and mouse unusable.
Here's a snippet of the kernel log from such platform, showing a
keyboard and a mouse being detected only after the initrd switched root:
[ 9.352608] systemd-journald[187]: Received SIGTERM from PID 1 (systemd).
[ 9.500146] systemd[1]: systemd 257.2 running in system mode (OMITTED)
...
[ 11.187756] xhci-pci-renesas 0000:04:00.0: xHCI Host Controller
[ 11.187870] xhci-pci-renesas 0000:04:00.0: new USB bus registered, assigned bus number 7
[ 11.193261] xhci-pci-renesas 0000:04:00.0: hcc params 0x014051cf hci version 0x100 quirks 0x0000000100000010
[ 11.194806] xhci-pci-renesas 0000:04:00.0: xHCI Host Controller
[ 11.196601] xhci-pci-renesas 0000:04:00.0: new USB bus registered, assigned bus number 8
[ 11.196613] xhci-pci-renesas 0000:04:00.0: Host supports USB 3.0 SuperSpeed
[ 11.196927] usb usb7: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.13
[ 11.196931] usb usb7: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 11.196935] usb usb7: Product: xHCI Host Controller
[ 11.196938] usb usb7: Manufacturer: Linux 6.13.3-aosc-main xhci-hcd
[ 11.196941] usb usb7: SerialNumber: 0000:04:00.0
[ 11.199598] hub 7-0:1.0: USB hub found
[ 11.199630] hub 7-0:1.0: 4 ports detected
...
[ 11.439561] usb 7-2: new high-speed USB device number 2 using xhci-pci-renesas
[ 11.568361] usb 7-2: New USB device found, idVendor=1532, idProduct=0114, bcdDevice= 1.00
[ 11.568369] usb 7-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 11.568372] usb 7-2: Product: DeathStalker Ultimate
[ 11.568376] usb 7-2: Manufacturer: Razer
[ 11.600474] input: Razer DeathStalker Ultimate as /devices/pci0000:00/0000:00:0e.0/0000:04:00.0/usb7/7-2/7-2:1.0/0003:1532:0114.0001/input/input12
[ 11.600686] hid-generic 0003:1532:0114.0001: input,hidraw0: USB HID v1.11 Mouse [Razer DeathStalker Ultimate] on usb-0000:04:00.0-2/input0
[ 11.601137] input: Razer DeathStalker Ultimate Keyboard as /devices/pci0000:00/0000:00:0e.0/0000:04:00.0/usb7/7-2/7-2:1.1/0003:1532:0114.0002/input/input13
[ 11.652148] input: Razer DeathStalker Ultimate as /devices/pci0000:00/0000:00:0e.0/0000:04:00.0/usb7/7-2/7-2:1.1/0003:1532:0114.0002/input/input14
[ 11.652409] hid-generic 0003:1532:0114.0002: input,hidraw1: USB HID v1.11 Keyboard [Razer DeathStalker Ultimate] on usb-0000:04:00.0-2/input1
[ 11.653054] input: Razer DeathStalker Ultimate as /devices/pci0000:00/0000:00:0e.0/0000:04:00.0/usb7/7-2/7-2:1.2/0003:1532:0114.0003/input/input15
[ 11.703768] hid-generic 0003:1532:0114.0003: input,hidraw2: USB HID v1.11 Keyboard [Razer DeathStalker Ultimate] on usb-0000:04:00.0-2/input2
Martin Wilck [Wed, 26 Feb 2025 13:59:44 +0000 (14:59 +0100)]
fix(iscsi): make sure services are shut down when switching root
When systemd prepares switching root, it starts 'initrd-cleanup.service',
which runs 'systemctl --no-block isolate initrd-switch-root.target'.
This will stop all units on which initrd-switch-root.target does not
depend, including iscsid.service and iscsiuio.service. But systemd
doesn't guarantee a time ordering in this case. It can happen that
systemd switches root (i.e. restarts itself on the new root) before
iscsiuio is actually stopped, or at least before PID 1 receives
the notification that it has stopped. In this case, it considers
iscsiuio still running, and will not start it later in the boot
sequence when iscsid is coming up.
A typical log excerpt with systemd.log_level=debug looks like this:
When iscsid is started later on in the real root, it resets all existing iSCSI
connections, causing the root FS to come offline. In iSCSI offload scenarios
if iscsiuio is already running, it will re-establish the session after a few
seconds. But if iscsiuio has not been started at this point in time, it can't
be loaded any more from the root FS, and booting fails.
To avoid this problem, add "Conflicts" and a "Before" dependencies against
initrd-cleanup.service to the iSCSI service units.
See also https://github.com/systemd/systemd/issues/3436
Martin Wilck [Wed, 26 Feb 2025 13:54:51 +0000 (14:54 +0100)]
fix(iscsi): don't require network setup for qedi
This adds the logic of cc2c48a ("fix(iscsi): don't require network setup
for bnx2i") for the qedi iSCSI offload driver. Testing has shown
that for qedi, network setup in the initrd is even more superfluous
as it is for bnx2i. qedi devices are usually separate PCI functions
that don't show up as ethernet interfaces at all.
Benjamin Drung [Fri, 21 Feb 2025 22:49:04 +0000 (23:49 +0100)]
fix(systemd-sysusers): silence "Creating " on stderr
dracut prints 20 lines when creating users and groups even with
`--quiet` option. Sample output:
```
Creating group 'nobody' with GID 65534.
Creating group 'audio' with GID 997.
Creating group 'disk' with GID 995.
Creating group 'input' with GID 994.
Creating group 'kmem' with GID 993.
Creating group 'kvm' with GID 992.
Creating group 'lp' with GID 991.
Creating group 'optical' with GID 990.
Creating group 'render' with GID 989.
Creating group 'sgx' with GID 988.
Creating group 'storage' with GID 987.
Creating group 'tty' with GID 5.
Creating group 'uucp' with GID 986.
Creating group 'video' with GID 985.
Creating group 'users' with GID 984.
Creating group 'systemd-journal' with GID 983.
Creating user 'root' (Super User) with UID 0 and GID 0.
Creating user 'nobody' (Kernel Overflow User) with UID 65534 and GID 65534.
Creating group 'nobody' with GID 65534.
Creating group 'audio' with GID 997.
```
Filter "Creating " messages from stderr, but keep the other messages on
stderr and all messages on stdout untouched.
Fixes: https://github.com/dracut-ng/dracut-ng/issues/1195 Fixes: f3dacc013d90 ("feat(systemd-sysusers): run systemd-sysusers as part of the build process")
You-Sheng Yang [Wed, 22 Jan 2025 15:37:53 +0000 (23:37 +0800)]
fix(dracut-install): install compressed blobs that match wildcard fwpath
dracut-install tries to invoke `glob()` with full path expanded from
"intel/ish/ish_*.bin", but while all the binaries were compressed, this
matches no file and none of the custom ISH firmware blobs will be
installed.
Closes: #1150
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2095518 Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Benjamin Drung [Wed, 12 Feb 2025 10:10:30 +0000 (11:10 +0100)]
fix(dracut-lib): support "set -e" in setdebug
A `return` statement will return with the exit code of the previous
command if no exit code is specified. In case `/usr/lib/initrd-release`
does not exist, `setdebug` will return with the exit code 1.
Return this function with code 0 in that case to support `set -e` users.
Fixes: 2b125c69cc80 ("base/dracut-lib.sh: do not setdebug, if not in initramfs")
Laszlo Gombos [Sat, 8 Feb 2025 01:48:42 +0000 (20:48 -0500)]
fix(release): tagging and release generation is no longer automated
Create release commit on relese branch automatically, but leave the
rest of the release creation process up to the project admins to
allow manual review and intervention.
We do not have a valid email address for the release automation,
so let's make it obvious that it is just a placeholder email address.
Benjamin Drung [Fri, 7 Feb 2025 18:35:35 +0000 (19:35 +0100)]
test(FULL-SYSTEMD): skip systemd-network-management if missing
The Debian/Ubuntu package runs the FULL-SYSTEMD test without
dracut-network installed. Therefore the test fails due to the missing
`systemd-network-management` module:
```
TEST: Full systemd serialization/deserialization test with /usr mount
dracut[E]: Module 'systemd-network-management' cannot be found.
```
Fixes: 75f3a191b675 ("test(FULL-SYSTEMD): when systemd-networkd is available, install it")
Benjamin Drung [Tue, 11 Feb 2025 11:57:34 +0000 (12:57 +0100)]
test: ignore shellcheck for disk_index
shellcheck complains about `disk_index` for appearing to be unused, but
this variable is used in `qemu_add_drive`. So ignore those shellcheck
complaints.
Jo Zzsi [Mon, 27 Jan 2025 00:24:05 +0000 (19:24 -0500)]
test(KERNEL-INSTALL): include generating and testing rescue boot
Make sure kernel-install generates the regular hostonly initrd and
the rescue (non-hostonly) initrd as well.
It is not necessary recommended for distributions to follow this
test case, in fact rescue (non-hostonly) initrd is not enabled by
default, but this is a very convinient way on the CI to test
both configuration and avoid regressions going forward.
Jo Zzsi [Sun, 26 Jan 2025 01:53:55 +0000 (20:53 -0500)]
test(KERNEL-INSTALL): enable for all CI container
Add preconditions, which would skip this test on
Debian/Ubuntu for now.
Move enviroment variables - such as BOOT_ROOT - out
from the test specific code to the common test infrastrucutre
so that it is available for all test cases.
Jo Zzsi [Fri, 24 Jan 2025 14:08:15 +0000 (09:08 -0500)]
ci: rename test-github to test-container
test-container better reflects that this scripts is meant to
install and run dracut in container and not restricted to be used
as part of GitHub Actions.
Also add a safety check to make sure that the script gets executed
inside a container and not on a host.