]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
2 years agofix(test): add support for thin volumes in the Gentoo container
Laszlo Gombos [Fri, 19 Apr 2024 12:56:25 +0000 (08:56 -0400)] 
fix(test): add support for thin volumes in the Gentoo container

2 years agoci: enable testing on arm64 using the Debian container
Laszlo Gombos [Sat, 13 Apr 2024 22:18:48 +0000 (18:18 -0400)] 
ci: enable testing on arm64 using the Debian container

2 years agofix(test): fixup Gentoo CI
Laszlo Gombos [Thu, 18 Apr 2024 22:27:10 +0000 (18:27 -0400)] 
fix(test): fixup Gentoo CI

Improve systemd installation by enabling cryptsetup flag.

Remove non-systemd craft from Gentoo, since now the project has
Alpine and Void container to test with.

Add some extra packages to enable more test coverage.

2 years agofeat(dracut.sh): make initramfs-${kernel}.img filename configurable
Laszlo Gombos [Fri, 12 Apr 2024 18:01:44 +0000 (14:01 -0400)] 
feat(dracut.sh): make initramfs-${kernel}.img filename configurable

2 years agofix(dracut.sh): include efi mountpoint for hostonly
dalto8 [Sat, 13 Apr 2024 18:39:22 +0000 (18:39 +0000)] 
fix(dracut.sh): include efi mountpoint for hostonly

When the ESP is mounted at /efi on it's own device, support for the underlying device is excluded from the initramfs.

2 years agofix(install.d): correctly install pre-genned image and die if no args
Andrew Ammerlaan [Wed, 17 Apr 2024 19:33:04 +0000 (21:33 +0200)] 
fix(install.d): correctly install pre-genned image and die if no args

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
2 years agofix(dracut): move hooks directory from /usr/lib to /var/lib
Laszlo Gombos [Fri, 5 Apr 2024 13:50:20 +0000 (15:50 +0200)] 
fix(dracut): move hooks directory from /usr/lib to /var/lib

Since https://github.com/systemd/systemd/commit/ffc1ec73, /usr is mounted as
read-only in the initramfs by default.

Fixes #2588

Co-authored-by: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
2 years agofix(install.d): simplify and use what kernel-install gives us
Andrew Ammerlaan [Fri, 5 Apr 2024 18:31:35 +0000 (20:31 +0200)] 
fix(install.d): simplify and use what kernel-install gives us

drops legacy fallback path, exit always if we are not chosen as initrd_
generator. Exit if we are already installing an UKI. Exit if an initrd
image is already specified by kernel-install.

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
2 years agofix(dracut-install): release memory allocated for regular expressions
Antonio Alvarez Feijoo [Tue, 28 Nov 2023 14:43:41 +0000 (15:43 +0100)] 
fix(dracut-install): release memory allocated for regular expressions

Use `regfree` to free memory allocated by `regcomp`. Quoting [1]:

"If the preg argument to regexec() or regfree() is not a compiled regular
expression returned by regcomp(), the result is undefined."

Therefore, `regfree` must only be called if `regcomp` succeeded.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/regcomp.html

2 years agofix(dracut.sh): don't unset LD_PRELOAD
Thierry Bultel [Mon, 10 Jan 2022 08:09:43 +0000 (09:09 +0100)] 
fix(dracut.sh): don't unset LD_PRELOAD

LD_PRELOAD and LD_LIBRARY_PATH are needed to run under fakeroot.

Signed-off-by: Thierry Bultel <thierry.bultel@linatsea.fr>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[yann.morin.1998@free.fr: commit log also mentions LD_LIBRARY_PATH]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2 years agotest(BTRFSRAID): make test 15 use the test dracut modules
Laszlo Gombos [Mon, 15 Apr 2024 01:10:24 +0000 (21:10 -0400)] 
test(BTRFSRAID): make test 15 use the test dracut modules

2 years agotest(ISMS): make test 14 use the test dracut modules
Laszlo Gombos [Mon, 15 Apr 2024 00:56:09 +0000 (20:56 -0400)] 
test(ISMS): make test 14 use the test dracut modules

2 years agotest(LVM-THIN): make sure dm_thin_pool Linux kernel module is loaded
Laszlo Gombos [Sun, 14 Apr 2024 14:28:33 +0000 (10:28 -0400)] 
test(LVM-THIN): make sure dm_thin_pool Linux kernel module is loaded

2 years agoci: gummiboot-stub no longer supports UEFI image with latest kernel
Laszlo Gombos [Sun, 14 Apr 2024 13:05:12 +0000 (09:05 -0400)] 
ci: gummiboot-stub no longer supports UEFI image with latest kernel

Remove ovmf from Alpine container to explicitly skip UEFI test.
Replace gummiboot with systemd-boot-efistub in the Void container.
Be consistent and remove sudo from all test containers.

2 years agotest(RAID-DEG): make test 12 use the test dracut modules
Laszlo Gombos [Sat, 13 Apr 2024 01:28:41 +0000 (21:28 -0400)] 
test(RAID-DEG): make test 12 use the test dracut modules

2 years agodocs(README.md): repology badges
Laszlo Gombos [Fri, 12 Apr 2024 11:19:31 +0000 (07:19 -0400)] 
docs(README.md): repology badges

2 years agofix(test): remove ib700wdt kernel module from tests
Laszlo Gombos [Mon, 20 Feb 2023 16:48:04 +0000 (16:48 +0000)] 
fix(test): remove ib700wdt kernel module from tests

i6300esb is preferred for tests.

2 years agoci: enable systemd-networkd testing
Laszlo Gombos [Mon, 8 Apr 2024 21:32:21 +0000 (17:32 -0400)] 
ci: enable systemd-networkd testing

Using Arch container for systemd-networkd testing as often it has
the latest version of systemd-networkd.

2 years agotest(DRACUT-CPIO): fix test by calling poweroff instead of SysRq
Laszlo Gombos [Fri, 12 Apr 2024 14:16:49 +0000 (10:16 -0400)] 
test(DRACUT-CPIO): fix test by calling poweroff instead of SysRq

2 years agotest(DRACUT-CPIO): enable building dracut-cpio when cargo is installed
Laszlo Gombos [Fri, 5 Apr 2024 01:59:35 +0000 (21:59 -0400)] 
test(DRACUT-CPIO): enable building dracut-cpio when cargo is installed

Since the test is well written, it will be just skipped if
cargo is not in the test container.

Add cargo to the openSUSE test caontainer.

2 years agoperf(dracut-init.sh): stop parsing args in dracut_instmods if --silent is found
Antonio Alvarez Feijoo [Wed, 29 Nov 2023 15:59:37 +0000 (16:59 +0100)] 
perf(dracut-init.sh): stop parsing args in dracut_instmods if --silent is found

2 years agoperf(drm): group dracut_instmods calls
Antonio Alvarez Feijoo [Thu, 30 Nov 2023 14:04:43 +0000 (15:04 +0100)] 
perf(drm): group dracut_instmods calls

This module loops over many bus devices, and calls `dracut_instmods` for each
one. E.g., on a Lenovo Thinkpad laptop:

```
> for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?,vmbus/devices}/*/modalias; do [[ -e $i ]] && [[ -n $(< "$i") ]]  && echo $i; done | wc -l
79
```

Every call to `dracut_instmods` spawns a `dracut-install` process, which in the
previous example means calling `dracut-install` 79 times using the same
arguments.

If any call to `dracut-install` fails, dracut continues its execution (even the
errors are not shown, because it's called with `--silent`). Therefore, let's
take the contents of all the `modalias` files into an array and call
`dracut-install` only once, adding also the `-o` argument, so if any of the
modules cannot be installed, `dracut-install` does not stop.

2 years agofix(man): further clarify live-image overlay types & RAM usage
Frederick Grose [Sat, 13 Apr 2024 03:11:42 +0000 (23:11 -0400)] 
fix(man): further clarify live-image overlay types & RAM usage

Describe the separate overlay types, their specification, and
their RAM usage for a live SquashFS (read-only) base filesystem
image.

2 years agofeat(lsinitrd.sh): print stored dracut cmdline
Steffen Maier [Fri, 10 Feb 2023 17:37:55 +0000 (18:37 +0100)] 
feat(lsinitrd.sh): print stored dracut cmdline

It's more convenient for debugging than extracting or unpacking the
corresponding files.

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
2 years agofeat(lsinitrd.sh): enable unpacking files from squash-root.img
Steffen Maier [Thu, 26 Jan 2023 13:50:40 +0000 (14:50 +0100)] 
feat(lsinitrd.sh): enable unpacking files from squash-root.img

This is helpful for debugging some kdump mkdumprd that prefer dracut-squash.

To not break when unsquashfs upstream would change the default path prefix,
explicitly specify the prefix as argument so users always find files from
squash-root.img by using the same hardcoded prefix, both in the file listing
and when extracting files.

Regarding extract_files (without --unpack):
Unsquashfs cannot seem to extract to stdout, so take a detour via a temp
file.

Regarding --unpack:
Even though cpio for comparison would not overwrite files on extracing,
pass the force flag to unsquashfs on extracing individual files.
Otherwise, unsquashfs complains about its relative top-level directory
"squashfs-root" which already exists after the first file was extracted.
With the force flag, the user can specify multiple files to extract from
squash-root.img, or can invoke lsinitrd multiple times in the same
directory to extract multiple files from squash-root.img.

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
2 years agofeat(tpm2-tss): add tpm2.target and systemd-tpm2-generator
Antonio Alvarez Feijoo [Mon, 19 Feb 2024 14:22:42 +0000 (15:22 +0100)] 
feat(tpm2-tss): add tpm2.target and systemd-tpm2-generator

https://github.com/systemd/systemd/commit/4e1f0037 added a new `tpm2.target`,
which is now used by `systemd-pcrphase-initrd.service`, and
`systemd-tpm2-generator`, which adds a `Wants=` dependency from `sysinit.target`
to `tpm2.target` when it detects that the firmware discovered a TPM2 device but
the kernel didn't.

2 years agofix(release): dracut --> dracut-ng for NEWS.md
Laszlo Gombos [Sat, 13 Apr 2024 01:46:50 +0000 (21:46 -0400)] 
fix(release): dracut --> dracut-ng for NEWS.md

2 years agoci: enable Void Linux for basic tests with runit
Laszlo Gombos [Fri, 12 Apr 2024 21:53:55 +0000 (17:53 -0400)] 
ci: enable Void Linux for basic tests with runit

2 years agofix(dracut-init.sh): handle decompress with `--sysroot`
Antonio Alvarez Feijoo [Wed, 7 Feb 2024 10:49:14 +0000 (11:49 +0100)] 
fix(dracut-init.sh): handle decompress with `--sysroot`

Remove `$dracutsysrootdir` from the file path passed to the decompress command,
otherwise the path is wrong and the file is not decompressed in the temporary
directory where the initramfs is being built.

E.g.:

```
dracut[I]: *** Including module: i18n ***
gzip: /var/tmp/dracut.6Iqygd/initramfs/.snapshots/12/snapshot/usr/share/kbd/keymaps/i386/include/euro1.map.gz: No such file or directory
gzip: /var/tmp/dracut.6Iqygd/initramfs/.snapshots/12/snapshot/usr/share/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory
gzip: /var/tmp/dracut.6Iqygd/initramfs/.snapshots/12/snapshot/usr/share/kbd/keymaps/xkb/us.map.gz: No such file or directory
```

2 years agofix(i18n): handle keymap includes with `--sysroot`
Antonio Alvarez Feijoo [Wed, 7 Feb 2024 10:48:57 +0000 (11:48 +0100)] 
fix(i18n): handle keymap includes with `--sysroot`

The results of `find "${dracutsysrootdir}${kbddir}"/keymaps/ -type f -name "${INCL}*" -print0`
are directly passed to `findkeymap` containing the `$dracutsysrootdir` path,
which causes that `[[ -f $dracutsysrootdir$1 ]]` evaluates to false because the
same path is prepended again, and the following `find` fails because `MAPNAME`
has an absolute path.

E.g., with `dracutsysrootdir=/.snapshots/9/snapshot`, for `MAPNAME=us` the
`INCLUDES` of `MAP=/.snapshots/9/snapshot/usr/share/kbd/keymaps/i386/qwerty/us.map.gz`
will pass `/.snapshots/9/snapshot/usr/share/kbd/keymaps/i386/include/qwerty-layout.inc` to
`findkeymap`.

```
dracut[I]: *** Including module: i18n ***
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
```

2 years agofix(dracut-lib): only remove initqueue/finished scripts, not the hook dir
Antonio Alvarez Feijoo [Mon, 12 Feb 2024 08:57:38 +0000 (09:57 +0100)] 
fix(dracut-lib): only remove initqueue/finished scripts, not the hook dir

The `remove_hostonly_files` function should only remove (as its name suggests)
hostonly configuration and files. The initqueue/finished scripts considered as
hostonly that must be removed are added via `wait_for_dev`. But, the `hookdirs`
are always created at build time, and should not be removed.

This patch also allows to remove the `mkdir` workaround in the `network-manager`
module (copied-pasted into the `connman` module after), and avoids having to add
it tree-wide in many missing places.

Fixes 87e90d7f4a344d8e0f638acfccb3e5a387a1658c
Fixes #2620

2 years agoci: fix support for regenerating dracut.html when making a release
Laszlo Gombos [Thu, 11 Apr 2024 13:19:18 +0000 (09:19 -0400)] 
ci: fix support for regenerating dracut.html when making a release

Remove the need for a step to manually correct version inside
dracut.html.

2 years agofix(dracut.sh): do not add device if find_block_device fails
dalto8 [Thu, 11 Apr 2024 22:26:03 +0000 (22:26 +0000)] 
fix(dracut.sh): do not add device if find_block_device fails

2 years agoci: sort packages by name
Laszlo Gombos [Fri, 12 Apr 2024 11:59:59 +0000 (07:59 -0400)] 
ci: sort packages by name

2 years agoci: remove dracut package without removing its dependencies
Laszlo Gombos [Fri, 12 Apr 2024 11:51:20 +0000 (07:51 -0400)] 
ci: remove dracut package without removing its dependencies

2 years agofix(test): do not omit dracut modules for initramfs.testing
Laszlo Gombos [Fri, 3 Mar 2023 13:39:02 +0000 (13:39 +0000)] 
fix(test): do not omit dracut modules for initramfs.testing

We want to know if including dracut modules makes the test fail
instead of masking issues by omitting dracut modules.

2 years agofix(systemd-sysext): handle confexts and correct extensions search path
Antonio Alvarez Feijoo [Tue, 16 May 2023 13:14:03 +0000 (15:14 +0200)] 
fix(systemd-sysext): handle confexts and correct extensions search path

- Support to confexts added in https://github.com/systemd/systemd/pull/26013
(instead of working on /usr and /opt, confext will extend only /etc).

- /usr/lib/extensions/ not supported since https://github.com/systemd/systemd/commit/de862276

- In addition to these two fixes, add only raw binary disk images contained in
regular files, because dracut does not have a helper function to add directories
recursively.

2 years agotest: disable debug log by default
Laszlo Gombos [Tue, 9 Apr 2024 00:24:16 +0000 (20:24 -0400)] 
test: disable debug log by default

Debug logs can be enabled outside of the tests.

2 years agofix(nvmf): move /etc/nvme/host{nqn,id} requirement to hostonly
Tomas Bzatek [Thu, 21 Sep 2023 12:31:07 +0000 (14:31 +0200)] 
fix(nvmf): move /etc/nvme/host{nqn,id} requirement to hostonly

When creating initramfs for universal boot image such as an installer,
we can't include any machine-specific IDs. Let's move the check
for /etc/nvme/hostnqn and /etc/nvme/hostid files presence to
the hostonly section to avoid unsatisfied requirements.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2 years agoci: add more packages to the Arch container to enable more testing
Laszlo Gombos [Sat, 6 Apr 2024 12:10:14 +0000 (08:10 -0400)] 
ci: add more packages to the Arch container to enable more testing

2 years agoci: manage tgt with pacman
Laszlo Gombos [Sat, 6 Apr 2024 10:56:12 +0000 (06:56 -0400)] 
ci: manage tgt with pacman

Install tgt with pacman as now tgt is in [extra].

2 years agofix(systemd): explicitly install some libs that will not be statically included
Antonio Alvarez Feijoo [Thu, 4 Apr 2024 11:49:26 +0000 (13:49 +0200)] 
fix(systemd): explicitly install some libs that will not be statically included

Some required libraries that used to be statically included are in the process
to be opened via `dlopen()`.

References:
- https://github.com/systemd/systemd/pull/31131
- https://github.com/systemd/systemd/pull/31550
- https://github.com/systemd/systemd/pull/32019

Closes #2642

2 years agochore(deps): bump actions/checkout to v4
Laszlo Gombos [Sat, 6 Apr 2024 20:57:17 +0000 (16:57 -0400)] 
chore(deps): bump actions/checkout to v4

2 years agofix(dracut.sh): make uki's reproducible
Anton Lundin [Wed, 14 Jun 2023 11:51:34 +0000 (13:51 +0200)] 
fix(dracut.sh): make uki's reproducible

If the user asks for the dracut output to be reproducible, we should
ensure objcopy produces a reproducible uki to.

Signed-off-by: Anton Lundin <glance@ac2.se>
2 years agofix(test): fixup Gentoo CI
Andrew Ammerlaan [Mon, 8 Apr 2024 10:22:37 +0000 (12:22 +0200)] 
fix(test): fixup Gentoo CI

we download systemd docker image, so we want systemd, not systemd-utils

use binpkgs to speed up, use parallel fetching, emerging, installing

efistub builder needs /boot etc from kernel builder

equery f is used to list files installed by a package on Gentoo

Closes: https://github.com/dracut-ng/dracut-ng/issues/135
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
2 years agoci: enable alpine for basic tests
Laszlo Gombos [Sun, 7 Apr 2024 22:20:40 +0000 (18:20 -0400)] 
ci: enable alpine for basic tests

2 years agoci: tell the installkernel package to use Debians installkernel
Laszlo Gombos [Sun, 7 Apr 2024 16:11:29 +0000 (12:11 -0400)] 
ci: tell the installkernel package to use Debians installkernel

2 years agotest: the Linux kernel is named kernel- in Gentoo container
Laszlo Gombos [Sun, 7 Apr 2024 15:46:08 +0000 (11:46 -0400)] 
test: the Linux kernel is named kernel- in Gentoo container

2 years agodocs: update NEWS.md and AUTHORS 101
dracutng[bot] [Sun, 7 Apr 2024 14:35:33 +0000 (14:35 +0000)] 
docs: update NEWS.md and AUTHORS

2 years agorevert: "fix(dracut.sh): do not add device if find_block_device returns"
Laszlo Gombos [Sun, 7 Apr 2024 13:38:00 +0000 (09:38 -0400)] 
revert: "fix(dracut.sh): do not add device if find_block_device returns"

This reverts commit 3d0d7e0737bd80f522f19918dc052bd795548b5e.

2 years agoci: improve Gentoo container
Laszlo Gombos [Sat, 25 Nov 2023 19:39:59 +0000 (14:39 -0500)] 
ci: improve Gentoo container

Switch from musl and OpenRC to glibc and systemd for Gentoo.
Use Alpine instead for musl and OpenRC testing.

2 years agofix(dmsquash-live): update documentation
Laszlo Gombos [Sun, 2 Apr 2023 01:37:15 +0000 (01:37 +0000)] 
fix(dmsquash-live): update documentation

Command line should have preference over image content driven
configuration when there is a conflict between the two.

Follow-up to 0e780720efe6488c4e07af39926575ee12f40339 .

2 years agofix(dracut-install): continue parsing if ldd prints "cannot be preloaded"
Antonio Alvarez Feijoo [Tue, 28 Feb 2023 11:06:35 +0000 (12:06 +0100)] 
fix(dracut-install): continue parsing if ldd prints "cannot be preloaded"

When /etc/ld.so.preload contains a non-existing library, `ldd` prints the
following output:

```
> ldd /usr/lib64/libfido2.so.1.12.0
ERROR: ld.so: object '/usr/lib64/libfoo.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib64/libfoo.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
linux-vdso.so.1 (0x00007ffd477f5000)
libcbor.so.0.10 => /lib64/libcbor.so.0.10 (0x00007f34062dd000)
libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007f3405e00000)
libudev.so.1 => /lib64/libudev.so.1 (0x00007f34062af000)
libhidapi-hidraw.so.0 => /lib64/libhidapi-hidraw.so.0 (0x00007f34062a6000)
libz.so.1 => /lib64/libz.so.1 (0x00007f340628c000)
libc.so.6 => /lib64/libc.so.6 (0x00007f3405c05000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3406336000)
ERROR: ld.so: object '/usr/lib64/libfoo.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
> echo $?
0
ERROR: ld.so: object '/usr/lib64/libfoo.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
```

If `dracut-install` stops parsing the `ldd` output, the initrd will not contain
all the required dependencies.

Fixes issue #2241

2 years agofix(dracut.sh): omit compressed kernel modules from find searching exec files
Antonio Alvarez Feijoo [Fri, 28 Apr 2023 08:57:02 +0000 (10:57 +0200)] 
fix(dracut.sh): omit compressed kernel modules from find searching exec files

Although the kernel modules are not included yet because they are not
executable, this speeds up the `find`.

2 years agofix(dracut-systemd): replace `rd.udev.log-priority` with `rd.udev.log_level`
Antonio Alvarez Feijoo [Wed, 24 Jan 2024 14:27:39 +0000 (15:27 +0100)] 
fix(dracut-systemd): replace `rd.udev.log-priority` with `rd.udev.log_level`

`rd.udev.log-priority` is deprecated since systemd-v247
(https://github.com/systemd/systemd/commit/64a3494c)

Also, fix deprecation warning not being displayed for `rdudevinfo` and
`rdudevdebug`.

2 years agodocs: update NEWS.md and AUTHORS 100
dracutng[bot] [Sat, 6 Apr 2024 01:15:27 +0000 (01:15 +0000)] 
docs: update NEWS.md and AUTHORS

2 years agoci: re-enable test 50
Laszlo Gombos [Thu, 4 Apr 2024 12:14:29 +0000 (08:14 -0400)] 
ci: re-enable test 50

2 years agoci: add support for regenerating dracut.html when making a release
Laszlo Gombos [Fri, 5 Apr 2024 10:17:58 +0000 (06:17 -0400)] 
ci: add support for regenerating dracut.html when making a release

2 years agofix(release): maintain dracut.html in the source tree
Laszlo Gombos [Thu, 4 Apr 2024 16:02:41 +0000 (12:02 -0400)] 
fix(release): maintain dracut.html in the source tree

Update dracut.html as part of release generation.

2 years agotest(FULL-SYSTEMD): use poweroff to shut down test
Laszlo Gombos [Thu, 4 Apr 2024 14:15:14 +0000 (10:15 -0400)] 
test(FULL-SYSTEMD): use poweroff to shut down test

Without this change the test seems to be flaky.

2 years agofix: wait 12 hours before halt on media check fail
Adam Williamson [Mon, 30 Oct 2023 04:19:36 +0000 (21:19 -0700)] 
fix: wait 12 hours before halt on media check fail

If a modesetting driver has been loaded by the time the media
check happens, halting the system (as we currently do immediately
if the check fails) blanks the screen, which is confusing for
the user. This adds a warning message and a 12-hour wait before
the system is eventually halted, so the user can see the media
check failure and (presumably) reboot and fix the medium.

It also tweaks the text of the failure message not to call it a
"CD check", since it's not 1998 any more.

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

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2 years agofix(dracut-lib): use poweroff instead of halt
Lukas Nykryn [Wed, 10 May 2023 10:54:25 +0000 (12:54 +0200)] 
fix(dracut-lib): use poweroff instead of halt

Using halt will keep the HW still powered on. This can be confusing for
users. The screen is blank, but for example the fan is still
running and they have no idea what is going on. So let's call poweroff.

2 years agofix(dracut-init.sh): do not print by default if a modules is not installed
Laszlo Gombos [Thu, 4 Apr 2024 15:05:59 +0000 (11:05 -0400)] 
fix(dracut-init.sh): do not print by default if a modules is not installed

We are already printing out by default what modules are installed so user
can check what got installed.

2 years agotest(NFS): enable NFSv4 tests
Laszlo Gombos [Wed, 3 Apr 2024 03:23:12 +0000 (23:23 -0400)] 
test(NFS): enable NFSv4 tests

In addition make sure that exportfs is available before attempting
to run the tests.

2 years agotest(LVM): make test 11 use the test dracut modules
Laszlo Gombos [Sat, 4 Mar 2023 12:33:34 +0000 (12:33 +0000)] 
test(LVM): make test 11 use the test dracut modules

2 years agodocs(README.md): remove reference to old kernel mailing list
Antonio Alvarez Feijoo [Thu, 8 Jun 2023 13:49:44 +0000 (15:49 +0200)] 
docs(README.md): remove reference to old kernel mailing list

Fixes issue #2135

2 years agorevert(dracut-install): file created without restricting permissions
Laszlo [Tue, 2 Apr 2024 15:47:28 +0000 (11:47 -0400)] 
revert(dracut-install): file created without restricting permissions

This reverts commit 3439d139616196f0cd0af2e6244acf6c5f85621f.

2 years agoci: drop which package from CI containers
Laszlo Gombos [Tue, 2 Apr 2024 23:39:46 +0000 (19:39 -0400)] 
ci: drop which package from CI containers

Prefer command over which and keep it that way.

2 years agoci: don't validate the pull request title
Laszlo Gombos [Wed, 3 Apr 2024 00:58:05 +0000 (20:58 -0400)] 
ci: don't validate the pull request title

2 years agofix(dracut.sh): recognize kernel file in /boot named vmlinux too
Icenowy Zheng [Sun, 18 Feb 2024 15:20:06 +0000 (23:20 +0800)] 
fix(dracut.sh): recognize kernel file in /boot named vmlinux too

The kernel file, at least in AOSC OS, is named vmlinux instead of
vmlinuz if uncompressed.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2 years agochore(deps): bump actions/upload-artifact from 3 to 4
dependabot[bot] [Tue, 2 Apr 2024 20:43:39 +0000 (20:43 +0000)] 
chore(deps): bump actions/upload-artifact from 3 to 4

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2 years agochore(deps): bump github/codeql-action from 2 to 3
dependabot[bot] [Tue, 2 Apr 2024 20:43:48 +0000 (20:43 +0000)] 
chore(deps): bump github/codeql-action from 2 to 3

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoci: switch ommisery to upstream version
Laszlo Gombos [Tue, 2 Apr 2024 16:05:09 +0000 (12:05 -0400)] 
ci: switch ommisery to upstream version

2 years agoci: disable running flaky tests on openSUSE
Laszlo Gombos [Tue, 2 Apr 2024 15:53:26 +0000 (11:53 -0400)] 
ci: disable running flaky tests on openSUSE

2 years agochore(deps): bump luizm/action-sh-checker from 0.6.0 to 0.8.0
dependabot[bot] [Tue, 31 Oct 2023 18:43:28 +0000 (18:43 +0000)] 
chore(deps): bump luizm/action-sh-checker from 0.6.0 to 0.8.0

Bumps [luizm/action-sh-checker](https://github.com/luizm/action-sh-checker) from 0.6.0 to 0.8.0.
- [Release notes](https://github.com/luizm/action-sh-checker/releases)
- [Commits](https://github.com/luizm/action-sh-checker/compare/v0.6.0...v0.8.0)

---
updated-dependencies:
- dependency-name: luizm/action-sh-checker
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoci: if container is 'all' run tests on all containers
Laszlo Gombos [Sun, 26 Feb 2023 18:22:49 +0000 (18:22 +0000)] 
ci: if container is 'all' run tests on all containers

Test container names are discovered using "find" command.
Add an option to specify container registry.

2 years agoci: if list of tests is empty, run all tests
Laszlo Gombos [Sun, 26 Feb 2023 13:51:57 +0000 (13:51 +0000)] 
ci: if list of tests is empty, run all tests

Test matrix for all tests is computed using "find" to.

2 years agoci: allow manual test workflow to set environment
Laszlo Gombos [Wed, 22 Feb 2023 17:41:22 +0000 (17:41 +0000)] 
ci: allow manual test workflow to set environment

Enable rd.debug for manual builds by default and allow changing it.

2 years agoci(lint): disable `sh-checker` ShellCheck
Jan Macku [Tue, 3 Oct 2023 08:33:26 +0000 (10:33 +0200)] 
ci(lint): disable `sh-checker` ShellCheck

ShellCheck linting is performed by `differential-shellcheck`.

2 years agoci(lint): remove broken parameter of sh-checker
Jan Macku [Tue, 3 Oct 2023 08:30:06 +0000 (10:30 +0200)] 
ci(lint): remove broken parameter of sh-checker

The `sh_checker_comment: true` requires special permissions (`pull-requests: write`).
This permission level could be achieved only on PR from the `dracut` repository. When PR is opened from the fork, it automatically drops to `read` only.

error message:
```
Commenting on the pull request
{
  "message": "Resource not accessible by integration",
  "documentation_url": "https://docs.github.com/rest/issues/comments#create-an-issue-comment"
}
```

2 years agoci(lint): add differential-shellcheck action
Jan Macku [Tue, 3 Oct 2023 08:17:22 +0000 (10:17 +0200)] 
ci(lint): add differential-shellcheck action

It performs differential ShellCheck scans and reports results directly on GitHub.

documentation: https://github.com/redhat-plumbers-in-action/differential-shellcheck

Signed-off-by: Jan Macku <jamacku@redhat.com>
2 years agofix(dracut-systemd): use `DRACUT_VERSION` instead of `VERSION`
Antonio Alvarez Feijoo [Tue, 10 Oct 2023 12:38:38 +0000 (14:38 +0200)] 
fix(dracut-systemd): use `DRACUT_VERSION` instead of `VERSION`

`VERSION` can contain other values unrelated to the dracut version, which
garbles the output.

2 years agoci: add support for releasing with signed tags
Henrik Gombos [Sat, 5 Aug 2023 13:07:10 +0000 (09:07 -0400)] 
ci: add support for releasing with signed tags

Now that tools/release.sh supports all steps described in RELEASE.md,
update RELEASE.md and point it to release.sh as the canonical
manual way to make a release.

2 years agofix(release): dracutdevs/dracut --> dracut-ng/dracut-ng
Laszlo Gombos [Sun, 31 Mar 2024 23:35:13 +0000 (19:35 -0400)] 
fix(release): dracutdevs/dracut --> dracut-ng/dracut-ng

2 years agofix(dmsquash-live): use the overlay size with thin provisioning
gregory-lee-bartholomew [Tue, 9 Jan 2024 18:16:53 +0000 (18:16 +0000)] 
fix(dmsquash-live): use the overlay size with thin provisioning

Using the overlay size in the device mapper table allows the filesystem
in the base image to be extended if the overlay is larger than the
base image (e.g. `resize2fs /dev/mapper/live-rw`).

2 years agofix(Makefile): release is now just made out of a git sha
Henrik Gombos [Fri, 25 Aug 2023 15:05:17 +0000 (11:05 -0400)] 
fix(Makefile): release is now just made out of a git sha

2 years agochore(gitignore): remove modules.d/99base/switch_root from
Henrik Gombos [Sun, 27 Aug 2023 00:45:05 +0000 (20:45 -0400)] 
chore(gitignore): remove modules.d/99base/switch_root from

switch_root use to be a native binary that was built, but not anymore.

2 years agoci: only run C code scan if src/ directory changed
Laszlo Gombos [Sun, 31 Mar 2024 23:55:57 +0000 (19:55 -0400)] 
ci: only run C code scan if src/ directory changed

2 years agotest(FULL SYSTEMD): no need to include dbus to the target rootfs 59/head
Laszlo Gombos [Sat, 4 Nov 2023 06:25:18 +0000 (02:25 -0400)] 
test(FULL SYSTEMD): no need to include dbus to the target rootfs

systemd does not depend on dbus.

2 years agofix(check_live_ram): increase /run tmpfs size, if needed
Frederick Grose [Wed, 8 Nov 2023 18:08:19 +0000 (13:08 -0500)] 
fix(check_live_ram): increase /run tmpfs size, if needed

Check the size and available space in /run to enlarge it,
  if needed.
Introduce the check_meminfo() function to dracut-lib.sh
  to replace a less versatile sed call.
Also, use local variables,
  use parameter expansion to assign a default value,
  use test exit logic directly, where possible,
  tweak comments,
  and move the check_live_ram() function to img-lib.sh.

2 years agofeat(dracut.sh): protect `push_host_devs` function
Antonio Alvarez Feijoo [Tue, 19 Dec 2023 14:26:17 +0000 (15:26 +0100)] 
feat(dracut.sh): protect `push_host_devs` function

Check at least that the arguments are not an empty string.

2 years agofix(dracut.sh): do not add device if `find_block_device` returns an error
Antonio Alvarez Feijoo [Tue, 19 Dec 2023 14:09:00 +0000 (15:09 +0100)] 
fix(dracut.sh): do not add device if `find_block_device` returns an error

If `find_block_device` returns an error, the device must not be added to the
list of host devices. E.g., a system with /etc mounted as overlay is pushing
the empty string '' as host device.

```
//usr/bin/dracut@1658(): readlink -f /etc
/usr/bin/dracut@1658(): mp=/etc
/usr/bin/dracut@1659(): mountpoint /etc
//usr/bin/dracut@1660(): find_block_device /etc
//usr/lib/dracut/dracut-functions.sh@366(find_block_device): local _dev _majmin _find_mpt
//usr/lib/dracut/dracut-functions.sh@367(find_block_device): _find_mpt=/etc
//usr/lib/dracut/dracut-functions.sh@369(find_block_device): [[ '' != yes ]]
//usr/lib/dracut/dracut-functions.sh@370(find_block_device): [[ -d /etc/. ]]
//usr/lib/dracut/dracut-functions.sh@371(find_block_device): findmnt -e -v -n -o MAJ:MIN,SOURCE --target /etc
//usr/lib/dracut/dracut-functions.sh@372(find_block_device): read -r _majmin _dev
//usr/lib/dracut/dracut-functions.sh@373(find_block_device): [[ -b overlay ]]
//usr/lib/dracut/dracut-functions.sh@384(find_block_device): [[ overlay == *:* ]]
//usr/lib/dracut/dracut-functions.sh@372(find_block_device): read -r _majmin _dev
//usr/lib/dracut/dracut-functions.sh@372(find_block_device): '[' -n '' ']'
//usr/lib/dracut/dracut-functions.sh@389(find_block_device): return 1
//usr/lib/dracut/dracut-functions.sh@393(find_block_device): [[ ! -f /etc/fstab ]]
//usr/lib/dracut/dracut-functions.sh@395(find_block_device): findmnt -e --fstab -v -n -o MAJ:MIN,SOURCE --target /etc
//usr/lib/dracut/dracut-functions.sh@396(find_block_device): read -r _majmin _dev
//usr/lib/dracut/dracut-functions.sh@397(find_block_device): [[ -n '' ]]
//usr/lib/dracut/dracut-functions.sh@398(find_block_device): _dev=overlay
//usr/lib/dracut/dracut-functions.sh@399(find_block_device): unset _majmin
//usr/lib/dracut/dracut-functions.sh@401(find_block_device): [[ -b overlay ]]
//usr/lib/dracut/dracut-functions.sh@410(find_block_device): [[ overlay == *:* ]]
//usr/lib/dracut/dracut-functions.sh@396(find_block_device): read -r _majmin _dev
//usr/lib/dracut/dracut-functions.sh@396(find_block_device): '[' -n '' ']'
//usr/lib/dracut/dracut-functions.sh@415(find_block_device): return 1
//usr/lib/dracut/dracut-functions.sh@418(find_block_device): return 1
/usr/bin/dracut@1660(): _dev=
//usr/bin/dracut@1661(): readlink -f /dev/block/
/usr/bin/dracut@1661(): _bdev=/dev/block
/usr/bin/dracut@1662(): [[ -b /dev/block ]]
/usr/bin/dracut@1663(): [[ /etc == \/ ]]
/usr/bin/dracut@1664(): push_host_devs ''
```

Fixes #2592

2 years agofix(dracut-install): file created without restricting permissions
Laszlo Gombos [Thu, 23 Feb 2023 05:58:06 +0000 (05:58 +0000)] 
fix(dracut-install): file created without restricting permissions

Resolve: https://github.com/dracutdevs/dracut/security/code-scanning/10

2 years agofix(rootfs-block): remove support for [no]readonlyroot and fastboot
Laszlo Gombos [Sun, 5 Mar 2023 02:05:14 +0000 (02:05 +0000)] 
fix(rootfs-block): remove support for [no]readonlyroot and fastboot

This PR removes some obsolete and undocumented functionality from a
core dracut module.

"readonlyroot" and "noreadonlyroot" command line option are no longer
supported. Use "ro" or "rw" instead.

2 years agofix: do not use modprobe --all
Laszlo Gombos [Sun, 10 Dec 2023 14:13:46 +0000 (09:13 -0500)] 
fix: do not use modprobe --all

busybox modprobe does not support the --all flag

2 years agofix(i18n): silence spurious setfont stderr warning
Laszlo Gombos [Sat, 10 Feb 2024 03:35:04 +0000 (22:35 -0500)] 
fix(i18n): silence spurious setfont stderr warning

Co-authored-by: Zach Dykstra <dykstra.zachary@gmail.com>
2 years agofix(udev-rules): remove legacy persistent network device name rule
Laszlo Gombos [Tue, 28 Feb 2023 17:31:19 +0000 (17:31 +0000)] 
fix(udev-rules): remove legacy persistent network device name rule

2 years agofeat(network): include 98-default-mac-none.link if it exists
Dusty Mabe [Wed, 22 Feb 2023 03:21:35 +0000 (22:21 -0500)] 
feat(network): include 98-default-mac-none.link if it exists

In Fedora Linux there was a new 98-default-mac-none.link file added
to set the MACAddressPolicy=none for bond/bridge/team devices. We'd
like for this policy to apply in the initramfs as well. See

- https://fedoraproject.org/wiki/Changes/MAC_Address_Policy_none
- https://src.fedoraproject.org/rpms/systemd/pull-request/100#

2 years agofix(dmsquash-live): handle relative pathspec
Laszlo Gombos [Mon, 6 Mar 2023 20:26:08 +0000 (20:26 +0000)] 
fix(dmsquash-live): handle relative pathspec

This change is required to make the earlier canonical
example work that is mentioned in the documentation:

At the same time, improve the documentation with a more
specific example.

2 years agotest(RAID): make test 10 use the test dracut modules
Laszlo Gombos [Sat, 25 Feb 2023 01:46:34 +0000 (01:46 +0000)] 
test(RAID): make test 10 use the test dracut modules