]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
4 months agofix(dracut): protect existing output file against build errors 694/head
Antonio Alvarez Feijoo [Thu, 13 Mar 2025 16:03:21 +0000 (17:03 +0100)] 
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.

4 months agochore: document recently introduced dracut modules
Jo Zzsi [Sun, 20 Apr 2025 01:05:47 +0000 (21:05 -0400)] 
chore: document recently introduced dracut modules

 - simpledrm
 - systemd-battery-check
 - systemd-emergency

4 months agoci(azurelinux): make sure tar is installed
Jo Zzsi [Sun, 20 Apr 2025 01:22:40 +0000 (21:22 -0400)] 
ci(azurelinux): make sure tar is installed

tar is required to download dracut source code before a build.

4 months agoci(opensuse): make sure cpio is explicitelly installed
Jo Zzsi [Sun, 20 Apr 2025 01:11:17 +0000 (21:11 -0400)] 
ci(opensuse): make sure cpio is explicitelly installed

arm64 CI started to fail with cpio binary missing.

4 months agofix(systemd-sysusers): make sure tss user for tpm2 is created
Jo Zzsi [Mon, 10 Feb 2025 01:38:52 +0000 (20:38 -0500)] 
fix(systemd-sysusers): make sure tss user for tpm2 is created

systemd-sysuser module should be orders afer all modules that
depends on it.

This is to make sure that all inst_sysusers calls are in place before
systemd-sysusers is called.

4 months agotest(GETARG): remove hardcoded dracut module ordering
Jo Zzsi [Tue, 15 Apr 2025 16:19:44 +0000 (12:19 -0400)] 
test(GETARG): remove hardcoded dracut module ordering

The intention of this PR is to help with issue
https://github.com/dracut-ng/dracut-ng/issues/538
and future-proof the test case.

4 months agofix(rngd): do not check for +x perms
Nowa Ammerlaan [Sun, 9 Feb 2025 09:20:02 +0000 (10:20 +0100)] 
fix(rngd): do not check for +x perms

require_binaries checks for an executable binary, but systemd
service files are usually not executable nor binary.

resolves an issue discovered on gentoo where the rngd module would
refuse to be included due to a missing file that does in fact exist

Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org>
4 months agofix(base): only set ID to dracut if systemd is not used
Jo Zzsi [Thu, 3 Apr 2025 11:54:57 +0000 (07:54 -0400)] 
fix(base): only set ID to dracut if systemd is not used

5bf724f & 41f9e8f, have exposed the misuse of the ID= parameter
in initrd-release and its links when using init.sh.

4 months agotest(NFS): remove hardcoded dracut module ordering
Jo Zzsi [Tue, 15 Apr 2025 12:58:40 +0000 (08:58 -0400)] 
test(NFS): remove hardcoded dracut module ordering

Use test-root and nfs dracut modules instead of reimplementing
logic as part of the test case.

4 months agofeat(UKI): use ukify when available to generate UKI
Jo Zzsi [Wed, 15 Jan 2025 22:26:03 +0000 (17:26 -0500)] 
feat(UKI): use ukify when available to generate UKI

Prefer to use ukify over the current objcopy and awk
based solution to generate UKI.

4 months agotest: add container for Azure Linux
Thien Trung Vuong [Tue, 1 Apr 2025 20:54:45 +0000 (20:54 +0000)] 
test: add container for Azure Linux

Signed-off-by: Thien Trung Vuong <tvuong@microsoft.com>
4 months agofix: don't use command -v to find binaries in the sysroot
James Le Cuirot [Tue, 1 Apr 2025 10:51:19 +0000 (11:51 +0100)] 
fix: don't use command -v to find binaries in the sysroot

If the binaries were missing outside the sysroot, "" was passed to
dracut-install, which then created an empty directory instead!

dracut-install will automatically search the sysroot for a named binary
if it is given without a path anyway.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
4 months agofix: add $dracutsysrootdir to paths where it should be present
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>
4 months agofix(crypt): always install s390 crypto modules
Antonio Alvarez Feijoo [Thu, 3 Apr 2025 05:31:10 +0000 (07:31 +0200)] 
fix(crypt): always install s390 crypto modules

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.

4 months agofix(dracut-init): assign real path to srcmods
Antonio Alvarez Feijoo [Tue, 15 Apr 2025 15:16:22 +0000 (17:16 +0200)] 
fix(dracut-init): assign real path to srcmods

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:

```
libkmod: ERROR: kmod_module_new_from_path: kmod_module 'nvidia' already exists with different path: new-path='/lib/modules/6.14.1-1-default//weak-updates/updates/nvidia-open-driver-G06-signed-570.133.07/nvidia.ko.zst' old-path='/usr/lib/modules/6.14.1-1-default/weak-updates/updates/nvidia-open-driver-G06-signed-570.133.07/nvidia.ko.zst'
libkmod: ERROR: kmod_module_parse_depline: ctx=0x560bbacad8f0 path=/lib/modules/6.14.1-1-default//weak-updates/updates/nvidia-open-driver-G06-signed-570.133.07/nvidia.ko.zst error=File exists
```

openSUSE bug report: https://bugzilla.opensuse.org/show_bug.cgi?id=1241114

4 months agofix(nfs): add possible `statd` user and group
Antonio Alvarez Feijoo [Tue, 1 Apr 2025 12:34:04 +0000 (14:34 +0200)] 
fix(nfs): add possible `statd` user and group

Some distributions use the `statd` user (openSUSE, Ubuntu) and group (openSUSE)
to handle `rpc.statd` directories.

4 months agofix(nfs): use `DRACUT_CP` instead of `cp`
Antonio Alvarez Feijoo [Tue, 1 Apr 2025 12:33:38 +0000 (14:33 +0200)] 
fix(nfs): use `DRACUT_CP` instead of `cp`

Using `cp` directly ignores `DRACUT_NO_XATTR`.

4 months agofix(nfs): libnfsidmap plugins not added in some distributions
Antonio Alvarez Feijoo [Tue, 25 Mar 2025 14:20:48 +0000 (15:20 +0100)] 
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.

4 months agorefactor(multipath): remove custom multipathd.service
Antonio Alvarez Feijoo [Mon, 3 Mar 2025 14:23:41 +0000 (15:23 +0100)] 
refactor(multipath): remove custom multipathd.service

Install `multipathd.service` provided by upstream, and add a dropin to support
`rd.multipath=0`.

4 months agochore(multipath): remove `rd_NO_MULTIPATH` kernel command line option
Antonio Alvarez Feijoo [Mon, 3 Mar 2025 14:22:14 +0000 (15:22 +0100)] 
chore(multipath): remove `rd_NO_MULTIPATH` kernel command line option

Deprecated since 778b3543609d8c9d32df7111229f4072d00d02f0 (Nov 25, 2014).

4 months agofeat(systemd): add new systemd-validatefs@.service
Antonio Alvarez Feijoo [Fri, 4 Apr 2025 08:18:07 +0000 (10:18 +0200)] 
feat(systemd): add new systemd-validatefs@.service

Introduced in https://github.com/systemd/systemd/commit/0bdd5ccc8145af8dae9779751d3e7a34c4fa6aa5
Used internally in fstab-generator (new `x-systemd.validatefs` mount option) and
gpt-auto-generator: https://github.com/systemd/systemd/commit/f872373a26dcaa0818b49220abfe35611d12fa82

4 months agofeat: add simpledrm module (as subset of drm module)
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.

Bug-Ubuntu: https://launchpad.net/bugs/2105377

4 months agoperf(base): move the chmod dependency from base to systemd
Jo Zzsi [Mon, 24 Mar 2025 13:23:22 +0000 (09:23 -0400)] 
perf(base): move the chmod dependency from base to systemd

base dracut module no longer requires chmod.

4 months agochore(network-legacy): no need to call chmod on ifup.sh
Jo Zzsi [Mon, 24 Mar 2025 13:12:13 +0000 (09:12 -0400)] 
chore(network-legacy): no need to call chmod on ifup.sh

This is a small optimization, with the goal of avoiding
calling chmod for a file that is already guaranteed to be
an executable.

4 months agoci(Fedora): make sure portablectl is installed
Jo Zzsi [Sat, 15 Mar 2025 11:54:23 +0000 (07:54 -0400)] 
ci(Fedora): make sure portablectl is installed

Add systemd-container to make sure portablectl is installed.

See https://src.fedoraproject.org/rpms/systemd/c/49ec9f3286e6c18e48f3ee3a08da950d0113f853?branch=rawhide
portablectl and importctl are moved to systemd-container (rhbz#2345551)

5 months agofix(multipath): skip default multipath.conf with mpathconf
Benjamin Marzinski [Wed, 26 Mar 2025 22:04:25 +0000 (18:04 -0400)] 
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>
5 months agofix(mdraid): do not call mdadm with full path
Alexander Tsoy [Tue, 18 Mar 2025 20:56:37 +0000 (23:56 +0300)] 
fix(mdraid): do not call mdadm with full path

We use `command -v` to find mdadm binary on the system anyway, so it
makes no sense to call it using the full path.

Bug: https://bugs.gentoo.org/951284
Signed-off-by: Alexander Tsoy <alexander@tsoy.me>
5 months agoci(fedora): always use update-crypto-policies to enable fips
Jo Zzsi [Tue, 4 Mar 2025 00:03:04 +0000 (19:03 -0500)] 
ci(fedora): always use update-crypto-policies to enable fips

5 months agofeat(systemd-integritysetup): add remote-integritysetup.target
Antonio Alvarez Feijoo [Wed, 26 Feb 2025 07:20:09 +0000 (08:20 +0100)] 
feat(systemd-integritysetup): add remote-integritysetup.target

Required since https://github.com/systemd/systemd/commit/810708f4b820543b8585a36e84ccca4bc5b18fee

6 months agofix(90kernel-modules): explicitly include xhci-pci-renesas
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

6 months agoci: fix container image name
Jo Zzsi [Thu, 27 Feb 2025 12:24:25 +0000 (07:24 -0500)] 
ci: fix container image name

Fix regression introduced by d8ff139 .

6 months agofix(iscsi): make sure services are shut down when switching root
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:

[   36.470761] worker2 systemd[1]: initrd-cleanup.service: Trying to enqueue job initrd-cleanup.service/start/replace
[   36.765241] worker2 systemd[1]: initrd-switch-root.target: Trying to enqueue job initrd-switch-root.target/start/isolate
[   36.765337] worker2 systemd[1]: iscsid.service: Installed new job iscsid.service/stop as 139
[   36.765535] worker2 systemd[1]: iscsiuio.service: Installed new job iscsiuio.service/stop as 138
[   36.824789] worker2 systemd[1]: iscsid.socket: stopping held back, waiting for: iscsid.service
[   36.824813] worker2 systemd[1]: iscsiuio.socket: stopping held back, waiting for: iscsiuio.service
[   36.888759] worker2 systemd[1]: iscsid.service: Thawing unit.
[   36.888882] worker2 systemd[1]: iscsid.service: Changed running -> stop-sigterm
[   36.889355] worker2 systemd[1]: Stopping Open-iSCSI...
[   36.889413] worker2 systemd[1]: iscsiuio.service: stopping held back, waiting for: iscsid.service
[   37.512072] worker2 systemd[1]: Reached target Switch Root.
[   37.549512] worker2 @ystemctl[1614]: Switching root - root: /sysroot; init: n/a
[   37.577264] worker2 systemd[1]: Switching root.

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

Signed-off-by: Martin Wilck <mwilck@suse.com>
6 months agofix(iscsi): don't require network setup for qedi
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.

While at it, simplify the conditional a bit.

Signed-off-by: Martin Wilck <mwilck@suse.com>
6 months agofix(systemd-veritysetup): install dm-verity kernel module
Antonio Alvarez Feijoo [Thu, 20 Feb 2025 10:20:36 +0000 (11:20 +0100)] 
fix(systemd-veritysetup): install dm-verity kernel module

6 months agofix(systemd-sysusers): silence "Creating " on stderr
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")
6 months agofeat(btrfs): also install btrfstune
Mark Harmstone [Thu, 23 Jan 2025 11:39:13 +0000 (11:39 +0000)] 
feat(btrfs): also install btrfstune

6 months agofix(dracut-install): install compressed blobs that match wildcard fwpath
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>
6 months agotest(test-functions): drop defining TEST_FSTYPE
Benjamin Drung [Wed, 12 Feb 2025 17:48:19 +0000 (18:48 +0100)] 
test(test-functions): drop defining TEST_FSTYPE

The variable `TEST_FSTYPE` is only used by `TEST-20-STORAGE` and is
defined there as well.

6 months agotest: define default network in the respective tests
Benjamin Drung [Wed, 12 Feb 2025 17:46:50 +0000 (18:46 +0100)] 
test: define default network in the respective tests

The variable `TEST_FSTYPE` will be needed to construct
`TEST_DESCRIPTION`.

So define `TEST_FSTYPE` in the respective tests before defining
`TEST_DESCRIPTION`.

6 months agotest: use "set -e" in all tests
Benjamin Drung [Wed, 12 Feb 2025 10:34:24 +0000 (11:34 +0100)] 
test: use "set -e" in all tests

To make all tests more robust, use `set -e` in all tests. Then the
`|| return 1` constructs can be removed.

6 months agofix(dracut-lib): support "set -e" in setdebug
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")
6 months agotest(GETARG): fix shellcheck SC2181
Benjamin Drung [Wed, 12 Feb 2025 10:05:00 +0000 (11:05 +0100)] 
test(GETARG): fix shellcheck SC2181

Fix shellcheck SC2181 in the getarg test case. This also makes the code
work with `set -e`.

6 months agotest(test-functions): support reading empty /etc/machine-id
Benjamin Drung [Wed, 12 Feb 2025 01:23:24 +0000 (02:23 +0100)] 
test(test-functions): support reading empty /etc/machine-id

When `/etc/machine-id` is empty, `read -r TOKEN < /etc/machine-id` will
exit with code 1. This case is supported. So just ignore the exit code.

6 months agotest: ignore exit code of increment in qemu_add_drive
Benjamin Drung [Wed, 12 Feb 2025 01:05:05 +0000 (02:05 +0100)] 
test: ignore exit code of increment in qemu_add_drive

Ignore error status code when incrementing from 0 to 1. See also
https://www.shellcheck.net/wiki/SC2219

Fixes: 1af00bf238c8 ("chore: resolve shellcheck for SC2219")
6 months agofix(dracut): avoid mktemp collisions with find filter
Brian Fjeldstad [Tue, 4 Feb 2025 22:09:04 +0000 (22:09 +0000)] 
fix(dracut): avoid mktemp collisions with find filter

6 months agofix(release): tagging and release generation is no longer automated
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.

6 months agotest(FULL-SYSTEMD): skip systemd-network-management if missing
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")
6 months agotest: log error when constructing sysroot
Benjamin Drung [Fri, 7 Feb 2025 17:51:25 +0000 (18:51 +0100)] 
test: log error when constructing sysroot

Log dracut errors for all dracut invocations. Otherwise tests can fail
without any log output.

Fixes: 8631284afbfa ("ci: do not log how sysroot is constructed")
6 months agotest: ignore shellcheck for disk_index
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.

6 months agotest(FULL-SYSTEMD): skip encrypted root if qemu -smbios is not supported
Benjamin Drung [Mon, 10 Feb 2025 20:33:34 +0000 (21:33 +0100)] 
test(FULL-SYSTEMD): skip encrypted root if qemu -smbios is not supported

The qemu option `-smbios` is not supported on most architectures.
Therefore `TEIT-41-FULL-SYSTEMD` will fail.

Fixes #1213

6 months agotest(FULL-SYSTEMD): make smbios option a parameter of run_client
Benjamin Drung [Mon, 10 Feb 2025 20:31:59 +0000 (21:31 +0100)] 
test(FULL-SYSTEMD): make smbios option a parameter of run_client

6 months agotest: use persistent names for network devices
Benjamin Drung [Tue, 11 Feb 2025 17:05:36 +0000 (18:05 +0100)] 
test: use persistent names for network devices

TEST-70-ISCSI fails on Ubuntu s390x because the network device is named
`enc0` instead of `enp0s1`:

```
CLIENT TEST START: NBD root=nbd:IP:port
[...]
[   36.084991] virtio_net virtio2 enc0: renamed from eth0
```

So use persistent names for network devices by mapping the MAC address
to a name.

6 months agotest: typo in the GitHub Action name
Jo Zzsi [Wed, 12 Feb 2025 01:46:03 +0000 (20:46 -0500)] 
test: typo in the GitHub Action name

These are arm64 runs not amd64 runs.

6 months agofix(systemd-sysusers): always silence stdout
Jo Zzsi [Sat, 8 Feb 2025 01:24:39 +0000 (20:24 -0500)] 
fix(systemd-sysusers): always silence stdout

systemd-sysusers does not have quiet option, so
always silence stdout (but not stderr).

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1195
6 months agotest(ISCSI): skip root=ibft if qemu -acpitable is not supported
Benjamin Drung [Mon, 10 Feb 2025 09:52:40 +0000 (10:52 +0100)] 
test(ISCSI): skip root=ibft if qemu -acpitable is not supported

Several architectures do not support the qemu option `-acpitable`. Skip
the `root=ibft` in this case.

6 months agotest: use "set -eu" in run-qemu
Benjamin Drung [Mon, 10 Feb 2025 09:48:51 +0000 (10:48 +0100)] 
test: use "set -eu" in run-qemu

6 months agotest(ISCSI): make acpitable file a parameter of run_client
Benjamin Drung [Mon, 10 Feb 2025 09:43:29 +0000 (10:43 +0100)] 
test(ISCSI): make acpitable file a parameter of run_client

The ACPI table only needs to be set for one of the iSCSI test cases.

7 months agodocs: update NEWS.md and AUTHORS for release 106 1197/head 106
dracutng[bot] [Sat, 1 Feb 2025 01:20:41 +0000 (01:20 +0000)] 
docs: update NEWS.md and AUTHORS for release 106

7 months agoci: switch integration tests from ubuntu:latest to ubuntu:rolling
Jo Zzsi [Mon, 27 Jan 2025 00:32:02 +0000 (19:32 -0500)] 
ci: switch integration tests from ubuntu:latest to ubuntu:rolling

ubuntu:latest points to Ubuntu 24.04.

ubuntu:rolling currently points ot 24.10 and soon will point to
25.04.

This change has no impact on the "Daily Integration tests", which
anyways expect to test and pass both with ubuntu:latest and
ubuntu:rolling.

For Fedora fedora:latest points to the bi-yearly releases,
and the corresponding label for Ubuntu is ubuntu:rolling.

7 months agofeat(systemd-battery-check): always include the module if possible
Pavel Valena [Wed, 29 Jan 2025 22:26:22 +0000 (23:26 +0100)] 
feat(systemd-battery-check): always include the module if possible

7 months agoci: add arm64 extra containers
Jo Zzsi [Thu, 30 Jan 2025 14:28:56 +0000 (09:28 -0500)] 
ci: add arm64 extra containers

Among other containers, this should enable arm64 for Gentoo.

7 months agotest(UEFI): add subtest for using ukify with kernel-install
Jo Zzsi [Wed, 29 Jan 2025 03:53:29 +0000 (22:53 -0500)] 
test(UEFI): add subtest for using ukify with kernel-install

New test case for end-to-end integration and keep
existing subtests as fallback.

7 months agoci(debian): make sure that systemd-ukify is installed when available
Jo Zzsi [Wed, 29 Jan 2025 04:32:59 +0000 (23:32 -0500)] 
ci(debian): make sure that systemd-ukify is installed when available

Fix typo in the containerfile.

7 months agoci: remove workaround from test cases
Jo Zzsi [Wed, 29 Jan 2025 00:38:02 +0000 (19:38 -0500)] 
ci: remove workaround from test cases

Now that workarounds are executed during test container
generation from containerfile, workarounds are no longer
needed in test cases.

7 months agoci: move distro specific workarounds to the containerfiles
Jo Zzsi [Tue, 28 Jan 2025 23:04:44 +0000 (18:04 -0500)] 
ci: move distro specific workarounds to the containerfiles

Follow-up to cfe8b21.

Debian and Uunbtu container worked well, but ubuntu:rolling and
ubuntu:devel did not.

I tested this PR on ubuntu:rolling.

7 months agoci: move distro specific workarounds to the containerfiles
Jo Zzsi [Tue, 28 Jan 2025 21:55:21 +0000 (16:55 -0500)] 
ci: move distro specific workarounds to the containerfiles

This change helps to keep the test itself more readable.

7 months agoci: reenable some tests for arm64
Jo Zzsi [Tue, 28 Jan 2025 21:57:39 +0000 (16:57 -0500)] 
ci: reenable some tests for arm64

These tests were accidentally disabled by 987be72 .

7 months agoci: pass the test on Fedora and openSUSE on arm64
Jo Zzsi [Tue, 28 Jan 2025 15:26:45 +0000 (10:26 -0500)] 
ci: pass the test on Fedora and openSUSE on arm64

increase timeout for finding sysroot
add workaround for finding kernel on openSUSE on arm64

These changes are required to pass the test on Fedora
and openSUSE on arm64.

7 months agotest(KERNEL-INSTALL): add support for Debian/Ubuntu
Jo Zzsi [Tue, 28 Jan 2025 13:21:26 +0000 (08:21 -0500)] 
test(KERNEL-INSTALL): add support for Debian/Ubuntu

Add workarouund for Debian/Ubuntu based distros, so that
kernel-install can find the kernel image.

7 months agoci(openSUSE): switch to packaged version of mkosi-initrd
Jo Zzsi [Tue, 28 Jan 2025 14:02:41 +0000 (09:02 -0500)] 
ci(openSUSE): switch to packaged version of mkosi-initrd

mkosi v25 packaged now, so lets switch to the packaged version.

7 months agoci: consolidate output filename for test runs
Jo Zzsi [Tue, 28 Jan 2025 12:11:00 +0000 (07:11 -0500)] 
ci: consolidate output filename for test runs

Move initramfs.testing output file name from individual
testins into test-functions.

7 months agoci: add root=LABEL=dracut to the common kernel cmdline for tests
Jo Zzsi [Mon, 27 Jan 2025 01:21:20 +0000 (20:21 -0500)] 
ci: add root=LABEL=dracut to the common kernel cmdline for tests

Individual tests can (and do) overide the default root.

7 months agotest(KERNEL-INSTALL): include generating and testing rescue boot
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.

7 months agotest(KERNEL-INSTALL): enable for all CI container
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.

7 months agotest(KERNEL-INSTALL): enable test for Arch, Gentoo, openSUSE as well
Jo Zzsi [Sun, 26 Jan 2025 00:36:34 +0000 (19:36 -0500)] 
test(KERNEL-INSTALL): enable test for Arch, Gentoo, openSUSE as well

Fix initrd location when /etc/machine-id does not exists.

The test does not yet work on Debian/Ubuntu.

7 months agoci: move more logic to test dracut config
Jo Zzsi [Sun, 26 Jan 2025 00:11:28 +0000 (19:11 -0500)] 
ci: move more logic to test dracut config

test dracut config is available for all test runs, including
kernel-install runs.

7 months agotest(KERNEL-INSTALL): enable dracut test config
Jo Zzsi [Sat, 25 Jan 2025 22:57:21 +0000 (17:57 -0500)] 
test(KERNEL-INSTALL): enable dracut test config

Enable the dracut test config not just the test dracut module.

7 months agotest(BASIC): remove workaround for systemd on arm64
Jo Zzsi [Sat, 25 Jan 2025 22:48:07 +0000 (17:48 -0500)] 
test(BASIC): remove workaround for systemd on arm64

Removed omitting systemd modules from the BASIC test.
Increase the rd.timeout=60 to give enough time for systemd on arm64.

Disable networking for this test (inside the qemu VM)
to increase test covergae and make this test even more basic.

7 months agoci: switch to ubuntu-24.04
Jo Zzsi [Sat, 25 Jan 2025 21:09:14 +0000 (16:09 -0500)] 
ci: switch to ubuntu-24.04

There is no ubuntu-latest for arm and the current ubuntu-latest
gives a warning...

7 months agotest(KERNEL-INSTALL): add test for kernel-install
Jo Zzsi [Sat, 25 Jan 2025 15:40:05 +0000 (10:40 -0500)] 
test(KERNEL-INSTALL): add test for kernel-install

The test requires kernel-install binary and only runs in a container.

7 months agoci: separate out amd64 tests into its own GA file
Jo Zzsi [Sat, 25 Jan 2025 13:47:32 +0000 (08:47 -0500)] 
ci: separate out amd64 tests into its own GA file

Having a separate file give more control to trigger independently.

7 months agoci: only set console for amd64
Jo Zzsi [Fri, 24 Jan 2025 17:59:56 +0000 (12:59 -0500)] 
ci: only set console for amd64

Follow-up to 25795c7.

This restore green CI for arm.

7 months agofeat(dracut.install): force hostonly for kernel-install plugin
Jo Zzsi [Thu, 23 Jan 2025 23:29:42 +0000 (18:29 -0500)] 
feat(dracut.install): force hostonly for kernel-install plugin

Distributions that have adapted and integrated dracut and
adopted the dracut kernel install plugin should default to
hostonly mode initrd.

7 months agoci: rename test-github to test-container
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.

7 months agoci(fedora): use Debian, Arch, Gentoo to test systemd-networkd
Jo Zzsi [Fri, 24 Jan 2025 13:39:50 +0000 (08:39 -0500)] 
ci(fedora): use Debian, Arch, Gentoo to test systemd-networkd

This is in an effort to simplify the CI and minimize
the difference between CentOS and Fedora testing.

While Fedora supports systemd-networkd, CentOS does not and
Debian, Arch and Gentoo already provides enought test coverage
for the Dracut CI.

7 months agoci: demote dmraid testing
Jo Zzsi [Fri, 24 Jan 2025 12:51:14 +0000 (07:51 -0500)] 
ci: demote dmraid testing

dmraid is no longer activly maitaned and has been already removed
form the following distributions
 - CentOS
 - Debian
 - Ubuntu

Dracut will continue to support dmraid, but lets minimize the CI
burdon and only test dmraid on Arch container going forward.

One of the other motivation of this change is to align Fedora
configuration a bit more with CentOS configuration for ease of
maitenance.

7 months agoci: restore regression for console messages
Jo Zzsi [Fri, 24 Jan 2025 00:37:53 +0000 (19:37 -0500)] 
ci: restore regression for console messages

BASIC, UEFI, DMSQUASH tests did not had some of the
kernel command line options properly set

7 months agoci: simplify manually adding dracut modules
Jo Zzsi [Thu, 23 Jan 2025 22:31:52 +0000 (17:31 -0500)] 
ci: simplify manually adding dracut modules

Remove manually adding dracut modules where possible to
let dracut determine which modules are required.

7 months agotest(DMSQUASH): enable all subtests on arm64
Jo Zzsi [Thu, 23 Jan 2025 03:01:05 +0000 (22:01 -0500)] 
test(DMSQUASH): enable all subtests on arm64

All tests are now passing on arm64.

7 months agotest(UEFI): include all kernel command line into the UKI
Jo Zzsi [Wed, 22 Jan 2025 17:25:55 +0000 (12:25 -0500)] 
test(UEFI): include all kernel command line into the UKI

We shoudl have a test with all kernel command line
included in the UKI.

7 months agotest(DMSQUASH): add test step for iso-scan
Jo Zzsi [Wed, 22 Jan 2025 15:41:49 +0000 (10:41 -0500)] 
test(DMSQUASH): add test step for iso-scan

Test iso-scan dracut module argument when xorriso is available
to create an iso.

7 months agoci: install xorriso into CI containers
Jo Zzsi [Wed, 22 Jan 2025 14:41:36 +0000 (09:41 -0500)] 
ci: install xorriso into CI containers

Preparation to test iso-scan dracut feature which requires
an iso file that xorriso would generate.

7 months agotest(DMSQUASH): reorganize test steps into test runs
Jo Zzsi [Mon, 20 Jan 2025 22:03:03 +0000 (17:03 -0500)] 
test(DMSQUASH): reorganize test steps into test runs

Make DMSQUASH test same structure as some other tests to make it easier
to debug and reason about.

7 months agotest(DMSQUASH): fix path and improve directory naming
Jo Zzsi [Mon, 20 Jan 2025 21:16:23 +0000 (16:16 -0500)] 
test(DMSQUASH): fix path and improve directory naming

Follow-up fix to ff370f5 to test the condition if
/proc does not exists.

7 months agotest(DMSQUASH): create rootfs without qemu and enable test for arm
Jo Zzsi [Mon, 20 Jan 2025 17:23:48 +0000 (12:23 -0500)] 
test(DMSQUASH): create rootfs without qemu and enable test for arm

This enables passing this test on arm as well.

Only the first subtest is passing on arm, so run only the first
test on arm, but run all the remaining tests on amd.

7 months agotest(DMSQUASH): qemu module is not needed
Jo Zzsi [Mon, 20 Jan 2025 04:34:37 +0000 (23:34 -0500)] 
test(DMSQUASH): qemu module is not needed

Only include the main dracut module and make sure that dependencies
are properly managed.

7 months agotest(DMSQUASH): combine test steps without loosing test coverage
Jo Zzsi [Mon, 20 Jan 2025 03:51:50 +0000 (22:51 -0500)] 
test(DMSQUASH): combine test steps without loosing test coverage

Build initrd only once.

7 months agoci: move arm64 tests to the Daily Interation Tests
Jo Zzsi [Mon, 20 Jan 2025 02:40:04 +0000 (21:40 -0500)] 
ci: move arm64 tests to the Daily Interation Tests

Move arm64 tests to the Daily Interation Tests.

Enable all arm64 tests that are passing.

7 months agoci: remove leftover '-j' argument from mkfs.ext4
Jo Zzsi [Mon, 20 Jan 2025 02:27:21 +0000 (21:27 -0500)] 
ci: remove leftover '-j' argument from mkfs.ext4

As the projects transitioned over to ext4, passing `-j` is no
longer desired.

7 months agotest(DMSQUASH): add bash module instead of installing several shells
Jo Zzsi [Mon, 20 Jan 2025 02:11:52 +0000 (21:11 -0500)] 
test(DMSQUASH): add bash module instead of installing several shells

This change tells dracut that shell is already included.