]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
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.

13 months agoci: drop privileged container flag to run tests sandboxed
Laszlo Gombos [Sat, 27 Jul 2024 18:27:31 +0000 (14:27 -0400)] 
ci: drop privileged container flag to run tests sandboxed

Only map /dev/kvm into the container to be able to use kvm when
when running VMs with qemu.

13 months agofix(squash): use 99busybox instead of installing it manually
Philipp Rudo [Tue, 30 Jul 2024 11:44:32 +0000 (13:44 +0200)] 
fix(squash): use 99busybox instead of installing it manually

Make use of 99busybox in 99squash rather than installing it manually.
This not only removes duplicate code but allows mixing of busybox with
tools from coreutils. This requires a small change in 99busybox to
remove the hard coded use of $initdir.

Suggested-by: Laszlo Gombos <laszlo.gombos@gmail.com>
Signed-off-by: Philipp Rudo <prudo@redhat.com>
13 months agofix(squash): explicitly create required directories
Philipp Rudo [Tue, 30 Jul 2024 11:35:17 +0000 (13:35 +0200)] 
fix(squash): explicitly create required directories

At the moment 99squash relies on dracut-install to create the required
directories it later links to. This approach is error prone and will
cause problems when switching to use 99busybox later on, which tries to
add a link to /usr/sbin that hasn't been created. Thus explicitly
create the expected directories before installing the minimal initrd.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
13 months agofeat(dracut-initramfs-restore): unpack erofs images
Philipp Rudo [Tue, 30 Jul 2024 15:24:28 +0000 (17:24 +0200)] 
feat(dracut-initramfs-restore): unpack erofs images

Follow the example for squashfs images and also unpack erofs images in
dracut-initramfs-restore.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
13 months agofeat(lsinitrd): add support for erofs images
Philipp Rudo [Tue, 23 Jul 2024 16:33:37 +0000 (18:33 +0200)] 
feat(lsinitrd): add support for erofs images

Add support to handle erofs images in lsinitrd. Unfortunately the erofs
tooling is missing some functionality of unsquashfs, esp. the ability to
extract single files and list the content of the image. Work around this
deficiency by always extracting the full image and emulate the missing
functionality as close as possible.

While at it also handle the rename of the squashfs image to
squashfs-root.img.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
13 months agofeat(squash): add module 95squash-erofs
Philipp Rudo [Tue, 23 Jul 2024 15:42:33 +0000 (17:42 +0200)] 
feat(squash): add module 95squash-erofs

Allow squashing the image in 99squash using erofs. Keep squashfs as
default to not change existing systems. I.e. only use erofs if the user
explicitly include 95squash-erofs or when the prereqs for squashfs are
missing.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
13 months agofeat(squash): split 95squash-squashfs from 99squash
Philipp Rudo [Tue, 23 Jul 2024 14:39:13 +0000 (16:39 +0200)] 
feat(squash): split 95squash-squashfs from 99squash

99squash only allows squashing the files using squashfs. In order to
make the implementation for different filesystems easier split out the
squashfs specific parts into 95squash-squashfs.

While at it rename the root image contained in the initrd to
squashfs-root.img. This allows tools like lsinitrd to detect the
filesystem used later on.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
13 months agofeat(squash): move mksquashfs to 99squash/modules-setup
Philipp Rudo [Mon, 22 Jul 2024 14:30:50 +0000 (16:30 +0200)] 
feat(squash): move mksquashfs to 99squash/modules-setup

When using 99squash dracut actually builds two separat initrds. The
"normal" one, that gets squashed into a squashfs image, and a
"minimalistic" one, whose only task is to mount and switch_root to the
squashfs image.

For that 99squash currently requires a lot of special handling in
dracut.sh. Move most of this special handling into 99squash itself. This
requires a new approach when building the "minimalistic" initrd. The new
approach works the following way

1. During the installation phase install the "normal" initrd into
   $initdir and the "minimalistic" initrd into $squashdir.
2. Strip the binaries in $initdir.
3. Trigger a special postinstall hook in 99squash that squashes the
   content of $initdir (excluding $squashdir) into the squashfs image,
   removes the content of $intidir (excluding $suqashdir) and, moves the
   content of $squashdir into $initdir.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
13 months agofix(dracut-init.sh): add module to mods_to_load before checking dependencies
Philipp Rudo [Thu, 25 Jul 2024 10:47:00 +0000 (12:47 +0200)] 
fix(dracut-init.sh): add module to mods_to_load before checking dependencies

When implementing erofs support for 99squash we end up with three
modules 99squash, 95squash-squashfs and 95squash-erofs. Where 99squash
contains the common code for filesystem images and
95squash-{squashfs,erofs} the special handing depending on the
filesystem used. This leads to a dependency cycle as we want to allow
users both to choose 99squash, when the exact filesystem doesn't matter,
as well as 95squash-{squashfs,erofs} when a specific filesystem is
required.

But when 99squash is added as a dependency calling
dracut_module_included fails in its depends() function. This lead to
cases where both handlers, 95squash-squashfs and 95squash-erofs, were
added to the initrd.

Reason for the failure is that a module only is marked to be loaded
after all it's dependencies have been checked as well. Thus a child
module cannot detect which parent module wants it to be included. Fix
this by marking modules to be loaded before checking its dependencies in
check_module. Do the same change in check_mount for consistency.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
13 months agofeat(dracut-init.sh): allow changing the destination directory for inst et al
Philipp Rudo [Mon, 22 Jul 2024 14:46:47 +0000 (16:46 +0200)] 
feat(dracut-init.sh): allow changing the destination directory for inst et al

When using 99squash dracut actually builds two separate initrds. The
"normal" one, that gets squashed into a squashfs image, and a
"minimalistic" one, whose only task is to mount and switch_root to the
squashfs image.

This is currently done the following way:
1. Skipp install() for 99squash during the "normal" installation phase.
2. Trigger a special postinstall hook in 99squash that moves the content
   of $initdir to $squashdir and installs the "minimalistic" initrd to
   $initdir.
3. Strip the binaries in $initdir (of which $squashdir is a sub
   directory of).
4. Squash the content of $squashdir into the squashfs image and remove
   $squashdir.

The problem with this approach is that the steps 2 and 4 specific to
99squash but need to be done in dracut.sh. Thus a lot of special
handling for 99squash is needed in dracut.sh. This will get even more
complex once support for different filesystem images, e.g. erofs, are
implemented.

In order to be able to move most of the functionality into 99squash
itself a new approach will be chosen, i.e.
1. During the installation phase install the "normal" initrd into
   $initdir and the "minimalistic" initrd into $squashdir.
2. Strip the binaries in $initdir.
3. Trigger a special postinstall hook in 99squash that squashes the
   content of $initdir (excluding $squashdir) into the squashfs image,
   removes the content of $intidir (excluding $suqashdir) and, moves the
   content of $squashdir into $initdir.

With that the only special handling remaining in dracut.sh is triggering
the postinstall hook.

However, in inst et al. the destination directory is hard coded to
$initdir. Thus allow setting a different destination directory in inst
et al. to get the new approach to work. For the time being only do that
for the functions required by 99squash.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
13 months agotest(UEFI): second initrd would just overwrite the first
Laszlo Gombos [Sat, 27 Jul 2024 04:58:02 +0000 (00:58 -0400)] 
test(UEFI): second initrd would just overwrite the first

Now that we have hostonly and no-hostonly CI containers, no need
to run the same test twice in the same container.

Also, the current approach did not actually work as the second
initrd would just overwrite the first one without testing the boot.

13 months agoci: improve test LVM, IMSM and LVM-THIN to work in hostonly mode
Laszlo Gombos [Sat, 27 Jul 2024 04:32:04 +0000 (00:32 -0400)] 
ci: improve test LVM, IMSM and LVM-THIN to work in hostonly mode

Adding modules explicitly is required in hostonly mode as the
actual CI continaer host is not using these modules to boot.

13 months agoci: mark tests no-hostonly that are failing in hostonly mode
Laszlo Gombos [Sat, 27 Jul 2024 00:23:13 +0000 (20:23 -0400)] 
ci: mark tests no-hostonly that are failing in hostonly mode

13 months agoci: remove dracut native config that is not compatible with upstream ci
Laszlo Gombos [Thu, 25 Jul 2024 21:09:49 +0000 (17:09 -0400)] 
ci: remove dracut native config that is not compatible with upstream ci

13 months agotest: grab the distro configuration from the host and make it available
Laszlo Gombos [Thu, 25 Jul 2024 19:46:16 +0000 (15:46 -0400)] 
test: grab the distro configuration from the host and make it available

Fix failing test cases by enforcing no-hostonly for those tests cases
that need it.

13 months agotest: do not force no-hostonly for all test runs
Laszlo Gombos [Thu, 25 Jul 2024 19:00:43 +0000 (15:00 -0400)] 
test: do not force no-hostonly for all test runs

Different distributions and containers might prefer different
defaults.

The motivation of this work is to increase test coverage and
to run the tests in the same configurations as dracut is used.

13 months agofix(man): update description of the --gzip option
Mike Gilbert [Wed, 24 Jul 2024 15:49:01 +0000 (11:49 -0400)] 
fix(man): update description of the --gzip option

dracut no longer defaults to gzip. There is a list of compressors and
the first available is used. See 9663307c and 693b7a32.

Add a warning about kernel support for gzip decompression, similar to
all of the other compressor options.

13 months agoci: do not remove native dracut installation from the test containers
Laszlo Gombos [Thu, 25 Jul 2024 15:34:03 +0000 (11:34 -0400)] 
ci: do not remove native dracut installation from the test containers

The change allows the CI to pick up distribution config from the dracut
package.

CI should be able to run not only in pristine default configuration,
but also in the configuration that the distribution set as the default.

As an example Fedora CI should run tests in hostonly mode (unless
specified otherwise).

Without this change some containers (e.g. Void, Ubunut, Arch) has the
native dracut package installed and some do not (e.g. Fedora).

13 months agoci: install systemd-experimental into openSUSE container
Laszlo Gombos [Wed, 24 Jul 2024 16:39:40 +0000 (12:39 -0400)] 
ci: install systemd-experimental  into openSUSE container

This PR is now required to run FULL-SYSTEMD on OpenSUSE.

13 months agochore(deps): bump softprops/action-gh-release from 2.0.6 to 2.0.8
dependabot[bot] [Tue, 23 Jul 2024 20:08:57 +0000 (20:08 +0000)] 
chore(deps): bump softprops/action-gh-release from 2.0.6 to 2.0.8

Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.6 to 2.0.8.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.0.6...v2.0.8)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
13 months agochore(busybox): remove empty check function
Laszlo Gombos [Mon, 22 Jul 2024 12:58:52 +0000 (08:58 -0400)] 
chore(busybox): remove empty check function

Follow-up to 9f365cb02b6331c9a7ef0bdd796edc84127c8e64 .

13 months agofix(busybox): install busybox symlinks later in the generation process
Laszlo Gombos [Mon, 22 Jul 2024 12:51:09 +0000 (08:51 -0400)] 
fix(busybox): install busybox symlinks later in the generation process

13 months agofix(busybox): install busybox symlinks manually
Laszlo Gombos [Mon, 22 Jul 2024 11:50:34 +0000 (07:50 -0400)] 
fix(busybox): install busybox symlinks manually

Do not depend on CONFIG_FEATURE_INSTALLER.
Do not remove existing destination files.

13 months agofix(lsinitrd): check skipcpio file directly
Pavel Valena [Wed, 17 Jul 2024 14:04:37 +0000 (16:04 +0200)] 
fix(lsinitrd): check skipcpio file directly

as the folder in /usr/lib/dracut/src might just exist; but the file might not.

13 months agotest: make sure test marker is reset properly
Laszlo Gombos [Sun, 21 Jul 2024 20:15:12 +0000 (16:15 -0400)] 
test: make sure test marker is reset properly

sync explicitly to flush cashes.

13 months agotest: mount rootfs read-only to avoid subtests to interfere
Laszlo Gombos [Sun, 21 Jul 2024 19:41:21 +0000 (15:41 -0400)] 
test: mount rootfs read-only to avoid subtests to interfere

13 months agoci: remove duplicated dracut module dependencies
Laszlo Gombos [Sun, 21 Jul 2024 18:26:15 +0000 (14:26 -0400)] 
ci: remove duplicated dracut module dependencies

rootfs-block kernel-modules are already included with each
test-makeroot dracut module.

13 months agoci: only install required dracut modules for test-makeroot
Laszlo Gombos [Sun, 21 Jul 2024 18:18:29 +0000 (14:18 -0400)] 
ci: only install required dracut modules for test-makeroot

Use '-m' instead of '-a' to run tests faster and more reliably.

Restores earlier ci functionality and now that dracut regressions
are resolved ci can revert 51d06540d.

13 months agochore(mksh)!: remove mksh dracut module
Laszlo Gombos [Sun, 21 Jul 2024 13:11:25 +0000 (09:11 -0400)] 
chore(mksh)!: remove mksh dracut module

BREAKING CHANGE: the mksh dracut module no longer maintained
due to lack of interest.

13 months agorevert(crypt): do not unlock encrypted devices by default during boot
Laszlo Gombos [Sun, 21 Jul 2024 13:04:13 +0000 (09:04 -0400)] 
revert(crypt): do not unlock encrypted devices by default during boot

This reverts commit 2339acfaeee60d6bb26a1103db2e53bc8f9cb2d1.

This change needs more test cases and more granular conditionals.

13 months agofeat(busybox): use busybox --install to install itself
Laszlo Gombos [Sun, 21 Jul 2024 00:24:13 +0000 (20:24 -0400)] 
feat(busybox): use busybox --install to install itself

Previous commits in this PR exposed a bug whereby some utilities
(e.g. dd) had both a busybox applet version and a coreutils version.

The busybox dracut module should not enforce taking always the
busybox version. The `busybox --install` command is safer option
that does not overwrite an existing binary of already exists.

13 months agotest(RAID-DEG): bash is not a requirement for this test
Laszlo Gombos [Sat, 20 Jul 2024 22:53:51 +0000 (18:53 -0400)] 
test(RAID-DEG): bash is not a requirement for this test

Increase tests coverage by letting the sh meta package pick a
shell.

13 months agotest: do not force include dash, let sh module make a selection
Laszlo Gombos [Sat, 20 Jul 2024 22:49:38 +0000 (18:49 -0400)] 
test: do not force include dash, let sh module make a selection

This is important for alpine, so that it does not install both
dash and busybox dracut modules that are potentially conflicting.

13 months agofeat(shell-interpreter): meta package for improved shell selection
Laszlo Gombos [Sat, 20 Jul 2024 22:40:43 +0000 (18:40 -0400)] 
feat(shell-interpreter): meta package for improved shell selection

13 months agofeat(pcmcia): only include when another module requires it
Laszlo Gombos [Sat, 20 Jul 2024 11:48:31 +0000 (07:48 -0400)] 
feat(pcmcia): only include when another module requires it

While the module itself is relativly new the technology is rarely
used any more as part of the boot process.

13 months agochore!: drop support for prepare_udev_rules
Laszlo Gombos [Sat, 20 Jul 2024 03:03:50 +0000 (23:03 -0400)] 
chore!: drop support for prepare_udev_rules

Follow-up to c95075e2c792cdb0e18aac6300ae8dc0dd6a6c1b.

13 months agofix(Makefile): install dracut config examples under /usr
Laszlo Gombos [Sat, 20 Jul 2024 18:09:44 +0000 (14:09 -0400)] 
fix(Makefile): install dracut config examples under /usr

13 months agofeat: add common config when networking is not desired
Laszlo Gombos [Sat, 20 Jul 2024 17:55:03 +0000 (13:55 -0400)] 
feat: add common config when networking is not desired

This is especially useful for distributions like Arch or Gentoo
that do not package networking dracut modules into its own
package.

13 months agofix(watchdog): change the priority of watchdog kernel modules
Laszlo Gombos [Sat, 20 Jul 2024 17:14:09 +0000 (13:14 -0400)] 
fix(watchdog): change the priority of watchdog kernel modules

i6300esb should be prioritized over ib700wdt.

Follow-up to f0a7fc5b4 .

13 months agotest(RAID-DEG): make it not flaky
Laszlo Gombos [Sat, 20 Jul 2024 16:57:24 +0000 (12:57 -0400)] 
test(RAID-DEG): make it not flaky

130f4dfce48b187944be9a0cacca794dd32428ad inadvertently made this
test flaky by including additional dracut modules not required
to pass the test.

13 months agotest: check for kernel module support from within the VM
Laszlo Gombos [Sat, 20 Jul 2024 12:10:46 +0000 (08:10 -0400)] 
test: check for kernel module support from within the VM

Testing kernel module support only works reliably form a VM
that is booted from the given Linux kernel version.

13 months agochore: remove empty check functions
Antonio Alvarez Feijoo [Thu, 18 Jul 2024 07:30:27 +0000 (09:30 +0200)] 
chore: remove empty check functions

13 months agochore: remove support for old mdadm versions
Antonio Alvarez Feijoo [Wed, 17 Jul 2024 07:45:04 +0000 (09:45 +0200)] 
chore: remove support for old mdadm versions

13 months agochore(github): use committer team for code owners
Neal Gompa [Thu, 18 Jul 2024 22:22:15 +0000 (18:22 -0400)] 
chore(github): use committer team for code owners

By using a GitHub team for the CODEOWNERS file, we can
easily add and remove people through the interface for
global committers and avoid unnecessary churn.

13 months agotest(DMSQUASH): no need to partition root_erofs disk
Laszlo Gombos [Sun, 14 Jul 2024 02:35:23 +0000 (22:35 -0400)] 
test(DMSQUASH): no need to partition root_erofs disk

13 months agofix(release): improve commit message
Laszlo Gombos [Sun, 14 Jul 2024 02:10:11 +0000 (22:10 -0400)] 
fix(release): improve commit message

Add new version commit number to the commit message.
Lock clog version to a version that is working well.
Allow clog to be installed in the user home as well.

13 months agofix(dracut): re-enable extended attributes in containers
Laszlo Gombos [Tue, 2 Jul 2024 19:50:37 +0000 (15:50 -0400)] 
fix(dracut): re-enable extended attributes in containers

add common config to make it easier to discable xattr.

Running inside a container is not a good proxy for making decisions
about filesystem properties.

13 months agofix(multipath): include module with "find_multipaths strict"
Martin Wilck [Tue, 16 Jul 2024 14:55:03 +0000 (16:55 +0200)] 
fix(multipath): include module with "find_multipaths strict"

The previous commits 377d52c and 4957ffa excluded the multipath module in
non-hostonly mode, with the purpose of avoiding to start multipath in the
initramfs on systems that don't use multipath. This is against the idea of
non-hostonly, which is to build an initramfs with all kernel modules and tools
that may be necessary to bring up the system.

This patch takes a different approach. In non-hostonly mode, if there are no
multipath devices and no multipath.conf, include the multipath module, but
require "find_multipaths strict" policy. This will ensure that users that don't
use dm-multipath won't be surprised by finding their root device under
multipath control. But the multipath tools will still be included in the
initramfs, allowing users to set up multipathing e.g. on the emergency shell if
necessary. Also, if /etc/multipath/wwids exists, it will be included in the
initramfs and will cause the WWIDs listed in that file to be multipathed.

Note that in multipath-tools upstream and many Linux distributions,
"find_multipaths strict" is the default anyway. Users of distributions with
different defaults (e.g. openSUSE) would just need to create
/etc/multipath.conf (possibly with empty contents) to override this behavior if
they intend to activate multipath in the initramfs.

Fixes: 377d52c ("fix(multipath): omit module if included with no multipath devices")
Fixes: 4957ffa ("fix(multipath): omit module if included with no multipath devices")
13 months agofix(systemd): move installation of libkmod to udev-rules module
Alexander Tsoy [Tue, 16 Jul 2024 05:48:54 +0000 (08:48 +0300)] 
fix(systemd): move installation of libkmod to udev-rules module

libkmod library should be installed even if systemd module is
omitted, so move its installation to udev-rules module.

13 months agodocs: update NEWS.md and AUTHORS for release 103 103
dracutng[bot] [Sat, 13 Jul 2024 13:34:31 +0000 (13:34 +0000)] 
docs: update NEWS.md and AUTHORS for release 103

13 months agotest(DMSQUASH): add test for part of erofs support
Brian C. Lane [Fri, 12 Jul 2024 22:43:12 +0000 (15:43 -0700)] 
test(DMSQUASH): add test for part of erofs support

This adds a test for using erofs on a bare partition by
creating a new disk image, root_erofs, and writing the erofs compressed
/source directory directly to partition 1 and then booting the image
with root=live:/dev/disk/by-label/dracut_erofs

This doesn't quite test the anaconda-dracut use case of calling
dmsquash-live-root with the path of an erofs compressed file, but it is
close enough for now.

13 months agofix(dmsquash-live): make sure erofs module is installed
Brian C. Lane [Fri, 12 Jul 2024 22:41:11 +0000 (15:41 -0700)] 
fix(dmsquash-live): make sure erofs module is installed

13 months agofeat(test): add erofs-utils to the containers
Brian C. Lane [Fri, 12 Jul 2024 14:43:57 +0000 (07:43 -0700)] 
feat(test): add erofs-utils to the containers

13 months agofeat(dmdquash-live): add support for using erofs
Brian C. Lane [Wed, 10 Jul 2024 23:30:09 +0000 (16:30 -0700)] 
feat(dmdquash-live): add support for using erofs

This adds support for rootfs compressed with erofs. Either as a plain
erofs image or a LiveOS/rootfs.img ext4 filesystem compressed with
erofs.

This patch does not make any attempt to change the squashfs directory
naming (or variable names) in order to make these changes as small as
possible and easy to review. It also does not make any attempt to
support the multitude of available options other than what is needed by
anaconda-dracut calling this script to setup the boot.iso root
filesystem.

(which isn't to say it doesn't work, it just hasn't been tested and is
outside the scope of this change).

13 months agofix(test): run test 14 with systemd again
Benjamin Drung [Fri, 12 Jul 2024 08:57:02 +0000 (10:57 +0200)] 
fix(test): run test 14 with systemd again

Commit 061a1068ba4c872e48605b9b0ecd282f4630ea8f ("test: avoid writing to
rootfs as it might be read-only") fixes the test failure with systemd
256. So revert the changes to `test/TEST-14-IMSM` from commit
130f4dfce48b187944be9a0cacca794dd32428ad.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
13 months agoci: run extended tests on openSUSE as well
Laszlo Gombos [Wed, 10 Jul 2024 15:21:51 +0000 (11:21 -0400)] 
ci: run extended tests on openSUSE as well

13 months agotest(FULL-SYSTEM): make sure systemd-pcrphase can be installed
Laszlo Gombos [Tue, 9 Jul 2024 13:34:45 +0000 (09:34 -0400)] 
test(FULL-SYSTEM): make sure systemd-pcrphase can be installed

13 months agotest(FULL-SYSTEMD): remove workaround for multipath
Laszlo Gombos [Wed, 10 Jul 2024 15:20:02 +0000 (11:20 -0400)] 
test(FULL-SYSTEMD): remove workaround for multipath

13 months agofix(multipath): omit module if included with no multipath devices
Laszlo Gombos [Wed, 10 Jul 2024 12:43:31 +0000 (08:43 -0400)] 
fix(multipath): omit module if included with no multipath devices

Follow-up to 4957ffa935. return 255 instead of 1 and change the order
of checks.

13 months agofeat(kernel-modules): install platform/chrome modules on ARM/RISC-V
Alper Nebi Yasak [Tue, 9 Jul 2024 21:21:18 +0000 (00:21 +0300)] 
feat(kernel-modules): install platform/chrome modules on ARM/RISC-V

Most ARM Chromebooks need the ChromiumOS Embedded Controller drivers
located under kernel/drivers/platform/chrome for essential functionality
like keyboard, USB, and display backlight. Add them to the non-hostonly
initramfs by adding them to the ARM/RISC-V-specific instmods call.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
14 months agofix(dracut-install): copy xattr when use clone ioctl
Huaxin Lu [Thu, 20 Jun 2024 05:38:26 +0000 (13:38 +0800)] 
fix(dracut-install): copy xattr when use clone ioctl

When use clone ioctl to copy a file, the extended attributes of files are
missing, which is inconsistent with the result by using the cp command.
This commit add the process to copy extended attributes after clone_file().

Signed-off-by: Huaxin Lu <luhuaxin1@huawei.com>
14 months agofix(Dockerfile-Gentoo): add requirements for systemd-pcrphase
Andrew Ammerlaan [Tue, 9 Jul 2024 06:49:19 +0000 (08:49 +0200)] 
fix(Dockerfile-Gentoo): add requirements for systemd-pcrphase

Closes: https://github.com/dracut-ng/dracut-ng/issues/481
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
14 months agotest(FULL-SYSTEMD): add test with rd.luks.name
Laszlo Gombos [Mon, 8 Jul 2024 13:11:47 +0000 (09:11 -0400)] 
test(FULL-SYSTEMD): add test with rd.luks.name

Arch wiki recommends this configuration and last release regressed
this configuration.

14 months agotest(FULL-SYSTEMD): do not disable kernel loglevel
Laszlo Gombos [Sun, 7 Jul 2024 23:39:49 +0000 (19:39 -0400)] 
test(FULL-SYSTEMD): do not disable kernel loglevel

No other tests sets it to zero by default.

14 months agotest(FULL-SYSTEMD): add tests for volatile mode
Laszlo Gombos [Sun, 7 Jul 2024 23:36:27 +0000 (19:36 -0400)] 
test(FULL-SYSTEMD): add tests for volatile mode

14 months agotest(FULL-SYSTEMD): remove managing drivers manually
Laszlo Gombos [Sun, 7 Jul 2024 23:23:34 +0000 (19:23 -0400)] 
test(FULL-SYSTEMD): remove managing drivers manually

Let the btrfs module manage the btrfs driver.

14 months agotest(FULL-SYSTEMD): align with other tests
Laszlo Gombos [Sun, 7 Jul 2024 20:48:42 +0000 (16:48 -0400)] 
test(FULL-SYSTEMD): align with other tests

14 months agotest(FULL-SYSTEMD): control decryption from command line
Laszlo Gombos [Sun, 7 Jul 2024 20:09:22 +0000 (16:09 -0400)] 
test(FULL-SYSTEMD): control decryption from command line

14 months agotest(FULL-SYSTEMD): no need for explicit bash dependency
Laszlo Gombos [Sun, 7 Jul 2024 20:01:22 +0000 (16:01 -0400)] 
test(FULL-SYSTEMD): no need for explicit bash dependency

14 months agotest(FULL-SYSTEMD): avoid hostonly files for a generic testcase
Laszlo Gombos [Sun, 7 Jul 2024 19:32:16 +0000 (15:32 -0400)] 
test(FULL-SYSTEMD): avoid hostonly files for a generic testcase

14 months agotest(FULL-SYSTEMD): add systemd-coredump for testing
Laszlo Gombos [Sun, 7 Jul 2024 19:19:15 +0000 (15:19 -0400)] 
test(FULL-SYSTEMD): add systemd-coredump for testing

14 months agotest: move /failed to /run/failed as rootfs might be read-only
Laszlo Gombos [Sun, 7 Jul 2024 19:10:43 +0000 (15:10 -0400)] 
test: move /failed to /run/failed as rootfs might be read-only

14 months agofix(dracut-init.sh): clarify the error message
Laszlo Gombos [Sat, 6 Jul 2024 12:29:57 +0000 (08:29 -0400)] 
fix(dracut-init.sh): clarify the error message

Clarify that dracut module is missing and not Linux command or package.

14 months agofix(systemd-pcrphase): make tpm2-tss an optional dependency
Laszlo Gombos [Fri, 5 Jul 2024 18:17:00 +0000 (14:17 -0400)] 
fix(systemd-pcrphase): make tpm2-tss an optional dependency

14 months agofix(multipath): omit module if included with no multipath devices
Laszlo Gombos [Mon, 8 Jul 2024 15:18:01 +0000 (11:18 -0400)] 
fix(multipath): omit module if included with no multipath devices

Instead of warning the user, lets omit the module to follow
'Principle of Least Surprise'.

14 months agofeat(multipath): warn if included with no multipath devices and no user conf
Antonio Alvarez Feijoo [Tue, 29 Nov 2022 14:21:04 +0000 (15:21 +0100)] 
feat(multipath): warn if included with no multipath devices and no user conf

The multipath module is always included in no-hostonly mode, but including it in
the initramfs might activate multipath on the root device, which could be
undesirable. This behavior can be manually fixed by explicitly excluding the
root device from multipath in /etc/multipath.conf.

Therefore, issue a warning in no-hostonly mode, if there is no multipath device
and the user has not configured multipath.

bsc#1069169

Signed-off-by: Martin Wilck <mwilck@suse.de>
Signed-off-by: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
14 months agofix(systemd): check for systemd-vconsole-setup.service
Laszlo Gombos [Thu, 4 Jul 2024 01:56:16 +0000 (21:56 -0400)] 
fix(systemd): check for systemd-vconsole-setup.service

14 months agofix(nfs): support rpcbind user named _rpc
Benjamin Drung [Mon, 8 Jul 2024 14:29:40 +0000 (16:29 +0200)] 
fix(nfs): support rpcbind user named _rpc

The Debian/Ubuntu package `rpcbind` creates a user named `_rpc`. Support
running `rpcbind` with that user. Add a helper function `get_rpc_user`
that derives the desired user from parsing `/etc/passwd`.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
14 months agofeat(dracut-install): configure if weak dep is still not supported in kmod
Jose Ignacio Tornos Martinez [Mon, 8 Jul 2024 11:41:24 +0000 (13:41 +0200)] 
feat(dracut-install): configure if weak dep is still not supported in kmod

The weak dependency feature is new and better be backward compatible.
So check in configure stage if the kmod used includes the weak dependency
feature so as not to include it here and avoid compilation errors.

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
14 months agofeat(dracut-install): add weak dependencies support
Jose Ignacio Tornos Martinez [Mon, 8 Jul 2024 11:06:56 +0000 (13:06 +0200)] 
feat(dracut-install): add weak dependencies support

It has been seen that for some network mac drivers (i.e. lan78xx) the
related module for the phy is loaded dynamically depending on the current
hardware. In this case, the associated phy is read using mdio bus and then
the associated phy module is loaded during runtime (kernel function
phy_request_driver_module). However, no software dependency is defined, so
the user tools will no be able to get this dependency. For example, if
dracut is used and the hardware is present, lan78xx will be included but no
phy module will be added, and in the next restart the device will not work
from boot because no related phy will be found during initramfs stage.

In order to solve this, we could define a normal 'pre' software dependency
in lan78xx module with all the possible phy modules (there may be some),
but proceeding in that way, all the possible phy modules would be loaded
while only one is necessary.

So, a new type of dependency has been created, that we are going to call
'weak' to be used only by the user tools that need to detect this situation.
In that way, for example, dracut could check the 'weak' dependency of the
modules involved in order to install these dependencies in initramfs too.
That is, for the commented lan78xx module, defining the 'weak' dependency
with the possible phy modules list, only the necessary phy would be loaded
on demand keeping the same behavior, but all the possible phy modules would
be available from initramfs.

The 'weak' dependency support has been already included in kmod:
https://github.com/kmod-project/kmod/commit/05828b4a6e9327a63ef94df544a042b5e9ce4fe7
And in kernel:
https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/commit/?h=modules-next&id=1f3dacc0dcef6681c2acf5890e018012f6b53085
After these, 'weak' dependencies for modules will start to appear.
Read the possible weak dependencies from dracut in order to take them into
account.

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
14 months agoperf(dracut-install): use driver/module sysfs dirs for module name
Alper Nebi Yasak [Mon, 3 Jun 2024 09:12:39 +0000 (12:12 +0300)] 
perf(dracut-install): use driver/module sysfs dirs for module name

To handle fw_devlink suppliers as dependencies, we traverse every device
in /sys and collect a hashmap of module names to their suppliers before
starting module installation work. The module names are found by reading
and passing the "modalias" file to the `kmod_module_new_from_lookup()`
function from libkmod. This function is unexpectedly slow on ARM64
systems with device-tree where this work is primarily necessary.

Usually (but not always), the running kernel has already looked up the
modalias and bound a driver from the associated module. Get module names
by resolving the "driver/module" symbolic link and taking its basename.
If it doesn't exist, fall back to looking up the modalias.

It's possible that multiple modules match the modalias, in which case
others will be ignored in favor of the one already chosen by the kernel.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
14 months agotest: drop 'quiet' from kernel cmdline on verbose runs
Benjamin Drung [Mon, 8 Jul 2024 09:39:06 +0000 (11:39 +0200)] 
test: drop 'quiet' from kernel cmdline on verbose runs

If the test cases are run in verbose with (i.e. with `V=1` or `V=2`
set), do not add `quiet` to the kernel cmdline.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
14 months agofix(net-lib): require and install only the necessary binaries
Antonio Alvarez Feijoo [Mon, 8 Jul 2024 07:17:54 +0000 (09:17 +0200)] 
fix(net-lib): require and install only the necessary binaries

- `pgrep`, `tr` not needed.
- `sed` installed by `base`.

14 months agofeat(lsinitrd.sh): support configurable initrd filenames
Benjamin Drung [Tue, 2 Jul 2024 20:15:57 +0000 (22:15 +0200)] 
feat(lsinitrd.sh): support configurable initrd filenames

The initrd filename can be configured via `initrdname`. Support this
feature also in `lsinitrd` (similar to the code in
`dracut-initramfs-restore.sh`).

Fix: 28820e205328 ("feat(dracut.sh): make initramfs-${kernel}.img filename configurable")
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
14 months agofix: check for searched initrds to be present
Benjamin Drung [Tue, 2 Jul 2024 20:15:41 +0000 (22:15 +0200)] 
fix: check for searched initrds to be present

`find_initrd_for_kernel_version` uses the same search order than
`kernel-install` from systemd v249 [1]. When
`dracut-initramfs-restore.sh` or `lsinitrd.sh` searches for initrds,
they should check the presence of the files instead of assuming them to
be present. Otherwise the search might be stopped before an existing
initrd is found. On Ubuntu 24.10 (oracular) with a mounted `/boot`:

```
$ ls /boot/initr* -alh
lrwxrwxrwx 1 root root  27 Jun 20 15:31 /boot/initrd.img -> initrd.img-6.8.0-31-generic
-rw-r--r-- 1 root root 22M Jun 20 16:27 /boot/initrd.img-6.8.0-31-generic
lrwxrwxrwx 1 root root  27 Jun 20 15:31 /boot/initrd.img.old -> initrd.img-6.8.0-31-generic
$ lsinitrd 2>&1 | head -n1
No <initramfs file> specified and the default image '/boot/efi/6491959c70e6481eae6406d25e250d76/6.8.0-31-generic/initrd' cannot be accessed!
```

[1] https://github.com/systemd/systemd/blob/v249/src/kernel-install/kernel-install

14 months agorefactor: introduce find_initrd_for_kernel_version
Benjamin Drung [Tue, 2 Jul 2024 20:14:40 +0000 (22:14 +0200)] 
refactor: introduce find_initrd_for_kernel_version

Refactor `dracut-initramfs-restore.sh` and `lsinitrd.sh` to introduce a
`find_initrd_for_kernel_version` function to abstract the code. This
commit does not change the logic of the search order.

14 months agofeat(debug): add findmnt to help debugging
Laszlo Gombos [Sat, 6 Jul 2024 18:41:34 +0000 (14:41 -0400)] 
feat(debug): add findmnt to help debugging

Also sorted the list.

14 months agoci: run extended tests on Alpine and Void as well
Laszlo Gombos [Fri, 5 Jul 2024 18:05:11 +0000 (14:05 -0400)] 
ci: run extended tests on Alpine and Void as well

14 months agodocs: remove suggesting that hostonly option is only for experts
Laszlo Gombos [Sat, 6 Jul 2024 12:47:35 +0000 (08:47 -0400)] 
docs: remove suggesting that hostonly option is only for experts

Since some distributions set hostonly the default, suggesting
that it is only for experts is a bit of overstatement.

14 months agotest(TEST-40-NBD): tests should avoid managing kernel modules manually
Laszlo Gombos [Sat, 6 Jul 2024 13:17:09 +0000 (09:17 -0400)] 
test(TEST-40-NBD): tests should avoid managing kernel modules manually

Remove NFS related kernel modules from the NBD test.
Remove networking modules that are installed by kernel-network-modules.

Increase server disk space as now more kernel modules gets installed.

14 months agotest: delete hosts files that are not used by tests
Laszlo Gombos [Thu, 4 Jul 2024 02:53:40 +0000 (22:53 -0400)] 
test: delete hosts files that are not used by tests

CI uses IP addresses for simplicity.

14 months agotest: avoid writing to rootfs as it might be read-only
Laszlo Gombos [Sun, 7 Jul 2024 00:12:33 +0000 (20:12 -0400)] 
test: avoid writing to rootfs as it might be read-only

There is no need to remount rootfs read only right before shutdown.

14 months agotest(FULL-SYSTEMD): remove /etc/fstab from the rootfs
Laszlo Gombos [Sat, 6 Jul 2024 17:53:42 +0000 (13:53 -0400)] 
test(FULL-SYSTEMD): remove /etc/fstab from the rootfs

This PR moves /usr mounting into initrd instead of after
switch_root.

This PR makes the test more generic and allow more testcases.

14 months agotest(FULL-SYSTEMD): add a test for encrypted root
Laszlo Gombos [Sat, 6 Jul 2024 02:11:18 +0000 (22:11 -0400)] 
test(FULL-SYSTEMD): add a test for encrypted root

14 months agotest(FULL-SYSTEMD): include more systemd dracut modules
Laszlo Gombos [Wed, 3 Jul 2024 23:42:07 +0000 (19:42 -0400)] 
test(FULL-SYSTEMD): include more systemd dracut modules

Most of modules added had no test coverage in any of the tests on CI.

14 months agoci: add systemd-coredump to Debian/Ubuntu containers
Laszlo Gombos [Thu, 4 Jul 2024 02:29:16 +0000 (22:29 -0400)] 
ci: add systemd-coredump to Debian/Ubuntu containers

PR to enable testing systemd-coredump module.

14 months agotest: run iscsi and nbd tests sequentially to make it less flaky
Laszlo Gombos [Thu, 4 Jul 2024 12:15:31 +0000 (08:15 -0400)] 
test: run iscsi and nbd tests sequentially to make it less flaky

14 months agodocs: correct shutdown path disucssion
Ian Wienand [Wed, 3 Jul 2024 04:48:28 +0000 (14:48 +1000)] 
docs: correct shutdown path disucssion

Since 4f03054e540427682221e4c62b4d44f79424e38a, these shutdown steps have been
in response to the ExecStop= called from the sysinit.target.

Correct the doc in the two places it mentions this.