]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
2 hours agotest(SYSTEMD): do not use test with globbing main
Benjamin Drung [Mon, 3 Aug 2026 10:41:29 +0000 (12:41 +0200)] 
test(SYSTEMD): do not use test with globbing

There might be multiple files matching the globbing as it can be seen on
`arch:latest`:

```
./test.sh: line 49: [: /usr/lib/libfido2.so.1: binary operator expected
```

Use `compgen` to check if the glob pattern matches one or more files
without failing on multiple matches.

Follow-up for 48e4665c97b3c71f485b95426e5bf00dae3ab1ab

3 hours agofix(dracut-functions): typo in log function
Antonio Alvarez Feijoo [Mon, 3 Aug 2026 10:05:20 +0000 (12:05 +0200)] 
fix(dracut-functions): typo in log function

`berror()` does not exist, it's `derror()`.

Follow-up for ceca74ccc397795db68ca6ffbe49d65af2178a50

3 hours agoci(debian): remove unused variable
devkontrol [Mon, 3 Aug 2026 00:44:42 +0000 (20:44 -0400)] 
ci(debian): remove unused variable

coreutils variable is no longer used.

3 hours agofix(iscsi): normalize the target name in the generated netroot=
Antonio Alvarez Feijoo [Mon, 3 Aug 2026 10:02:06 +0000 (12:02 +0200)] 
fix(iscsi): normalize the target name in the generated netroot=

Commit 843af3e751782285cd2bc7c9a3a9d33e843fb91d normalized `rd.iscsi.initiator=`
but left the target name in the `netroot=` line on the next line unnormalized,
even though both come from the same sysfs session directory and are subject to
the same RFC 3722 rules.

Follow-up for 843af3e751782285cd2bc7c9a3a9d33e843fb91d

3 hours agofix(iscsi): do not source the boot-time net-lib.sh into module-setup.sh
Antonio Alvarez Feijoo [Mon, 3 Aug 2026 09:52:55 +0000 (11:52 +0200)] 
fix(iscsi): do not source the boot-time net-lib.sh into module-setup.sh

That sources all of net-lib.sh into dracut.sh, not just the one function that
is wanted. net-lib.sh defines `iface_for_remote_addr()`, which is also defined
in dracut-functions.sh with a different implementation, so the boot-time version
silently replaces it for the rest of the run. The version in dracut-functions.sh
parses `ip -o route get` and prints nothing when the route has no dev token;
the version in net-lib.sh parses `ip route get` and prints the last field
unconditionally, so an unreachable route yields the literal string "unreachable"
as an interface name. `ip_params_for_remote_addr()` then builds a bogus `ip=`
line from it.

Usually boot-time libraries are not sourced into the generator, helpers on both
sides are duplicated instead, e.g.: `iface_for_remote_addr()`.

Fixes 843af3e751782285cd2bc7c9a3a9d33e843fb91d

3 hours agofix(net-lib): normalize iSCSI target names on the iqn./eui./naa. path
Antonio Alvarez Feijoo [Mon, 3 Aug 2026 09:50:50 +0000 (11:50 +0200)] 
fix(net-lib): normalize iSCSI target names on the iqn./eui./naa. path

Commit 843af3e751782285cd2bc7c9a3a9d33e843fb91d added a
`normalized_iscsi_name()` call at the end of `parse_iscsi_root()`, but that
statement is only reachable via the legacy positional parsing path. When the
target name is matched by the `*:iqn.*` / `*:eui.*` / `*:naa.*` case statement,
the function returns before the normalization is ever applied.

Follow-up for 843af3e751782285cd2bc7c9a3a9d33e843fb91d

15 hours agoci(debian): order packages alphabetically
devkontrol [Mon, 3 Aug 2026 00:26:10 +0000 (20:26 -0400)] 
ci(debian): order packages alphabetically

iproute2 package should be order earlier to maintain
alphabetical ordering.

22 hours agodocs: update NEWS.md and AUTHORS for release 112 112
devkontrol [Sun, 2 Aug 2026 17:17:23 +0000 (13:17 -0400)] 
docs: update NEWS.md and AUTHORS for release 112

24 hours agofix(dracut): write force_drivers cmdline file in one step
Benjamin Drung [Sun, 2 Aug 2026 14:39:32 +0000 (16:39 +0200)] 
fix(dracut): write force_drivers cmdline file in one step

The file that should have been removed is `20-force_drivers.conf`.
Instead of removing the file, (over)write the file in one step.

Follow-up for cea907f6bf2fc97933b59e04f4520ca227251574

24 hours agofix(dracut-functions): reset _found flag per rule in inst_rules()
Antonio Alvarez Feijoo [Fri, 31 Jul 2026 13:14:03 +0000 (15:14 +0200)] 
fix(dracut-functions): reset _found flag per rule in inst_rules()

Otherwise, once any rule matches, the warning "Skipping udev rule" is never
emitted again for the rest of the list.

Follow-up for c97e1a76f3756be176f1cc53c96e23259bc96449

24 hours agofix(dracut): use dstdir in build_ld_cache()
Antonio Alvarez Feijoo [Fri, 31 Jul 2026 13:03:03 +0000 (15:03 +0200)] 
fix(dracut): use dstdir in build_ld_cache()

The destination directory `dstdir` is assigned and not used, the call to
`$DRACUT_LDCONFIG` hard-codes `initdir`.

Follow-up for 3ad7e6c23bdcac7c7f6adc8a2cb31bab3c37038a

24 hours agofix(dracut): do not exit the loop in push_user_devs() without checking all items
Antonio Alvarez Feijoo [Fri, 31 Jul 2026 13:01:24 +0000 (15:01 +0200)] 
fix(dracut): do not exit the loop in push_user_devs() without checking all items

This function was copied from `push_host_devs()`, so it inherited the same bug.

If the same device is named in both a configuration file with `add_device+=` and
on the command line with `--add-device=`, it silently discards the rest of the
listed devices after the matching one.

Follow-up for c79fc8fd0d4b9aaa8e753296cbafdb1f82781d08

24 hours agofix(dracut): do not exit the loop in push_host_devs() without checking all items
Antonio Alvarez Feijoo [Fri, 31 Jul 2026 13:00:32 +0000 (15:00 +0200)] 
fix(dracut): do not exit the loop in push_host_devs() without checking all items

This function only accepted one device before it was refactored in
694725abf0d4956bb07b5f96b7887a75e0f430df, but after that it loops over an array
of devices.

Follow-up for 694725abf0d4956bb07b5f96b7887a75e0f430df

24 hours agofix(dracut): log warning if touch fails
Antonio Alvarez Feijoo [Fri, 31 Jul 2026 12:59:39 +0000 (14:59 +0200)] 
fix(dracut): log warning if touch fails

Currently the test is inverted.

Follow-up for 6dc1cd052b51875d7f5497b7ef37d266e59084fb

24 hours agofix(dracut): two typos in the 3cpio fallback
Antonio Alvarez Feijoo [Fri, 31 Jul 2026 12:58:05 +0000 (14:58 +0200)] 
fix(dracut): two typos in the 3cpio fallback

Follow-up for 2abaced74e688b6a807d9d7e7ddd070de632153e

25 hours agofix(net-lib): validate iSCSI LUN parameters
Benjamin Drung [Sun, 2 Aug 2026 13:31:31 +0000 (15:31 +0200)] 
fix(net-lib): validate iSCSI LUN parameters

The iscsi module writes the iSCSI LUN into
`/etc/udev/rules.d/99-iscsi-root.rules` and into
`$hookdir/mount/01-$$-iscsi.sh`.

The iSCSI LUN is a number. Validate that given LUNs are numbers. This
prevents invalid characters from propagating to those files.

25 hours agofix(iscsi): normalize initiator and target names
Benjamin Drung [Sun, 2 Aug 2026 12:24:58 +0000 (14:24 +0200)] 
fix(iscsi): normalize initiator and target names

According to RFC 3720 the iSCSI names must only use lowercase ASCII
letters ('a'-'z'), digits ('0'-'9'), hyphen ('-'), period ('.'), and
colon (':'). RFC 3720 also requires case-normalization from uppercase to
lowercase.

To prevent injecting special characters into `initiatorname.iscsi`
normalize the initiator and target names before writing them to
`initiatorname.iscsi`.

2 days agoci(busybox): busybox blkid is not compatible with dracut
devkontrol [Fri, 31 Jul 2026 20:19:52 +0000 (16:19 -0400)] 
ci(busybox): busybox blkid is not compatible with dracut

Temporary use util-linux blkid as a workaround for busybox blkid
compatibility issue, until the busybox blkid issue is fixed.

See https://github.com/dracut-ng/dracut/issues/2512

3 days agofix(dracut): default to hostonly_cmdline=no in chroot
Benjamin Drung [Fri, 31 Jul 2026 13:53:20 +0000 (15:53 +0200)] 
fix(dracut): default to hostonly_cmdline=no in chroot

autopkgtest-build-qemu builds an image that should include a initrd that
can boot this image. It uses the `chroot` command to build the image.
Relevant log:

```
$ sudo autopkgtest-build-qemu --boot=efi unstable /tmp/unstable-amd64.img
[...]
Exec: ['chroot', '/tmp/tmpyajn1s9p', 'eatmydata', 'apt-get', '-y', '--no-show-progress', '', 'install', 'linux-image-amd64']
[...]
Processing triggers for dracut (110-9) ...
update-initramfs: Generating /boot/initrd.img-6.19.11+deb14-amd64
dracut[W]: Turning off host-only mode: /dev is not mounted!
[...]
Exec: ['mount', '--bind', '/dev', '/tmp/tmpyajn1s9p/dev']
Exec: ['mount', '--bind', '/sys', '/tmp/tmpyajn1s9p/sys']
Exec: ['mount', '--bind', '/proc', '/tmp/tmpyajn1s9p/proc']
Exec: ['parted', '-s', '/dev/loop15', 'set', '1', 'esp', 'on']
Exec: ['chroot', '/tmp/tmpyajn1s9p', 'apt-get', 'update']
Hit:1 http://deb.debian.org/debian unstable InRelease
Reading package lists...
Exec: ['chroot', '/tmp/tmpyajn1s9p', 'apt-get', '-y', '--no-show-progress', 'install', 'grub-efi-amd64']
[...]
Processing triggers for dracut (110-9) ...
update-initramfs: Generating /boot/initrd.img-6.19.11+deb14-amd64
[...]
```

Converting the resulting image to raw, mounting it and running
`lsinitrd` on `/boot/initrd.img-6.19.11+deb14-amd64` shows:

```
dracut cmdline:
 root=/dev/mapper/loop15p2 rootfstype=ext4 rootflags=rw,relatime
```

This boot hangs then at:

> (1 of 2) Job dev-mapper-loop0p1.device/start running (3s / no limit)
> (2 of 2) Job dracut-initqueue.service/start running (8s / no limit)

When installing `linux-image-amd64`, `/dev` is not mounted and dracut
turns off host-only mode. That's what we want for this image. But then
`/dev` gets mounted and the initrd is regenerated (when installing
`grub-efi-amd64`). This time the initrd is build in host-only mode and
hostonly-cmdline is enabled.

So default to `hostonly_cmdline=no` in case a chroot is detected. Users
that want to use hostonly-cmdline in a chroot can specify
`hostonly_cmdline=yes` in the dracut config or call dracut with
`--hostonly-cmdline`.

Fixes: https://github.com/dracut-ng/dracut/issues/2355
Bug-Debian: https://bugs.debian.org/1132794

3 days agorefactor(base): merge set_systemd_timeout_for_dev into wait_for_dev
Benjamin Drung [Sat, 28 Mar 2026 17:44:41 +0000 (18:44 +0100)] 
refactor(base): merge set_systemd_timeout_for_dev into wait_for_dev

The function `set_systemd_timeout_for_dev` is only used by
`wait_for_dev`. Merge this function back into `wait_for_dev` to avoid
calling `dev_unit_name` twice.

3 days agofix(dracut): properly pass user-supplied SBAT to ukify
Frantisek Sumsal [Fri, 24 Jul 2026 07:55:17 +0000 (09:55 +0200)] 
fix(dracut): properly pass user-supplied SBAT to ukify

ukify's --sbat option requires an @-prefixed argument if it's a path to
a file. Without it it refuses the SBAT as invalid and moves on:

~# dracut -v --uefi --sbat "bar,666,Foo Corp,foo,1,https://example.com" test.efi
dracut[I]: Executing: /usr/bin/dracut -v --uefi --sbat "bar,666,Foo Corp,foo,1,https://example.com" test.efi
...
dracut[I]: *** Creating image file '/root/test.efi' ***
dracut[I]: *** Hardlinking files ***
dracut[I]: *** Hardlinking files done ***
dracut[I]: Using auto-determined compression method 'zstd'
dracut[I]: *** Using ukify to create UKI ***
/var/tmp/dracut.dlTsVgm/uefi/uki.sbat does not contain a valid SBAT section, skipping.
Wrote unsigned /var/tmp/dracut.dlTsVgm/uefi/linux.efi
dracut[I]: *** Creating UEFI image file '/root/test.efi' done ***

~# ukify inspect test.efi
.sbat:
  size: 342 bytes
  sha256: 1b071df03087b5f8186ec98c1915543c7c057c9e5b3adb333b0af61c0cfbac5a
  text:
    sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
    systemd-stub,1,The systemd Developers,systemd,261,https://systemd.io/
    systemd-stub.fedora,1,Fedora Linux,systemd,261.1-21.fc45,https://bugzilla.redhat.com/
    kernel.fedora,1,Red Hat,kernel-core,7.2.0-0.rc2.260711gdd3210c47e8d.24.fc45.x86_64,mailto:secalert@redhat.com

Also, pass only user-supplied SBAT to ukify, as ukify extracts the SBATs
from the stub and kernel PEs on its own. Without this the final UKI
contains duplicated SBATs for which there's not enough space:

dracut[I]: *** Using ukify to create UKI ***
Traceback (most recent call last):
  File "/usr/bin/ukify", line 2568, in <module>
    main()
    ~~~~^^
  File "/usr/bin/ukify", line 2557, in main
    make_uki(opts)
    ~~~~~~~~^^^^^^
  File "/usr/bin/ukify", line 1540, in make_uki
    pe_add_sections(opts, uki, unsigned_output)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/ukify", line 1057, in pe_add_sections
    raise PEError(
    ...<2 lines>...
    )
PEError: Not enough space in existing section .sbat to append new data (need 5354, have 1024)
dracut[F]: *** Creating UEFI image file '/root/test.efi' failed ***

3 days agofix(dbus): restrict After/Requires removal patterns
Vivian Wang [Wed, 1 Jul 2026 03:12:19 +0000 (11:12 +0800)] 
fix(dbus): restrict After/Requires removal patterns

While the intention for removing all After= and Requires= lines on
dbus.service and dbus.socket is to remove the dependency on
sysinit.target, this unintentionally removes the Requires=dbus.socket
dependency for dbus.service as well, which is present in both upstream
dbus and dbus-broker.

Restrict the pattern to only lines mentioning sysinit.target, to better
match what Ubuntu has added downstream.

This fixes or at least works around a problem where
NetworkManager.service can fail to start in the openRuyi distribution.
The symptom is:

- dbus.service is sometimes not stopped before switching root
- ... which causes units in the (non-initrd) system to not bring up
  dbus.service, since it is already active.
- Afterwards, dbus.service stops on its own, possibly because the
  initramfs is gone.
- Then, NetworkManager.service tries to start, but since it
  BindsTo=dbus.service, and dbus.service has already stopped,
  NetworkManager.service fails to start.

Journal shows this while attempting to start NetworkManager:

    systemd[1]: NetworkManager.service: Bound to unit dbus.service, but unit isn't active.
    systemd[1]: Dependency failed for Network Manager.
    systemd[1]: NetworkManager.service: Job NetworkManager.service/start failed with result 'dependency'.

See https://gist.github.com/dramforever/825a4e3f0f7a2dee29ed9d1e43047075

Keeping the dbus.service Requires=dbus.socket dependency prevents
dbus.service from being kept alive from the initramfs environment.

3 days agoperf(systemd-tmpfiles): do not install systemd-tmpfiles-clean.service
Antonio Alvarez Feijoo [Fri, 31 Jul 2026 08:35:08 +0000 (10:35 +0200)] 
perf(systemd-tmpfiles): do not install systemd-tmpfiles-clean.service

It does not have an "Install" section, nor is it manually installed, its only
trigger systemd-tmpfiles-clean.timer is also not installed, and it cannot be run
in the initrd [1].

[1] https://github.com/systemd/systemd/commit/fe7f113c1331e11af4e9f815d7305c8b1b332312

3 days agoperf(systemd-sysctl): remove duplicate paths from inst_multiple
Antonio Alvarez Feijoo [Fri, 31 Jul 2026 06:55:26 +0000 (08:55 +0200)] 
perf(systemd-sysctl): remove duplicate paths from inst_multiple

- /usr/lib/sysctl.d == `$sysctld`
- /etc/sysctl.d == `$sysctlconfdir`

Follow-up for d6ba849bb6234ff11fe840ff5c7c327f7c8492f6

3 days agoperf(systemd-modules-load): remove duplicate paths from inst_multiple
Antonio Alvarez Feijoo [Fri, 31 Jul 2026 06:55:14 +0000 (08:55 +0200)] 
perf(systemd-modules-load): remove duplicate paths from inst_multiple

- /usr/lib/modules-load.d == `$modulesload`
- /etc/modules-load.d == `$modulesloadconfdir`

Follow-up for 45a65df352f5460c74cc3af71562b62b1cb47429

3 days agofix(dracut-functions): correct hostonly path for Gentoo sysusers
Antonio Alvarez Feijoo [Fri, 31 Jul 2026 06:51:12 +0000 (08:51 +0200)] 
fix(dracut-functions): correct hostonly path for Gentoo sysusers

Fixes 1c5f45a24b34e3fb81e29f44de451bd1f9638203

3 days agofix(dracut): remove support for tmpfilesconfdir
devkontrol [Fri, 31 Jul 2026 00:51:26 +0000 (20:51 -0400)] 
fix(dracut): remove support for tmpfilesconfdir

tmpfilesconfdir variable was used only by the systemd-tmpfiles
dracut module, but after 73e9b64 that variable is no no longer in use.

The motivation for this PR is to explicitly disallow the use
of tmpfilesconfdir going forward as it is not recommended for
a dracut module to pick up files from /etc/tmpfiles.d.

Follow-up to 73e9b64 .

3 days agofix(mdraid): escape slash in sed regular expression
Benjamin Drung [Wed, 22 Jul 2026 09:40:04 +0000 (11:40 +0200)] 
fix(mdraid): escape slash in sed regular expression

`sed` from busybox treats the `/` from `[[:alpha:]/]` inside
`/pattern/d` as the closing delimiter for the match pattern, rather than
a character inside the bracket class:

```
sed: bad regex '(RUN|IMPORT\{program\})\+?="[[:alpha:]': Missing ']'
```

Escape the slash in sed regular expression.

3 days agofix(systemd-tmpfiles): do not include tmpfiles configured in /etc
Antonio Alvarez Feijoo [Mon, 16 Feb 2026 07:30:15 +0000 (08:30 +0100)] 
fix(systemd-tmpfiles): do not include tmpfiles configured in /etc

Users may have tmpfiles configured in /etc to be created after switching root,
always including this user configuration in the initrd may break their setups.

Fixes #1706

4 days agoperf(udev-rules): do not install the mtp-probe udev helper
Antonio Alvarez Feijoo [Wed, 29 Jul 2026 12:58:19 +0000 (14:58 +0200)] 
perf(udev-rules): do not install the mtp-probe udev helper

The mtp-probe udev helper belongs to the libmtp package, and is called from
69-libmtp.rules, which is not installed in the initrd. Since mtp-probe depends
on libmtp, libgcrypt and libgpg-error, we can save ~2.5 MB uncompressed (~1 MB
compressed) avoiding the installation of a udev helper that is not necessary.
Also, if an external udev rule would require this helper, it would be installed
by `_inst_rule_programs()`.

4 days agoperf(udev-rules): do not install the hid2hci udev helper
Antonio Alvarez Feijoo [Wed, 29 Jul 2026 12:57:41 +0000 (14:57 +0200)] 
perf(udev-rules): do not install the hid2hci udev helper

The hid2hci udev helper belongs to the bluez package, and is called from
97-hid2hci.rules, which is not installed in the initrd. Moreover, it should be
installed by the bluetooth dracut module if it were necessary. Also, if an
external udev rule would require this helper, it would be installed by
`_inst_rule_programs()`.

4 days agoperf(udev-rules): do not try to install fw_unit_symlinks.sh
Antonio Alvarez Feijoo [Wed, 29 Jul 2026 12:56:57 +0000 (14:56 +0200)] 
perf(udev-rules): do not try to install fw_unit_symlinks.sh

This script was specific for RH/Fedora, it was last shipped in their downstream
udev package in RHEL 6/Fedora 13 [1][2], and no longer present in Fedora 14 [3].

[1] https://src.fedoraproject.org/rpms/udev/blob/f13/f/fw_unit_symlinks.sh
[2] https://src.fedoraproject.org/rpms/udev/blob/f13/f/udev.spec#_33
[3] https://src.fedoraproject.org/rpms/udev/tree/f14

4 days agoperf(udev-rules): do not try to install create_floppy_devices
Antonio Alvarez Feijoo [Wed, 29 Jul 2026 12:56:24 +0000 (14:56 +0200)] 
perf(udev-rules): do not try to install create_floppy_devices

It was removed in 2012 from both systemd [1] and eudev [2].

[1] https://github.com/systemd/systemd/commit/3e2147858f21943d5f4a781c60f33ac22c6096ed
[2] https://github.com/eudev-project/eudev/commit/3e2147858f21943d5f4a781c60f33ac22c6096ed

4 days agoperf(udev-rules): do not try to install udev built-ins
Antonio Alvarez Feijoo [Wed, 29 Jul 2026 12:55:25 +0000 (14:55 +0200)] 
perf(udev-rules): do not try to install udev built-ins

input_id, path_id and usb_id are udev built-ins, not binaries. These 3 were
already built-ins in the original import of the udev repository in 2012 to
systemd [1], hence they are also built-ins in eudev [2].

[1] https://github.com/systemd/systemd/commit/19c5f19d69bb5f520fa7213239490c55de06d99d
[2] https://github.com/eudev-project/eudev/commit/19c5f19d69bb5f520fa7213239490c55de06d99d

4 days agoperf(udev-rules): do not try to install 59-scsi-sg3_utils.rules
Antonio Alvarez Feijoo [Wed, 29 Jul 2026 12:54:09 +0000 (14:54 +0200)] 
perf(udev-rules): do not try to install 59-scsi-sg3_utils.rules

It was removed and split in 2014 (sg3_utils-1.39) into 55-scsi-sg3_id.rules and
58-scsi-sg3_symlink.rules.

Follow-up for 15eed1e4f1d3b72a6112cce686f00d0c97ec616d

4 days agoperf(udev-rules): do not try to install 95-udev-late.rules
Antonio Alvarez Feijoo [Wed, 29 Jul 2026 12:53:22 +0000 (14:53 +0200)] 
perf(udev-rules): do not try to install 95-udev-late.rules

It was removed in 2015 from both systemd [1] and eudev [2].

[1] https://github.com/systemd/systemd/commit/654b036ba7368d2f9f2577e2d64d45d52fa8262a
[2] https://github.com/eudev-project/eudev/commit/51ed849fb0ce93dc37776bcf7676082cc9c1d203

4 days agofix(systemd-udevd): install systemd-udevd-varlink.socket
Antonio Alvarez Feijoo [Thu, 30 Jul 2026 07:41:38 +0000 (09:41 +0200)] 
fix(systemd-udevd): install systemd-udevd-varlink.socket

It was added in systemd-v258 [1], but it has become more important since
systemd-udevd-control.socket was removed [2]. Although for now it remains as a
symlink to systemd-udevd-varlink.socket for compatibility reasons,
systemd-udevd.service and systemd-udev-trigger.service no longer reference it in
"Sockets=" and "After=" respectively.

This is still working by accident. Thanks to the current symlink from
systemd-udevd-control.socket to systemd-udevd-varlink.socket, dracut resolves it
and also installs systemd-udevd-varlink.socket in the initrd. The symlink to
sockets.target.wants is not created, but since systemd-udevd.service has
`Sockets=... systemd-udevd-varlink.socket`, systemd creates automatic "Wants="
and "After=" dependencies (see systemd.service(5)), so the unit gets into the
transaction anyway.

[1] https://github.com/systemd/systemd/commit/2bc733d9b0e9c0b850ed523f5d1695cddb0c23d7
[2] https://github.com/systemd/systemd/commit/17e911ffc853c54f44edd11ead8b6edab72c1217

4 days agoci: install chrony to test the new chrony module
devkontrol [Sat, 25 Jul 2026 14:56:04 +0000 (10:56 -0400)] 
ci: install chrony to test the new chrony module

Install chrony to test the new chrony module.

4 days agoperf(systemd-networkd): remove duplicate service from inst_multiple
Antonio Alvarez Feijoo [Thu, 30 Jul 2026 11:30:25 +0000 (13:30 +0200)] 
perf(systemd-networkd): remove duplicate service from inst_multiple

systemd-network-generator.service is listed twice.

5 days agofix(tpm2-tss): add missing 60-tpm2-id.rules
Antonio Alvarez Feijoo [Tue, 28 Jul 2026 08:24:58 +0000 (10:24 +0200)] 
fix(tpm2-tss): add missing 60-tpm2-id.rules

These rules containing hwdb quicks were added in systemd-v260 [1] to fix some
TPM2 issues.

[1] https://github.com/systemd/systemd/pull/40931

8 days agochore(Makefile): filter out chrony dracut module for non-systemd
devkontrol [Sat, 25 Jul 2026 16:49:01 +0000 (12:49 -0400)] 
chore(Makefile): filter out chrony dracut module for non-systemd

chrony dracut module in its current form depends on the systemd
dracut module. Filter out chrony dracut module during build
time for enviroments not supporting systemd to be consisent with
othersystemd dependent dracut modules.

8 days agofeat(systemd): drop unnecessary dependency on libgcrypt
Pavel Valena [Mon, 4 Aug 2025 21:26:14 +0000 (23:26 +0200)] 
feat(systemd): drop unnecessary dependency on libgcrypt

9 days agofix(mdraid): install 59-persistent-storage-md.rules only when needed
Benjamin Drung [Thu, 23 Jul 2026 10:40:46 +0000 (12:40 +0200)] 
fix(mdraid): install 59-persistent-storage-md.rules only when needed

Dracut installs in the initrd a custom `59-persistent-storage-md.rules`
only to set the option `db_persist`. The main purpose is that if an MD
device is activated in the initrd, its properties are kept on the udev
database after the transition from the initrd to the rootfs. This was
added to fix detection issues when LVM is on top.

mdadm 4.5 included this change from Dracut. Therefore installing
`59-persistent-storage-md.rules` is not needed any more when using
mdadm >= 4.5. `59-persistent-storage-md.rules` can be removed completely
once Dracut drops support for mdadm < 4.5.

See also: https://github.com/md-raid-utilities/mdadm/pull/143

9 days agofix(nfs): rpc.statd binary is not required for NFSv4
devkontrol [Thu, 23 Jul 2026 01:30:16 +0000 (21:30 -0400)] 
fix(nfs): rpc.statd binary is not required for NFSv4

Dracut fails to create initramfs on nfs4-only host as
the rpc.statd binary is not required for NFSv4 and yet
dracut is checking for its existence and fails.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2483609
Fixes: https://github.com/dracut-ng/dracut/issues/2488
Co-authored-by: Pavel Simó <pavel.simo@gmail.com>
9 days agofix(dracut): support chmod applet from busybox
Benjamin Drung [Wed, 22 Jul 2026 08:59:43 +0000 (10:59 +0200)] 
fix(dracut): support chmod applet from busybox

busybox's `chmod` applet does not support `--reference`. So replace it
by using `stat` to query the mode.

9 days agofeat(chrony): introducing the chrony module
Antonio Alvarez Feijoo [Tue, 12 May 2026 07:18:08 +0000 (09:18 +0200)] 
feat(chrony): introducing the chrony module

This new module relies on chrony to add support for NTP in the initrd. By
default, it also uses NTP sources from DHCP.

It provides two new kernel command line options:
- `rd.ntp`: it can be used multiple times to specify server, pool and peer time
sources.
- `rd.ntp.nodhcp`: it disables the use of NTP sources from DHCP.

In some environments, it's necessary to fetch live images from HTTPS URLs. The
problem is that the hardware clock may be off, so the validation of the SSL
certificates may fail if the time is out of sync. Also, some systems may not
have access to DHCP for security reasons, that's why we need a way to configure
them on the kernel command line.

9 days agotest: allow to start an HTTPS server using start_webserver()
Antonio Alvarez Feijoo [Thu, 30 Apr 2026 13:21:05 +0000 (15:21 +0200)] 
test: allow to start an HTTPS server using start_webserver()

The first argument will define the server type: HTTP or HTTPS.
The second argument will get the name of the certificate required for HTTPS.

9 days agofeat(systemd-networkd): write info about NTP servers in dhcpopts file
Antonio Alvarez Feijoo [Thu, 23 Jul 2026 12:05:15 +0000 (14:05 +0200)] 
feat(systemd-networkd): write info about NTP servers in dhcpopts file

9 days agofeat(network-manager): write info about NTP servers in dhcpopts file
Antonio Alvarez Feijoo [Fri, 17 Apr 2026 13:03:35 +0000 (15:03 +0200)] 
feat(network-manager): write info about NTP servers in dhcpopts file

9 days agoci: increase timeout for test 60-NFS from 10 to 15 min
Benjamin Drung [Fri, 24 Jul 2026 16:32:42 +0000 (18:32 +0200)] 
ci: increase timeout for test 60-NFS from 10 to 15 min

Test 60-NFS is the biggest test and 10 minutes was not enough for it on
`fedora:rawhide` (network) and `gentoo:latest` (network-legacy).

So increase the timeout for test 60-NFS from 10 to 15 minutes.

See also: 4f6f4c47a5eb ("ci: unify timeout to 10 min by default")

9 days agofeat(dracut): add module to load Qualcomm ADSP module pre-udev
Hans de Goede [Fri, 13 Mar 2026 18:13:57 +0000 (19:13 +0100)] 
feat(dracut): add module to load Qualcomm ADSP module pre-udev

On Qualcomm sc8280xp and x1e laptops the kernel reboots the ADSP with new
firmware because the BIOS loads ADSP firmware with limited functionality
without sound or battery charge/status reading support.

Unfortunately the ADSP also controls the TCPM (Type-C Port Manager) and
rebooting the ADSP also resets the TCPM, causing any USB devices connected
over Type-C ports to get disconnected as all devices on the USB bus are
removed and re-enumerated.

This breaks booting from USB-drives as the drive gets disconnected and
re-enumerated as a new block device, leaving any filesystems mounted
before the ADSP reset without any backing device.

To workaround this add a module to load the ADSP driver from a pre-udev
hook so that the USB re-enumeration happens before the rootfs is mounted.

Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
Changes in v5:
- Sort `inst_multiple` arguments alphabetically

Changes in v4:
- Change host-only check to [[ $hostonly_mode == "strict" ]] so that
  30-qcom-adsp-pre-udev.sh gets installed in sloppy hostonly mode
- Add modprobe to list of binaries to install from install()

Changes in v3:
- Add "inst grep" to install()

Changes in v2:
- Directly use $DRACUT_ARCH instead of defining _arch local var
- Add the new module to labeler.yml and core.adoc

10 days agostyle: remove unneeded function keyword
Benjamin Drung [Fri, 24 Jul 2026 12:41:22 +0000 (14:41 +0200)] 
style: remove unneeded function keyword

`function` is a non-standard keyword that can be used to declare
functions in Bash and Ksh, but this would not work with POSIX shell.
Remove it to make the code more consistent (and potential easier to port
to POSIX).

10 days agofix(dracut-install): check return value in modalias read()
Antonio Alvarez Feijoo [Fri, 24 Jul 2026 06:25:43 +0000 (08:25 +0200)] 
fix(dracut-install): check return value in modalias read()

`find_kmod_module_from_sysfs_modalias()` reads the content of the modalias file
via `len = read()`, and then writes to `alias[len - 1]` without checking if
read() returned 0 (empty file) or -1 (error), potentially causing a stack buffer
out-of-bounds write.

10 days agofix(dracut-install): handle empty string in dir_len()
Antonio Alvarez Feijoo [Fri, 24 Jul 2026 06:22:43 +0000 (08:22 +0200)] 
fix(dracut-install): handle empty string in dir_len()

`strlen()` returns the unsigned type size_t, so if `file` were an empty string,
`strlen(file) - 1` would return SIZE_MAX, causing an out-of-bounds read.

10 days agofeat: check shellcode to support busybox
Benjamin Drung [Thu, 23 Jul 2026 11:18:06 +0000 (13:18 +0200)] 
feat: check shellcode to support busybox

Explicitly check the shellcode to work with busybox to also catch cases
like 'local' is only valid in functions (SC2168).

10 days agoci: unify timeout to 10 min by default
Benjamin Drung [Thu, 18 Jun 2026 13:23:30 +0000 (15:23 +0200)] 
ci: unify timeout to 10 min by default

Most tests take only a few seconds or minutes on AMD. The tests on ARM
are two to four times slower than their AMD counterparts (due to not
using KVM).

All tests finish in under five minutes except test 60-NFS on AMD (which
can take six to seven minutes) and following tests on ARM:

| Test              | Duration  | Timeout |
| ----------------- | --------- | ------- |
| 11-USR-MOUNT      | 5-10 min  | 20 min  |
| 20-STORAGE        | 9-22 min  | 40 min  |
| 21-OVERLAYFS      | 5-11 min  | 20 min  |
| 26-ENC-RAID-LVM   | 9-21 min  | 40 min  |
| 30-DMSQUASH       | 5-10 min  | 20 min  |
| 41-FULL-SYSTEMD   | 5-9 min   | 20 min  |
| 45-SYSTEMD-IMPORT | 7 min     | 20 min  |
| 60-NFS            | 19-49 min | 60 min  |
| 71-ISCSI          | 9 min     | 20 min  |
| 72-ISCSI-MULTI    | 9-20 min  | 40 min  |

So use a 10 min timeout on all AMD tests and most ARM tests, but
increase the timeout for ARM for those test mentioned above. So use 20
min timeout for several ARM tests, 40 min timeout for 20-STORAGE,
26-ENC-RAID-LVM, 72-ISCSI-MULTI on ARM, and 60 min timeout for 60-NFS
on ARM.

11 days agofeat(Makefile): allow running syntax checks separately
Benjamin Drung [Thu, 23 Jul 2026 11:11:50 +0000 (13:11 +0200)] 
feat(Makefile): allow running syntax checks separately

Split the syntax check `syncheck` into one check for bash and one for
shellcheck to allow running these checks separately.

11 days agofix(lunmask): use function in parse-lunmask.sh
Benjamin Drung [Thu, 23 Jul 2026 10:51:35 +0000 (12:51 +0200)] 
fix(lunmask): use function in parse-lunmask.sh

shellcheck will complain about `parse-lunmask.sh` when checking for
busybox:

```
$ shellcheck -s busybox modules.d/74lunmask/parse-lunmask.sh

In modules.d/74lunmask/parse-lunmask.sh line 28:
        local OLDIFS="$IFS"
        ^---^ SC2168 (error): 'local' is only valid in functions.

In modules.d/74lunmask/parse-lunmask.sh line 29:
        local IFS=","
        ^---^ SC2168 (error): 'local' is only valid in functions.
```

So move the code into a function. Using a subshell for the loop is not
needed there.

11 days agofix: remove basename calls
Benjamin Drung [Wed, 22 Jul 2026 10:05:13 +0000 (12:05 +0200)] 
fix: remove basename calls

https://dracut-ng.github.io/dracut/developer/bash.html says that
`basename` should not be used.

So replace the usage of `basename` by variable expansion instead.

11 days agofix(usrmount): filter out subvolid option for btrfs
Alexander Tsoy [Sun, 17 Aug 2025 20:32:02 +0000 (23:32 +0300)] 
fix(usrmount): filter out subvolid option for btrfs

Currently if rootfs mount options contain subvolid, then /usr subvolume
will fail to mount with the following error:

BTRFS error (device dm-0): subvol '/usr' does not match subvolid 5

Fix this by filtering out subvolid from rootfs options.

Bug: https://bugs.gentoo.org/961622

11 days agofix(kernel-modules): include xhci-pci-prom21 for early USB
Jihong Min [Tue, 7 Jul 2026 22:07:05 +0000 (07:07 +0900)] 
fix(kernel-modules): include xhci-pci-prom21 for early USB

Since Linux 7.2-rc1, AMD PROM21 xHCI controllers may be handled by the
separate xhci-pci-prom21 PCI glue driver.

When CONFIG_USB_XHCI_PCI_PROM21=m, plain xhci-pci intentionally returns
-ENODEV for the PROM21 PCI IDs so that xhci-pci-prom21 can bind them.
However, xhci-pci-prom21 is not a dependency of xhci-pci, so an
initramfs can include xhci-pci.ko while missing xhci-pci-prom21.ko.

On systems where USB keyboard or storage is attached through a PROM21
controller, this can make USB unavailable during initrd, for example at
Plymouth/LUKS unlock.

This is the same class of issue as xhci-pci-renesas, which dracut
already includes explicitly.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=221721
Signed-off-by: Jihong Min <hurryman2212@gmail.com>
11 days agorefactor(crypt): use function in crypt-cleanup.sh
Benjamin Drung [Sat, 18 Jul 2026 21:59:19 +0000 (23:59 +0200)] 
refactor(crypt): use function in crypt-cleanup.sh

shellcheck will complain about crypt-cleanup.sh when checking for
busybox:

```
In modules.d/70crypt/crypt-cleanup.sh line 8:
        local do_break="y"
        ^---^ SC2168 (error): 'local' is only valid in functions.
```

12 days agotest(DRACUT-CPIO): run without set -x
Benjamin Drung [Wed, 22 Jul 2026 08:55:09 +0000 (10:55 +0200)] 
test(DRACUT-CPIO): run without set -x

Running the test with `set -x` will be quite verbose and makes the logs
harder to read.

12 days agofix(systemd-networkd): use another name for the default .network file
Antonio Alvarez Feijoo [Wed, 22 Jul 2026 09:33:55 +0000 (11:33 +0200)] 
fix(systemd-networkd): use another name for the default .network file

Since da3353f022cc7b930dd532e2f1e06af4e86999d3, there is another file matching
the pattern `dracut-*` used by lsinitrd to print the dracut version:

```
$ lsinitrd /boot/test.img | grep usr/lib/dracut/
-rw-r--r--   1 root     root           38 Jul 22 09:20 usr/lib/dracut/build-parameter.txt
-rw-r--r--   1 root     root           32 Jul 22 09:20 usr/lib/dracut/dracut-110+suse.45.geaec47e4-38
-rw-r--r--   1 root     root          131 Jul 22 08:10 usr/lib/dracut/dracut-default.network
-rw-r--r--   1 root     root          420 Jul 22 09:20 usr/lib/dracut/hostonly-files
-rw-r--r--   1 root     root          493 Jul 22 09:20 usr/lib/dracut/modules.txt
-rw-r--r--   1 root     root            0 Jul 22 09:20 usr/lib/dracut/need-initqueue
```

This is messing the output when the systemd-networkd module is included:

```
$ lsinitrd -m /boot/test.img
Image: /boot/test.img: 71M
========================================================================
Version: dracut-110+suse.45.geaec47e4-38
[Match]
Kind=!*
Type=!loopback

[Network]
DHCP=yes

[DHCPv4]
ClientIdentifier=mac
RequestOptions=17

[DHCPv6]
RequestOptions=59 60

dracut modules:
bash
systemd
systemd-ask-password
systemd-battery-check
systemd-initrd
systemd-journald
systemd-modules-load
systemd-networkd
...
```

There are already other files in /usr/lib/dracut, all of them avoiding the
"dracut-" prefix, so use another name for this file.

Fixes da3353f022cc7b930dd532e2f1e06af4e86999d3

12 days agotest(DRACUT-CPIO): fix specifying initrd name twice
Benjamin Drung [Tue, 21 Jul 2026 23:26:43 +0000 (01:26 +0200)] 
test(DRACUT-CPIO): fix specifying initrd name twice

The initrd output file name parameter was moved to the `test_dracut`.
Thus specifying the initrd name in the `test_dracut` would become the
second parameter for dracut and interpreted as kernel name. This would
lead to this `realpath` failure:

```
Calling dracut --confdir /var/tmp/dracut-test.NilYUr/dracut.conf.d --add-confdir test --tmpdir /var/tmp/dracut-test.NilYUr/initrd --no-kernel --drivers '' --add-confdir test --enhanced-cpio --no-compress --nostrip --include /var/tmp/dracut-test.NilYUr/cpio-test.Gg7wLrYrO7/simple/init.sh /usr/lib/dracut/hooks/emergency/00-init.sh --install poweroff /var/tmp/dracut-test.NilYUr/cpio-test.Gg7wLrYrO7/simple/initramfs /var/tmp/dracut-test.NilYUr/initramfs.testing
realpath: /lib/modules//var/tmp/dracut-test.NilYUr/initramfs.testing: No such file or directory
```

So use the common initrd output file name in the dracut-cpio test case
as well.

Fixes: 4d55517094f6 ("ci: consolidate output filename for test runs")
12 days agofeat(resume): include in hostonly sloppy mode if supported by kernel
Benjamin Drung [Thu, 16 Jul 2026 14:18:08 +0000 (16:18 +0200)] 
feat(resume): include in hostonly sloppy mode if supported by kernel

Systems might support hibernation. They need the resume module to get a
working hibernation. Users might configure their systems to enable
hibernation, but the correct order of steps are crucial for it.
Currently this workflow does not work:

1. Make sure system is supported the power state:
```
$ cat /sys/power/state
freeze mem disk
```
2. Configured swap partition
3. Populated the resume kernel boot parameter `resume=/dev/<swap partition>`
4. update grub
5. regenerate initrd

Regenerating the initrd will not include the resume module, because it
hits the "hibernation supported by the kernel, but not enabled" code
path (`/proc/cmdline` doesn not contain `resume=` yet and
`/sys/power/resume` contains `0:0`). A user would need to reboot once
before regenerating the initrd.

To make the system more predictable, include the `resume` module in
hostonly `sloppy` mode if hibernation is supported by the kernel.

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

12 days agorefactor(resume): flatten nested if-else structure in check()
Benjamin Drung [Thu, 16 Jul 2026 14:11:42 +0000 (16:11 +0200)] 
refactor(resume): flatten nested if-else structure in check()

13 days agoci(azurelinux): install busybox
Benjamin Drung [Tue, 21 Jul 2026 13:44:49 +0000 (15:44 +0200)] 
ci(azurelinux): install busybox

busybox will be needed for running the upcoming busybox test case.

13 days agofix(network-manager): prevent command injection while parsing DHCP options
Antonio Alvarez Feijoo [Tue, 21 Jul 2026 07:11:28 +0000 (09:11 +0200)] 
fix(network-manager): prevent command injection while parsing DHCP options

Replacing `printf '%q'` with the custom `escape` function introduced a flaw: if
the whole format string is surrounded by single quotes (`'%s='%s'\n'`),
the shell consumes those inner `'` characters as quoting delimiters instead of
passing them to printf, so it receives just `%s=%s\n`, i.e., the surrounding
quotes around the value are gone. Since nothing is quoted, now commands can be
injected via dhcpopts files.

E.g.:

```
$ cat /tmp/test-rogue-dhcp
next-server=$(id > /tmp/pwned 2>&1)$
$ cat /tmp/pwned
cat: /tmp/pwned: No such file or directory
$ kf_parse next-server new_next_server < /tmp/test-rogue-dhcp > /tmp/test.dhcpopts
$ cat /tmp/test.dhcpopts
new_next_server=$(id > /tmp/pwned 2>&1)$
$ . /tmp/test.dhcpopts
$ cat /tmp/pwned
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
```

Fixes 9c7459bde0e78dd2e1e14d35c5351ef627b1b1fc

13 days agofix(systemd-networkd): escape values from DHCP options
Antonio Alvarez Feijoo [Tue, 21 Jul 2026 09:37:27 +0000 (11:37 +0200)] 
fix(systemd-networkd): escape values from DHCP options

Although systemd-networkd filters invalid values for DHCP options before writing
them to lease files, it's a good practice to escape values read from lease files
before writing them to ".dhcpopts" files, because ".dhcpopts" files are sourced
as a shell script in multiple parts [1][2][3].

Same motivation as e509c638e68a8e3cae446d1a4f9f86e3aa6e7a99, but for
systemd-networkd.

Fixes: 0e1e78711502347412e2c0a0621773f034332499
Fixes: 7c57b1cccd4100351da5258ac6a22e07608a5e85
Fixes: GHSA-x37p-6hhc-6628
[1] https://github.com/dracut-ng/dracut/blob/02e7ae10830d1268f1acdf879ef14d5b6bc89ac3/modules.d/45net-lib/net-lib.sh#L139
[2] https://github.com/dracut-ng/dracut/blob/02e7ae10830d1268f1acdf879ef14d5b6bc89ac3/modules.d/45net-lib/netroot.sh#L44
[3] https://github.com/dracut-ng/dracut/blob/02e7ae10830d1268f1acdf879ef14d5b6bc89ac3/modules.d/74nfs/nfs-lib.sh#L109-L112

13 days agofix(dracut-lib): sanitize variable assignments using eval
Antonio Alvarez Feijoo [Tue, 21 Jul 2026 11:37:11 +0000 (13:37 +0200)] 
fix(dracut-lib): sanitize variable assignments using eval

`splitsep()` uses `eval "$1='${tmp}'"` and `eval "$1='$str'"` to assign values
to caller-named variables. A single quote in the value breaks out of the
assignment.

`export_n()` uses `eval "$var=\"$val\""` to re-assign an unexported variable. A
double quote in the value breaks out of the assignment.

13 days agofeat(network-manager): use escape to drop requiring bash
Benjamin Drung [Mon, 20 Jul 2026 14:05:24 +0000 (16:05 +0200)] 
feat(network-manager): use escape to drop requiring bash

Use the new `escape` function to drop requiring bash in the
network-manager module.

The output of `kf_parse` is written to
`/tmp/dhclient."$ifname".dhcpopts` which is sourced by other dracut
modules.

13 days agofeat(base): add escape function implementing printf %q
Benjamin Drung [Mon, 20 Jul 2026 14:00:57 +0000 (16:00 +0200)] 
feat(base): add escape function implementing printf %q

In POSIX shell, `printf %q` is undefined. Add an `escape` function to
dracut-lib.sh to implement `printf %q` in POSIX shell.

13 days agofix(overlayfs-crypt): prevent eval injection in parse_overlay_opts()
Antonio Alvarez Feijoo [Wed, 27 May 2026 06:44:00 +0000 (08:44 +0200)] 
fix(overlayfs-crypt): prevent eval injection in parse_overlay_opts()

parse_overlay_opts() used eval "${ns}${key}='${val}'" to assign
parsed options from the rd.overlay.crypt kernel cmdline parameter.
A single quote in the value breaks out of the assignment and allows
arbitrary command execution.

Fixes: GHSA-wr6r-5whr-98qx
Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2 weeks agoci(debian:sid): install systemd-tpm package
devkontrol [Sun, 19 Jul 2026 00:00:17 +0000 (20:00 -0400)] 
ci(debian:sid): install systemd-tpm package

Debian:sid has split out systemd-pcrextend into
systemd-tpm package.

See https://packages.debian.org/sid/systemd-tpm

This commit is required to resolve a regression for the
kernel-install test.

This split has been done in systemd 261-2.

2 weeks agotest(systemd): give more context in case of failure
Benjamin Drung [Thu, 16 Jul 2026 14:02:42 +0000 (16:02 +0200)] 
test(systemd): give more context in case of failure

To ease debugging, give more context in case of failure in the
`systemd-analyze.sh` check.

2 weeks agochore(deps): bump actions/setup-node from 6 to 7
dependabot[bot] [Tue, 14 Jul 2026 20:52:35 +0000 (20:52 +0000)] 
chore(deps): bump actions/setup-node from 6 to 7

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6 to 7.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 weeks agoci(azurelinux): enable more test runs
devkontrol [Sun, 12 Jul 2026 15:44:21 +0000 (11:44 -0400)] 
ci(azurelinux): enable more test runs

Install systemd-networkd package to enable networking tests for the
Azure Linux test container.

Install diffutils package as TEST SKIPCPIO (81) needs diff command.

3 weeks agofix(systemd-pcrextend): add missing systemd-pcr{nvdone,osseparator}.service
Antonio Alvarez Feijoo [Wed, 1 Jul 2026 15:00:23 +0000 (17:00 +0200)] 
fix(systemd-pcrextend): add missing systemd-pcr{nvdone,osseparator}.service

systemd-pcrnvdone.service was added in systemd-v259, but runs in the initrd
since systemd-v261 [1], and it acts as additional separator measurement
separating pre-boot (firmware + bootloader) measurements from OS measurements.

systemd-pcrosseparator.service was added in systemd-v261 [2], and it measures a
separator event into PCR 9 once all NvPCRs have completed initialization.

[1] https://github.com/systemd/systemd/commit/856ab04a29bb45b41f96bd507f982e75101c537a
[2] https://github.com/systemd/systemd/commit/7c27f9f59455b199e12976c76b28b708c525b55c

3 weeks agofix(tpm2-tss): add missing systemd-tpm2-setup-early.service
Antonio Alvarez Feijoo [Wed, 1 Jul 2026 15:00:07 +0000 (17:00 +0200)] 
fix(tpm2-tss): add missing systemd-tpm2-setup-early.service

Added in systemd-v255 [1] to generate the Storage Root Key (SRK) in the initrd.

[1] https://github.com/systemd/systemd/commit/2e64cb71b9c0160c335d8e52954149e078bba2fb

3 weeks agofix(dracut-systemd): add ordering constraints
Miao Wang [Fri, 3 Jul 2026 11:57:53 +0000 (19:57 +0800)] 
fix(dracut-systemd): add ordering constraints

When dracut-initqueue is not enabled, there would be no
dracut-initqueue.service as a sequence point. So explicitly
declare After = basic.target to order dracut-pre-mount.service
after all the services ordered before dracut-initqueue.service.

Fixes: b1ae591945ac ("dracut-systemd: add back missing dependencies")
3 weeks agofix(dracut-install): remove FTS_NOSTAT in install_modules() fts traversal
Josh Poimboeuf [Wed, 15 Apr 2026 17:21:07 +0000 (10:21 -0700)] 
fix(dracut-install): remove FTS_NOSTAT in install_modules() fts traversal

install_modules() uses FTS_NOSTAT when traversing kernel module
directories.  With FTS_NOSTAT, fts may skip stat() and report regular
files as FTS_NSOK instead of FTS_F.  However, the fts_info check only
accepts FTS_F and FTS_SL, causing all .ko files found this way to be
silently skipped.

This was previously masked by glibc's fts implementation which ignored
FTS_NOSTAT when FTS_LOGICAL was also set, always calling stat and
returning FTS_F.  A recent glibc change (commit 99303f3871, "io: Use
gnulib fts implementation") now honors FTS_NOSTAT regardless, exposing
this bug.

The result is that all '=directory' pattern module installs (=drivers,
=crypto, =fs, etc.) find zero modules, producing an initramfs with only
explicitly-named modules (~40 instead of ~500+), which typically fails
to boot.

Fix it by removing FTS_NOSTAT so that fts always stats files and
reliably reports actual file types.

3 weeks agofeat(dracut): add parameter --nvmf-nbft-mode
Martin Wilck [Mon, 6 Jul 2026 16:42:52 +0000 (18:42 +0200)] 
feat(dracut): add parameter --nvmf-nbft-mode

This is equivalent to the dracut.conf option nvmf_nbft_mode.

Signed-off-by: Martin Wilck <mwilck@suse.com>
3 weeks agofix(nvmf): parse json output from "nvme list-subsys"
Stuart Hayes [Fri, 15 May 2026 18:21:27 +0000 (20:21 +0200)] 
fix(nvmf): parse json output from "nvme list-subsys"

Modify code that parses the output of "nvme list-subsys" to set up
rd.nvmf.discover parameter to use the json output of nvme rather than the
human-readable output.

A recent commit to nvme-cli changed the human-readable output to only
print the transport address rather than the address line that includes all
of the needed information, but the json output still contains the needed
information.

An even more recent commit to nvme-cli changed the json output (it moved
some details from the "Address" value to an "AddressDetails" object), so
support that as well as the previous format.

Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
3 weeks agofix(nvmf): make network driver determination work without nbft$X
Martin Wilck [Mon, 6 Jul 2026 20:35:27 +0000 (22:35 +0200)] 
fix(nvmf): make network driver determination work without nbft$X

82f7f7d ("improvement(74nvmf): lookup required NIC kernel modules for NBFT
interfaces") assumes that the NBFT network interfaces are named according
to the nbft$X convention, which is no longer true with the latest patches.

Fix it.

Signed-off-by: Martin Wilck <mwilck@suse.com>
3 weeks agofeat(nvmf): set rd.nvmf.nm=1 if NetworkManager 1.54 is detected
Martin Wilck [Mon, 16 Feb 2026 22:39:37 +0000 (23:39 +0100)] 
feat(nvmf): set rd.nvmf.nm=1 if NetworkManager 1.54 is detected

Automatically enable nm-initrd-generator with recent Networkmanager.

Signed-off-by: Martin Wilck <mwilck@suse.com>
3 weeks agofeat(nvmf): allow using system interface naming policy
Martin Wilck [Mon, 16 Feb 2026 22:34:20 +0000 (23:34 +0100)] 
feat(nvmf): allow using system interface naming policy

nm-initrd-generator from NetworkManager 1.54 or newer supports parsing the
NBFT directly. Because NM allows identifying network interface by MAC
address, we don't need the ifname= setting any more to identify the
interface at the cmdline stage. We just need to check whether the system
has an NBFT with at least one entry.

Introduce the cmdline parameter "rd.nvmf.nm" to force dracut to use
nm-initrd-generator to set up network interfaces from the NBFT.

Signed-off-by: Martin Wilck <mwilck@suse.com>
3 weeks agofeat(nvmf): add dracut.conf option nvmf_nbft_mode
Martin Wilck [Mon, 16 Feb 2026 19:11:26 +0000 (20:11 +0100)] 
feat(nvmf): add dracut.conf option nvmf_nbft_mode

Add a dracut.conf.d option to control the generation of rd.nvmf.discover=
entries if hostonly_cmdline = "yes".

The option can take the values "static" (previous default behavior,
generate cmdline entries for every NVMe subsystem in the device stack),
"nbft" (don't generate any for tcp transport if an NBFT is present),
and "match" (only generate rd.nvmf.discover= entries for subsystems that
are not matched by current NBFT entries, as implemented by the previous
commit).

The default is "match", because this should fit user expectations best.

Signed-off-by: Martin Wilck <mwilck@suse.com>
3 weeks agofeat(nvmf): enable adapting to NBFT reconfiguration
Martin Wilck [Mon, 16 Feb 2026 17:40:25 +0000 (18:40 +0100)] 
feat(nvmf): enable adapting to NBFT reconfiguration

The cmdline() function of the nvmf module creates rd.nvmf.discover=
cmdline entries for all discovered subsystems. But this is often
not desirable for systems booting from an NBFT table, where the
contents of the table may change between reboots. With hard-coded
rd.nvmf.discover= entries, booting may fail if the NBFT configuration
has changed.

Compare the traddr/trsvcid pairs that appear in the block device
stack with the contents of the NBFT, and don't create rd.nvmf.discover=
entries for those that are matched.

Note: This approach is simplified, as entries might differ by
host_traddr. But such configurations are extremely rare, and
because we don't use interface-specific routes (VRF-lite) in the
initrd, omitting these entries can't cause boot failure, as long
as they match by transport, traddr, and trsvcid.

A follow-up patch will introduce an option to modify this behavior.

Signed-off-by: Martin Wilck <mwilck@suse.com>
3 weeks agofix(dracut.conf.5): move fstab/chroot warning to hostonly_mode section
Martin Wilck [Mon, 16 Feb 2026 19:29:19 +0000 (20:29 +0100)] 
fix(dracut.conf.5): move fstab/chroot warning to hostonly_mode section

The warning about using --fstab when chrooted belongs into the
hostonly_mode section, as can be seen in commit 888d53f ("replace xml
documentation with asciidoc"). It seems to have moved slowly downward.
Fix it.

Signed-off-by: Martin Wilck <mwilck@suse.com>
3 weeks agoci(azurelinux): install additional packages to pass CI
devkontrol [Sun, 12 Jul 2026 02:30:15 +0000 (22:30 -0400)] 
ci(azurelinux): install additional packages to pass CI

systemd-container is required to make importctl available for
test SYSTEMD-IMPORT (45).

openssl is required for test SYSTEMD-SYSEXT (46).

3 weeks agofix(network-legacy): sanitize DHCP values in dhclient-script.sh
Antonio Alvarez Feijoo [Fri, 19 Jun 2026 04:36:06 +0000 (06:36 +0200)] 
fix(network-legacy): sanitize DHCP values in dhclient-script.sh

A rogue DHCP server can inject shell commands through hostname,
domain, gateway, and classless static route values. These values
are written to /tmp files that setup_net() later sources as shell.

- Sanitize hostname to RFC 952 chars (a-zA-Z0-9.-)
- Strip control chars from domain (like search already does)
- Validate gateway IPs contain only digits and dots
- Single-quote interpolated values in generated shell commands
- Validate all parse_option_121 octets are numeric upfront;
  the existing inline checks only validated mask and the first
  destination octet, leaving dest octets 2-4 and all four
  gateway octets unchecked — those flow into shell commands
  written to the initqueue/setup_net_"$netif".sh hook script
  via echo

Fixes: CVE-2026-6893
Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
3 weeks agoperf(dracut-systemd): drop ExecStart from oneshot shutdown service
Benjamin Drung [Sat, 9 May 2026 10:01:08 +0000 (12:01 +0200)] 
perf(dracut-systemd): drop ExecStart from oneshot shutdown service

Systemd oneshot services that set `RemainAfterExit=yes` do not need to
specify `ExecStart` in case they define `ExecStop`.

So remove the useless `/bin/true` start command from
`dracut-shutdown.service`.

3 weeks agoci: switch from debian:latest to ubuntu:rolling
Benjamin Drung [Tue, 31 Mar 2026 14:15:49 +0000 (16:15 +0200)] 
ci: switch from debian:latest to ubuntu:rolling

Commit 28323e6b769c ("ci: switch from ubuntu:devel to a more stable
debian:latest") switched away from the Ubuntu devel release (which can
be more unstable since it is a release in development) but also switched
from Ubuntu to Debian.

Switch to `ubuntu:rolling` which is the latest Ubuntu release which
should be stable enough for our purposes. Ubuntu gets a new release
every six month in comparsion to Debian which cuts a new release around
every two years.

3 weeks agoci: run nbd test on debian:sid again
Benjamin Drung [Fri, 1 May 2026 18:08:23 +0000 (20:08 +0200)] 
ci: run nbd test on debian:sid again

The nbd 1:3.27.1-1 Debian package broke the nbd tests. nbd 1:3.27.1-2
fixed that regression.

So run the nbd test on `debian:sid` again.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/2381
3 weeks agotest(FULL-SYSTEMD): make systemd-timesyncd optional
Jo Zzsi [Sat, 2 May 2026 23:01:19 +0000 (19:01 -0400)] 
test(FULL-SYSTEMD): make systemd-timesyncd optional

Make it optional for this test to include systemd-timesyncd
in the initramfs for the purpose of this test.

The motivation for this PR is to allow the CI to support
other alternative NTP solution.

3 weeks agofix: remove dirname calls
Benjamin Drung [Fri, 8 May 2026 11:14:15 +0000 (13:14 +0200)] 
fix: remove dirname calls

https://dracut-ng.github.io/dracut/developer/bash.html says that
`dirname` should not be used.

So replace the usage of `dirname` by variable expansion instead.

3 weeks agofix(virtfs): move mount hook to pre-mount
Miao Wang [Fri, 3 Jul 2026 13:02:52 +0000 (21:02 +0800)] 
fix(virtfs): move mount hook to pre-mount

Mount hooks are executed after sysroot.mount when systemd is used.
However, the systemd generated sysroot.mount from kernel cmdline will
always fail when the given root= begins with virtfs:, making the system
unable to start.

Moving the mount hook to pre-mount will mount the 9p virtfs directly
onto /sysroot and the generated sysroot.mount will be ignored. This
practice is similar to what is in virtiofs.

Fixes: #1397
3 weeks agoci: update to systemd v257 and Azure Linux v4
devkontrol [Fri, 5 Jun 2026 05:01:22 +0000 (01:01 -0400)] 
ci: update to systemd v257 and Azure Linux v4

Azure Linux v3.0 is quite dated and a door has opened to
upgrade to systemd v257 and Azure Linux v4.

3 weeks agotest(run-qemu): use -accel kvm instead of -enable-kvm
Miao Wang [Fri, 10 Jul 2026 09:12:51 +0000 (17:12 +0800)] 
test(run-qemu): use -accel kvm instead of -enable-kvm

-enable-kvm is believed to be deprecated [1] and -accel kvm should be
used instead. -enable-kvm will not support new architectures even if KVM
is actually supported on these architectures. -accel kvm is recommended
instead as a unified option to enable KVM on all the architectures.

[1]: https://lore.kernel.org/all/c7828107-d2c8-4cbd-9208-dcc637161597@oss.qualcomm.com/