]> git.ipfire.org Git - thirdparty/dracut.git/log
thirdparty/dracut.git
4 weeks agofix(zfcp_rules): correct shellcheck regression when parsing ccw args master
Ihno Krumreich [Wed, 28 Feb 2024 07:24:35 +0000 (08:24 +0100)] 
fix(zfcp_rules): correct shellcheck regression when parsing ccw args

Fixes 032ecd95c94b77f3f08237e0f765b355dacb9573

3 months agofix(configure): misleading error if C compiler is not installed
Antonio Alvarez Feijoo [Thu, 7 Dec 2023 11:08:17 +0000 (12:08 +0100)] 
fix(configure): misleading error if C compiler is not installed

While preparing a new system for development, `./configure` reaches a point
where it fails with:

```
$ ./configure
dracut needs fts development files.
```

After installing the fts library, `./configure` keeps throwing the same error:

```
$ rpm -qf /usr/include/fts.h
glibc-devel-2.38-6.1.x86_64
$ ./configure
dracut needs fts development files.
```

The problem is `${CC} $CFLAGS $LDFLAGS conftest.c` can also fail if the compiler
referenced by `$CC` is not installed.

3 months agofix(github): update format of labeler
Antonio Alvarez Feijoo [Tue, 2 Jan 2024 16:10:11 +0000 (17:10 +0100)] 
fix(github): update format of labeler

Since we are using `actions/labeler@main`, its format changed, displaying the
following error with every new PR:

```
Run actions/labeler@main
The configuration file (path: .github/labeler.yml) was not found locally, fetching via the api
Error: Error: found unexpected type for label 'repository' (should be array of config options)
Error: found unexpected type for label 'repository' (should be array of config options)
```

5 months agofix(systemd-journald): add systemd-sysusers dependency
Antonio Alvarez Feijoo [Thu, 27 Jul 2023 09:08:49 +0000 (11:08 +0200)] 
fix(systemd-journald): add systemd-sysusers dependency

5 months agofix(dracut-initramfs-restore.sh): do not set selinux labels if disabled
Antonio Alvarez Feijoo [Tue, 12 Sep 2023 13:07:16 +0000 (15:07 +0200)] 
fix(dracut-initramfs-restore.sh): do not set selinux labels if disabled

Also, it's not enough to check if `SELINUX=disabled` in /etc/selinux/config,
because it can be disabled via kernel command line options.

5 months agofix(systemd-repart): correct undefined $libdir
Daniel P. Berrangé [Tue, 17 Oct 2023 16:42:13 +0000 (17:42 +0100)] 
fix(systemd-repart): correct undefined $libdir

Nothing in dracut appears to define the '$libdir' environment
variable when module scripts are being run. As a result when
the 01-systemd-repart module script runs, it fails to copy any
of the config files into the initrd. Replace it with '/usr/lib'
which reflects where systemd-repart expects its global config
files.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agofix(overlayfs): split overlayfs mount in two steps
David Cassany [Fri, 22 Sep 2023 14:28:48 +0000 (16:28 +0200)] 
fix(overlayfs): split overlayfs mount in two steps

This commit splits the creation of required overlayfs underlaying
directories and the actual overlayfs mount. This way it is still
possible to mount the overlayfs with the generated sysroot.mount that
dmsquash-live creates.

The overlayfs tree is created in a pre-mount hook so it is executed
before sysroot.mount is started. Otherwise sysroot.mount starts and
fails before mount hooks are executed.

Signed-off-by: David Cassany <dcassany@suse.com>
5 months agofix(pkcs11): delete trailing dot on libcryptsetup-token-systemd-pkcs11.so
innovara [Fri, 27 Oct 2023 10:53:49 +0000 (11:53 +0100)] 
fix(pkcs11): delete trailing dot on libcryptsetup-token-systemd-pkcs11.so

libcryptsetup-token-systemd-pkcs11.so.* doesn't match the file libcryptsetup-token-systemd-pkcs11.so

5 months agodocs: update NEWS.md and AUTHORS
Henrik Gombos [Sat, 28 Oct 2023 23:11:39 +0000 (19:11 -0400)] 
docs: update NEWS.md and AUTHORS

5 months agofix(install.d): do not create initramfs if the supplied image is UKI
Vitaly Kuznetsov [Tue, 19 Sep 2023 15:36:37 +0000 (17:36 +0200)] 
fix(install.d): do not create initramfs if the supplied image is UKI

When the supplied kernel image is a UKI, there's no point in creating
initramfs as the UKI has it built-in already. This is the situation when
dracut.install is called for a distro shipped UKI.

Note, KERNEL_INSTALL_IMAGE_TYPE == "uki" is different from
KERNEL_INSTALL_LAYOUT == "uki", the later can be used to create UKI upon
installing a standard kernel image.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
6 months agofeat(systemd): install systemd-executor
Frantisek Sumsal [Sat, 14 Oct 2023 21:45:57 +0000 (23:45 +0200)] 
feat(systemd): install systemd-executor

In [0] systemd gained a new binary - systemd-executor - that's used to
spawn processes forked off systemd. Let's copy it into the initrd if
it's available.

[0] https://github.com/systemd/systemd/pull/27890

7 months agochore: remove unnecessary shellcheck disable for SC1087
Laszlo Gombos [Fri, 24 Feb 2023 22:16:21 +0000 (22:16 +0000)] 
chore: remove unnecessary shellcheck disable for SC1087

7 months agofix(dracut.sh): remove microcode check based on CONFIG_MICROCODE_[AMD|INTEL]
Antonio Alvarez Feijoo [Mon, 14 Aug 2023 10:28:11 +0000 (12:28 +0200)] 
fix(dracut.sh): remove microcode check based on CONFIG_MICROCODE_[AMD|INTEL]

`CONFIG_MICROCODE_AMD` and `CONFIG_MICROCODE_INTEL` are hidden since
https://lore.kernel.org/all/20230810160805.081212701@linutronix.de/, therefore
this check is wrong and early microcode is always disabled.

7 months agofix(release): maintain dracut-version.sh in the source tree
Henrik Gombos [Wed, 26 Jul 2023 16:43:37 +0000 (12:43 -0400)] 
fix(release): maintain dracut-version.sh in the source tree

Update dracut-version.sh as part of release generation.

7 months agodocs: set KVERSION for running test suite
Benjamin Drung [Sat, 19 Aug 2023 14:34:52 +0000 (16:34 +0200)] 
docs: set KVERSION for running test suite

Running the test suite in podman will most likely require setting
`KVERSION` because the running Linux kernel version will most likely be
different to the kernel version in the container.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
7 months agochore: remove unnecessary shellcheck disable for SC2154
Laszlo Gombos [Fri, 24 Feb 2023 17:34:33 +0000 (17:34 +0000)] 
chore: remove unnecessary shellcheck disable for SC2154

8 months agofeat(install.d): allow using dracut in combination with ukify
Andrew Ammerlaan [Sun, 20 Aug 2023 10:19:10 +0000 (12:19 +0200)] 
feat(install.d): allow using dracut in combination with ukify

This can be simply accomplished with the KERNEL_INSTALL_INITRD_GENERATOR
and KERNEL_INSTALL_UKI_GENERATOR variables. `60-ukify.install` looks for
the initrd in the KERNEL_INSTALL_STAGING_AREA and then takes care of building
the uki.

This change makes it possible to use a configuration like this:
/etc/kernel/install.conf
layout=uki
uki_generator=ukify
initrd_generator=dracut

Without this change this configuration will fail since dracut would also
generate an uki instead of initrd, which will cause a problem in
`60-ukify.install` since it can't find an initrd to use.

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
8 months agotest: support disabling KVM by setting NO_KVM
Benjamin Drung [Sun, 20 Aug 2023 00:20:01 +0000 (02:20 +0200)] 
test: support disabling KVM by setting NO_KVM

KVM fails on the Ubuntu ppc64el autopkgtest runners:

```
$ /usr/bin/qemu-system-ppc64el -enable-kvm -cpu host [...]
ioctl(KVM_CREATE_VM) failed: 22 Invalid argument
PPC KVM module is not loaded. Try modprobe kvm_hv.
qemu-system-ppc64el: failed to initialize kvm: Invalid argument
$ modprobe kvm_hv
modprobe: ERROR: could not insert 'kvm_hv': No such device
```

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agotest: set QEMU machine for ARM and PowerPC
Benjamin Drung [Fri, 18 Aug 2023 11:17:59 +0000 (13:17 +0200)] 
test: set QEMU machine for ARM and PowerPC

Set QEMU machine for ARM and PowerPC to run on Debian/Ubuntu.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agofix(test): only use QEMU machine q35 on x86
Benjamin Drung [Thu, 17 Aug 2023 17:35:04 +0000 (19:35 +0200)] 
fix(test): only use QEMU machine q35 on x86

The QEMU machine `q35` is only available on x86:

```
qemu-system-aarch64: unsupported machine type
Use -machine help to list supported machines
```

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agotest: support /boot/vmlinux
Benjamin Drung [Wed, 16 Aug 2023 23:03:20 +0000 (01:03 +0200)] 
test: support /boot/vmlinux

On the Ubuntu ppc64el architecture the kernel is named `/boot/vmlinux`.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agotest: log qemu calls to ease debugging
Benjamin Drung [Wed, 16 Aug 2023 17:21:26 +0000 (19:21 +0200)] 
test: log qemu calls to ease debugging

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agotest: introduce overridable ARCH variable in run-qemu
Benjamin Drung [Wed, 16 Aug 2023 13:53:27 +0000 (15:53 +0200)] 
test: introduce overridable ARCH variable in run-qemu

Allow specifying the architecture for `run-qemu`. E.g. this enables
running armhf containers on arm64 hosts.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agofix(test): use bash for jobs -r parameter
Benjamin Drung [Mon, 21 Aug 2023 16:46:59 +0000 (18:46 +0200)] 
fix(test): use bash for jobs -r parameter

Test 20 - "NFSv3 root=dhcp DHCP IP:path" fails on Debian with following
error message in `server.log`:

```
jobs -rp
/sbin/init: 105: jobs: Illegal option -r
```

The jobs parameter `-r` requires bash.

Partially fixes #1901
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agoci: also run integration test on Ubuntu
Benjamin Drung [Mon, 21 Aug 2023 10:03:54 +0000 (12:03 +0200)] 
ci: also run integration test on Ubuntu

Add a Dockerfile for Ubuntu (very similar to Debian) and run the
integration tests also on Ubuntu.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agofeat(Makefile): allow setting dracut version via environment variables
Benjamin Drung [Sat, 19 Aug 2023 11:15:00 +0000 (13:15 +0200)] 
feat(Makefile): allow setting dracut version via environment variables

To ease packaging dracut for Debian/Ubuntu, please support setting the
dracut main/full version via environment variables:

```
$ DRACUT_MAIN_VERSION=007
$ export DRACUT_FULL_VERSION=007-bond
$ make dracut-version.sh
$ grep VERSION dracut-version.sh
DRACUT_VERSION=007-bond
```

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agofix: codespell
Henrik Gombos [Sat, 19 Aug 2023 12:35:56 +0000 (08:35 -0400)] 
fix: codespell

8 months agotest: fix skipcpio path for installed binary
Benjamin Drung [Wed, 16 Aug 2023 12:03:10 +0000 (14:03 +0200)] 
test: fix skipcpio path for installed binary

The `skipcpio` binary is installed in `${PKGLIBDIR}/skipcpio`.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agotest: skip test 98 if dracut-util is not available
Benjamin Drung [Wed, 16 Aug 2023 11:56:41 +0000 (13:56 +0200)] 
test: skip test 98 if dracut-util is not available

Building `dracut-util` requires the source code to be present and
prevents running the test against the installed system. Check that
`dracut-util` and rely on the test environment to build `dracut-util`
beforehand.

8 months agotest: make package libdir configurable
Benjamin Drung [Wed, 16 Aug 2023 11:50:47 +0000 (13:50 +0200)] 
test: make package libdir configurable

Make the package libdir configurable to allow running the test suite
out-of-tree. `PKGLIBDIR` can be pointed to the installed dracut libdir.
Use `PKGLIBDIR` for the location of `dracut-init.sh`, `dracut-install`,
`dracut-util`, `dracut-cpio`, and `modules.d`.

This change is used to run the test suite against the installed dracut
in an autopkgtest for the Debian/Ubuntu package.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agotest: make dracut directory configurable
Benjamin Drung [Wed, 16 Aug 2023 09:06:16 +0000 (11:06 +0200)] 
test: make dracut directory configurable

Make the directory of the `dracut.sh` script configurable to allow
running the test suite out-of-tree.

This change is used to run the test suite against the installed dracut
in an autopkgtest for the Debian/Ubuntu package.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
8 months agofix(systemd): add new systemd-tmpfiles-setup-dev-early.service
Antonio Alvarez Feijoo [Mon, 14 Aug 2023 07:11:15 +0000 (09:11 +0200)] 
fix(systemd): add new systemd-tmpfiles-setup-dev-early.service

`systemd-tmpfiles-setup-dev.service`, `kmod-static-nodes.service` and
`systemd-sysusers.service` have an ordering dependency on this new service since
https://github.com/systemd/systemd/commit/353c849

8 months agofix(systemd-udevd): add missing override paths
Antonio Alvarez Feijoo [Thu, 27 Jul 2023 13:37:46 +0000 (15:37 +0200)] 
fix(systemd-udevd): add missing override paths

8 months agofix(dracut-install): protect against broken links pointing to themselves
Antonio Alvarez Feijoo [Thu, 10 Aug 2023 07:22:28 +0000 (09:22 +0200)] 
fix(dracut-install): protect against broken links pointing to themselves

`readlink` does not return an error if a symbolic link points to itself, which
can cause a stack overflow due to infinite recursion in the `get_real_file`
function.

Although this type of recursive links should not exist, we discovered this
issue on a real system. It can be reproduced as follows:

```
> ls -l /lib64/libblkid.so
-rwxr-xr-x 1 root root 224368 Aug  9 15:13 /lib64/libblkid.so
> rm -f /lib64/libblkid.so
> ln -s /lib64/libblkid.so /lib64/libblkid.so
> ls -l /lib64/libblkid.so
lrwxrwxrwx 1 root root 18 Aug  9 15:06 /lib64/libblkid.so -> /lib64/libblkid.so
> dracut -f -I "/lib64/libblkid.so" test.img
...
dracut-install: Handle '/lib64/libblkid.so'
dracut-install: dracut_install('/lib64/libblkid.so', '/lib64/libblkid.so', 0, 0, 1)
dracut-install: get_real_file('/lib64/libblkid.so')
dracut-install: get_real_file: readlink('/lib64/libblkid.so') returns '/lib64/libblkid.so'
dracut-install: get_real_file('/lib64/libblkid.so') => '/lib64/libblkid.so'
...
[infinite recursion]
...
dracut-install: dracut_install('/lib64/libblkid.so', '/lib64/libblkid.so', 0, 0, 1)
dracut-install: get_real_file('/lib64/libblkid.so')
dracut-install: get_real_file: readlink('/lib64/libblkid.so') returns '/lib64/libblkid.so'
dracut-install: get_real_file('/lib64/libblkid.so') => '/lib64/libblkid.so'
dracut-install: dracut_install('/lib64/libblkid.so', '/lib64/libblkid.so', 0, 0, 1)
/usr/lib/dracut/dracut-init.sh: line 298: 20949 Segmentation fault      (core dumped) $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
dracut: FAILED: /usr/lib/dracut/dracut-install --debug -D /var/tmp/dracut.dqLmOS/initramfs -a /lib64/libblkid.so
...
```

After applying this patch:

```
> dracut -f -I "/lib64/libblkid.so" test.img
...
dracut-install: Handle '/lib64/libblkid.so'
dracut-install: dracut_install('/lib64/libblkid.so', '/lib64/libblkid.so', 0, 0, 1)
dracut-install: get_real_file('/lib64/libblkid.so')
dracut-install: get_real_file: readlink('/lib64/libblkid.so') returns '/lib64/libblkid.so'
dracut-install: ERROR: '/lib64/libblkid.so' is pointing to itself.
dracut-install: ERROR: installing '/lib64/libblkid.so'
dracut: FAILED: /usr/lib/dracut/dracut-install --debug -D /var/tmp/dracut.4w8FVL/initramfs -a /lib64/libblkid.so
...
```

8 months agofix(dracut.sh): exit if resolving executable dependencies fails
Antonio Alvarez Feijoo [Wed, 9 Aug 2023 09:28:15 +0000 (11:28 +0200)] 
fix(dracut.sh): exit if resolving executable dependencies fails

We came across an issue where, when resolving executable dependencies, a call to
a buggy glib function in `dracut-install` was causing a termination with
SIGSEGV, but dracut didn't stop the build process, which resulted in an
unbootable initrd, due to missing required libraries.

```
dracut: *** Resolving executable dependencies ***
xargs: /usr/lib/dracut/dracut-install: terminated by signal 11
dracut: *** Resolving executable dependencies done ***
```

Therefore, stop the initrd creation in this case.

8 months agofeat(dracut): add --sbat option to add sbat policy to UKI
Emanuele Giuseppe Esposito [Wed, 12 Jul 2023 07:50:47 +0000 (03:50 -0400)] 
feat(dracut): add --sbat option to add sbat policy to UKI

Take existing .sbat section from the uefi stub and merge it
with vmlinux .sbat (if it exists) and user-provided .sbat parameters
using the new --sbat option.

For some reasons, --update-section in objcopy does not resize the
.sbat section, so remove the section from the stub and add it
to the UKI as new one, to avoid having incomplete SBAT strings.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
8 months agoci: run all local tests on all containers (including Gentoo)
Henrik Gombos [Thu, 3 Aug 2023 01:08:27 +0000 (21:08 -0400)] 
ci: run all local tests on all containers (including Gentoo)

8 months agochore(dracut-init.sh): remove support for obsolete syntax
Laszlo Gombos [Sat, 18 Mar 2023 00:38:23 +0000 (00:38 +0000)] 
chore(dracut-init.sh): remove support for obsolete syntax

Old syntax dracut modules had its check install installkernel
scripts in dedicated shell files and did not support module
dependencies.

8 months agoci: change the order of lint jobs as lint_shell is more likely to fail
Henrik Gombos [Wed, 26 Jul 2023 12:32:36 +0000 (08:32 -0400)] 
ci: change the order of lint jobs as lint_shell is more likely to fail

8 months agoci: migrate from systemd-boot to systemd-utils in Gentoo container
Henrik Gombos [Mon, 31 Jul 2023 12:15:42 +0000 (08:15 -0400)] 
ci: migrate from systemd-boot to systemd-utils in Gentoo container

See https://www-cdn.gentoo.org/support/news-items/2022-04-19-systemd-utils.html

Also no longer include open-iscsi for musl as it fails to compile, see
https://bugs.gentoo.org/908587

8 months agoci: do not run test container generation on forked repos by default
Henrik Gombos [Sun, 30 Jul 2023 13:31:56 +0000 (09:31 -0400)] 
ci: do not run test container generation on forked repos by default

If CONTAINER Github variable set, reenable the github action
schedule.

8 months agorefactor(install): log about missing firmware only once
David Disseldorp [Wed, 26 Jul 2023 13:49:41 +0000 (15:49 +0200)] 
refactor(install): log about missing firmware only once

When attempting to locate a firmware path under each of the firwaredirs
parent directories, Dracut logs an error for every missing path.
Instead, only log the error if the firmware path isn't found under any
of the firmwaredirs.

Signed-off-by: David Disseldorp <ddiss@suse.de>
8 months agotest: increase test VM memory from 512M to 1024M to avoid OOM killer
Henrik Gombos [Sat, 29 Jul 2023 02:49:21 +0000 (22:49 -0400)] 
test: increase test VM memory from 512M to 1024M to avoid OOM killer

8 months agofix(integrity): do not require ls
Henrik Gombos [Wed, 26 Jul 2023 12:08:59 +0000 (08:08 -0400)] 
fix(integrity): do not require ls

ls is not used by the integrity dracut module.

8 months agoci: match comment with code
Henrik Gombos [Wed, 26 Jul 2023 12:04:45 +0000 (08:04 -0400)] 
ci: match comment with code

Properly document the time container generation runs daily.

8 months agoci: automate release generation
Henrik Gombos [Sun, 16 Jul 2023 17:03:47 +0000 (13:03 -0400)] 
ci: automate release generation

8 months agoci: allow the release generation script to compute the next release
Henrik Gombos [Sun, 16 Jul 2023 16:52:28 +0000 (12:52 -0400)] 
ci: allow the release generation script to compute the next release

8 months agorefactor(Makefile): improve AUTHORS and CONTRIBUTORS targets
Henrik Gombos [Thu, 13 Jul 2023 18:43:46 +0000 (14:43 -0400)] 
refactor(Makefile): improve AUTHORS and CONTRIBUTORS targets

Make make rules more generic to be able to use them not just in
manual release process but also in CI release process.

9 months agofix(dracut-init.sh): `module_check` method ignores `forced` option
Antonio Alvarez Feijoo [Fri, 14 Jul 2023 09:48:34 +0000 (11:48 +0200)] 
fix(dracut-init.sh): `module_check` method ignores `forced` option

When the `module_check` method is called passing 3 arguments (all calls right
now), the `forced` option is ignored, so the `hostonly` variable is never unset
before the module's `check` method is called.

9 months agofeat(systemd-rfkill): remove module
Antonio Alvarez Feijoo [Wed, 5 Jul 2023 06:24:21 +0000 (08:24 +0200)] 
feat(systemd-rfkill): remove module

The rfkill service and socket provided by systemd will not be activated in the
initrd since https://github.com/systemd/systemd/commit/49c55abc

9 months agofix(man): add missing initrd-root-device.target to flow chart
Antonio Alvarez Feijoo [Wed, 5 Jul 2023 13:25:43 +0000 (15:25 +0200)] 
fix(man): add missing initrd-root-device.target to flow chart

This target was added since https://github.com/dracutdevs/dracut/commit/d4efc0ae
and is ordered between `basic.target` and `sysroot.mount`, see `man bootup.7`
(`dracut-pre-mount.service` starts after).

9 months agofix(dracut-init.sh): use the local _ret variable
Frederick Grose [Sun, 23 Jul 2023 17:25:52 +0000 (13:25 -0400)] 
fix(dracut-init.sh): use the local _ret variable

Use the local _ret variable when declared.

9 months agoci: install util-linux-systemd and systemd-boot into openSUSE container
Antonio Alvarez Feijoo [Wed, 12 Jul 2023 15:25:36 +0000 (17:25 +0200)] 
ci: install util-linux-systemd and systemd-boot into openSUSE container

- `findmnt` is installed by `util-linux-systemd`
- `/usr/lib/systemd/boot/efi/linuxx64.efi.stub` is installed by `systemd-boot`

9 months agofix(dracut.sh): shellcheck warning SC1004
Pavel Valena [Sun, 23 Jul 2023 16:36:46 +0000 (18:36 +0200)] 
fix(dracut.sh): shellcheck warning SC1004

As stated in [1] it should work without literal backslash+linefeed.

[1] https://github.com/koalaman/shellcheck/issues/1246

9 months agofix(dracut.sh): use gawk for strtonum
Sam James [Thu, 20 Jul 2023 03:36:01 +0000 (04:36 +0100)] 
fix(dracut.sh): use gawk for strtonum

strtonum is a gawkism and is not available in all awks, e.g. mawk. Use gawk
to avoid failure.

Fixes: f32e95bcadbc5158843530407adc1e7b700561b1
Signed-off-by: Sam James <sam@gentoo.org>
9 months agofix(man): remove duplicate entry
Henrik Gombos [Sat, 15 Jul 2023 11:58:45 +0000 (07:58 -0400)] 
fix(man): remove duplicate entry

DRACUT_COMPRESS_BZIP2 was mentioned several times in the list.

9 months agoci: release
Henrik Gombos [Wed, 28 Jun 2023 12:04:08 +0000 (12:04 +0000)] 
ci: release

9 months agofeat(livenet): add memory size check depending on live image size
Thomas Blume [Mon, 17 Apr 2023 13:41:07 +0000 (15:41 +0200)] 
feat(livenet): add memory size check depending on live image size

For writeable live images, the memory must hold the complete image.
That means it must be at least the size of the image plus some RAM
necessary to run processes.
With too small RAM, the OOM Killer steps in and makes the boot hang.
This patch lets the system go into the emergency shell instead.

The default minimum RAM after subtracting the live image size is set to 1G.
The parameter rd.minmem is added to modify this.

9 months agochore(gentoo.conf): remove examples to avoid confusion
Henrik Gombos [Wed, 28 Jun 2023 16:50:00 +0000 (16:50 +0000)] 
chore(gentoo.conf): remove examples to avoid confusion

These examples are not used and not maintained and changing them
would not have an impact on Gentoo.

9 months agofix(modsign): load keys to correct keyring
Michał Zegan [Wed, 26 Oct 2022 16:10:38 +0000 (18:10 +0200)] 
fix(modsign): load keys to correct keyring

Until now, 03modsign module was loading keys from /lib/modules/keys/* into the
current session keyring.
This change makes it add keys to the secondary trusted keyring. This works
only as long as added certificate is signed by key from the same keyring.

9 months agofix(dmsquash-live-autooverlay): specify filesystemtype when it is already known
Laszlo Gombos [Wed, 17 May 2023 14:36:03 +0000 (14:36 +0000)] 
fix(dmsquash-live-autooverlay): specify filesystemtype when it is already known

9 months agochore: remove git2spec.pl, it is no longer used
Laszlo Gombos [Fri, 3 Mar 2023 00:49:26 +0000 (00:49 +0000)] 
chore: remove git2spec.pl, it is no longer used

9 months agofix(fs-lib): remove quoting form the first argument of the e2fsck call
Laszlo Gombos [Sat, 4 Mar 2023 23:28:17 +0000 (23:28 +0000)] 
fix(fs-lib): remove quoting form the first argument of the e2fsck call

Fix regression.

9 months agofix(Makefile): remove leftover rpm build rules
Laszlo Gombos [Mon, 20 Feb 2023 23:44:44 +0000 (23:44 +0000)] 
fix(Makefile): remove leftover rpm build rules

9 months agofix(Makefile): no longer upload to kernel.org
Laszlo Gombos [Tue, 21 Feb 2023 02:33:42 +0000 (02:33 +0000)] 
fix(Makefile): no longer upload to kernel.org

9 months agofeat(nvmf): add code for parsing the NBFT
Martin Wilck [Fri, 16 Sep 2022 19:36:52 +0000 (21:36 +0200)] 
feat(nvmf): add code for parsing the NBFT

Add code to parse the Nvme-oF Boot Firmware Table (NBFT) according
to the NVM Express Boot Specification 1.0 [1]. The implementation in
dracut follows a similar general approach as iBFT support in the
iscsi module.

NBFT support requires two steps:

(1) Setting up the network and routing according to the
    HFI ("Host Fabric Interface") records in the NBFT,
(2) Establishing the actual NVMe-oF connection.

(1) is accomplished by reading the NBFT using JSON output from
the "nvme nbft show" command, and transforming it into command
line options ("ip=", "rd.neednet", etc.) understood by dracut's
network module and its backends. The resulting network setup code
is backend-agnostic. It has been tested with the "network-legacy"
and "network-manager" network backend modules. The network setup
code supports IPv4 and IPv6 with static, RA, or DHCP configurations,
802.1q VLANs, and simple routing / gateway setup.

(2) is done using the "nvme connect-all" command [2] in the netroot handler,
which is invoked by networking backends when an interface gets fully
configured. This patch adds support for "netboot=nbft". The "nbftroot"
handler calls nvmf-autoconnect.sh, which contains the actual connect
logic. nvmf-autoconnect.sh itself is preserved, because there are
other NVMe-oF setups like NVMe over FC which don't depend on the
network.

The various ways to configure NVMe-oF are prioritized like this:

 1 FC autoconnect from kernel commandline (rd.nvmf.discover=fc,auto)
 2 NBFT, if present
 3 discovery.conf or config.json, if present, and cmdline.d parameters,
   if present (rd.nvmf.discovery=...)
 4 FC autoconnect (without kernel command line)

The reason for this priorization is that in the initial RAM fs, we try
to activate only those connections that are necessary to mount the root
file system. This avoids confusion, possible contradicting or ambiguous
configuration, and timeouts from unavailable targets.

A retry logic is implemented for enabling the NVMe-oF connections,
using the "settled" initqueue, the netroot handler, and eventually, the
"timeout" initqueue. This is similar to the retry logic of the iscsi module.
In the "timeout" case, connection to all possible NVMe-oF subsystems
is attempted.

Two new command line parameters are introduced to make it possible to
change the priorities above:

 - "rd.nvmf.nonbft" causes the NBFT to be ignored,
 - "rd.nvmf.nostatic" causes any statically configured NVMe-oF targets
   (config.json, discovery.conf, and cmdline.d) to be ignored.

These parameters may be helpful to skip attempts to set up broken
configurations.

At initramfs build time, the nvmf module is now enabled if an NBFT
table is detected in the system.

[1] https://nvmexpress.org/wp-content/uploads/NVM-Express-Boot-Specification-2022.11.15-Ratified.pdf
[2] NBFT support in nvme-cli requires the latest upstream code (> v2.4).

Signed-off-by: Martin Wilck <mwilck@suse.com>
Co-authored-by: John Meneghini <jmeneghi@redhat.com>
Co-authored-by: Charles Rose <charles.rose@dell.com>
9 months agofix(nvmf): support /etc/nvme/config.json
Martin Wilck [Thu, 9 Mar 2023 15:55:36 +0000 (16:55 +0100)] 
fix(nvmf): support /etc/nvme/config.json

Since nvme-cli 2.0, configuration of subsystems to connect to is
stored under `/etc/nvme` in either `discovery.conf` or `config.json`.
Attempt discovery also if the latter exists, but not the former.
Also, install "config.json" if it's present on the root FS.

As before, "rd.nvmf.discover=fc,auto" will force either file to be ignored,
and NBFT-defined targets take precedence if found.

9 months agofix(nvmf): install 8021q module unconditionally
Martin Wilck [Thu, 12 Jan 2023 10:06:35 +0000 (11:06 +0100)] 
fix(nvmf): install 8021q module unconditionally

In NBFT setups, VLAN can be configured in the firmware.
Add the 8021q module in hostonly mode even if VLAN is currently
not used to be prepared for such configuration change.

9 months agofix(install.d): respect even more kernel-install vars, plus style fixes
Andrew Ammerlaan [Thu, 22 Jun 2023 07:45:36 +0000 (09:45 +0200)] 
fix(install.d): respect even more kernel-install vars, plus style fixes

- More verbose with KERNEL_INSTALL_VERBOSE=1

- Use KERNEL_INSTALL_CONF_ROOT if defined

- Fallback to /usr/lib/os-release if /etc/os-release does not exist

- Fallback to "Linux $KERNEL_VERSION" if no PRETTY_NAME found

- Styling fixes

Co-authored-by: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
9 months agofix(install.d): respect more kernel-install env variables
Andrew Ammerlaan [Sat, 17 Jun 2023 06:18:55 +0000 (08:18 +0200)] 
fix(install.d): respect more kernel-install env variables

- If kernel-install has defined a staging area for us
(KERNEL_INSTALL_STAGING_AREA) install generated initrd/uki.efi there.
The actual install is then handled by 90-loaderentry.install or
90-uki-copy-install.

- Also skip regeneration if an uki.efi already exists.

- Pass --kernel-image to dracut, this is required to generate an uki (uefi=yes)

- Add --no-uefi argument to dracut rescue image generation, this ensures that
it at least installs correctly. TODO: Rework 51-dracut-rescue.install to also
work with uki's.

This fixes installing a kernel with uefi=yes in dracut config and layout=uki
in kernel/install.conf.

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
9 months agofix(dracut.sh): also prevent fsfreeze for tmpfs
Andrew Ammerlaan [Sat, 17 Jun 2023 06:18:05 +0000 (08:18 +0200)] 
fix(dracut.sh): also prevent fsfreeze for tmpfs

KERNEL_INSTALL_STAGING_AREA is often on tmpfs, it cannot be frozen

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
9 months agofix(dmsquash-live): allow other fstypes
Laszlo Gombos [Sat, 17 Dec 2022 01:18:46 +0000 (01:18 +0000)] 
fix(dmsquash-live): allow other fstypes

Use det_fs to determine fstype and provide fallback instead of
just calling blkid.

Many other dracut modules (e.g. fs-lib, btrfs, mdraid) are already
using det_fs to determine fstype.

9 months agotest(DMSQUASH): add test for NTFS
Laszlo Gombos [Sat, 17 Dec 2022 01:00:28 +0000 (01:00 +0000)] 
test(DMSQUASH): add test for NTFS

Add a test case for mounting the root filesystem from
a squashfs image file that is store on an NTFS drive.

The test case is using ntfs3 module to mount the NTFS drive.

9 months agotest(16): check for failure after each sub-test run
Laszlo Gombos [Sat, 17 Dec 2022 00:34:25 +0000 (00:34 +0000)] 
test(16): check for failure after each sub-test run

The test case had a bug where it only checked for
at least one of the passing instead of all the subtests passing.

9 months agofix(bluetooth): make bluetooth rules more strict
Laszlo Gombos [Fri, 24 Feb 2023 17:12:44 +0000 (17:12 +0000)] 
fix(bluetooth): make bluetooth rules more strict

Only warn if bluetooth kernel module is loaded
at the time of initrd generation in hostonly mode.

9 months agofix(bluetooth): add missing files
Antonio Alvarez Feijoo [Tue, 9 May 2023 12:25:22 +0000 (14:25 +0200)] 
fix(bluetooth): add missing files

- org.bluez.service dbus system service
- bluetooth.service override conf

9 months agofix(bluetooth): include it if Appearance matches the value assigned for keyboard
Antonio Alvarez Feijoo [Tue, 9 May 2023 12:24:57 +0000 (14:24 +0200)] 
fix(bluetooth): include it if Appearance matches the value assigned for keyboard

Following the Bluetooth spec [1], Assigned Numbers Document, Rev. 2023-05-04,
Section 2.6.3, Appearance Sub-category, the Appearance value defined for
keyboards is 0x03C1.

This value must be checked to include the bluetooth module in hostonly mode,
because some Bluetooth keyboards do not set the Class attribute.

[1] https://www.bluetooth.com/specifications/assigned-numbers/

10 months agofix(bluetooth): warn user instead of including it by default
Henrik Gombos [Sat, 17 Jun 2023 18:15:03 +0000 (18:15 +0000)] 
fix(bluetooth): warn user instead of including it by default

Bluetooth module can result in a known race condition at boot.
Discourage its usage by default.

10 months agofix(systemd-timedated): correct typo in override path
Antonio Alvarez Feijoo [Fri, 12 May 2023 07:44:51 +0000 (09:44 +0200)] 
fix(systemd-timedated): correct typo in override path

10 months agofix(systemd-resolved): correct typo in override path
Antonio Alvarez Feijoo [Fri, 12 May 2023 07:43:59 +0000 (09:43 +0200)] 
fix(systemd-resolved): correct typo in override path

10 months agofix(systemd-networkd): correct typos in override paths
Antonio Alvarez Feijoo [Fri, 12 May 2023 07:43:37 +0000 (09:43 +0200)] 
fix(systemd-networkd): correct typos in override paths

10 months agofix(dracut-init.sh): correct check in `is_qemu_virtualized` function
Antonio Alvarez Feijoo [Thu, 27 Apr 2023 15:28:44 +0000 (17:28 +0200)] 
fix(dracut-init.sh): correct check in `is_qemu_virtualized` function

Do not redirect `systemd-detect-virt` to /dev/null, otherwise, the `vm` variable
is always empty. This function was working only thanks to the following /sys
check.

Reported-by: Raymund Will <rw@suse.com>
10 months agofix(btrfs): do not require module via cmdline when --no-kernel
Michal Koutný [Mon, 19 Jun 2023 14:40:49 +0000 (16:40 +0200)] 
fix(btrfs): do not require module via cmdline when --no-kernel

initrd built without modules would fail when it attempts to load a
kernel module. (Use case scenario: kernel with built-in module.)

synthesize an the cmdline only when modules are truly installed.

10 months agofix(btrfs): add missing cmdline function
Antonio Alvarez Feijoo [Wed, 19 Apr 2023 07:25:34 +0000 (09:25 +0200)] 
fix(btrfs): add missing cmdline function

Otherwise `dracut --print-cmdline` does not print the command line option added
by the btrfs module.

10 months agoci: conditionally add tgt to Gentoo container
Laszlo Gombos [Thu, 18 May 2023 19:04:24 +0000 (19:04 +0000)] 
ci: conditionally add tgt to Gentoo container

This commit allows to run test 30 and test 35 on a Gentoo.

Use the newly introduced conditional for nfs4 support as well.

10 months agoci: re-enable lvm on Gentoo container
Laszlo Gombos [Thu, 18 May 2023 16:43:38 +0000 (16:43 +0000)] 
ci: re-enable lvm on Gentoo container

Gentoo changed it's policy and now lvm needs to be enabled explicitly.

See https://www.gentoo.org/support/news-items/2022-11-19-lvm2-default-USE-flags.html

No need to install thin-provisioning-tools explicitelly, it is
pulled in as a dependency of the lvm2 package.

10 months agoci: disable initramfs generation inside Gentoo container
Laszlo Gombos [Mon, 8 May 2023 14:36:58 +0000 (14:36 +0000)] 
ci: disable initramfs generation inside Gentoo container

Disabling initramfs generation saves installing 4 additional packages.

10 months agoci: add extra packages for tests to Gentoo container
Laszlo Gombos [Mon, 8 May 2023 14:31:38 +0000 (14:31 +0000)] 
ci: add extra packages for tests to Gentoo container

Add cryptsetup, multipath-tools and open-iscsi
to the Gentoo container for tests 10, 14, 30, 35.

10 months agoci: switching the musl test to 18 (uefi)
Henrik Gombos [Sat, 17 Jun 2023 19:04:25 +0000 (19:04 +0000)] 
ci: switching the musl test to 18 (uefi)

10 months agotest(ISCSI): make test-30 use the test dracut modules
Henrik Gombos [Thu, 8 Jun 2023 13:38:06 +0000 (13:38 +0000)] 
test(ISCSI): make test-30 use the test dracut modules

Introduce test_dracut that is meant to be shared between tests
in test-functions.

10 months agoci: add dependencies to Debian container
Henrik Gombos [Wed, 14 Jun 2023 19:17:20 +0000 (19:17 +0000)] 
ci: add dependencies to Debian container

- add systemd-boot-efi for test 18
- tgt is needed for test 30 and 35
- nbd-server is needed for test 40
- gawk dependency has been introduced by f32e95bcadbc5158843530407adc1e7b700561b1
- install dracut instead of initramfs-tools to match actual usage
- remove workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=962300
as it is now fixed on Debian 12.

10 months agotest(UEFI): add test case for UEFI boot
Laszlo Gombos [Wed, 22 Mar 2023 19:56:25 +0000 (19:56 +0000)] 
test(UEFI): add test case for UEFI boot

Include OVMF in containers if it is not already present.

10 months agodocs: remove rd.lvm.snapsize and rd.lvm.snapshot
Henrik Gombos [Sun, 11 Jun 2023 22:34:35 +0000 (22:34 +0000)] 
docs: remove rd.lvm.snapsize and rd.lvm.snapshot

10 months agofix(Makefile): execute command -v instead of which
Henrik Gombos [Sun, 11 Jun 2023 23:04:27 +0000 (23:04 +0000)] 
fix(Makefile): execute command -v instead of which

10 months agofix(network-legacy): typo
lilinjie [Tue, 18 Apr 2023 03:22:26 +0000 (11:22 +0800)] 
fix(network-legacy): typo

Signed-off-by: lilinjie <lilinjie@uniontech.com>
10 months agofix(network,dbus): improve dependency checking
Laszlo Gombos [Thu, 2 Feb 2023 21:22:26 +0000 (21:22 +0000)] 
fix(network,dbus): improve dependency checking

Decouple implementation details of the backend
dependencies from the meta module.

Call check_module for each submodule instead
of reimplementing sub-package dependencies
inside the meta module itself.

Add missing NetworkManager binary to the
network-manager dracut module check.

10 months agofix(systemd-pcrphase): only include systemd-pcrphase-initrd.service
Antonio Alvarez Feijoo [Thu, 9 Feb 2023 12:55:47 +0000 (13:55 +0100)] 
fix(systemd-pcrphase): only include systemd-pcrphase-initrd.service

The only systemd-pcrphase related unit configured to run in the initrd is
systemd-pcrphase-initrd.service.
Both systemd-pcrphase.service and systemd-pcrphase-sysinit.service contain
`ConditionPathExists=!/etc/initrd-release`.

10 months agofix(systemd-tmpfiles): do not include systemd-tmpfiles-clean.timer
Antonio Alvarez Feijoo [Thu, 9 Feb 2023 12:55:31 +0000 (13:55 +0100)] 
fix(systemd-tmpfiles): do not include systemd-tmpfiles-clean.timer

The systemd-tmpfiles-clean.timer unit is configured not to run in the initrd
since https://github.com/systemd/systemd/commit/fe7f113c

10 months agofix(systemd-journald): do not include systemd-journal-flush.service
Antonio Alvarez Feijoo [Thu, 9 Feb 2023 12:55:11 +0000 (13:55 +0100)] 
fix(systemd-journald): do not include systemd-journal-flush.service

The systemd-journal-flush.service unit is configured not to run in the initrd
since https://github.com/systemd/systemd/commit/fe7f113c

10 months agofix(systemd): do not include systemd-random-seed.service
Antonio Alvarez Feijoo [Thu, 9 Feb 2023 12:54:46 +0000 (13:54 +0100)] 
fix(systemd): do not include systemd-random-seed.service

The systemd-random-seed.service unit is configured not to run in the initrd
since https://github.com/systemd/systemd/commit/fe7f113c

Also, the systemd-random-seed-load.service does not exist since
https://github.com/systemd/systemd/commit/c35b956d