]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
7 hours agofix(74nvmf): set root=nvmf main
Tomas Bzatek [Tue, 24 Jun 2025 14:50:31 +0000 (16:50 +0200)] 
fix(74nvmf): set root=nvmf

In a restricted image like kdump the kernel commandline argument root=
is typically absent. However it is required by the 45net-lib/netroot.sh
module that fails with:

    [   23.599862] dracut: FATAL: No or empty root= argument
    [   23.604956] dracut: Refusing to continue

Inspired by the 74iscsi module, let's set it to root=nvmf if not set
before.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2 days agofix(UKI): explicitly specify '--uname'
Vitaly Kuznetsov [Mon, 18 Aug 2025 13:24:20 +0000 (15:24 +0200)] 
fix(UKI): explicitly specify '--uname'

When '--uname' is not passed to 'ukify' it uses an autodetection mechanism
which is "hacky as hell" (see systemd commit 483c9c1b8a) and there's

 Kernel version not specified, starting autodetection ðŸ˜–.

in the log. In some cases autodetection fails. As dracut has the required
information already, there's no need to use it at all.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
2 days agofeat(dracut): make hostonly the default
Jo Zzsi [Thu, 14 Aug 2025 23:48:10 +0000 (19:48 -0400)] 
feat(dracut): make hostonly the default

Hostonly is already the default in the last dracut release,
but the default was set as a configuration file.

This commit changes that and sets the default inside the dracut.sh
script (unless of course a distribution or user overrides the default).

The hostonly configuration file is kept intentionally, but it is now
not used by the configure option by default.

4 days agoci(alpine): add networkmanager-initrd-generator package
Jo Zzsi [Sun, 24 Aug 2025 15:17:57 +0000 (11:17 -0400)] 
ci(alpine): add networkmanager-initrd-generator package

NETWORK test now would pass on alpine as long as
networkmanager-initrd-generator is installed.

This commit would expand test coverage for network-manager
dracut module.

Dowstream alpine maintains a dracut-tests package the
already does a good job installing dracut test dependencies
including networkmanager-initrd-generator.

Let's rely on dracut-tests package to further reduce
the need to maintain alpine package lists here upstream.

See https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/dracut/APKBUILD

5 days agotest: remove unmaintained tests MULTINIC and BONDBRIDGEVLAN
Jo Zzsi [Sun, 24 Aug 2025 04:12:42 +0000 (00:12 -0400)] 
test: remove unmaintained tests MULTINIC and BONDBRIDGEVLAN

These tests are always skipped in all CI containers as they
no longer pass. These tests require network-legacy and in some
cases ifcfg and nobody stepped up to modernize them for years.

Since the tests are in revision history, iof someone step up
to maintain these tests, the project can easily bring them back.

5 days agofix(resume): avoid matching extra resume= substrings in cmdline
Alexander Zubkov [Sun, 31 Aug 2025 08:12:38 +0000 (10:12 +0200)] 
fix(resume): avoid matching extra resume= substrings in cmdline

`grep ... 'resume='` matches not only 'resume' parameter, but any alike
substring. It could be other parameter ending in 'resume' or even parameter
value. The presense of those could fail the module setup.
Fix it by checking for a space or the beginning of a line.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1595
Signed-off-by: Alexander Zubkov <green@qrator.net>
5 days agofix(dracut-systemd): avoid matching extra root= substrings in cmdline
Alexander Zubkov [Sun, 31 Aug 2025 07:50:29 +0000 (09:50 +0200)] 
fix(dracut-systemd): avoid matching extra root= substrings in cmdline

`strstr ... 'root='` matches not only 'root' parameter, but any alike
substring. It could be other parameter ending in 'root', for example
'cryto_root=' or even parameter value. The presense of those in cmdline
could fail the boot process.
Fix it by adding a space in front of the matched string.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1595
Signed-off-by: Alexander Zubkov <green@qrator.net>
5 days agofix(systemd-sysusers): increase ordering from 68 to 78
Jo Zzsi [Sun, 31 Aug 2025 01:45:52 +0000 (21:45 -0400)] 
fix(systemd-sysusers): increase ordering from 68 to 78

This module should be orders afer all modules that depends on it

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

This rule is already documented in the module-setup.sh file
but was not followed for all modules.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1610
5 days agofix: ignore shellcheck SC2329 in addition to SC2317
Benjamin Drung [Wed, 13 Aug 2025 10:33:12 +0000 (12:33 +0200)] 
fix: ignore shellcheck SC2329 in addition to SC2317

Shellcheck <= 0.10 complains about SC2317 (info): Command appears to be
unreachable. Check usage (or ignore if invoked indirectly). Shellcheck
0.11 changes this complaint to SC2329 (info): This function is never
invoked. Check usage (or ignored if invoked indirectly).

So ignore shellcheck SC2329 in addition to SC2317 to make both
shellcheck versions happy.

5 days agofix(dm,dmraid): shellcheck SC2268
Benjamin Drung [Wed, 13 Aug 2025 10:27:27 +0000 (12:27 +0200)] 
fix(dm,dmraid): shellcheck SC2268

Shellcheck 0.11 complains about SC2268 (style): Avoid x-prefix in
comparisons as it no longer serves a purpose.

5 days agodocs: update minimal versions in the compatibility table
Jo Zzsi [Fri, 15 Aug 2025 16:24:43 +0000 (12:24 -0400)] 
docs: update minimal versions in the compatibility table

Now that the minimal supported version is Debian 13, let's
update the corresponding developer documentation.

5 days agoci: switching the main CI to ubuntu:devel from ubuntu:rolling
Jo Zzsi [Sun, 31 Aug 2025 01:31:20 +0000 (21:31 -0400)] 
ci: switching the main CI to ubuntu:devel from ubuntu:rolling

Switch the main CI to ubuntu:devel as it seems more stable and
more forward looking at this time.

Continue to test ubuntu:rolling as part of Daily Integration test.

This commit does not change the test coverage - it just changes
to run tests on ubuntu:devel more frequently.

5 days agoci(gentoo): install networkmanager when systemd is not installed
Jo Zzsi [Sun, 31 Aug 2025 01:59:19 +0000 (21:59 -0400)] 
ci(gentoo): install networkmanager when systemd is not installed

network-manager dracut module no longer depends on the systemd
dracut module.

Alpine and Void CI containers have switched over to networkmanager
networking already.

Let's install networkmanager into the Gentoo CI container as well.

5 days agotest: run-qemu requires initrd argument to be last
Jo Zzsi [Sun, 24 Aug 2025 04:05:46 +0000 (00:05 -0400)] 
test: run-qemu requires initrd argument to be last

If initrd argument is not last the following is seen in the test case run:

```
getopt: invalid option -- 'd'
getopt: invalid option -- 'a'
getopt: invalid option -- 'e'
getopt: invalid option -- 'o'
getopt: invalid option -- 'n'
getopt: invalid option -- 'i'
getopt: invalid option -- 'z'
getopt: invalid option -- 'e'
Usage: lsinitrd [options] [<initramfs file> [<filename> [<filename> [...] ]]]
```

7 days agochore(deps): bump actions/upload-pages-artifact from 3 to 4
dependabot[bot] [Wed, 27 Aug 2025 04:48:19 +0000 (04:48 +0000)] 
chore(deps): bump actions/upload-pages-artifact from 3 to 4

Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
7 days agochore(deps): bump actions/checkout from 4 to 5
dependabot[bot] [Fri, 15 Aug 2025 23:33:35 +0000 (23:33 +0000)] 
chore(deps): bump actions/checkout from 4 to 5

Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
7 days agoci(debian): install 3cpio on Debian and Ubuntu
Benjamin Drung [Fri, 22 Aug 2025 22:55:41 +0000 (00:55 +0200)] 
ci(debian): install 3cpio on Debian and Ubuntu

In preparation for supporting 3cpio, install it on the Debian and Ubuntu
containers (except Debian stable where 3cpio is not available).

10 days agoci: increase test coverage by not forcing additional config
Jo Zzsi [Sun, 24 Aug 2025 15:24:53 +0000 (11:24 -0400)] 
ci: increase test coverage by not forcing additional config

Test suite should also strip if it is enabled in the CI test
container. Make the test case less opinionated to increase
tests coverage.

2 weeks agofix(dracut): use "-name" to avoid find matching temporary directory
Deli Zhang [Mon, 18 Aug 2025 01:41:10 +0000 (01:41 +0000)] 
fix(dracut): use "-name" to avoid find matching temporary directory

$initdir includes a temporary directory, and the "-path" option of
find attempts to match the entire path. If the temporary directory
happens to contain ".ko", e.g.
  initdir=/var/tmp/dracut.ko79pT/initramfs
this can lead to a incorrect match, finally all executable files are
excluded.

Signed-off-by: Deli Zhang <deli.zhang@cloud.com>
2 weeks agofix(dracut): decrease logging by default
Jo Zzsi [Fri, 15 Aug 2025 16:03:23 +0000 (12:03 -0400)] 
fix(dracut): decrease logging by default

The current default set in dracut is "4". All distributions
(except Debian), sets the default to "3".

Instead of relying on good defaults only within distribution
configurations, let's set the dracut default to be less verbose.

Most users new to dracut perceive the verbose dracut logs as errors.
This change will help prevent and eliminate user confusion and improve
the user experience.

3 weeks agoci: introduce networking tests into Daily integration tests
Jo Zzsi [Fri, 15 Aug 2025 16:42:27 +0000 (12:42 -0400)] 
ci: introduce networking tests into Daily integration tests

The newly introduced NETWORK test case is simple enough to run on all
available dracut network modules. Let's use Debian and Arch only for
now to keep the test matrix small.

3 weeks agofix(debian): lower the ordering number for debian conf
Jo Zzsi [Fri, 15 Aug 2025 16:30:08 +0000 (12:30 -0400)] 
fix(debian): lower the ordering number for debian conf

All other distribution config files (Fedora, openSUSE) has the
ordering number 01, except Debian.

The path of least resistance is to align Debian conf file as well
and number it 01.

3 weeks agoci: remove kernel command line workarounds from test config
Jo Zzsi [Fri, 15 Aug 2025 20:14:26 +0000 (16:14 -0400)] 
ci: remove kernel command line workarounds from test config

This commit makes the test suite runs less opinionated and
closer to actual users environment.

Some of these workarounds have been added to the CI as patch work,
this is a good time to reevaluate if these are still needed.

3 weeks agofix(man): move the documentation hostonly and hostonly_mode variables
Jo Zzsi [Fri, 15 Aug 2025 10:37:41 +0000 (06:37 -0400)] 
fix(man): move the documentation hostonly and hostonly_mode variables

Move the documentation block to the man pages.

3 weeks agofix(man): expand the documentation for hostonly-cmdline
Jo Zzsi [Fri, 15 Aug 2025 11:13:52 +0000 (07:13 -0400)] 
fix(man): expand the documentation for hostonly-cmdline

Explained that it is up to each dracut module what cmdline
arguments get generated.

Explained that bootloader cmdline arguments have priority over
dracut generated cmdline arguments inside the initrd.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1536
3 weeks agofix(ubuntu): set DISTRIBUTION when building container
Jo Zzsi [Fri, 15 Aug 2025 14:03:03 +0000 (10:03 -0400)] 
fix(ubuntu): set DISTRIBUTION when building container

The containers built with as part of container-extra GA set
DISTRIBUTION variable when when building container.

Do the same for the container GA to make sure that ubuntu:rolling
container is properly built.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1581
3 weeks agoci: add arm testing to the integration testsuite for each PR
Jo Zzsi [Fri, 15 Aug 2025 01:00:16 +0000 (21:00 -0400)] 
ci: add arm testing to the integration testsuite for each PR

Currently PRs are not tested on arm - only an extended
tessuite that runs once a day run some arm tests.

Let's run at least the basic tests on arm for each PR.

3 weeks agotest: do not force set hostonly_cmdline to no
Jo Zzsi [Sat, 9 Aug 2025 14:26:03 +0000 (10:26 -0400)] 
test: do not force set hostonly_cmdline to no

hostonly_cmdline=yes is not tested by the CI as CI force sets it to
no.

Make the test case less opinionated and go with the distribution
default configuration, to test both hostonly_cmdline set to no and yes.

3 weeks agofix(debian.conf): re-enable hostonly_cmdline
Jo Zzsi [Fri, 15 Aug 2025 11:17:18 +0000 (07:17 -0400)] 
fix(debian.conf): re-enable hostonly_cmdline

Do not set hostonly_cmdline to no for Debian-based distributions
and let dracut modules store generated cmdline inside the initrd.

Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1103457
3 weeks agofeat(configure): autoconfigure configprofile
Jo Zzsi [Sun, 10 Aug 2025 12:20:09 +0000 (08:20 -0400)] 
feat(configure): autoconfigure configprofile

The original motivation of this PR was to set the openSUSE config
inside the openSUSE CI container.

This commit will autoconfigure those configprofiles that are
maintained upstream for fedora, debian and opensuse based distro's.

One notable change from this commit is that it would now allow testing
hostonly_cmdline=yes configuration which is currently untested
on the CI.

3 weeks agotest(NETWORK): remove the hostonly_mode=sloppy workaround
Jo Zzsi [Tue, 12 Aug 2025 02:47:52 +0000 (22:47 -0400)] 
test(NETWORK): remove the hostonly_mode=sloppy workaround

The test now passes regardless of the value of hostonly_mode.

3 weeks agofix(network-manager): load required kernel modules
Jo Zzsi [Tue, 12 Aug 2025 03:02:05 +0000 (23:02 -0400)] 
fix(network-manager): load required kernel modules

network-manager always requires nf_tables and other kernel modules
in the generated initramfs to function, regardless if these
modules are loaded on the host or not at the time of initramfs
generation.

3 weeks agofix(net-lib): always include af_packet
Jo Zzsi [Sat, 9 Aug 2025 22:24:32 +0000 (18:24 -0400)] 
fix(net-lib): always include af_packet

For static IPv4 configurations, we use arping to check for duplicate
IP addresses. arping requires the af_packet module to work, and if arping
fails, the IP address will not be set and booting will fail.
af_packet may not be loaded / required in the running system, for example if
the system had been booted in an IPv6 configuration, or if it had been
manually unloaded. Make sure it's included in initramfs in hostonly mode, too.

Follow-up to b0742165e1fec168 and to de862885e .

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1437
3 weeks agochore: always set hostonly and hostonly_mode
Jo Zzsi [Sat, 2 Aug 2025 23:08:44 +0000 (19:08 -0400)] 
chore: always set hostonly and hostonly_mode

It makes it easier to reason both for built-in and out-of-tree dracut
modules with the assumption that hostonly and hostonly_mode variables
are always set.

Document most commonly used shell variables for dracut modules and
document that they are always set.

Partial revert of c85c93245bf .

3 weeks agorevert(efaee44): hostonly_cmdline should continue to default to yes
Jo Zzsi [Tue, 12 Aug 2025 11:17:52 +0000 (07:17 -0400)] 
revert(efaee44): hostonly_cmdline should continue to default to yes

Despite the Fedora setting, let's keep the default to yes
for distributions that do not whish to overwrite the default.

3 weeks agofix(dracut-install): broken calls to mmap with 0 length
James Le Cuirot [Tue, 12 Aug 2025 09:15:58 +0000 (10:15 +0100)] 
fix(dracut-install): broken calls to mmap with 0 length

This results in an invalid argument error, so check for 0 length first.

Fixes: https://bugs.gentoo.org/961340
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
3 weeks agofix(debian): remove Debian 12 support
Jo Zzsi [Sat, 2 Aug 2025 17:40:55 +0000 (13:40 -0400)] 
fix(debian): remove Debian 12 support

Debian v13 (Trixie) is now the minimal Debian version supported
by the CI.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1458
3 weeks agofix(lsinitrd): avoid rechecking for squash images
Benjamin Drung [Mon, 11 Aug 2025 12:01:23 +0000 (14:01 +0200)] 
fix(lsinitrd): avoid rechecking for squash images

The function `extract_squash_img` uses `SQUASH_TMPDIR` to check that it
was already called but did not find any squash image.

Instead of setting `SQUASH_TMPDIR` `SQUASH_TMPFILE` was set and
therefore the cpio file is searched again on every `extract_squash_img`
call.

3 weeks agofix(Makefile): use install for installing files
Benjamin Drung [Tue, 5 Aug 2025 17:16:17 +0000 (19:16 +0200)] 
fix(Makefile): use install for installing files

The `cp` command will copy the file/directory permissions from the
source files. The local source files might have group write permission
set which should not be applied to the installation.

Tighten the file/directory permission by using the `install` command
with specifying the mode.

3 weeks agorefactor(lsinitrd): introduce cpio_list function
Benjamin Drung [Wed, 6 Aug 2025 17:50:49 +0000 (19:50 +0200)] 
refactor(lsinitrd): introduce cpio_list function

In preparation to support 3cpio as alternative archive tool, move the
cpio listing call into `cpio_list`.

3 weeks agorefactor(lsinitrd): introduce cpio_extract_to_stdout function
Benjamin Drung [Wed, 6 Aug 2025 17:50:08 +0000 (19:50 +0200)] 
refactor(lsinitrd): introduce cpio_extract_to_stdout function

In preparation to support 3cpio as alternative archive tool, move the
cpio extraction to stdout call into `cpio_extract_to_stdout`.

3 weeks agorefactor(lsinitrd): introduce cpio_extract function
Benjamin Drung [Wed, 6 Aug 2025 16:57:15 +0000 (18:57 +0200)] 
refactor(lsinitrd): introduce cpio_extract function

In preparation to support 3cpio as alternative archive tool, move the
cpio extraction call into `cpio_extract`.

3 weeks agofix(kernel-modules): add Cadence USB driver to base
Benjamin Drung [Thu, 31 Jul 2025 19:45:17 +0000 (21:45 +0200)] 
fix(kernel-modules): add Cadence USB driver to base

Installed Debian Trixie d-i rc2 (dvd-1) on USB storage on Pine64 Star64
is not bootable due to missing modules `cdns3_starfive` and `cdns3` from
initramfs.

Note the above USB support on Pine64 Star64 is directly part of StarFive
JH7110 CPU and differs from StarFive VisionFive2 which uses an external
controller attached to the PCIe bus.

Bug-Debian: https://bugs.debian.org/1108924

3 weeks agofix(systemd-portabled, initqueue): enable systemd type units
Jo Zzsi [Sun, 10 Aug 2025 17:55:08 +0000 (13:55 -0400)] 
fix(systemd-portabled, initqueue): enable systemd type units

Use systemctl enable command (instead of add-wants command) to
enable systemd type units.

Without these changes the following error message is seen on
TEST-FULL-SYSTEMD:

```
Failed to add dependency on unit: Unit initrd.target does not exist
Failed to add dependency on unit: Unit initrd.target does not exist
```

3 weeks agotest(KERNEL-INSTALL): config path for test dracut config
Jo Zzsi [Sun, 10 Aug 2025 11:30:29 +0000 (07:30 -0400)] 
test(KERNEL-INSTALL): config path for test dracut config

The path for test dracut config has changed. Fix it.

3 weeks agotest(NETWORK): coverage for bringing up network interface
Jo Zzsi [Sun, 13 Jul 2025 05:35:51 +0000 (01:35 -0400)] 
test(NETWORK): coverage for bringing up network interface

Currently, all networking tests in the dracut CI require a client and a
server VM, and all the server VMs are enabled to work with network-legacy only.

Introduce a simpler networking test that tests the rd.neednet dracut
boot time argument and ensures that the interface is up without needing
a server VM.

This simple networking test could be run in most networking configurations
and pass in the Void test containers as well, which previously have not had
any network tests enabled.

3 weeks agotest: remove leftover comment
Jo Zzsi [Sun, 10 Aug 2025 10:55:20 +0000 (06:55 -0400)] 
test: remove leftover comment

The 'install the files needed to make the root filesystem' comment
no longer adds value to the understanding of the test cases.
Remove it.

3 weeks agofix(systemd-sysext): skip manual systemct enablement for systemd>=258
Vitaly Kuznetsov [Mon, 11 Aug 2025 09:36:41 +0000 (11:36 +0200)] 
fix(systemd-sysext): skip manual systemct enablement for systemd>=258

systemd-258 ships the required initrd.target.wants symlinks, there is
no need to enable services manually. Use the existence of old
systemd-confext/systemd-sysext units as an indication of when manual
(legacy) enablement is still needed.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
3 weeks agofix(systemd-sysext): package initrd.target.wants symlinks
Vitaly Kuznetsov [Mon, 11 Aug 2025 09:34:56 +0000 (11:34 +0200)] 
fix(systemd-sysext): package initrd.target.wants symlinks

Systemd-258 provides the 'initrd.target.wants' symlinks for systemd-confext/
systemd-sysext initrd services. Include them to the image when present.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
3 weeks agoci: remove testing with ubuntu:latest
Jo Zzsi [Sun, 10 Aug 2025 15:44:15 +0000 (11:44 -0400)] 
ci: remove testing with ubuntu:latest

ubuntu:latest could be as old as two years old, and, while testing with
debian:stable makes sense, testing with ubuntu:latest seems redundant.

Ubuntu is now well integrated with dracut and dracut usptream main no
longer needs to target (or backported) to ubuntu:latest.

3 weeks agofix(doc_site): remove reference to udev < 143
Jo Zzsi [Sun, 10 Aug 2025 23:04:43 +0000 (19:04 -0400)] 
fix(doc_site): remove reference to udev < 143

Let's keep the documentation fresh and do not reference an udev
version that is more than a decade old.

3 weeks agofix(dracut-install): the handling of absolute paths in sonames
James Le Cuirot [Fri, 8 Aug 2025 12:18:07 +0000 (13:18 +0100)] 
fix(dracut-install): the handling of absolute paths in sonames

If the soname is an absolute path, expand it like the RUNPATH, and
return it (with the sysroot) without further checks like glibc and musl
do.

They also support relative paths, but we cannot feasibly support them.
Such paths are relative to the current directory of the calling process
at runtime, which we cannot know in this context.

This was observed with Neovim.

Bug: https://bugs.gentoo.org/961101
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
3 weeks agofix(dracut-install): the RUNPATH expansion returning empty strings
James Le Cuirot [Fri, 8 Aug 2025 11:52:23 +0000 (12:52 +0100)] 
fix(dracut-install): the RUNPATH expansion returning empty strings

The input was not initially copied into the result, so the result would
start with a null pointer and be treated as an empty string. Expansion
will not occur in most cases, leading to a straight copy of input being
returned, so just do that in the first place.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
3 weeks agofix(dracut-install): the -n short option for --dry-run
James Le Cuirot [Fri, 8 Aug 2025 11:50:12 +0000 (12:50 +0100)] 
fix(dracut-install): the -n short option for --dry-run

I forgot to update the getopt call.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
3 weeks agofeat(dracut.sh): output error message for --regenerate-all
Pavel Valena [Thu, 29 May 2025 12:47:18 +0000 (14:47 +0200)] 
feat(dracut.sh): output error message for --regenerate-all

Without it, users might be confused on which initrd is failing.

3 weeks agofix(livenet): source img-lib.sh for check_live_ram
Jo Zzsi [Wed, 6 Aug 2025 11:15:27 +0000 (07:15 -0400)] 
fix(livenet): source img-lib.sh for check_live_ram

When livenetroot.sh is called and tries to find the check_live_ram()
function, livenetroot.sh cannot source from img-lib.sh.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1523
3 weeks agoci: adopt test configuration without test module
Jo Zzsi [Sat, 9 Aug 2025 19:25:08 +0000 (15:25 -0400)] 
ci: adopt test configuration without test module

Test module no longer exists. This is a follow-up to 4598998 .

3 weeks agofix(base): silence error log if shadow does not exists
Jo Zzsi [Sat, 2 Aug 2025 10:44:36 +0000 (06:44 -0400)] 
fix(base): silence error log if shadow does not exists

3 weeks agofix: make sure final hostonly value is computed before reading it
Jo Zzsi [Sat, 2 Aug 2025 16:53:50 +0000 (12:53 -0400)] 
fix: make sure final hostonly value is computed before reading it

hostonly variable is unset later in a later code block after
decisions are made based on the value of the hostonly variable
which is unexpected, hard to reason about and inconsistent.

Fix it by rearranging the order of execution of the code blocks.

3 weeks agotest: remove test module
Jo Zzsi [Thu, 31 Jul 2025 11:21:44 +0000 (07:21 -0400)] 
test: remove test module

test module can be simplified down to just a configuration file instead
as it no longer has its own additional scripts files that would
require a module.

This commit is an additional step to reinforce testing in a similar configuration
as actual end-user configuration.

3 weeks agotest(SYSTEMD-INITRD): be more careful with `set -e` and subshells
Frantisek Sumsal [Wed, 6 Aug 2025 14:22:34 +0000 (16:22 +0200)] 
test(SYSTEMD-INITRD): be more careful with `set -e` and subshells

When the condition in the subshell fails (i.e. none of the
dracut*.service files is found), it doesn't trigger shell exit due to
`set -e` as it's a part of a larger condition (&& ...), but since it's
the last command of that subshell, it sets the subshell error code to 1.
This is then treated by the parent shell as an error and the test is
incorrectly interrupted and marked as failed.

For comparison:

$ (set -ex; echo begin; (for f in dracut*.service; do [[ -e "$f" ]] && echo fail; done); echo end); echo $?
+ echo begin
begin
+ for f in dracut*.service
+ [[ -e dracut*.service ]]
1

$ (set -ex; echo begin; (for f in dracut*.service; do if [[ -e "$f" ]]; then echo nope; fi; done); echo end); echo $?
+ echo begin
begin
+ for f in dracut*.service
+ [[ -e dracut*.service ]]
+ echo end
end
0

Follow-up for 80350104949708c60806a255765e87d7b1d5a98c

3 weeks agotest: drop setting DRACUT_PATH
Benjamin Drung [Sat, 9 Aug 2025 16:54:33 +0000 (18:54 +0200)] 
test: drop setting DRACUT_PATH

Commit 2606f985d6f3 ("feat(dracut): drop DRACUT_PATH and rely on PATH")
removed the `DRACUT_PATH` variable. So `DRACUT_PATH` does not need to be
set in the tests any more.

3 weeks agofeat(dracut.conf.d): move examples into subdirectories
Benjamin Drung [Sat, 9 Aug 2025 16:55:11 +0000 (18:55 +0200)] 
feat(dracut.conf.d): move examples into subdirectories

Instead of shipping example configuration files that need to be
installed in the right place, move those configuration files into
configuration directories. Then they can be easily installed via a
configure option. Example: `./configure --configprofile=fedora`.

3 weeks agoci: enable SYSROOT test more to run on arm daily
Jo Zzsi [Sun, 25 May 2025 20:33:49 +0000 (16:33 -0400)] 
ci: enable SYSROOT test more to run on arm daily

The arm64 bot seems to be stable, lets add more tests.

3 weeks agotest(UEFI): remove version check test for kernel-install
Jo Zzsi [Thu, 17 Jul 2025 12:03:41 +0000 (08:03 -0400)] 
test(UEFI): remove version check test for kernel-install

The current way of checking the version of kernel-install is not
portable between distributions and it no longer adds any value to the CI.

Remove the version check to make it easier to reason about the
test run and enable this subtest in more test environments.

3 weeks agofix(dracut): do not call uname -r in chroot environments
Benjamin Drung [Mon, 4 Aug 2025 12:41:41 +0000 (14:41 +0200)] 
fix(dracut): do not call uname -r in chroot environments

Running dracut in a schroot environment (even with `systemd-detect-virt`
installed) will pick `uname -r` as kernel version despite that kernel
not being available.

So also check `systemd-detect-virt --chroot` before relying on
`uname -r`.

3 weeks agofeat(systemd-networkd): do not require bash
Benjamin Drung [Tue, 5 Aug 2025 08:41:54 +0000 (10:41 +0200)] 
feat(systemd-networkd): do not require bash

The systemd-networkd module ships `networkd-run.sh` that uses bash, but
there is no bash specific code inside this script. So drop the bash
requirement.

3 weeks agofix(hwdb): make module-setup.sh executable
Benjamin Drung [Tue, 5 Aug 2025 11:17:15 +0000 (13:17 +0200)] 
fix(hwdb): make module-setup.sh executable

The `module-setup.sh` scripts are shell scripts and should be
executable.

3 weeks agofeat(Makefile): introduce distclean target
Benjamin Drung [Mon, 4 Aug 2025 22:09:31 +0000 (00:09 +0200)] 
feat(Makefile): introduce distclean target

Add a `distclean` target to remove all generated files including the one
(`Makefile.inc`) created by `configure`. Calling `make distclean` should
have the same result as `git clean -fdx`.

3 weeks agofeat(Makefile): set Dracut version on install
Benjamin Drung [Mon, 4 Aug 2025 21:52:20 +0000 (23:52 +0200)] 
feat(Makefile): set Dracut version on install

Distributions can override `DRACUT_VERSION` or `DRACUT_FULL_VERSION` to
include the distribution's revision in the dracut version. This override
is not reflected in the installed `dracut-version.sh` and needs to be
modified by the distribution.

Persist the version in the installed `dracut-version.sh` during
`make install`.

3 weeks agotest: fix Linux kernel detection for qemu runs
Jo Zzsi [Sat, 2 Aug 2025 11:38:09 +0000 (07:38 -0400)] 
test: fix Linux kernel detection for qemu runs

Determine KVERSION from the generated initramfs for qemu runs.

Extend fallback detection even when KVERSION is specified.

3 weeks agofix(release): force push (for updating)
Benjamin Drung [Fri, 1 Aug 2025 19:13:27 +0000 (21:13 +0200)] 
fix(release): force push (for updating)

In case the `release` branch already exists, `tools/release.sh` will
fail instead of pushing an updated version.

3 weeks agotest(NFS): use of test dracut modules
Jo Zzsi [Sun, 3 Aug 2025 13:11:01 +0000 (09:11 -0400)] 
test(NFS): use of test dracut modules

Make use of test dracut modules and configuration and make the
test consistent with the rest of the CI.

3 weeks agotest(ISCSI-MULTI, NBD): reenable running these tests on the CI
Jo Zzsi [Fri, 8 Aug 2025 00:45:13 +0000 (20:45 -0400)] 
test(ISCSI-MULTI, NBD): reenable running these tests on the CI

3 weeks agofix(dracut-util): crash if CMDLINE ends with quotation mark
Benjamin Drung [Thu, 7 Aug 2025 16:04:01 +0000 (18:04 +0200)] 
fix(dracut-util): crash if CMDLINE ends with quotation mark

Sudhakar Verma from the Ubuntu security team found a memory corruption:

```
$ pwd
/tmp/dracut-ng/src/util
$ CC=clang-17 CXX=clang++-17 CFLAGS="-fsanitize=address" cmake .
-- The C compiler identification is Clang 17.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang-17 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/dracut-ng/src/util
$ CC=clang-17 CXX=clang++-17 CFLAGS="-fsanitize=address" make
[ 50%] Building C object CMakeFiles/dracut-util.dir/util.c.o
[100%] Linking C executable dracut-util
[100%] Built target dracut-util
$ ln -s $PWD/dracut-util dracut-getargs
$ ln -s $PWD/dracut-util dracut-getarg

$ CMDLINE=' "' ./dracut-getarg ' '
AddressSanitizer:DEADLYSIGNAL
=================================================================
==163118==ERROR: AddressSanitizer: SEGV on unknown address 0x50210000001d (pc 0x599a6b7d4c07 bp 0x7ffe44ea9ef0 sp 0x7ffe44ea9da0 T0)
==163118==The signal is caused by a READ memory access.
    #0 0x599a6b7d4c07 in next_arg util.c
    #1 0x599a6b7d3e75 in getarg util.c
    #2 0x599a6b7d3448 in main (/tmp/dracut-ng/src/util/dracut-util+0x108448) (BuildId: ea28a61b3c6dd0a75c505cd1749f8711779bd819)
    #3 0x72381be2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #4 0x72381be2a28a in __libc_start_main csu/../csu/libc-start.c:360:3
    #5 0x599a6b6f7304 in _start (/tmp/dracut-ng/src/util/dracut-util+0x2c304) (BuildId: ea28a61b3c6dd0a75c505cd1749f8711779bd819)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV util.c in next_arg
==163118==ABORTING
```

The variable `i` in `next_arg` is an unsigned integeter. `i - 1` will
result in an underflow in case `i` is 0.

4 weeks agoci(debian): install open-iscsi
Benjamin Drung [Wed, 6 Aug 2025 13:20:58 +0000 (15:20 +0200)] 
ci(debian): install open-iscsi

Install `open-iscsi` in the Debian/Ubuntu container which is needed in
the iscsi tests.

4 weeks agofix(test): make sure $1 is not read as an unbound variable
Jo Zzsi [Wed, 6 Aug 2025 11:41:58 +0000 (07:41 -0400)] 
fix(test): make sure $1 is not read as an unbound variable

Document generation fails on the CI as test-container.sh is called
with an empty $1.

Follow-up to 5c9230f.

4 weeks agofix(dracut): look for both vmlinuz and vmlinux for UKI creation
Jo Zzsi [Sat, 2 Aug 2025 15:58:57 +0000 (11:58 -0400)] 
fix(dracut): look for both vmlinuz and vmlinux for UKI creation

Dracut does not look for or find kernels named vmlinux-${kernel} in uefi mode.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1366
4 weeks agofix(dracut-init): remove the heuristic to determine fallback kernel version
Jo Zzsi [Sat, 19 Jul 2025 02:24:47 +0000 (22:24 -0400)] 
fix(dracut-init): remove the heuristic to determine fallback kernel version

If kernel version is not passed in the command line for a dracut invocation then
dracut.sh should be the only place where kernel version is determined.

Remove the heuristic to determine kernel version from dracut-init.sh.

4 weeks agofix(Makefile): remove the heuristic to determine fallback kernel version
Jo Zzsi [Sat, 19 Jul 2025 02:19:35 +0000 (22:19 -0400)] 
fix(Makefile): remove the heuristic to determine fallback kernel version

If kernel version is not passed in the command line for a dracut invocation
then dracut.sh should be the only place where kernel version is determined.

Remove the heuristic to determine kernel version from Makefile.

4 weeks agoci: disable running arm64 tests on Fedora
Jo Zzsi [Thu, 3 Jul 2025 12:33:46 +0000 (08:33 -0400)] 
ci: disable running arm64 tests on Fedora

If CI is not kept green, than it is hard to separate regressions
caused by PRs from regressions not caused by PRs.

The primary purpose of the CI is to help contributors to highlight
regressions caused by PRs. Leaving tests broken caused by
changes in distributions and not by dracut changes would make it
harder to contribute to dracut.

Ideally we want to respond changes in distributions,                                                                                                                                                                                  but for this the project is leaning on specific
Linux distribution contributors (Fedora in this case)                                                                                                                                                                                 to help out who are more familiar with distribution
specific regressions and changes.

Issue filed https://github.com/dracut-ng/dracut-ng/issues/1406

4 weeks agofeat(network-manager): remove support for ifcfg-rh
Jo Zzsi [Sat, 28 Jun 2025 17:41:28 +0000 (13:41 -0400)] 
feat(network-manager): remove support for ifcfg-rh

This commit removes the dracut module for the NetworkManager fcfg-rh
plugin (`nm-fcfg-rh`), effectively discontinuing its support within dracut.

The `fcfg-rh` plugin for NetworkManager provides backward compatibility
with the legacy `ifcfg` network configuration format.
This format, traditionally found in `/etc/sysconfig/network-scripts/`,
was the standard method for configuring network interfaces on Red Hat-based
distributions for many years. It relies on a collection of shell-script-like
files to define network connections.

While functional for basic configurations, the `ifcfg` format has several
limitations in the context of modern networking and the capabilities of NetworkManager.

The removal of the `nm-fcfg-rh` support from dracut is a forward-looking change
that aligns with the broader trend in the Linux ecosystem to modernize network configuration.
The key reasons for this decision are as follows:

* **Deprecation by Upstream and Distributions:**
The `fcfg-rh` plugin is considered deprecated by the NetworkManager project
and major Linux distributions, such as Fedora and its derivatives.
These distributions are actively migrating users away from the legacy `ifcfg` format
in favor of the more robust `keyfile` format.

See https://networkmanager.dev/docs/api/latest/nm-settings-ifcfg-rh.html.

4 weeks agochore: remove dead code that is no longer expected to be executed
Jo Zzsi [Sat, 2 Aug 2025 15:44:26 +0000 (11:44 -0400)] 
chore: remove dead code that is no longer expected to be executed

/lib/modules should always exists, which is consistent with the
assumptions made in the rest of the dracut mode.

4 weeks agotest: use "set -u" in in test-container.sh
Jo Zzsi [Sat, 2 Aug 2025 17:30:43 +0000 (13:30 -0400)] 
test: use "set -u" in in test-container.sh

To make testing more robust, use `set -u`.

4 weeks agofix(dracut.sh,lsinitrd.sh): use obj{copy,dump} set by toolchain
Nowa Ammerlaan [Sun, 13 Jul 2025 14:40:38 +0000 (16:40 +0200)] 
fix(dracut.sh,lsinitrd.sh): use obj{copy,dump} set by toolchain

If dracut is invoked in a context where the toolchain is configured
to use a certain objcopy implementation, use that one. This may be
the case if dracut is invoked via systemd's kernel-install in a
Gentoo ebuild on a llvm-only system.

Closes: https://github.com/dracut-ng/dracut-ng/issues/1424
Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org>
4 weeks agofix(btrfs): write cmdline in install()
Antonio Alvarez Feijoo [Fri, 1 Aug 2025 07:11:38 +0000 (09:11 +0200)] 
fix(btrfs): write cmdline in install()

This fixes the build with `--kernel-only` option.

```
$ dracut -f --kernel-only
...
dracut[I]: *** Including module: btrfs ***
/usr/lib/dracut/modules.d/90btrfs/module-setup.sh: line 35: /var/tmp/dracut.dqV4ugj/initramfs/etc/cmdline.d/00-btrfs.conf: No such file or directory
```

4 weeks agodocs(release): document how to create release tag
Benjamin Drung [Mon, 4 Aug 2025 10:54:10 +0000 (12:54 +0200)] 
docs(release): document how to create release tag

Document how to create release tag in `tools/release.sh`.

4 weeks agoci(opensuse.conf.example): change log levels
Antonio Alvarez Feijoo [Mon, 4 Aug 2025 07:47:58 +0000 (09:47 +0200)] 
ci(opensuse.conf.example): change log levels

Upstream new log levels in openSUSE, present in Tumbleweed since
snapshot 20250612. Reduce default standard log verbosity from `info` to
`warning`, and increase syslog verbosity from none to `info`.

4 weeks agodocs: update NEWS.md and AUTHORS for release 108 108
dracutng[bot] [Fri, 1 Aug 2025 19:17:43 +0000 (19:17 +0000)] 
docs: update NEWS.md and AUTHORS for release 108

5 weeks agofeat(Makefile): explicitly list configs to install
Benjamin Drung [Thu, 31 Jul 2025 16:15:39 +0000 (18:15 +0200)] 
feat(Makefile): explicitly list configs to install

Instead of copying all configuration files in `dracut.conf.d`, copy the
wanted files explicitly. Install all configuration files that could be
useful for `--confdir`/`--add-confdir`, but exclude the distribution
configuration examples.

Move the Dracut test configurations back to `dracut.conf.d`.

5 weeks agotest: eliminate redundant code by eliminating determine_kernel_version
Jo Zzsi [Sun, 20 Jul 2025 15:11:26 +0000 (11:11 -0400)] 
test: eliminate redundant code by eliminating determine_kernel_version

Both dracut and determine_kernel_version contains a similar code block
for determining linux kernel version.

Instead of duplicating code, let dracut compute the kernel version and
call lsinitrd on the generated initramfs to determine the kernel
version for testing as well.

remove unbound KVERSION variable.

5 weeks agotest: extract KVERSION from the generated initramfs
Jo Zzsi [Sun, 20 Jul 2025 17:53:49 +0000 (13:53 -0400)] 
test: extract KVERSION from the generated initramfs

Use lsinitrd to list the files of the generated initramfs and extract
the the KVERSION that was computed by the dracut call.

5 weeks agofeat: add Debian/Ubuntu specific Dracut configuration
Benjamin Drung [Wed, 30 Jul 2025 14:21:15 +0000 (16:21 +0200)] 
feat: add Debian/Ubuntu specific Dracut configuration

Add the Debian/Ubuntu specific Dracut configuration, but do not install
this configuration by default. It is meant to be used via
`./configure --configprofile debian` during Debian/Ubuntu package build.

5 weeks agochore: rename suse.conf.example to opensuse.conf.example
Jo Zzsi [Sat, 19 Jul 2025 11:24:26 +0000 (07:24 -0400)] 
chore: rename suse.conf.example to opensuse.conf.example

opensuse is a more inclusive and more appropriate name for this
example file.

5 weeks agotest(SYSROOT): always run it in hostonly mode
Jo Zzsi [Wed, 30 Jul 2025 16:52:54 +0000 (12:52 -0400)] 
test(SYSROOT): always run it in hostonly mode

The recent addition of root password test coverage only passing in
hostonly mode. For now turn this test into hostonly test, as it does not
reduce test coverage significantly (BASIC test is running a similar test
without forcing hostonly).

5 weeks agodocs: switch to asciidoctor for man generation, with fallback
Ian Wienand [Tue, 29 Jul 2025 12:36:20 +0000 (14:36 +0200)] 
docs: switch to asciidoctor for man generation, with fallback

lintian complains about the man pages in the Debian/Ubuntu package. The
following warnings are only present when building the man pages with
asciidoc and they will be fixed by using asciidoctor:

```
W: dracut-core: groff-message troff:<standard input>:183: warning: macro 'an-trap' not defined [usr/share/man/man8/dracut.8.gz:1]
W: dracut-core: groff-message troff:<standard input>:537: warning: macro 'an-trap' not defined [usr/share/man/man7/dracut.cmdline.7.gz:1]
W: dracut-core: groff-message troff:<standard input>:537: warning: macro 'an-trap' not defined [usr/share/man/man7/dracut.kernel.7.gz:1]
W: dracut-core: groff-message troff:<standard input>:68: warning: macro 'an-trap' not defined [usr/share/man/man7/dracut.modules.7.gz:1]
W: dracut-core: groff-message troff:<standard input>:72: warning: macro 'an-trap' not defined [usr/share/man/man5/dracut.conf.5.gz:1]
```

Other projects like git use asciidoctor.

This switches the man page generator to asciidoctor, with a fallback option to
configure to use the existing asciidoc/docbook path.

The reason to do this is to consolidate the published site generation and man
page generation around asciidoctor.  With that in place, we can use some
asciidoctor features like extensions to better link the man pages together, or
provide other tweaks to the documentation.

This switches the default generation to asciidoctor, but adds a
--disable-asciidoctor switch as a temporary escape hatch for packagers.

The testing is converted to asciidoctor, with an additional test of the
asciidoc toolchain just to avoid major regressions there.

5 weeks agoci(suse.conf.example): set openSUSE-specific initrdname
Antonio Alvarez Feijoo [Wed, 30 Jul 2025 12:39:37 +0000 (14:39 +0200)] 
ci(suse.conf.example): set openSUSE-specific initrdname

5 weeks agofix(dracut-initramfs-restore): check for Debian initrd.img symlink
Benjamin Drung [Tue, 29 Jul 2025 18:59:45 +0000 (20:59 +0200)] 
fix(dracut-initramfs-restore): check for Debian initrd.img symlink

In case no initrd was found for the kernel version, also check the the
symlinks `/boot/initrd.img` (for Ubuntu) and `/initrd.img` (for Debian).

5 weeks agotest: use "set -u" in all tests
Benjamin Drung [Wed, 11 Jun 2025 18:05:07 +0000 (20:05 +0200)] 
test: use "set -u" in all tests

To make all tests more robust, use `set -u` in all tests.

5 weeks agotest: initialize variables for dracut-init.sh
Benjamin Drung [Mon, 16 Jun 2025 08:54:52 +0000 (10:54 +0200)] 
test: initialize variables for dracut-init.sh

dracut-init.sh sources dracut-functions.sh which expect several
variables to be specified when sourced. dracut.sh sets those variables.