]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
5 weeks agotest(STORAGE): initialize global variables
Benjamin Drung [Wed, 11 Jun 2025 18:42:07 +0000 (20:42 +0200)] 
test(STORAGE): initialize global variables

Initialize the global variables in `test/TEST-20-STORAGE/test.sh` to
make the test work with `set -u`.

5 weeks agofeat: allow the use of $kernel in initrdname= config
Jo Zzsi [Thu, 19 Jun 2025 16:54:59 +0000 (12:54 -0400)] 
feat: allow the use of $kernel in initrdname= config

Assign $kernel before conf files are sourced.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1310
5 weeks agofix(base): base module failure if root password is already set
Jo Zzsi [Tue, 29 Jul 2025 17:59:35 +0000 (13:59 -0400)] 
fix(base): base module failure if root password is already set

Replace sed with grep and simplify logic by removing a conditional
and if needed simply copying the line from the host shadow file to
the initramfs shadow file.

Add test coverage for root entry in /etc/shadow.

Fixes https://github.com/dracut-ng/dracut-ng/issues/1478

5 weeks agofix(systemd-sysusers): maintain users and groups
Jo Zzsi [Sun, 13 Jul 2025 00:31:12 +0000 (20:31 -0400)] 
fix(systemd-sysusers): maintain users and groups

Currently dracut deletes entries for users and groups created
by systemd-sysusers.

This PR maitaines users and groups created by systemd-sysusers
and merges root password from the host with the shadow file
created by systemd-sysusers.

Add test assertion to check if systemd-coredump user is present,
which is expected on a systemd-enabled system.

Allow the owner to read and write /etc/shadow and /etc/gshadow
in the initramfs.

This fixes a permission error during dracut when it's not run
as root:

dracut[I]: *** Creating image file '.../initramfs.img' ***
cpio: etc/gshadow: Cannot open: Permission denied
cpio: etc/shadow: Cannot open: Permission denied
dracut[F]: Creation of .../initramfs.img failed

Indeed, the permissions were set empty:

$ cd $initdir
$ ls -l etc/gshadow etc/shadow
----------. 1 myuser mygroup  179 mar  26 10:29 gshadow
----------. 1 myuser mygroup   32 mar  26 10:29 shadow

This approach also enables systemd-sysusers credentials, see
https://www.freedesktop.org/software/systemd/man/latest/systemd-sysusers.html#Credentials

5 weeks agofix(dracut): only call uname -r if it is safe to do
Jo Zzsi [Tue, 29 Jul 2025 09:54:41 +0000 (05:54 -0400)] 
fix(dracut): only call uname -r if it is safe to do

Change the priority order to determine the kernel version of it is
not specified on the command line.

Only call uname -r if it is safe to do, meaning if it is confirmed
that dracut is not called from within a container.

Follow-up to 2b2debd.

5 weeks agofix(fcoe-uefi): exit early on empty vlan
Pavel Valena [Sat, 12 Jul 2025 16:47:28 +0000 (12:47 -0400)] 
fix(fcoe-uefi): exit early on empty vlan

Exit early in case get_fcoe_boot_vlan exits with error or just an empty string,
instead of producing invalid config entry.

5 weeks agotest: remove unnecessary drivers from test dracut modules
Jo Zzsi [Thu, 3 Jul 2025 13:59:05 +0000 (09:59 -0400)] 
test: remove unnecessary drivers from test dracut modules

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1324
To increase test coverage for kernel-modules and instead
of hard-coding required Linux kernel modules,
use the kernel-modules dracut module instead.

This change is enabled by 8730476 .

5 weeks agofix(generic.conf): increase ordering for generic.conf
Jo Zzsi [Tue, 15 Jul 2025 16:26:15 +0000 (12:26 -0400)] 
fix(generic.conf): increase ordering for generic.conf

In the unlikely case that both hostonly and generic config
is installed generic should take an explicit precedence.

Currently both hostonly and generic config has the same ordering
number (10), so the precedence is based on the rest of the name
and not based on the ordering number.

Now that hostonly is the default configuration that gets installed
by default, it is particularly important for generic has higher
precedence as generic is likely only installed as an opt-in
configuration and not as the "default".

5 weeks agofix: load essential storage kernel modules in sloppy hostonly mode
Jo Zzsi [Sat, 24 May 2025 01:56:56 +0000 (21:56 -0400)] 
fix: load essential storage kernel modules in sloppy hostonly mode

Essential storage kernel modules (e.g. sd_mod) should be
always included unless hostonly_mode is set to strict.

This PR installs even more drivers in hostonly sloppy mode
as a follow-up to 8519dcd .

Fixes: https://github.com/dracut-ng/dracut-ng/issues/748
5 weeks agofix(systemd-udevd): handle root=gpt-auto for systemd-v258
Antonio Alvarez Feijoo [Mon, 28 Jul 2025 08:10:45 +0000 (10:10 +0200)] 
fix(systemd-udevd): handle root=gpt-auto for systemd-v258

A new file 90-image-dissect.rules was split from 99-systemd.rules to handle
gpt-root.

Since https://github.com/systemd/systemd/commit/e3f6ae1d09d28dbe31ccf67122486ad037d25ed0

5 weeks agoperf(systemd-udevd): 99-systemd.rules added in two places
Antonio Alvarez Feijoo [Mon, 28 Jul 2025 08:07:49 +0000 (10:07 +0200)] 
perf(systemd-udevd): 99-systemd.rules added in two places

6 weeks agofeat(dracut): drop DRACUT_PATH and rely on PATH
Benjamin Drung [Sun, 20 Jul 2025 12:14:00 +0000 (14:14 +0200)] 
feat(dracut): drop DRACUT_PATH and rely on PATH

This reverts commit eab9b75c8a9b ("dracut.sh: add DRACUT_PATH").

Drop `DRACUT_PATH` and rely on `PATH` instead to avoid user confusion
and behave like most other programs.

To avoid failing on misconfiguration (e.g. when `/usr/sbin` is not in
`PATH`), ensure that the common default paths `/usr/sbin`, `/usr/bin`,
`/sbin`, and `/bin` are included in `PATH`.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1467
6 weeks agofix(dracut): detect if systemd-detect-virt is available before calling it
Jo Zzsi [Sun, 20 Jul 2025 23:37:31 +0000 (19:37 -0400)] 
fix(dracut): detect if systemd-detect-virt is available before calling it

When systemd-detect-virt is not available (e.g. in a non-systemd host)
The following error is reported

```
/usr/sbin/dracut: line 1435: systemd-detect-virt: command not found
```

Let's detect if systemd-detect-virt is available before calling it.

6 weeks agotest: compute VMLINUZ in run-qemu only when it is needed
Jo Zzsi [Sat, 19 Jul 2025 20:13:20 +0000 (16:13 -0400)] 
test: compute VMLINUZ in run-qemu only when it is needed

Currently VMLINUZ is computed and set even when it is not needed
(e.g. for test 80). Move the computation to run-qemu instead
and only set it when needed.

6 weeks agotest: prefer testing dracut over testing ukify
Jo Zzsi [Sat, 19 Jul 2025 19:54:28 +0000 (15:54 -0400)] 
test: prefer testing dracut over testing ukify

Dracut can call ukify when available to generate UKI
(see acfddd69f). Prefer testing this flow, over testing calling ukify
directly from the test-case.

This change also remove the need for test-cases to have direct access
to VMLINUZ variable.

6 weeks agofix(dracut): consolidate reporting running in a container
Jo Zzsi [Sat, 19 Jul 2025 03:05:58 +0000 (23:05 -0400)] 
fix(dracut): consolidate reporting running in a container

dinfo call to report running in a container does not work as expected
as dinfo is not yet defined in the first code block.

In addition we're already reporting running in a container in some
other conditions, which would lead to reporting it twice.

Consolidate reporting running in a container into one single place
and make it work, and reporting is as information and not as a warning
as using dracut inside container is common.

Reordered two code blocks to enable the usage of dinfo to simplify
reporting.

Follow-up to 2b2debd .

6 weeks agofeat(dracut): support SOURCE_DATE_EPOCH
Benjamin Drung [Sat, 19 Jul 2025 08:30:19 +0000 (10:30 +0200)] 
feat(dracut): support SOURCE_DATE_EPOCH

`SOURCE_DATE_EPOCH` is a standardised environment variable that
distributions can set centrally and have build tools consume this in
order to produce reproducible output (see
https://reproducible-builds.org/docs/source-date-epoch/).

Enable reproducible builds when `SOURCE_DATE_EPOCH` is set and use this
timestamp when clamping the mtime.

6 weeks agodocs(test): add new test/README.md
Marc Herbert [Tue, 15 Jul 2025 22:33:53 +0000 (22:33 +0000)] 
docs(test): add new test/README.md

As discussed on July 14th in #1268, add a new and small test/README.md
file for convenience. This is just a list of pointers/shortcuts to
existing documentation. Add enough English around the pointers to make
it easy to find the new location even if stuff moves. Even when pointers
go out of date, it makes a big difference to have an idea of what you're
looking for - and that it even exists in the first place!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
7 weeks agofix: increase deteminism by not relying on the default sorting from ls
Jo Zzsi [Wed, 16 Jul 2025 19:36:00 +0000 (15:36 -0400)] 
fix: increase deteminism by not relying on the default sorting from ls

In the unlikely case where there are several kernels installed on the host
and kernel is not specified on the command line, let's not rely
on the the default sorting from ls and call ls with -v for natural
sort of (version) numbers within text.

7 weeks agofix(dracut.sh): do not use uname to detect kernel version in a container
Jo Zzsi [Wed, 16 Jul 2025 14:21:01 +0000 (10:21 -0400)] 
fix(dracut.sh): do not use uname to detect kernel version in a container

A big general papercut with dracut right now in that it always assumes
the kernel it's running on is the kernel to target.

This commit lets dracut to detect that it's in a container (e.g. systemd-detect-virt -c),
and check for a single /usr/lib/modules/$kver directory and automatically use that kernel.

Currently this kernel version detection has three copies in the source
(dracut.sh, lsinitrd.sh,test-functions). This commit keeps the
logic for the three copies the same. As a follow-up commit, we should
try to actually share the code for this logic instead of copying it.

Fixes https://github.com/dracut-ng/dracut-ng/issues/1455.

7 weeks agofix(dmsquash-live): erofs collision with latest util-linux
Karel Zak [Thu, 19 Jun 2025 16:32:13 +0000 (12:32 -0400)] 
fix(dmsquash-live): erofs collision with latest util-linux

This PR fixes the issue that recent kernels can mount EROFS
directly without loop devices, and this feature is enabled in Fedora
kernels (>=6.12; CONFIG_EROFS_FS_BACKED_BY_FILE=y).
This feature is now supported by mount/libmount, too.

I think the best approach would be to avoid the second mount altogether,
independently of the util-linux version.
It is more robust to use a bind mount there than to attempt to create
a second instance of the same file system.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1384
7 weeks agochore: eliminate overlapping functions
Jo Zzsi [Tue, 15 Jul 2025 02:06:42 +0000 (22:06 -0400)] 
chore: eliminate overlapping functions

In its current form inst_library function executes the same set of
commands as the inst function.

Copying (instead of reusing code) is usually preferred, especially
in this particular case where inst_library function is not used by
dracut, so it is not tested by dracut CI.

After this commit, inst_library would just call inst, and inst
is being used and as such tested by dracut CI, so it makes it
less likely to egress out-of tree coide depending on dracut.

7 weeks agofix(dracut): ensure hardlink deduplication is reproducible
Chris Riches [Wed, 9 Jul 2025 16:40:18 +0000 (16:40 +0000)] 
fix(dracut): ensure hardlink deduplication is reproducible

By default, hardlink will only deduplicate files with identical mtimes,
down to one-second granularity. If a dracut module rapidly generates
multiple identical files, it is completely up to chance as to whether
their mtimes cross a second boundary or not, and thus whether they get
deduplicated or not. This results in non-reproducible output.

Re-order hardlink with respect to clamping to avoid this problem.

Fixes: https://issues.redhat.com/browse/RHEL-101901
7 weeks agotest(SYSTEMD): convert test to run without initqueue
Jo Zzsi [Tue, 15 Jul 2025 02:55:31 +0000 (22:55 -0400)] 
test(SYSTEMD): convert test to run without initqueue

Systemd itself provides similar functionality to the
dracut initqueue module. It has been a long-standing
criticism of dracut systemd integration that
initqueue should not be necessary for most system boot scenarios.

While there is still a long way to go, we can start testing some of
the common systemd boot scenarios without initqueue.

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

7 weeks agotest: remove hard-off test hooks hooks
Jo Zzsi [Thu, 3 Jul 2025 16:15:21 +0000 (12:15 -0400)] 
test: remove hard-off test hooks hooks

These hard-off test hooks make the test shut down in a
non-graceful way.

These hooks are no longer required.

Removing these hooks would make the test run similarly
to production environments.

7 weeks agofix: network-manager dracut module no longer depends on systemd
Jo Zzsi [Sun, 13 Jul 2025 22:26:03 +0000 (18:26 -0400)] 
fix: network-manager dracut module no longer depends on systemd

Previously dracut network-manager module only worked with systemd.

Now after 58baf86, network-manager dracut module should work
in non-systemd Linux distributions as well, such as Void Linux.

This commit re-enables network-manager dracut module for all
Linux distributions.

7 weeks agofix(dracut.conf.d): reserve namespace 50 to out-of-tree configurations
Jo Zzsi [Sat, 12 Jul 2025 17:08:20 +0000 (13:08 -0400)] 
fix(dracut.conf.d): reserve namespace 50 to out-of-tree configurations

50 should be reserved for out-of-tree dracut configurations, just like
50 is reserved for out-of-tree dracut modules. This policy makes dracut
more consistent and easier to reason about.

Change the built-in dracut configurations from namespace 50 to namespace 10.

Document that the recommended ordering for distribution or user provided
configuration files is in the range of 50-59.

7 weeks agoci(gentoo): remove workaround for forcing hostonly mode
Jo Zzsi [Sat, 12 Jul 2025 16:58:08 +0000 (12:58 -0400)] 
ci(gentoo): remove workaround for forcing hostonly mode

Forcing hostonly mode for Gentoo was introduced in commit
9fc9128, as a step towards enabling hostonly mode by default
for all distributions.

After 62fdf59 this workaround for Gentoo is no longer needed to
be maintained as now hostonly is the default for all Linux
installation (set in configure).

7 weeks agoci: install NetworkManager into the Void CI container
Jo Zzsi [Sun, 13 Jul 2025 22:36:56 +0000 (18:36 -0400)] 
ci: install NetworkManager into the Void CI container

Previously dracut network-manager package only worked with systemd.
Now after 58baf86, network-manager dracut package should work in
non-systemd Linux distributions as well, such as Void Linux.

Install NetworkManager into the Void CI container to enable
testing it on the CI.

7 weeks agofix(fips): make sha512hmac an optional requirement
Jo Zzsi [Sat, 12 Jul 2025 16:34:33 +0000 (12:34 -0400)] 
fix(fips): make sha512hmac an optional requirement

sha512hmac binary is not available on most Linux distributions,
including openSUSE and it is not a hard requirement for the
fips dracut module to function.

Install sha512hmac with an optional flag to not regress
distributions that have sha512hmac installed and also
enable distributions without sha512hmac to not fail.

7 weeks agofeat(rootfs-block-fallback): factor out rootfallback into its own module
Jo Zzsi [Sat, 24 May 2025 10:59:39 +0000 (06:59 -0400)] 
feat(rootfs-block-fallback): factor out rootfallback into its own module

This change allows to remove the initqueue dependency from
rootfs-block.

initqueue will be only included into the initramfs when
rootfs-block-fallback is explicitelly included.

7 weeks agofix(base): dracut-lib.sh soft depends on poweroff/reboot/halt
Jo Zzsi [Thu, 3 Jul 2025 17:37:35 +0000 (13:37 -0400)] 
fix(base): dracut-lib.sh soft depends on poweroff/reboot/halt

Currently base module does not include poweroff/reboot/halt
even though dracut-lib.sh could call these binaries. Dracut
should make it easier to create an initramfs that has all
the dependent libraries.

After this change we can remove poweroff - which was a workaround
for the base module bug - from test modules.

7 weeks agofix(man): document what to expect running dracut non-root
Jo Zzsi [Sat, 12 Jul 2025 23:04:05 +0000 (19:04 -0400)] 
fix(man): document what to expect running dracut non-root

Running dracut non-root supports only a limited set of functionalities.

7 weeks agofix(systemd-sysusers): remove (g)shadow created by systemd-sysusers
Jo Zzsi [Wed, 21 May 2025 12:38:30 +0000 (08:38 -0400)] 
fix(systemd-sysusers): remove (g)shadow created by systemd-sysusers

The files shadow and gshadow do NOT exist when using the commit before f3dacc0.

This commit restores the earlier behaviour.

Fixes #1242

8 weeks agofix(systemd-repart): allow partition format
Emanuele Giuseppe Esposito [Fri, 20 Jun 2025 12:38:27 +0000 (08:38 -0400)] 
fix(systemd-repart): allow partition format

systemd-repart is capable not only of creating a partition, but also of
formatting it. According with repart.d, it is able to create the
following filesystems: ext4, btrfs, xfs, vfat, erofs and squashfs.

Add support in the systemd-repart module for the underlying tools to
allow systemd-repart to format the partition.

Failure to do so would make systemd-repart initramfs unit fail, if
Format= option is provided in a repart.d config file.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
8 weeks agofix(dracut-install): sort output of --modalias
Benjamin Drung [Wed, 9 Jul 2025 10:28:51 +0000 (12:28 +0200)] 
fix(dracut-install): sort output of --modalias

Calling `dracut-install --modalias` will print kernel modules in an
unstable order. This breaks reproducible builds, because the output is
stored inside the initrd as `lib/dracut/hostonly-kernel-modules.txt`.

So sort the output of `--modalias` to be reproducible and easier to
diff.

Partially fixes https://github.com/dracut-ng/dracut-ng/issues/1409

8 weeks agorefactor(dracut-install): add print_values helper function
Benjamin Drung [Wed, 9 Jul 2025 10:03:37 +0000 (12:03 +0200)] 
refactor(dracut-install): add print_values helper function

8 weeks agorefactor(dracut): introduce clamp_mtimes helper function
Chris Riches [Thu, 3 Jul 2025 13:42:09 +0000 (13:42 +0000)] 
refactor(dracut): introduce clamp_mtimes helper function

Avoid code duplication by introducing `clamp_mtimes`.

8 weeks agoRevert "chore: remove unused function"
Adam Williamson [Thu, 10 Jul 2025 17:33:21 +0000 (10:33 -0700)] 
Revert "chore: remove unused function"

This reverts commit 81ddde54051351ea17dbb84ef6232820f96740af.
dracut itself may not use inst_library, but external modules do,
at least anaconda's does.

8 weeks agofix(lsinitrd): resolve initrd to real path
Benjamin Drung [Tue, 8 Jul 2025 15:58:18 +0000 (17:58 +0200)] 
fix(lsinitrd): resolve initrd to real path

`lsinitrd /boot/initrd.img` fails in case the initrd is zstd compressed:

```
$ dracut --zstd --no-early-microcode --force
$ 3cpio --examine /boot/initrd.img
0 zstd
$ lsinitrd /boot/initrd.img
Image: /boot/initrd.img: 0
========================================================================
Warning : /boot/initrd.img is a symbolic link, ignoring
Version:

Arguments:
dracut modules:
Warning : /boot/initrd.img is a symbolic link, ignoring
Warning : /boot/initrd.img is a symbolic link, ignoring
========================================================================
========================================================================
cpio: premature end of archive

dracut cmdline:
Warning : /boot/initrd.img is a symbolic link, ignoring
```

The `CAT` variable is `zstd -d -c`. The zstd man page says about the
`--force` parameter: "disable input and output checks. Allows [...]
operating on links". So this zstd behavior is intentional.

Resolve the initrd path to the real path. Then `lsinitrd` prints the
correct content and image size:

```
$ lsinitrd /boot/initrd.img
Image: /boot/initrd.img-6.14.0-23-generic: 15M
[...]
```

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

8 weeks agofix(network-manager): depend on dbus only when using systemd
Andrew Gunnerson [Sun, 6 Jul 2025 04:21:53 +0000 (00:21 -0400)] 
fix(network-manager): depend on dbus only when using systemd

network-manager does not require dbus to function when using the
--configure-and-quit=initrd option. This should be guaranteed as it is
documented behavior in the NetworkManager.conf(5) manpage and
specifically mentions dracut's use case.

With this change, initramfs images that don't or can't use systemd can
use network-manager instead of the old network-legacy module.

Fixes: #1422
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
8 weeks agorefactor(dracut-install): copy_xattr: more idiomatic loop
Marcos Mello [Tue, 8 Jul 2025 22:06:09 +0000 (19:06 -0300)] 
refactor(dracut-install): copy_xattr: more idiomatic loop

Update the loop to more idiomatic iteration over null-terminated
strings.

8 weeks agorefactor(dracut-install): copy_xattr: use malloc rather than calloc
Marcos Mello [Tue, 8 Jul 2025 22:03:39 +0000 (19:03 -0300)] 
refactor(dracut-install): copy_xattr: use malloc rather than calloc

Replace calloc() with malloc() as flistxattr() overwrites the buffer
and ensures null-terminated xattr names.

8 weeks agorefactor(dracut-install): copy_xattr: use _cleanup_free_
Marcos Mello [Tue, 8 Jul 2025 22:01:42 +0000 (19:01 -0300)] 
refactor(dracut-install): copy_xattr: use _cleanup_free_

Use _cleanup_free_ for buffers and remove unnecessary variable
initializations.

8 weeks agorefactor(dracut-install): copy_xattr: return early when no xattrs are present
Marcos Mello [Tue, 8 Jul 2025 21:57:32 +0000 (18:57 -0300)] 
refactor(dracut-install): copy_xattr: return early when no xattrs are present

8 weeks agofix(systemd-sysext): install the required kernel modules
Vitaly Kuznetsov [Mon, 23 Jun 2025 13:29:12 +0000 (15:29 +0200)] 
fix(systemd-sysext): install the required kernel modules

'systemd-repart' tool is commonly used to produce Discoverable Disk Image
(DDI) ("--make-ddi=TYPE" option) and by default the tool creates 'erofs'
root volume for sysext/confext. Include 'erofs' kernel module into
initramfs if present.

While on in, include 'loop' module as well as this one is an absolute must.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
2 months agofix: support DRACUT_SYSTEMD being unset
Benjamin Drung [Fri, 20 Jun 2025 20:10:54 +0000 (22:10 +0200)] 
fix: support DRACUT_SYSTEMD being unset

Support `DRACUT_SYSTEMD` being unset when using `set -u`.

2 months agofeat: add support for removing a space separated list of files
Jo Zzsi [Sun, 27 Apr 2025 20:01:27 +0000 (16:01 -0400)] 
feat: add support for removing a space separated list of files

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1297
2 months agorevert: bump tomtom-international/commisery-action from 3 to 4
Jo Zzsi [Tue, 1 Jul 2025 23:25:34 +0000 (19:25 -0400)] 
revert: bump tomtom-international/commisery-action from 3 to 4

Why: v4 fails for this project, v3 does not fail.

2 months agotest(GETARGS): set NEWROOT and PREFIX for dracut-lib.sh
Benjamin Drung [Fri, 27 Jun 2025 13:47:52 +0000 (15:47 +0200)] 
test(GETARGS): set NEWROOT and PREFIX for dracut-lib.sh

Set `NEWROOT` to an existing directory to make sourcing `dracut-lib.sh`
work with `set -u`. Also set `PREFIX` to avoid creating `/run/initramfs`
which requires root permission.

2 months agofeat: make variable set check work with "set -u"
Benjamin Drung [Fri, 20 Jun 2025 20:55:18 +0000 (22:55 +0200)] 
feat: make variable set check work with "set -u"

Make checking if a variable is defined/set work with `set -u`.

2 months agofix(base): support PREFIX being unset
Benjamin Drung [Fri, 20 Jun 2025 17:57:40 +0000 (19:57 +0200)] 
fix(base): support PREFIX being unset

Support `PREFIX` being unset when using `set -u`.

2 months agotest: change tests to recommended configuration
Jo Zzsi [Sat, 28 Jun 2025 15:09:48 +0000 (11:09 -0400)] 
test: change tests to recommended configuration

Follow-up to f698315 .

In most cases the "--add-drivers" option is what you want to use.

2 months agofix: support hostonly being unset
Benjamin Drung [Fri, 20 Jun 2025 17:56:27 +0000 (19:56 +0200)] 
fix: support hostonly being unset

Support `hostonly` being unset when using `set -u`.

2 months agochore(deps): bump tomtom-international/commisery-action from 3 to 4
dependabot[bot] [Tue, 1 Jul 2025 20:54:50 +0000 (20:54 +0000)] 
chore(deps): bump tomtom-international/commisery-action from 3 to 4

Bumps [tomtom-international/commisery-action](https://github.com/tomtom-international/commisery-action) from 3 to 4.
- [Release notes](https://github.com/tomtom-international/commisery-action/releases)
- [Commits](https://github.com/tomtom-international/commisery-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: tomtom-international/commisery-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agofix(modules): free up range 00-09 to out of tree dracut modules
Jo Zzsi [Mon, 26 May 2025 15:43:46 +0000 (11:43 -0400)] 
fix(modules): free up range 00-09 to out of tree dracut modules

This PR does not change the ascending sort order of the modules.

It adds 10 to all dracut modules in the range of 00-10 to move it up
to the 10-20 range.

The motivation for this PR is to have namespace (dracut module numbers)
reserved at the beginning (similar to the end) of the range.

Fixes https://github.com/dracut-ng/dracut-ng/issues/538.

2 months agoperf(watchdog): only install wdctl for the non-systemd case
Jo Zzsi [Thu, 29 May 2025 14:06:26 +0000 (10:06 -0400)] 
perf(watchdog): only install wdctl for the non-systemd case

Move the installation of wdctl in install() to the non-systemd block as
systemd doesn't use it, so it's only needed by watchdog.sh.

2 months agofeat(watchdog): do not depend on initqueue if systemd is used
Jo Zzsi [Thu, 29 May 2025 14:04:34 +0000 (10:04 -0400)] 
feat(watchdog): do not depend on initqueue if systemd is used

initqueue is not used when systemd is included in the initramfs.

2 months agofeat(resume): do not depend on initqueue if systemd is used
Jo Zzsi [Tue, 27 May 2025 11:57:11 +0000 (07:57 -0400)] 
feat(resume): do not depend on initqueue if systemd is used

initqueue is not used when systemd is included in the initramfs.

Fixes https://github.com/dracut-ng/dracut-ng/issues/1362 .

2 months agotest: add --pbkdf pbkdf2 to luksFormat commands
Jo Zzsi [Sat, 28 Jun 2025 16:33:16 +0000 (12:33 -0400)] 
test: add --pbkdf pbkdf2 to luksFormat commands

Make the test work with recent release (v2.8.0) of cryptsetup.

This PR keeps memory requirements for LUKS unlocking minimal,
allowing testcases run in system with minimal memory.

The storage stack and boot process that is being tested,
remains exactly the same.

Default for LUKS2 is now Argon2 (memory-hard KDF,
so it means that it requires some amount of memory).

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1389
2 months agodocs: improve documentation for out of tree dracut modules
Jo Zzsi [Sat, 28 Jun 2025 13:48:33 +0000 (09:48 -0400)] 
docs: improve documentation for out of tree dracut modules

Follow-up to 2199846.

Partially resolve #538.

2 months agochore: version lock commisery-action
Jo Zzsi [Thu, 19 Jun 2025 16:05:06 +0000 (12:05 -0400)] 
chore: version lock commisery-action

@master seems to report the folloeing error

Error: Resource not accessible by integration

Switch to @v3, as it is the last stable version.

2 months agofeat(network-manager): use upstream initrd services if available
Antonio Alvarez Feijoo [Fri, 13 Jun 2025 07:30:11 +0000 (09:30 +0200)] 
feat(network-manager): use upstream initrd services if available

Added in https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/8640ea822f054c8817e0fd773ba7d1a8f42fa214

2 months agofeat: support dracutsysrootdir being unset
Benjamin Drung [Wed, 11 Jun 2025 15:21:14 +0000 (17:21 +0200)] 
feat: support dracutsysrootdir being unset

Support `dracutsysrootdir` being unset when using `set -u`.

2 months agotest: support DEBUGFAIL being unset
Benjamin Drung [Fri, 13 Jun 2025 10:22:04 +0000 (12:22 +0200)] 
test: support DEBUGFAIL being unset

Support `DEBUGFAIL` being unset when using `set -u`.

2 months agotest: support V being unset
Benjamin Drung [Wed, 11 Jun 2025 18:53:09 +0000 (20:53 +0200)] 
test: support V being unset

Support `V` being unset when using `set -u`.

2 months agotest: support CPIO_TESTDIR being unset in test_cleanup
Benjamin Drung [Wed, 11 Jun 2025 18:37:35 +0000 (20:37 +0200)] 
test: support CPIO_TESTDIR being unset in test_cleanup

Support `CPIO_TESTDIR` being unset when using `set -u`.

2 months agotest: support DEBUGOUT being unset
Benjamin Drung [Wed, 11 Jun 2025 18:36:04 +0000 (20:36 +0200)] 
test: support DEBUGOUT being unset

Support `DEBUGOUT` being unset when using `set -u`.

2 months agotest: support SERVER_DEBUG being unset
Benjamin Drung [Wed, 11 Jun 2025 18:21:52 +0000 (20:21 +0200)] 
test: support SERVER_DEBUG being unset

Support `SERVER_DEBUG` being unset when using `set -u`.

2 months agotest: support SERIAL being unset
Benjamin Drung [Wed, 11 Jun 2025 18:19:16 +0000 (20:19 +0200)] 
test: support SERIAL being unset

Support `SERIAL` being unset when using `set -u`.

2 months agofix(dracut-logger.sh): initialize errmsg in dlog_init
Benjamin Drung [Fri, 13 Jun 2025 10:17:53 +0000 (12:17 +0200)] 
fix(dracut-logger.sh): initialize errmsg in dlog_init

Initialize the local variable `errmsg` in `dlog_init` to make the
function work with `set -u`.

2 months agotest: initialize bootindex in qemu_add_drive
Benjamin Drung [Fri, 13 Jun 2025 10:28:22 +0000 (12:28 +0200)] 
test: initialize bootindex in qemu_add_drive

Initialize the optional variables in `bootindex` to make the function
work with `set -u`.

2 months agofix: support DRACUT_RESOLVE_LAZY being unset
Benjamin Drung [Wed, 11 Jun 2025 18:46:22 +0000 (20:46 +0200)] 
fix: support DRACUT_RESOLVE_LAZY being unset

Support `DRACUT_RESOLVE_LAZY` being unset when using `set -u`.

2 months agofix(dracut-init.sh): support DRACUT_NO_XATTR being unset
Benjamin Drung [Wed, 11 Jun 2025 18:44:25 +0000 (20:44 +0200)] 
fix(dracut-init.sh): support DRACUT_NO_XATTR being unset

Support `DRACUT_NO_XATTR` being unset when using `set -u`.

2 months agofix(Makefile): remove test modules after renumbering
Benjamin Drung [Wed, 11 Jun 2025 12:34:18 +0000 (14:34 +0200)] 
fix(Makefile): remove test modules after renumbering

The test modules were renumbered from 80 to 70, but the Makefile did not
adjust to this change.

Fixes: 2199846ffebc ("fix(modules): all modules with 99 ordering should have a unique number")
2 months agofix(test): renumber test modules to 70
Benjamin Drung [Wed, 11 Jun 2025 12:32:15 +0000 (14:32 +0200)] 
fix(test): renumber test modules to 70

Renumber the test modules from 80 to 70 (not just rename the symlinks).

Fixes: 2199846ffebc ("fix(modules): all modules with 99 ordering should have a unique number")
2 months agofix(dracut-init.sh): initialize _files in inst_libdir_file
Benjamin Drung [Wed, 11 Jun 2025 17:59:59 +0000 (19:59 +0200)] 
fix(dracut-init.sh): initialize _files in inst_libdir_file

Initialize the local variable `_files` in `inst_libdir_file` to make the
function work with `set -u`.

2 months agofix(dracut-lib.sh): initialize variables in getargs
Benjamin Drung [Wed, 11 Jun 2025 17:56:56 +0000 (19:56 +0200)] 
fix(dracut-lib.sh): initialize variables in getargs

Initialize the variables in `getargs` to make the function work with
`set -u`.

2 months agofix(dracut.sh): initialize variables that get exported
Benjamin Drung [Wed, 11 Jun 2025 18:15:37 +0000 (20:15 +0200)] 
fix(dracut.sh): initialize variables that get exported

`dracut.sh` exports several variables. Initialize them empty instead of
leaving them potentially undefined.

2 months agofix: loongarch architecture support
zhuyaliang [Wed, 11 Jun 2025 01:34:08 +0000 (09:34 +0800)] 
fix: loongarch architecture support

2 months agofeat(base): add support for rd.driver.pre
Jo Zzsi [Mon, 26 May 2025 00:44:07 +0000 (20:44 -0400)] 
feat(base): add support for rd.driver.pre

Move support for rd.driver.pre from kernel-modules to base
module.

One of the reason for this is as rd.driver.pre has a dependency on
modprobe binary and modprobe binary is installed in the base
dracut module.

Another reason is to support the use case where kernel modules
are installed via dracut command line and not via kernel-modules
dracut library.

Fixes https://github.com/dracut-ng/dracut-ng/issues/1302

2 months agofeat: tests are not packaged by default to simplify packaging
Jo Zzsi [Sun, 18 May 2025 17:17:31 +0000 (13:17 -0400)] 
feat: tests are not packaged by default to simplify packaging

If it is desired to package tests, set enable_test=yes .

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1327
3 months agofix(base): only create nobody user for nfs dracut module
Jo Zzsi [Sun, 9 Feb 2025 15:33:34 +0000 (10:33 -0500)] 
fix(base): only create nobody user for nfs dracut module

Usual local initrd does not need nobody user.

3 months agofix(systemd-sysext): make non-hostonly non-host
Jo Zzsi [Fri, 25 Apr 2025 16:49:22 +0000 (12:49 -0400)] 
fix(systemd-sysext): make non-hostonly non-host

/var is by definition host specific.

3 months agofix(systemd): systemd.volatile needs overlayfs kernel module
Jo Zzsi [Sun, 25 May 2025 20:16:40 +0000 (16:16 -0400)] 
fix(systemd): systemd.volatile needs overlayfs kernel module

See https://www.freedesktop.org/software/systemd/man/latest/systemd-volatile-root.service.html

> This service is only enabled if full volatile mode is selected,
> for example by specifying "systemd.volatile=yes" on the kernel command line.
> This service runs only in the initrd, before the system transitions to the host's root directory.
> Note that this service is not used if "systemd.volatile=state" is used, as in that mode the root
> directory is non-volatile.

Support for this systemd feature has been added in systemd v242 .
https://github.com/systemd/systemd/pull/11243

3 months agofix: let check_vol_slaves_all return 1 when checks on all slaves fail
Coiby Xu [Mon, 26 May 2025 07:34:30 +0000 (15:34 +0800)] 
fix: let check_vol_slaves_all return 1 when checks on all slaves fail

Currently check_vol_slaves_all return 0 even after checks on all slaves
fail. And this leads to an issue that "dracut -hostonly-mode strict"
gets stuck forever because instmods keeps waiting for user input when
it's passed empty argument in the kernel-modules module.

Fixes: c7c8c498 ("dracut-functions.sh: catch all lvm slaves")
Reported-by: Tomáš Bžatek <tbzatek@redhat.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
3 months agofix(modules): document known module dependencies
Jo Zzsi [Mon, 26 May 2025 00:16:53 +0000 (20:16 -0400)] 
fix(modules): document known module dependencies

Document the known dependencies as comments.

3 months agofix(systemd): make checking for systemd availability consistent
Jo Zzsi [Mon, 26 May 2025 00:21:42 +0000 (20:21 -0400)] 
fix(systemd): make checking for systemd availability consistent

The best way to check if systemd is available is to check for the
systemd dracut module. Most of the existing code does this already,
fix the remaining few places where it does not.

3 months agofix(modules): move more modules with unimportant ordering to 70
Jo Zzsi [Sun, 25 May 2025 23:27:08 +0000 (19:27 -0400)] 
fix(modules): move more modules with unimportant ordering to 70

Dracut library modules - such as fs-lib, img-lib or uefi-lib,
do not need to be ordered differently from other regular modules.

3 months agodocs: document the new defaults set by configure
Jo Zzsi [Thu, 22 May 2025 13:13:06 +0000 (09:13 -0400)] 
docs: document the new defaults set by configure

The new default is set by 62fdf59.

3 months agodocs: promote usage of splash over rhgb
Jo Zzsi [Sun, 25 May 2025 17:13:01 +0000 (13:13 -0400)] 
docs: promote usage of splash over rhgb

This is a documentation only change.

The rhgb command line option will continue to be supported.

Also remove some distribution specific details from the example that
is not essentail for understanding the example.

3 months agofix(livenet): drop stray command call
David Tardon [Wed, 21 May 2025 07:02:46 +0000 (09:02 +0200)] 
fix(livenet): drop stray command call

It was evidently added by a mistake by the original commit, as it makes
no sense.

Fixes a regression from 8b71a80edfca725e8aa281a4f91c55ff6234cc82 .

Fixes #1240

3 months agofix(systemd-repart): copy systemd system drop-in configuration
Jo Zzsi [Wed, 21 May 2025 12:52:06 +0000 (08:52 -0400)] 
fix(systemd-repart): copy systemd system drop-in configuration

Fixes https://github.com/dracut-ng/dracut-ng/issues/1328

3 months agodocs: range 90 - 99 are reserved for out of tree dracut modules
Jo Zzsi [Thu, 22 May 2025 12:44:05 +0000 (08:44 -0400)] 
docs: range 90 - 99 are reserved for out of tree dracut modules

Document the new feature introduced by 2199846 .

3 months agotest: fix the dlopen dependencies test on Gentoo
James Le Cuirot [Fri, 23 May 2025 21:53:26 +0000 (22:53 +0100)] 
test: fix the dlopen dependencies test on Gentoo

systemd needs to have fido2 support enabled at build time for the dlopen
dependency to be present.

Closes: https://github.com/dracut-ng/dracut-ng/issues/1347
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
3 months agotest: omit fido2 module when testing dlopen dependencies support
James Le Cuirot [Fri, 23 May 2025 21:51:44 +0000 (22:51 +0100)] 
test: omit fido2 module when testing dlopen dependencies support

We check whether libfido2.so.1 is included, but we want it to be because
of systemd's dlopen dependency, not because of the fido2 Dracut module.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
3 months agofeat: set hostonly_cmdline config to no by default
Jo Zzsi [Sun, 18 May 2025 16:30:52 +0000 (12:30 -0400)] 
feat: set hostonly_cmdline config to no by default

This is already the default on Fedora, see

https://github.com/dracut-ng/dracut-ng/blob/main/dracut.conf.d/fedora.conf.example#L44

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1326
3 months agoci: fix integration extra
Jo Zzsi [Wed, 21 May 2025 01:35:33 +0000 (21:35 -0400)] 
ci: fix integration extra

Resolve CI regression introduced by cba9e77 .

3 months agofix(modules): all modules with 99 ordering should have a unique number
Jo Zzsi [Sun, 18 May 2025 11:43:15 +0000 (07:43 -0400)] 
fix(modules): all modules with 99 ordering should have a unique number

This PR does not change the ascending sort order of the modules.

Partially resolve https://github.com/dracut-ng/dracut-ng/issues/538#issuecomment-2487284279

3 months agofix(dracut.sh): don't pass empty string as dir
David Tardon [Tue, 20 May 2025 07:31:52 +0000 (09:31 +0200)] 
fix(dracut.sh): don't pass empty string as dir

That causes dropindirs_sort() to look for .conf files in / due to
expansion:

    for d in "$@"; do
        for i in "$d/"*"$suffix"; do

Fixes #1275