]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
11 months agofix(nvmf): require NVMeoF modules
Martin Wilck [Fri, 6 Sep 2024 11:36:41 +0000 (13:36 +0200)] 
fix(nvmf): require NVMeoF modules

Signed-off-by: Martin Wilck <mwilck@suse.com>
11 months agofeat(systemd): always install libsystemd libraries
Antonio Alvarez Feijoo [Tue, 10 Sep 2024 13:51:46 +0000 (15:51 +0200)] 
feat(systemd): always install libsystemd libraries

11 months agofix(dracut): do not add all lib subdirs to `LD_LIBRARY_PATH` with `--sysroot`
Mike Schwarz [Tue, 10 Sep 2024 13:51:04 +0000 (15:51 +0200)] 
fix(dracut): do not add all lib subdirs to `LD_LIBRARY_PATH` with `--sysroot`

On systems with too many library subdirectories, the current approach causes
`Argument list too long` errors, and the initrd also fails to build.

This patch does not fix the original issue by itself (i.e., libsystemd libs not
found), so all the dracut modules that require libraries stored in
subdirectories must explicitly install them using `inst_libdir_file`, which
already successfully handles the `--sysroot` prefix.

Fixes e0b876823d9c608db7132cab9e5edd62543a27ae

Co-authored-by: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
11 months agofix(dracut-install): use correct data type for pid
Marcos Mello [Tue, 10 Sep 2024 19:58:15 +0000 (16:58 -0300)] 
fix(dracut-install): use correct data type for pid

11 months agotest: continue to force network-legacy for server when needed
Jo Zzsi [Mon, 2 Sep 2024 18:41:27 +0000 (14:41 -0400)] 
test: continue to force network-legacy for server when needed

This change allows us to address the remaining test issues one by one.

11 months agorevert(test): network dracut package needs to be added with '-a'
Jo Zzsi [Mon, 2 Sep 2024 17:46:39 +0000 (13:46 -0400)] 
revert(test): network dracut package needs to be added with '-a'

reverts 7445b72a7e6e2435d5af39d26e61c960612f4c85

11 months agofix(network): handle '-m network'
Jo Zzsi [Mon, 2 Sep 2024 17:33:59 +0000 (13:33 -0400)] 
fix(network): handle '-m network'

call module_check instead of check_module

11 months agoci: run tests in verbose mode for Ubuntu
Jo Zzsi [Tue, 10 Sep 2024 01:21:13 +0000 (21:21 -0400)] 
ci: run tests in verbose mode for Ubuntu

Ubuntu is the most active supporting verbose test configuration and
running tests in V=2 mode downstream.

11 months agoci: remove mksh as there is no longer a dracut module supporting it
Jo Zzsi [Tue, 10 Sep 2024 01:19:59 +0000 (21:19 -0400)] 
ci: remove mksh as there is no longer a dracut module supporting it

11 months agoci: install mkosi into a few containers to be able to use it for tests
Jo Zzsi [Tue, 10 Sep 2024 01:18:19 +0000 (21:18 -0400)] 
ci: install mkosi into a few containers to be able to use it for tests

mkosi-initrd is a portable way to create a reference initrd and compare
it to the output of dracut generated initrd.

11 months agoci: make container file names and tag names consistent
Jo Zzsi [Sun, 8 Sep 2024 15:32:35 +0000 (11:32 -0400)] 
ci: make container file names and tag names consistent

11 months agoci: python3-pefile is a dependency for ukify
Jo Zzsi [Sun, 8 Sep 2024 15:13:19 +0000 (11:13 -0400)] 
ci: python3-pefile is a dependency for ukify

12 months agotest(SYSTEMD-INITRD): demonstrate minimal initrd passing test
Jo Zzsi [Mon, 2 Sep 2024 16:12:35 +0000 (12:12 -0400)] 
test(SYSTEMD-INITRD): demonstrate minimal initrd passing test

12 months agofix(systemd-udevd): make systemd-sysctl, systemd-modules-load optional
Jo Zzsi [Mon, 2 Sep 2024 14:07:55 +0000 (10:07 -0400)] 
fix(systemd-udevd): make systemd-sysctl, systemd-modules-load optional

12 months agofix(systemd-sysctl): systemd-modules-load is not a dependency
Jo Zzsi [Mon, 2 Sep 2024 14:01:06 +0000 (10:01 -0400)] 
fix(systemd-sysctl): systemd-modules-load is not a dependency

After= in systemd-sysctl.service does not imply dependency
on systemd-modules-load.

12 months agoci(alpine): use clang instead of gcc for more test coverage
Jo Zzsi [Sat, 7 Sep 2024 23:57:00 +0000 (19:57 -0400)] 
ci(alpine): use clang instead of gcc for more test coverage

12 months agochore(dracut-install): fix clang build
Jo Zzsi [Sat, 7 Sep 2024 18:43:11 +0000 (14:43 -0400)] 
chore(dracut-install): fix clang build

Fix the following build error:

dracut-install.c: unused parameter 'ctx' [-Werror,-Wunused-parameter]

12 months agofix(dracut-install): handle correctly sysrootdir with trailing '/'
Ondrej Kubik [Fri, 26 Jul 2024 20:53:59 +0000 (20:53 +0000)] 
fix(dracut-install): handle correctly sysrootdir with trailing '/'

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
12 months agofix(dracut-install): do not assume handled path starts with sysrootdir
Ondrej Kubik [Fri, 26 Jul 2024 21:40:51 +0000 (21:40 +0000)] 
fix(dracut-install): do not assume handled path starts with sysrootdir

When using --sysrootdir argument, we cannot assume fulldstpath and
fullsrcpath always start with sysrootdir. When dracut_install is
called on destination directory, this results in passing pointer which
is often beyond valid buffer.

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
12 months agofix(dracut-functions): allow for \ in get_maj_min file path
Pavel Valena [Wed, 7 Aug 2024 23:30:50 +0000 (01:30 +0200)] 
fix(dracut-functions): allow for \ in get_maj_min file path

as the path might be f.e. /dev/disk/by-partlabel/EFI\x20System\x20Partition

which would produce Warning 'grep: warning: stray \ before x' in get_maj_min

Resolves: !505

12 months agofix(fips-crypto-policies): make it depend on fips dracut module
Jo Zzsi [Thu, 5 Sep 2024 13:09:36 +0000 (09:09 -0400)] 
fix(fips-crypto-policies): make it depend on fips dracut module

12 months agofeat(test-root): only include debug module if V is set to 2
Jo Zzsi [Thu, 5 Sep 2024 13:20:14 +0000 (09:20 -0400)] 
feat(test-root): only include debug module if V is set to 2

This PR enables CI to run faster by default (V=1).

When debugging (V=2) debug module will be included as before.

12 months agoci: test plymouth dracut module in more containers
Jo Zzsi [Fri, 6 Sep 2024 15:03:40 +0000 (11:03 -0400)] 
ci: test plymouth dracut module in more containers

12 months agotest(FULL-SYSTEM): remove non-systemd dracut modules from the test
Jo Zzsi [Sat, 31 Aug 2024 19:31:44 +0000 (15:31 -0400)] 
test(FULL-SYSTEM): remove non-systemd dracut modules from the test

i18n is not longer required after 238378ad2b7367900a0050bb9fc5b9eab5294cba.

12 months agoci: change default fstype for Arch and openSUSE
Jo Zzsi [Sat, 7 Sep 2024 03:29:14 +0000 (23:29 -0400)] 
ci: change default fstype for Arch and openSUSE

Default (when test allows it) is now XFS for Arch
and btrfs for openSUSE.

12 months agotest(BASIC): add support for XFS
Jo Zzsi [Sat, 7 Sep 2024 03:15:07 +0000 (23:15 -0400)] 
test(BASIC): add support for XFS

XFS filesystem labels can be at most 12 characters long,
so move the test case for the ' rdinit=/bin/sh' label
to TEST-02 instead and keep TEST-01 simple.

XFS filesystem must be larger than 300MB.

12 months agotest(BASIC): allow to run the test with various fstypes
Jo Zzsi [Sun, 1 Sep 2024 14:51:24 +0000 (10:51 -0400)] 
test(BASIC): allow to run the test with various fstypes

Tested with the following fstypes:
 - ext2
 - ext3
 - ext4
 - btrfs
 - jfs

12 months agoci: add more fstypes support (xfs, jfs, f2fs)
Jo Zzsi [Sun, 1 Sep 2024 15:19:38 +0000 (11:19 -0400)] 
ci: add more fstypes support (xfs, jfs, f2fs)

This PR is just a container change, no tests are added or removed.

12 months agochore: remove boilerplate
Jo Zzsi [Fri, 30 Aug 2024 16:01:19 +0000 (12:01 -0400)] 
chore: remove boilerplate

It is not required to redefine empty functions.

12 months agofix(udev-rules): remove systemd-specific rules
Jo Zzsi [Fri, 30 Aug 2024 21:20:08 +0000 (17:20 -0400)] 
fix(udev-rules): remove systemd-specific rules

These rules are already present in the systemd dracut module.

12 months agotest(NBD): fix how rootfs is built
Jo Zzsi [Fri, 30 Aug 2024 20:03:46 +0000 (16:03 -0400)] 
test(NBD): fix how rootfs is built

Change in systemd dracut module exposed that thest NBD had a dependency
on a particular dracut module rule that is not needed in production.

Change the test and align it with other tests.

12 months agofix(systemd): do not set unused target as the default
Jo Zzsi [Fri, 30 Aug 2024 16:43:30 +0000 (12:43 -0400)] 
fix(systemd): do not set unused target as the default

initrd.target is set as default in systemd-initrd dracut module.

12 months agofix(systemd): /sbin/init is not required inside initrd
Jo Zzsi [Fri, 30 Aug 2024 16:16:32 +0000 (12:16 -0400)] 
fix(systemd): /sbin/init is not required inside initrd

12 months agotest: network dracut package needs to be added with '-a'
Jo Zzsi [Sat, 31 Aug 2024 00:35:43 +0000 (20:35 -0400)] 
test: network dracut package needs to be added with '-a'

'-m network' does not really work as it is not able to include
the actual networking backend as check_module call with
always fail.

12 months agofix(Dockerfile-Gentoo): explicitly pull in all build dependencies
Andrew Ammerlaan [Sat, 31 Aug 2024 13:15:13 +0000 (15:15 +0200)] 
fix(Dockerfile-Gentoo): explicitly pull in all build dependencies

Closes: https://github.com/dracut-ng/dracut-ng/issues/630
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
12 months agotest: document and fix extra verbose mode (V=2)
Jo Zzsi [Sun, 25 Aug 2024 16:28:50 +0000 (12:28 -0400)] 
test: document and fix extra verbose mode (V=2)

Set 'rd.debug' for all tests  in 'V=2' mode to make
it more verbose than 'V=1' test mode.

12 months agofix(systemd-networkd): remove basename dependency
Fabian Henze [Mon, 26 Aug 2024 20:05:35 +0000 (20:05 +0000)] 
fix(systemd-networkd): remove basename dependency

The basename tool was not listed in the requirements and is also not needed.
Also see https://github.com/dracutdevs/dracut/commit/4c216b1db6a86373549e13b60250a7fcf94417b9

12 months agoci: add more packages to Debian and Ubuntu containers
Jo Zzsi [Fri, 30 Aug 2024 00:53:30 +0000 (20:53 -0400)] 
ci: add more packages to Debian and Ubuntu containers

Increase test coverage. Some of the newly added packages
are needed to to install some dracut modules and are already
installed for other CI containers.

12 months agorevert(systemd): trigger systemd-vconsole-setup.service only on demand
Jo Zzsi [Thu, 29 Aug 2024 01:53:33 +0000 (21:53 -0400)] 
revert(systemd): trigger systemd-vconsole-setup.service only on demand

Revert 6b095274fb935ffb7639d1ea7e51f9bd0f487726.

Enable systemd-vconsole-setup.service always when it is avaiable
as it usually gets triggered by udev rules anyways.

12 months agofix(systemd-networkd): make sure default network is always last
Timo Rothenpieler [Wed, 28 Aug 2024 18:45:48 +0000 (20:45 +0200)] 
fix(systemd-networkd): make sure default network is always last

Fixes #618

12 months agochore: remove obsolete old syntax for rd.driver.* and rd.live
Jo Zzsi [Mon, 26 Aug 2024 20:19:11 +0000 (16:19 -0400)] 
chore: remove obsolete old syntax for rd.driver.* and rd.live

Remove support for the following arguments:
- rdblacklist
- rdinsmodpost
- rdloaddriver
- check
- rdlivedebug
- live_dir
- liveimg
- overlay
- readonly_overlay
- reset_overlay
- live_ram

12 months agochore: rd.ccw is deprecated
Jo Zzsi [Mon, 26 Aug 2024 20:06:31 +0000 (16:06 -0400)] 
chore: rd.ccw is deprecated

12 months agochore: rdinitdebug, rdnetdebug, rdinfo, rd_retry and rdshell are deprecated
Jo Zzsi [Mon, 26 Aug 2024 20:03:41 +0000 (16:03 -0400)] 
chore: rdinitdebug, rdnetdebug, rdinfo, rd_retry and rdshell are deprecated

12 months agochore: rdbreak is deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:57:33 +0000 (15:57 -0400)] 
chore: rdbreak is deprecated

12 months agochore: rd_NO_*TAB rd_NO_LVM* are deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:45:55 +0000 (15:45 -0400)] 
chore: rd_NO_*TAB rd_NO_LVM* are deprecated

12 months agochore: rd_LVM_LV and rd_LVM_VG are deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:41:19 +0000 (15:41 -0400)] 
chore: rd_LVM_LV and rd_LVM_VG are deprecated

12 months agochore: rd_LUKS_PARTUUID, rd_LUKS_SERIAL and rd_LUKS_UUID are deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:37:31 +0000 (15:37 -0400)] 
chore: rd_LUKS_PARTUUID, rd_LUKS_SERIAL and rd_LUKS_UUID are deprecated

12 months agochore: rd_NO_LUKS is deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:35:02 +0000 (15:35 -0400)] 
chore: rd_NO_LUKS is deprecated

12 months agochore: rd_NFS_DOMAIN is deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:33:37 +0000 (15:33 -0400)] 
chore: rd_NFS_DOMAIN is deprecated

12 months agochore: rd_NO_PLYMOUTH is deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:32:24 +0000 (15:32 -0400)] 
chore: rd_NO_PLYMOUTH is deprecated

12 months agochore: rd_DM_UUID is deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:30:56 +0000 (15:30 -0400)] 
chore: rd_DM_UUID is deprecated

12 months agochore: rd_ZNET is deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:29:15 +0000 (15:29 -0400)] 
chore: rd_ZNET is deprecated

12 months agochore: rd_NO_ZFCPCONF is deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:26:23 +0000 (15:26 -0400)] 
chore: rd_NO_ZFCPCONF is deprecated

12 months agochore: rd_CCW is deprecated
Jo Zzsi [Mon, 26 Aug 2024 19:21:25 +0000 (15:21 -0400)] 
chore: rd_CCW is deprecated

12 months agofix(lvm): clean up whitespace in messages
David Teigland [Tue, 27 Aug 2024 20:51:44 +0000 (15:51 -0500)] 
fix(lvm): clean up whitespace in messages

The lvm module has been printing messages with whitespace damage:

  Scanning devices sda sdb  for LVM logical volumes vg/root
  vg/swap

Remove the trailing space after the final device name, and remove the
newlines between LV names.  The message above becomes:

  Scanning devices sda sdb for LVM logical volumes vg/root vg/swap

(The same change is made to the VG activation message.)

12 months agofix(base): init from base is not needed when systemd is enabled
Jo Zzsi [Mon, 26 Aug 2024 01:58:13 +0000 (21:58 -0400)] 
fix(base): init from base is not needed when systemd is enabled

12 months agotest(SYSTEMD-INITRD): kernel-independent systemd-based initrd
Jo Zzsi [Sat, 24 Aug 2024 21:47:02 +0000 (17:47 -0400)] 
test(SYSTEMD-INITRD): kernel-independent systemd-based initrd

Explicitly verify that dracut systemd services are not included in this
test.

Separate systemd-based initrd out from the rest of the test
infrastructure to make it easier to check (e.g. by passing -v)
what is included in this minimal initrd.

This test produces initrd that is comparable design to the systemd
based initrd produced by mkosi or mkinitcpio.

Copy some additional tests steps from FULL-SYSTEMD and include it
in this test as well.

12 months agofix(dracut-systemd): include systemd-cryptsetup module when needed
Jo Zzsi [Thu, 29 Aug 2024 03:06:08 +0000 (23:06 -0400)] 
fix(dracut-systemd): include systemd-cryptsetup module when needed

12 months agorevert(crypt): include systemd-cryptsetup module when needed
Jo Zzsi [Wed, 28 Aug 2024 13:52:46 +0000 (09:52 -0400)] 
revert(crypt): include systemd-cryptsetup module when needed

12 months agofix(systemd-cryptsetup): install cryptsetup-pre.target
Jo Zzsi [Mon, 26 Aug 2024 12:45:14 +0000 (08:45 -0400)] 
fix(systemd-cryptsetup): install cryptsetup-pre.target

12 months agofix(systemd): systemd-vconsole-setup has a dependency on loadkeys
Jo Zzsi [Sun, 25 Aug 2024 00:23:14 +0000 (20:23 -0400)] 
fix(systemd): systemd-vconsole-setup has a dependency on loadkeys

loadkeys is installed by 10i18n dracut module.

12 months agofeat(fips-crypto-policies): make c-p follow FIPS mode automatically
Clemens Lang [Thu, 8 Aug 2024 14:43:31 +0000 (16:43 +0200)] 
feat(fips-crypto-policies): make c-p follow FIPS mode automatically

For a system that uses crypto-policies to be switched to FIPS mode
correctly, it needs to be

- booted with `fips=1` on the kernel command line
- switched to the FIPS crypto-policy (or a policy derived from it)
- have the fips dracut module enabled

On older systems, there were additional steps, for example, creating
`/etc/system-fips`.

We have repeatedly seen inconsistencies between those different toggles,
either because the user space tooling to switch between those does not
(for reliability, maintainability, and compliance reasons) undo some of
the steps it does when disabling FIPS mode, or because other
installation methods (bootc, containers, image builder) independently do
some of those steps. Eventually, all of these ended with user confusion.

We can avoid this situation by eliminating the difference by treating
the `fips=1` kernel command line switch as a single source of truth, and
making all others follow automatically. This module provides this for
crypto-policies, by adding bind-mounts before pivot if the system has
not already been switched to a FIPS-based crypto-policy.

This requires some support from the crypto-policies package (because it
needs to deal with the bind mounts when a user calls
`update-crypto-policies --set`), so make it a no-op unless

 - `fips=1` is on the kernel command line
 - crypto-policies is installed
 - crypto-policies supports the bind-mounts (indicated by the presence
   of the `default-fips-config` file)
 - the policy isn't already FIPS

These checks should make this safe to add to the initramfs on all
current systems.

The bind-mounts also need to happen in the initramfs already, because
systemd links against OpenSSL, and doing them later means that systemd
will start with an OpenSSL configuration that isn't tailored for FIPS.

See also [1], which adds the user space support to crypto-policies,
along with a systemd service that does the same steps in case dracut
hasn't already done them (which is useful for environments that don't
use an initramfs like containers).

  [1]: https://gitlab.com/redhat-crypto/fedora-crypto-policies/-/merge_requests/191

Signed-off-by: Clemens Lang <cllang@redhat.com>
12 months agochore(fs-lib): remove reiserfs support
Jo Zzsi [Mon, 26 Aug 2024 16:52:15 +0000 (12:52 -0400)] 
chore(fs-lib): remove reiserfs support

12 months agofix(base): remove the undocumented real_init, realinitpath and rd.distroinit
Jo Zzsi [Mon, 26 Aug 2024 16:24:28 +0000 (12:24 -0400)] 
fix(base): remove the undocumented real_init, realinitpath and rd.distroinit

12 months agoci(Gentoo): fix docker warning
Jo Zzsi [Mon, 26 Aug 2024 23:34:47 +0000 (19:34 -0400)] 
ci(Gentoo): fix docker warning

See for syntax rules
https://docs.docker.com/reference/build-checks/from-as-casing/ .

12 months agoci(Debian): remove dmraid in preparation for next Debian release
Jo Zzsi [Sun, 25 Aug 2024 12:35:36 +0000 (08:35 -0400)] 
ci(Debian): remove dmraid in preparation for next Debian release

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056944

12 months agotest(test-podman.sh): script to run tests in podman
Jo Zzsi [Sat, 24 Aug 2024 02:47:29 +0000 (22:47 -0400)] 
test(test-podman.sh): script to run tests in podman

12 months agofix(squash-lib): harden against empty $initdir
Philipp Rudo [Mon, 26 Aug 2024 13:29:01 +0000 (15:29 +0200)] 
fix(squash-lib): harden against empty $initdir

The postinstall phase of 99squash-lib has the potential to delete the
whole rootfs if $initdir is empty. This should(tm) never happen.
Nevertheless as the consequences are so devastating it is better to
double check.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
12 months agofix(dracut.sh): exit when installing the squash loader fails
Philipp Rudo [Tue, 27 Aug 2024 10:14:40 +0000 (12:14 +0200)] 
fix(dracut.sh): exit when installing the squash loader fails

The postinstall phase in 99squash-lib can fail, e.g. when 99squash-lib
is added without one of the required back ends. Usually this isn't fatal
and simply results in a "normal" initrd, i.e. one without squashed
image, being created. Nevertheless, a user needs to explicitly add one
of the required modules for the code to be triggered.  So it is better
to fail with an error rather than giving the user something he didn't
ask for.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
12 months agofix(squash): remove cyclic dependency
Philipp Rudo [Mon, 26 Aug 2024 13:23:41 +0000 (15:23 +0200)] 
fix(squash): remove cyclic dependency

With commit d0f8fde5 ("fix(dracut-init.sh): add module to mods_to_load
before checking dependencies") reverted 99squash can no longer rely on
dracut_module_included working as expected in its check() and depends()
function. Solve this problem by breaking up the cyclic dependency
between 99squash and 95squash-{squashfs,erofs} as the commit was
originally introduced to allow this cyclic dependency.

This requires to move all code shared by 95squash-{squashfs,erofs} from
99squash to a new 99squash-lib module and update the dependencies
accordingly. In addition update the checks in dracut.sh to check for
99squash-lib as 99squash is no longer guaranteed to be included.
Finally make sure that 99squash-lib isn't included without a back
end.

While at it improve and align the error messages in 99squash and
99squash-lib.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
12 months agorevert(dracut-init.sh): add module to mods_to_load before checking dependencies
Philipp Rudo [Mon, 26 Aug 2024 13:58:54 +0000 (15:58 +0200)] 
revert(dracut-init.sh): add module to mods_to_load before checking dependencies

Commit d0f8fde5 ("fix(dracut-init.sh): add module to mods_to_load before
checking dependencies") introduced a regression. When dracut is in
"auto" mode, i.e. '--modules auto' or no --modules is provided, the
expected behavior is that all modules that return 0 in their check()
function are included. Except for the ones where the dependencies cannot
be installed. The commit however, caused those modules to be included
without their dependencies. Thus revert the commit.

This reverts commit d0f8fde5668cfd7fda1d15824e268b4949b4fd04.

Reported-by: Jo Zzsi <jozzsicsataban@gmail.com>
Signed-off-by: Philipp Rudo <prudo@redhat.com>
12 months agotest: improve tests with crypt dracut module to work in hostonly mode
Jo Zzsi [Tue, 20 Aug 2024 00:22:54 +0000 (20:22 -0400)] 
test: improve tests with crypt dracut module to work in hostonly mode

Enable running these test both in hostonly and non-hostonly mode.

12 months agofix(crypt): include systemd-cryptsetup module when needed
Jo Zzsi [Mon, 5 Aug 2024 14:48:50 +0000 (10:48 -0400)] 
fix(crypt): include systemd-cryptsetup module when needed

12 months agochore!: drop support for ifcfg
Laszlo Gombos [Sat, 20 Jul 2024 00:40:13 +0000 (20:40 -0400)] 
chore!: drop support for ifcfg

Skip test 60 if ifcfg can not be installed as test 60 still
needs ifcfg dracut module.

12 months agotest(SYSTEMD): let dracut figure out to include systemd for this test
Jo Zzsi [Sat, 24 Aug 2024 00:35:55 +0000 (20:35 -0400)] 
test(SYSTEMD): let dracut figure out to include systemd for this test

12 months agotest(SYSTEMD-INITRD): call test_dracut instead of repeating it
Jo Zzsi [Wed, 21 Aug 2024 23:11:26 +0000 (19:11 -0400)] 
test(SYSTEMD-INITRD): call test_dracut instead of repeating it

12 months agofix(udev-rules): move *-persistent-storage.rules to rootfs-block
Jo Zzsi [Wed, 21 Aug 2024 15:03:41 +0000 (11:03 -0400)] 
fix(udev-rules): move *-persistent-storage.rules to rootfs-block

12 months agofix(systemd-initrd): add base as dependency
Dorina Kovacs [Thu, 8 Aug 2024 15:00:43 +0000 (17:00 +0200)] 
fix(systemd-initrd): add base as dependency

For systemd to run properly inside initramfs, /etc/initrd-release is required to exist. [1]
/etc/initrd-release is only written in the base module.

[1]: https://systemd.io/INITRD_INTERFACE/#using-systemd-inside-an-initrd

12 months agofix(systemd): remove duplicate systemd cryptsetup targets
Jo Zzsi [Mon, 19 Aug 2024 20:07:38 +0000 (16:07 -0400)] 
fix(systemd): remove duplicate systemd cryptsetup targets

These targets are installed in the systemd-cryptsetup dracut module.

12 months agofix(udev-rules): install dropins for udev.conf
Jo Zzsi [Sun, 18 Aug 2024 19:03:57 +0000 (15:03 -0400)] 
fix(udev-rules): install dropins for udev.conf

12 months agotest(FULL-SYSTEM): simplify and make it easier to maintain
Jo Zzsi [Sat, 17 Aug 2024 11:41:50 +0000 (07:41 -0400)] 
test(FULL-SYSTEM): simplify and make it easier to maintain

Remove packaging and distribution specific systemd service files.

No need to explicitly check if /usr is mounted as
without it Switch Root service would fail with the following
error:

'Failed to start initrd-switch-root.service - Switch Root.'

12 months agoci(alpine): install dracut to enable native dracut configuration
Jo Zzsi [Sat, 17 Aug 2024 17:29:54 +0000 (13:29 -0400)] 
ci(alpine): install dracut to enable native dracut configuration

Similarly to Fedora, this PR enables hostonly by default for Alpine
Linux CI container.

This PR installs additional packages to the
Alpine container that other Linux test containers already have.

This PR removed extra post steps from the container that are
not necessary.

12 months agofix(dracut-install): resolve -Wextra warnings
Jo Zzsi [Sat, 17 Aug 2024 11:12:46 +0000 (07:12 -0400)] 
fix(dracut-install): resolve -Wextra warnings

Explicitly convert from int type to size_t type to resolve
'comparison of integer expressions of different signedness'
warning.

12 months agochore: treat compilation warning as errors
Jo Zzsi [Sat, 17 Aug 2024 11:03:46 +0000 (07:03 -0400)] 
chore: treat compilation warning as errors

The intention of this PR is to enforce that on all CI containers
C code builds without any warnings.

This PR intentionally does not enforce the same for normal builds.

12 months agotest(ISMS): only include mdraid into the initrd under test
Jo Zzsi [Sat, 17 Aug 2024 12:22:33 +0000 (08:22 -0400)] 
test(ISMS): only include mdraid into the initrd under test

This test is testing mdraid, do not include dmraid into
the same initrd that is being tested as it is unnecessary.

12 months agofix(crypt): install dm_crypt module in non-hostonly mode as well
Jo Zzsi [Sat, 17 Aug 2024 00:58:31 +0000 (20:58 -0400)] 
fix(crypt): install dm_crypt module in non-hostonly mode as well

Without dm_crypt Linux module, the dracut module will not be fully
functional.

12 months agofeat(systemd*): include systemd config files from /usr/lib/systemd
Pavel Valena [Wed, 12 Jun 2024 04:06:32 +0000 (06:06 +0200)] 
feat(systemd*): include systemd config files from /usr/lib/systemd

and also use proper variables for the paths.

--

The new systemd reads from both /etc and /usr/, so to accomodate this,
I've added new paths to install configs from (I probably haven't covered
all). This changes only hostonly behaviour; uses global variables:

systemdutilconfdir: "/etc/systemd"
systemdutildir: "/lib/systemd:/lib/systemd/systemd-udevd" "/usr/lib/systemd:/usr/lib/systemd/systemd-udevd"

Ref: https://issues.redhat.com/browse/RHEL-32506

12 months agofix(squash-erofs): properly exclude $squashdir
Philipp Rudo [Wed, 14 Aug 2024 14:33:23 +0000 (16:33 +0200)] 
fix(squash-erofs): properly exclude $squashdir

Option --exclude-path from mkfs.erofs requires a path relative to the
source of the image. Otherwise the path won't be excluded resulting in a
slightly larger (~1M) initrd.

Fixes: ebc9e84d ("feat(squash): add module 95squash-erofs")
Signed-off-by: Philipp Rudo <prudo@redhat.com>
12 months agofix(nfs): include also entries from /usr/lib/{passwd,group}
Pavel Valena [Wed, 7 Aug 2024 22:55:03 +0000 (00:55 +0200)] 
fix(nfs): include also entries from /usr/lib/{passwd,group}

as those paths are used by bootc instead of the /etc ones.

12 months agofix(test): always install kernel modules
Jo Zzsi [Fri, 2 Aug 2024 15:39:23 +0000 (11:39 -0400)] 
fix(test): always install kernel modules

Always install Linux kernel modules regardless of the value of hostonly.

12 months agofix(systemd): make nologin optional
Jochen Sprickerhof [Wed, 14 Aug 2024 05:13:39 +0000 (07:13 +0200)] 
fix(systemd): make nologin optional

12 months agofix(rngd): install system service file
Pavel Valena [Sun, 23 Jul 2023 17:44:17 +0000 (19:44 +0200)] 
fix(rngd): install system service file

as there's no reason to keep a copy; there shouldn't be any modifications.

In case there are args stored in a separate file (Fedora and alike),
it needs to be supplied too, but without the option to change the user.

This avoids shipping and maintaining the service file.

https://bugzilla.redhat.com/show_bug.cgi?id=2181540

12 months agofix(dracut-install): refuse empty DRACUT_LDD environment variable
Marcos Mello [Thu, 8 Aug 2024 16:40:58 +0000 (13:40 -0300)] 
fix(dracut-install): refuse empty DRACUT_LDD environment variable

With DRACUT_LDD='', let's fallback to default ldd. Better safe than sorry.

12 months agofix(dracut.sh): use only compressor that kernel supports
Andrew Ammerlaan [Sun, 4 Aug 2024 12:22:38 +0000 (14:22 +0200)] 
fix(dracut.sh): use only compressor that kernel supports

Follows up on:
- https://github.com/dracut-ng/dracut-ng/pull/520
- https://github.com/dracut-ng/dracut-ng/pull/541

And fixes:
- https://github.com/dracut-ng/dracut-ng/issues/378

Note #520 contains a fix for the check_kernel_config function and should be
merged first.

Closes: https://github.com/dracut-ng/dracut-ng/issues/378
12 months agofeat(dracut): detect kernel initrd support
Matteo Croce [Thu, 1 Aug 2024 23:35:08 +0000 (01:35 +0200)] 
feat(dracut): detect kernel initrd support

If the installed kernel has no initrd support, skip the image creation.

12 months agofeat(dracut-functions): check more paths
Matteo Croce [Sat, 20 Jul 2024 12:04:14 +0000 (14:04 +0200)] 
feat(dracut-functions): check more paths

Check more paths for config file. Refactor check_kernel_config
with stylistics improvements.

12 months agofix(dracut-fuctions.sh): avoid reading the wrong kconfig
Matteo Croce [Fri, 2 Aug 2024 10:00:18 +0000 (12:00 +0200)] 
fix(dracut-fuctions.sh): avoid reading the wrong kconfig

If $no_kernel is set, $kernel will point to the running kernel,
avoid reading the current kernel config in this case.

12 months agofix(dracut): ldd output borked with `--sysroot`
Antonio Alvarez Feijoo [Tue, 6 Aug 2024 12:58:58 +0000 (14:58 +0200)] 
fix(dracut): ldd output borked with `--sysroot`

dracut-install calls ldd to resolve dependencies, but when the `--sysroot`
option is used, ldd is not performing the search within the sysroot directory.
To fix this issue, the `LD_LIBRARY_PATH` variable needs to be properly set to
the directories containing shared libraries within the specified sysroot
directory.

E.g., running dracut with `--sysroot` produces an initrd without the required
systemd shared libraries when the version between the host system and the
sysroot directory differs:

```
localhost:~ # ldd /.snapshots/9/snapshot/usr/lib/systemd/systemd | grep libsystemd
    libsystemd-core-256.so => not found
    libsystemd-shared-256.so => not found
localhost:~ # export LD_LIBRARY_PATH=/.snapshots/9/snapshot/usr/lib64/systemd
localhost:~ # ldd /.snapshots/9/snapshot/usr/lib/systemd/systemd | grep libsystemd
    libsystemd-core-256.so => /.snapshots/9/snapshot/usr/lib64/systemd/libsystemd-core-256.so (0x00007f817b600000)
    libsystemd-shared-256.so => /.snapshots/9/snapshot/usr/lib64/systemd/libsystemd-shared-256.so (0x00007f817b000000)
```

13 months agofix(dracut-functions.sh): only return block devices from get_persistent_dev
Fabian Vogt [Mon, 5 Aug 2024 09:28:32 +0000 (11:28 +0200)] 
fix(dracut-functions.sh): only return block devices from get_persistent_dev

With udev 256, there are now directories such as
/dev/disk/by-path/pci-0000:02:00.0-nvme-1-part/ which match here.

In case a nonexisting file/device was passed to get_persistent_dev, it
returned the first directory it looked at because both have maj:min 0:0.
This accidental conversion from garbage to a sensible looking path leads
to weird behaviour later.

Instead of filtering out directories explicitly switch the check to only
return block devices, which also takes care of the character special
/dev/mapper/control.

13 months agofix(dracut.sh): account for the kernel being named kernel
Andrew Ammerlaan [Mon, 5 Aug 2024 07:25:04 +0000 (09:25 +0200)] 
fix(dracut.sh): account for the kernel being named kernel

kernel is also a name accepted by grub-mkconfig.

On Gentoo the kernel is named this way if systemd's kernel-install is used.