]> git.ipfire.org Git - thirdparty/dracut.git/log
thirdparty/dracut.git
2 years agofix(fips): do not blindly remove /boot
Antonio Alvarez Feijoo [Wed, 23 Nov 2022 13:22:21 +0000 (14:22 +0100)] 
fix(fips): do not blindly remove /boot

The `mount_boot` method called from fips-noboot.sh in the pre-pivot hook blindly
executes `rm -rf /boot` if there is no `boot=` command line parameter, without
first checking that /boot is not already mounted by other means.

2 years agochore(base): remove support for <udev-176
Laszlo Gombos [Sat, 3 Dec 2022 23:06:54 +0000 (23:06 +0000)] 
chore(base): remove support for <udev-176

This reverts 579238a3acd0317d7124a76dc489f19d9471fb63.

Keep the support for prepare_udev_rules for out-of-tree
dracut modules and issue a deprecation warning.

2 years agofix(plymouth): remove /etc/system-release dependency
Laszlo Gombos [Wed, 1 Feb 2023 02:20:23 +0000 (02:20 +0000)] 
fix(plymouth): remove /etc/system-release dependency

/etc/*release files should not be managed in the plymouth module
and more importantly dracut assumes /etc/os-release not
/etc/system-release

2 years agofeat(resume): also consider resume= in the cmdline as enabling hibernation
наб [Mon, 2 Jan 2023 15:48:14 +0000 (16:48 +0100)] 
feat(resume): also consider resume= in the cmdline as enabling hibernation

Don't consider noresume to disable, that's a single-boot flag

Closes #924

2 years agofix(network-manager): add "After" dependency on dbus.service
Beniamino Galvani [Tue, 31 Jan 2023 15:32:19 +0000 (16:32 +0100)] 
fix(network-manager): add "After" dependency on dbus.service

During shutdown, there is no ordering dependency between the nm-initrd service
and the D-Bus daemon, and so the latter can be stopped before. This causes
issues to NetworkManager, especially when team interfaces are present because
NM will see teamd dropping from the bus and will try to reactivate the
connection.

Add a "After" dependency to make sure the D-Bus daemon is stopped after NM on
shutdown.

2 years agofix(fido2): libfido2.so depends on libz.so
Laszlo Gombos [Sun, 5 Feb 2023 01:35:36 +0000 (01:35 +0000)] 
fix(fido2): libfido2.so depends on libz.so

Co-authored-by: cs50guy2
2 years agofix(dracut-install): continue parsing if ldd prints "cannot execute binary file"
Antonio Alvarez Feijoo [Thu, 9 Feb 2023 14:30:34 +0000 (15:30 +0100)] 
fix(dracut-install): continue parsing if ldd prints "cannot execute binary file"

When the kernel is compiled without IA32_EMULATION and the glibc 32-bit library
is installed on the system, `ldd` prints the following output:

```
> ldd /usr/lib64/libfido2.so.1.12.0
/bin/ldd: line 162: /lib/ld-linux.so.2: cannot execute binary file: Exec format error
linux-vdso.so.1 (0x00007ffd627fa000)
libcbor.so.0.9 => /lib64/libcbor.so.0.9 (0x00007f18d799f000)
libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007f18d7400000)
libudev.so.1 => /lib64/libudev.so.1 (0x00007f18d7971000)
libhidapi-hidraw.so.0 => /lib64/libhidapi-hidraw.so.0 (0x00007f18d7968000)
libz.so.1 => /lib64/libz.so.1 (0x00007f18d794e000)
libc.so.6 => /lib64/libc.so.6 (0x00007f18d7205000)
/lib64/ld-linux-x86-64.so.2 (0x00007f18d79f9000)
> echo $?
0
```

The `ldd` script uses the following code to resolve dependencies:

```
RTLDLIST="/lib/ld-linux.so.2 /lib64/ld-linux-x86-64.so.2 /libx32/ld-linux-x32.so.2"
...
RTLD=
ret=1
for rtld in ${RTLDLIST}; do
  if test -x $rtld; then
    verify_out=`${rtld} --verify "$file"`
    ret=$?
    case $ret in
      [02]) RTLD=${rtld}; break;;
    esac
  fi
done
```

So, if the 32-bit library fails, the 64-bit library may work, so don't stop
parsing the `ldd` output unconditionally when the message "cannot execute binary
file" is printed.

Fixes issue #2190

2 years agofix: make iso-scan trigger udev events
0x5c [Thu, 9 Feb 2023 10:26:30 +0000 (05:26 -0500)] 
fix: make iso-scan trigger udev events

Fixes #2183

2 years agoci: enable test 60
Beniamino Galvani [Fri, 10 Feb 2023 18:04:06 +0000 (19:04 +0100)] 
ci: enable test 60

It's hopefully stable now.

2 years agofix(test): rename test 60
Beniamino Galvani [Fri, 10 Feb 2023 18:02:05 +0000 (19:02 +0100)] 
fix(test): rename test 60

The test *also* checks the generation of ifcfg files, but it's primarily a test
for bonding, bridging and VLANs. Update the name to reflect this.

2 years agofix(test): improve test 60
Beniamino Galvani [Tue, 7 Feb 2023 14:28:57 +0000 (15:28 +0100)] 
fix(test): improve test 60

The test has the following issues:

 - it sets up a bridge on net1 and net2, however those interfaces
   are part of the same qemu hub and this causes switching loops;

 - the bonds are created on two interfaces but only one has a DHCP server, and
   this causes random failures;

 - the checks performed on the client are pretty limited.

Rework the test:

 - avoid the bridging loop;

 - update the topology to use a bond interface on the server side;

 - introduce additional checks on the client: start a ping and check that ports
   are properly attached to bonds and bridge;

 - make it possible to return module-specific information from the client; in
   the future this can be added for example to check that the NetworkManager or
   systemd-networkd configuration is correct.

2 years agofix(test): remove leftover link file from server rootfs
Beniamino Galvani [Tue, 7 Feb 2023 12:49:15 +0000 (13:49 +0100)] 
fix(test): remove leftover link file from server rootfs

01-client.link must be removed, otherwise it conflicts with 01-server.link that
sets a different naming policy.

2 years agofix(test): assign fixed address to bridge
Beniamino Galvani [Thu, 2 Feb 2023 09:42:00 +0000 (10:42 +0100)] 
fix(test): assign fixed address to bridge

Kernel uses the lowest MAC of all attached ports as MAC address of the
bridge. However, after the first port gets attached, DHCP can be started on the
bridge and it will use the MAC (and client-id) of the first port; so, the MAC
used for DHCP depends on the order of attachment of ports, which is not
guaranteed to be stable in general.

To make sure that the DHCP server always sees the request from the MAC of
enp0s1, assign that MAC to the bridge from the kernel command line.

2 years agofix(test): bump DHCP timeout to 30 seconds
Beniamino Galvani [Wed, 1 Feb 2023 10:18:57 +0000 (11:18 +0100)] 
fix(test): bump DHCP timeout to 30 seconds

The current interval (3 seconds) is very low and causes sporadic failures
especially when DHCP is run on a bridge (TEST-50-MULTINIC); in that specific
case, interfaces take time to be attached to the bridge and before enp0s1 is
attached all DISCOVER packets are lost.

Bump the timeout to a more robust value of 30 seconds.

2 years agofix(test): remove check on dhclient support for --timeout
Beniamino Galvani [Wed, 1 Feb 2023 10:07:49 +0000 (11:07 +0100)] 
fix(test): remove check on dhclient support for --timeout

The network-legacy dracut module already ignores the DHCP timeout option when
it's not supported by dhclient. Other network modules don't use dhclient for
DHCP.

2 years agofix(test): adapt multinic test for new NetworkManager versions
Beniamino Galvani [Wed, 1 Feb 2023 09:39:15 +0000 (10:39 +0100)] 
fix(test): adapt multinic test for new NetworkManager versions

Since version 1.42, NetworkManager creates a "external" connection for the
loopback interface. Ignore that connection in the multinic test.

2 years agofix(install): do not undef _FILE_OFFSET_BITS
Khem Raj [Sat, 31 Dec 2022 22:41:52 +0000 (14:41 -0800)] 
fix(install): do not undef _FILE_OFFSET_BITS

_FILE_OFFSET_BITS is a feature test macro to determine largefile
support. Usually its set to 64 on systems supporting LFS. Its also
needed to be set to 64 for supporting 64bit time_t on glibc on 32bit
systems. If its undefined explicitly, then 64bit time_t can not be
enabled.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 years agochore(deps): bump docker/build-push-action from 3 to 4
dependabot[bot] [Tue, 31 Jan 2023 18:01:40 +0000 (18:01 +0000)] 
chore(deps): bump docker/build-push-action from 3 to 4

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 4.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agofix(dracut.sh): --sysroot option broken if global variables not set in conf
Antonio Alvarez Feijoo [Thu, 29 Dec 2022 10:38:58 +0000 (11:38 +0100)] 
fix(dracut.sh): --sysroot option broken if global variables not set in conf

When `$dracutsysrootdir` is set and references an existing directory, the
internal global variables are never set, unless their value is assigned via
configuration file.

The simple fix would be turn all:

```
[[ -d $dracutsysrootdir$var ]] || var=value
```
into:
```
[[ -z $var || ! -d $dracutsysrootdir$var ]] && var=value
```

But this patch also includes a refactoring, removing duplicate code using the
same `set_global_var` function to set and export global variables, and improving
readability.

2 years agorefactor(dracut-init.sh): remove redundant "dracut" from "dracut module" prints
Antonio Alvarez Feijoo [Tue, 27 Dec 2022 15:58:24 +0000 (16:58 +0100)] 
refactor(dracut-init.sh): remove redundant "dracut" from "dracut module" prints

In a similar fashion than "Including module" prints.

2 years agofeat(dracut-init.sh): specify if a module cannot be found or cannot be installed
Antonio Alvarez Feijoo [Tue, 27 Dec 2022 14:26:50 +0000 (15:26 +0100)] 
feat(dracut-init.sh): specify if a module cannot be found or cannot be installed

Do not print the same error message for both situations.

2 years agofix(lsinitrd.sh): handle filenames with special characters
Antonio Alvarez Feijoo [Wed, 4 Jan 2023 15:51:12 +0000 (16:51 +0100)] 
fix(lsinitrd.sh): handle filenames with special characters

Printing and unpacking of specific files passed as arguments does not work if
their filenames contain special characters with a hexadecimal character escape
(\x), which is often the case for systemd device units.

2 years agofix(dracut-systemd): remove unused argument
Antonio Alvarez Feijoo [Mon, 9 Jan 2023 10:47:06 +0000 (11:47 +0100)] 
fix(dracut-systemd): remove unused argument

The `generator_wait_for_dev` function of the dracut rootfs systemd generator
only uses the first argument. Moreover, RDRETRY is unset at this point.

2 years agofeat(lvm): always include all drivers that LVM can use
Antonio Alvarez Feijoo [Wed, 14 Dec 2022 10:44:51 +0000 (11:44 +0100)] 
feat(lvm): always include all drivers that LVM can use

This patch adds all the kernel modules that might be needed by LVM, to avoid
having to rebuild the initrd in hostonly mode after a dynamic change that
requires new drivers to boot.

For example, LVM allows to dynamically convert a linear logical volume to a
RAID-1 type (`lvconvert --type raid1 vg/lv`), which, in hostonly mode, will
require the user to manually rebuild the initrd again to include the new RAID
drivers in use, otherwise the system will fail to boot.

2 years agofix(dracut-init.sh): correct typo in comment
Antonio Alvarez Feijoo [Thu, 19 Jan 2023 13:28:09 +0000 (14:28 +0100)] 
fix(dracut-init.sh): correct typo in comment

2 years agofix(dracut.sh): correct --help and --version exit codes
Antonio Alvarez Feijoo [Thu, 19 Jan 2023 11:08:39 +0000 (12:08 +0100)] 
fix(dracut.sh): correct --help and --version exit codes

Both are valid options that cause regular program termination without errors, so
dracut should return 0.

2 years agorefactor(virtiofs): remove exit after die
Antonio Alvarez Feijoo [Thu, 19 Jan 2023 09:42:14 +0000 (10:42 +0100)] 
refactor(virtiofs): remove exit after die

The `die` function already ends with `exit 1`.

2 years agoci: fix Gentoo container used for testing
Laszlo Gombos [Fri, 13 Jan 2023 17:50:35 +0000 (17:50 +0000)] 
ci: fix Gentoo container used for testing

2 years agofix(crypt-gpg): do not use always --card-status
LinkTed [Fri, 23 Dec 2022 19:16:31 +0000 (20:16 +0100)] 
fix(crypt-gpg): do not use always --card-status

If no GPG smart card is used then the card-status breaks the decryption
of the keyfile. Therefore, use the card-status only if a smart card is
used to decrypt the keyfie.

Fixes issue #2004

2 years agodocs(RELEASE.md): update release docs
Jóhann B. Guðmundsson [Sat, 24 Dec 2022 17:38:54 +0000 (17:38 +0000)] 
docs(RELEASE.md): update release docs

- Remove the reference to Harald's git ci alias
- Added a missing push to master
- Added a warning not to add the Rendered View entry from the NEWS.md to
  the tags. ( Github adds that to the release with no way of removing it, see 058 )
- Added validation of the new tag ( Good practice )
- Clarify milestone handover.

2 years agoci: disable test 50
Laszlo Gombos [Mon, 2 Jan 2023 21:11:47 +0000 (21:11 +0000)] 
ci: disable test 50

Test 50 (MULTINIC) seems to be the only test that prevents
the project from having an all passing continuous integration
test suite.

2 years agofix: shellcheck 0.8.0
Antonio Alvarez Feijoo [Mon, 2 Jan 2023 08:58:06 +0000 (09:58 +0100)] 
fix: shellcheck 0.8.0

2 years agofix(dmsquash-live): live:/dev/*
Laszlo Gombos [Sun, 1 Jan 2023 03:39:17 +0000 (03:39 +0000)] 
fix(dmsquash-live): live:/dev/*

fix a bug introduced in 71cfa2e22

make sure root is set correctly for both of the following cases
 - "root=live:/dev/*"
 - "rd.live.image root=/dev/*"

2 years agofix(load_fstype): avoid false positive searchs
Frederick Grose [Sun, 27 Nov 2022 18:52:27 +0000 (13:52 -0500)] 
fix(load_fstype): avoid false positive searchs

Refactor to avoid substring matches
  and to speed processing.
Also avoid xtracing.

2 years agofix: shellcheck 0.8.0
Laszlo Gombos [Mon, 21 Nov 2022 04:01:59 +0000 (04:01 +0000)] 
fix: shellcheck 0.8.0

2 years agorefactor(dracut-install): strerror(errno) -> %m
наб [Wed, 27 Apr 2022 16:57:50 +0000 (18:57 +0200)] 
refactor(dracut-install): strerror(errno) -> %m

2 years agoperf(dracut-install): don't strdup() environment block
наб [Wed, 27 Apr 2022 16:52:36 +0000 (18:52 +0200)] 
perf(dracut-install): don't strdup() environment block

2 years agoperf(dracut-install): don't reallocate {src,dst}path in hmac_install()
наб [Wed, 27 Apr 2022 16:46:58 +0000 (18:46 +0200)] 
perf(dracut-install): don't reallocate {src,dst}path in hmac_install()

2 years agoperf(dracut-install): don't strdup() excessively for dracut_install()
наб [Wed, 27 Apr 2022 13:14:59 +0000 (15:14 +0200)] 
perf(dracut-install): don't strdup() excessively for dracut_install()

2 years agoperf(dracut-install): stat() w/unused buf -> access(F_OK) in dracut-install
наб [Tue, 26 Apr 2022 15:23:38 +0000 (17:23 +0200)] 
perf(dracut-install): stat() w/unused buf -> access(F_OK) in dracut-install

2 years agoperf(dracut-install): multiple single-character strstr()s -> strpbrk()
наб [Tue, 26 Apr 2022 15:13:55 +0000 (17:13 +0200)] 
perf(dracut-install): multiple single-character strstr()s -> strpbrk()

2 years agochore: remove src/install/hashmap.lo
наб [Tue, 26 Apr 2022 14:34:41 +0000 (16:34 +0200)] 
chore: remove src/install/hashmap.lo

2 years agofeat(network-wicked): remove module
Laszlo Gombos [Thu, 15 Dec 2022 22:39:00 +0000 (22:39 +0000)] 
feat(network-wicked): remove module

wicked is being phased out from openSUSE
https://news.opensuse.org/2022/01/28/bash-systemd-libvirt-update-in-tw/

2 years agodocs: update NEWS.md and AUTHORS 059
Jóhann B. Guðmundsson [Sat, 24 Dec 2022 16:49:27 +0000 (16:49 +0000)] 
docs: update NEWS.md and AUTHORS

2 years agofix(NEWS.md): add missing entries
Jóhann B. Guðmundsson [Sat, 24 Dec 2022 15:53:05 +0000 (15:53 +0000)] 
fix(NEWS.md): add missing entries

I somehow managed to screw the update of news when making a release fixing my
mistake.

2 years agofix(systemd-timedated): add missing dbus-org.freedesktop.timedate1.service
Antonio Alvarez Feijoo [Thu, 22 Dec 2022 14:19:49 +0000 (15:19 +0100)] 
fix(systemd-timedated): add missing dbus-org.freedesktop.timedate1.service

Without this service, timedatectl fails to run in the initrd.

```
sh-5.2# timedatectl
Failed to query server: Could not activate remote peer: activation request failed: unknown unit.
sh-5.2# systemctl status dbus | grep timedate
Dec 22 13:57:03 sd-net-test dbus-broker-launch[219]: Activation request for 'org.freedesktop.timedate1' failed: The systemd unit 'dbus-org.freedesktop.timedate1.service' could not be found.
```

2 years agofix(systemd-hostnamed): add missing dbus-org.freedesktop.hostname1.service
Antonio Alvarez Feijoo [Thu, 22 Dec 2022 14:13:29 +0000 (15:13 +0100)] 
fix(systemd-hostnamed): add missing dbus-org.freedesktop.hostname1.service

Without this service, hostnamectl fails to run in the initrd.

```
sh-5.2# hostnamectl
Failed to query system properties: Could not activate remote peer: activation request failed: unknown unit.
sh-5.2# systemctl status dbus | grep hostname
Dec 22 11:07:56 sd-net-test dbus-broker-launch[216]: Activation request for 'org.freedesktop.hostname1' failed: The systemd unit 'dbus-org.freedesktop.hostname1.service' could not be found.
```

2 years agofix(dbus-broker): add missing sockets.target.wants/dbus.socket
Antonio Alvarez Feijoo [Thu, 22 Dec 2022 11:34:30 +0000 (12:34 +0100)] 
fix(dbus-broker): add missing sockets.target.wants/dbus.socket

If dbus.socket is not started automatically in the initrd, all binaries that
require dbus to work fail.

2 years agofix(systemd-hostnamed): correct sysusers configuration
Antonio Alvarez Feijoo [Thu, 22 Dec 2022 09:45:56 +0000 (10:45 +0100)] 
fix(systemd-hostnamed): correct sysusers configuration

Lines of type 'g' don't take a GECOS field.

2 years agotest(FULL SYSTEMD): make test 04 use the test dracut modules 2142/head
Laszlo Gombos [Sat, 26 Nov 2022 18:25:54 +0000 (18:25 +0000)] 
test(FULL SYSTEMD): make test 04 use the test dracut modules

Add test case for systemd.unit and  systemd.mask arguments
instead of extra test setup steps.

2 years agotest(FULL SYSTEMD): remove unnecessary dependencies
Laszlo Gombos [Fri, 25 Nov 2022 14:37:35 +0000 (14:37 +0000)] 
test(FULL SYSTEMD): remove unnecessary dependencies

2 years agofeat(overlayfs): add new overlayfs module to dracut.spec
Laszlo Gombos [Wed, 14 Dec 2022 20:05:48 +0000 (20:05 +0000)] 
feat(overlayfs): add new overlayfs module to dracut.spec

2 years agofix(zipl): remove trailing spaces from zipl boot device name
Antonio Alvarez Feijoo [Mon, 14 Nov 2022 15:45:48 +0000 (16:45 +0100)] 
fix(zipl): remove trailing spaces from zipl boot device name

Trailing spaces are misleading blkid input after fixes for shellcheck were
introduced in https://github.com/dracutdevs/dracut/commit/d75b029a

Test showing the wrong output:

```
localhost:~ # _boot_zipl=$(sed -n -e '/^[[:space:]]*#/d' -e 's/\(.*\)\w*\/boot\/zipl.*/\1/p' /etc/fstab)
localhost:~ # echo "[${_boot_zipl}]"
[/dev/disk/by-path/ccw-0.0.0000-part1  ]
localhost:~ # blkid -s TYPE -o udev "${_boot_zipl}"
localhost:~ # blkid -s TYPE -o udev ${_boot_zipl}
ID_FS_TYPE=ext2
```

Also, remove duplicate code by creating a function to get the zipl boot device,
prepend $dracutsysrootdir to /etc/fstab and print cmdline properly: start
with a space and do not print a newline.

2 years agofix(lsinitrd.sh): add a missing path to image
Kenneth D'souza [Tue, 13 Dec 2022 15:26:33 +0000 (20:56 +0530)] 
fix(lsinitrd.sh): add a missing path to image

The initramfs file for Fedora/RedHat CoreOS can be found under
`/lib/modules/${KERNEL_VERSION}/initramfs.img', add this path
to image search logic.

Signed-off-by: Kenneth D'souza <kennethdsouza94@gmail.com>
2 years agofix(dracut): allow to set persistent policy based on /dev/mapper device names
Antonio Alvarez Feijoo [Wed, 7 Sep 2022 13:17:06 +0000 (15:17 +0200)] 
fix(dracut): allow to set persistent policy based on /dev/mapper device names

Currently, dracut only allows to configure the persistent policy to address
disks and partitions using any directory name found in /dev/disk, but there is
no defined way to set the default policy based on /dev/mapper device names. So,
for example, if the persistent policy is set by the distribution in any
configuration file, the user cannot set the default if he wants to.

The current workaround is to set persistent_policy="" in a conf file or pass
--persistent-policy " " (white space) as an argument. This patch aims to
establish a specific value for this case.

2 years agofix(dracut-init): make require_kernel_modules ignore no kernel build
Kairui Song [Thu, 8 Dec 2022 16:25:42 +0000 (00:25 +0800)] 
fix(dracut-init): make require_kernel_modules ignore no kernel build

If --no-kernel is specified, kernel module checking won't work, just
skip it.

Signed-off-by: Kairui Song <kasong@tencent.com>
2 years agofix(iscsi): don't install the module if kernel doesn't support iscsi
Kairui Song [Tue, 6 Dec 2022 16:06:34 +0000 (00:06 +0800)] 
fix(iscsi): don't install the module if kernel doesn't support iscsi

The cmdline hook of iscsi module will force check if iscsi_tcp module
is available, and abort the boot progress is not. But actually iscsi
module shouldn't be allowed to be installed in the first place if the
corresponding kernel doesn't support it.

So print an warning and refuse to install the iscsi dracut module
in such case, instead of dying on reboot.

Signed-off-by: Kairui Song <kasong@tencent.com>
2 years agofeat(squash): use require_kernel_modules for better module checking
Kairui Song [Tue, 6 Dec 2022 16:04:40 +0000 (00:04 +0800)] 
feat(squash): use require_kernel_modules for better module checking

require_kernel_modules prints more friendly erorr message and make the
code cleaner.

Signed-off-by: Kairui Song <kasong@tencent.com>
2 years agofeat(dracut-init.sh): introduce a new helper require_kernel_modules
Kairui Song [Tue, 6 Dec 2022 09:24:47 +0000 (17:24 +0800)] 
feat(dracut-init.sh): introduce a new helper require_kernel_modules

Some dracut modules won't work without certain kernel modules,
this helper will be helpful for checking such kernel configs in
check() and error out early.

Signed-off-by: Kairui Song <kasong@tencent.com>
2 years agofix(dracut-functions.sh): check_kernel_module should follow dracutsysrootdir
Kairui Song [Tue, 6 Dec 2022 09:20:26 +0000 (17:20 +0800)] 
fix(dracut-functions.sh): check_kernel_module should follow dracutsysrootdir

check_kernel_module calls modprobe and tries to dry-run a module load to
check if a module is available. modprobe supports `-d` to specify a
rootdir, so just pass dracutsysrootdir to it to make it work as expected
when building initramfs for another rootfs.

Signed-off-by: Kairui Song <kasong@tencent.com>
2 years agoci: there is no longer a need for special handling test 04
Laszlo Gombos [Wed, 7 Dec 2022 20:08:55 +0000 (20:08 +0000)] 
ci: there is no longer a need for special handling test 04

2 years agoci: reduce the timeout for local tests to 30 min
Laszlo Gombos [Wed, 7 Dec 2022 20:04:27 +0000 (20:04 +0000)] 
ci: reduce the timeout for local tests to 30 min

The main motivation here is to do not allow each test to grow beyond
30 min. If a longer test is needed for some reason, it should be
split into two tests.

Currently each local test is passing at 20 min.

The longest running local test is test 12: encrypted LVM PV
on a degraded RAID-5.

2 years agoci: run all local tests on all containers
Laszlo Gombos [Wed, 7 Dec 2022 19:28:13 +0000 (19:28 +0000)] 
ci: run all local tests on all containers

2 years agorefactor(dmsquash-live): move ntfs-3g code to dmsquash-live-ntfs
Laszlo Gombos [Tue, 25 Oct 2022 17:54:34 +0000 (17:54 +0000)] 
refactor(dmsquash-live): move ntfs-3g code to dmsquash-live-ntfs

Since the installation of ntfs-3g binary is in the
dmsquash-live-ntfs module, calling ntfs-3g from dmsquash-live fails
when dmsquash-live-ntfs module is not installed anyways.

2 years agofix(dracut.sh): split drivers_dir check
Antonio Alvarez Feijoo [Thu, 27 Oct 2022 15:34:41 +0000 (17:34 +0200)] 
fix(dracut.sh): split drivers_dir check

The directory where to look for kernel modules can be set via the -k/--kmoddir
command line option or the drivers_dir configuration option. Its current check
should be split into two different ones to avoid misleading error messages (see
referenced issue):
- First check that its basename matches the kernel version set for the initramfs
(via --kver or automatically set by "uname -r").
- Second check that the parent directory of the last provided directory contains
"/lib/modules/". This check was also fixed to avoid accepting other directories
like "xxxlib/modules".

Fixes issue #1608

2 years agoperf(dracut.sh): do not mkdir $initdir/lib/dracut within a loop
Antonio Alvarez Feijoo [Mon, 19 Dec 2022 15:39:46 +0000 (16:39 +0100)] 
perf(dracut.sh): do not mkdir $initdir/lib/dracut within a loop

This directory is always needed to store files like modules.txt and
build-parameter.txt, so always create it, but only in one place.

2 years agofix(systemd-timesyncd): typo in systemd-time-wait-sync.service local conf path
Antonio Alvarez Feijoo [Thu, 24 Nov 2022 11:13:40 +0000 (12:13 +0100)] 
fix(systemd-timesyncd): typo in systemd-time-wait-sync.service local conf path

2 years agofix(lvm): drop dm-eventd binary and libs from initramfs
Scott Moser [Fri, 28 Oct 2022 13:31:33 +0000 (09:31 -0400)] 
fix(lvm): drop dm-eventd binary and libs from initramfs

Per David Teigland:

 > dmeventd is not meant to be run in the initrd. When it's started
 > later, it will monitor LVs activated by the initrd if needed.

So, lets git rid of the dmeventd binary and the libraries that were
being added for it.

2 years agotest: disable debug logging by default
Laszlo Gombos [Thu, 8 Dec 2022 04:21:32 +0000 (04:21 +0000)] 
test: disable debug logging by default

This makes the the tests more consistent, run faster by default
and less likely to timeout on the CI.

2 years agotest: do not omit dash module
Laszlo Gombos [Sun, 11 Dec 2022 15:33:00 +0000 (15:33 +0000)] 
test: do not omit dash module

It should not be necessary to explicitly omit dash module.
If this is needed, that would mean that bash is not marked
as an explicit dependency for some modules.

2 years agofix(dracut): shellcheck regression in DRACUT_INSTALL calls
Antonio Alvarez Feijoo [Mon, 12 Dec 2022 14:41:55 +0000 (15:41 +0100)] 
fix(dracut): shellcheck regression in DRACUT_INSTALL calls

If the DRACUT_INSTALL environment variable contains arguments (e.g.:
DRACUT_INSTALL="/usr/lib/dracut/dracut-install --debug"), its call cannot
be enclosed in double quotes. E.g.:

```
> export DRACUT_INSTALL="/usr/lib/dracut/dracut-install"
> "$DRACUT_INSTALL" > /dev/null
dracut-install: No SOURCE argument given
> export DRACUT_INSTALL="/usr/lib/dracut/dracut-install --debug"
> "$DRACUT_INSTALL" > /dev/null
-bash: /usr/lib/dracut/dracut-install --debug: No such file or directory
> $DRACUT_INSTALL > /dev/null
dracut-install: No SOURCE argument given

```

2 years agoci: introduce more networking options into test containers
Laszlo Gombos [Sun, 11 Dec 2022 15:03:48 +0000 (15:03 +0000)] 
ci: introduce more networking options into test containers

Add systemd-networked to Fedora container.
Add connman to Arch container.

This change enables manual testing of various network configurations
and also allows the ci to ensure that having additional networking
packages installed does not break the network meta module.

2 years agofix(90kernel-modules): MMC and NVMe on kernels 6.0+
Mikhail Novosyolov [Sat, 3 Dec 2022 16:56:38 +0000 (19:56 +0300)] 
fix(90kernel-modules): MMC and NVMe on kernels 6.0+

Commit 6f8191fdf41 ("block: simplify disk shutdown") in Linux kernels 6.0 and above
renamed blk_cleanup_disk to blk_mq_destroy_queue. Adapt code to handle both cases.

Because of this the kernel module mmc_block.ko was not included into initrd on kernel 6.1:
dracut-install: No symbol or path match for '/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
while on kernel 5.15 it was included:
dracut-install: Handling /lib/modules/5.15.79-generic-1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
dracut-install: Module mmc_block: symbol blk_cleanup_queue matched inclusion filter

It made booting OS from root on /dev/mmcblk* impossible.

Just adding blk_mq_destroy_queue was not enough to make mmc_block.ko be included into initrd
(maybe because call of blk_cleanup_disk() was removed and call of blk_mq_destroy_queue() was not added).
So also adding blk_mq_alloc_request which is used from mmc_block.

Fixes: https://github.com/dracutdevs/dracut/issues/2102
2 years agorefactor: use read -r instead of cat
keentux [Tue, 29 Nov 2022 18:23:54 +0000 (18:23 +0000)] 
refactor: use read -r instead of cat

Fixes #2093: Bad style `var=$(cat <file>)`. Replace by `read -r var < file`

Signed-off-by: keentux <valentin.lefebvre@suse.com>
2 years agoci: document workaround for Gentoo
Laszlo Gombos [Thu, 15 Dec 2022 20:49:29 +0000 (20:49 +0000)] 
ci: document workaround for Gentoo

2 years agotest: rpc.idmapd is optional for NFS
Laszlo Gombos [Fri, 25 Nov 2022 01:37:33 +0000 (01:37 +0000)] 
test: rpc.idmapd is optional for NFS

See dracut NFS module (95nfs/module-setup.sh).

2 years agoci: add networking to Gentoo test containers
Laszlo Gombos [Thu, 24 Nov 2022 05:02:39 +0000 (05:02 +0000)] 
ci: add networking to Gentoo test containers

nfs-utils and dhcp is needed to test nfs.
nbd is needed to test nbd.

2 years agofix(network): check if ip command fails
Laszlo Gombos [Fri, 2 Dec 2022 22:30:55 +0000 (22:30 +0000)] 
fix(network): check if ip command fails

2 years agofix(network): two bugs which cause minutes long boot times
tupper [Thu, 24 Mar 2022 13:23:20 +0000 (09:23 -0400)] 
fix(network): two bugs which cause minutes long boot times

Caused by unneeded arping to the default gateway.

2 years agoci: install shfmt with dnf into openSuse container
Laszlo Gombos [Mon, 5 Dec 2022 23:42:37 +0000 (23:42 +0000)] 
ci: install shfmt with dnf into openSuse container

Remove the special handling for shfmt binary.

No need to grab a specific version of the shfm binary that
is not tested together with the distribution.

2 years agoci: make sure portage command working inside Gentoo container
Laszlo Gombos [Mon, 5 Dec 2022 23:07:44 +0000 (23:07 +0000)] 
ci: make sure portage command working inside Gentoo container

Do not remove /var/db/repos/gentoo as it breaks portage.

2 years agoci: add mdadm to Gentoo container to run test 10
Laszlo Gombos [Mon, 5 Dec 2022 17:14:35 +0000 (17:14 +0000)] 
ci: add mdadm to Gentoo container to run test 10

2 years agoci: add tools for thin provisioning to Debian and Gentoo container for test 17
Laszlo Gombos [Mon, 5 Dec 2022 17:12:50 +0000 (17:12 +0000)] 
ci: add tools for thin provisioning to Debian and Gentoo container for test 17

2 years agoci: add dmraid to Debian and Gentoo container to run test 14
Laszlo Gombos [Mon, 5 Dec 2022 15:54:07 +0000 (15:54 +0000)] 
ci: add dmraid to Debian and Gentoo container to run test 14

2 years agoci: seperate local and network tests
Laszlo Gombos [Wed, 30 Nov 2022 00:54:14 +0000 (00:54 +0000)] 
ci: seperate local and network tests

Configure network module outside of test.sh scripts
to allow for parallelizm and flexibility.

Remove NM test directory wrappers and set network
in Github action instead.

This is in preparation to test other dracut network modules
such as systemd-networkd dracut module.

2 years agotest: do not omit dracut networking modules
Laszlo Gombos [Fri, 25 Nov 2022 03:04:26 +0000 (03:04 +0000)] 
test: do not omit dracut networking modules

The main motivation of this change is to prepare to enable
testing all four networking dracut modules not just two.

There are four networking modules supported currently.
Omitting one networking module not only is not necessary but
confusing as if the test really wants to omit networking modules,
it should omit all three non-used dracut networking modules.

2 years agofeat(kernel-modules): exclude USB drivers in strict hostonly mode
Antonio Alvarez Feijoo [Tue, 29 Nov 2022 16:02:03 +0000 (17:02 +0100)] 
feat(kernel-modules): exclude USB drivers in strict hostonly mode

Provide a way to avoid installing all USB drivers in some use cases where they
are not needed, i.e., machines without a USB bus.

2 years agoci: install procps-ng into Fedora container
Laszlo Gombos [Mon, 5 Dec 2022 21:43:06 +0000 (21:43 +0000)] 
ci: install procps-ng into Fedora container

2 years agoci: set DEBUGFAIL to rd.debug when debug logging is enabled
Laszlo Gombos [Thu, 1 Dec 2022 16:34:13 +0000 (16:34 +0000)] 
ci: set DEBUGFAIL to rd.debug when debug logging is enabled

GitHub Actions allow to opt-in to more debug logging both on
web UI and on the command line.

When GitHub Action debug logging is enabled also enable
additional dracut test debugging by setting DEBUGFAIL to rd.debug.

This is particularly useful when re-run failed jobs with
debug logging enabled.

2 years agoci: remove native dracut installation from the test containers
Laszlo Gombos [Sun, 27 Nov 2022 04:08:58 +0000 (04:08 +0000)] 
ci: remove native dracut installation from the test containers

The installed packaged dracut version from a distributions can
interfere with testing latest dracut from source, which is the
primary goal of these containers.

2 years agoci: teach manual test workflow to run several tests
Laszlo Gombos [Wed, 23 Nov 2022 04:51:37 +0000 (04:51 +0000)] 
ci: teach manual test workflow to run several tests

Timesaver for running tests during development and reviews.

2 years agodocs: document the new release process
Laszlo Gombos [Fri, 2 Dec 2022 19:54:46 +0000 (19:54 +0000)] 
docs: document the new release process

Release tarballs are only available on github from now on.

2 years agofix(base): do not require chroot inside initramfs
Henrik Gombos [Mon, 21 Feb 2022 02:40:02 +0000 (21:40 -0500)] 
fix(base): do not require chroot inside initramfs

dracut can be invoked inside a chroot, but inside
the generated initramfs the chroot binary is not required.

add chroot to the generated initramfs if debug or selinux
dracut modules are enabled.

2 years agotest: remove dead code regarding special handling of test 99
Laszlo Gombos [Tue, 22 Nov 2022 20:07:38 +0000 (20:07 +0000)] 
test: remove dead code regarding special handling of test 99

2 years agofix(systemd-coredump): correct systemd-coredump binary path
Antonio Alvarez Feijoo [Thu, 24 Nov 2022 09:59:09 +0000 (10:59 +0100)] 
fix(systemd-coredump): correct systemd-coredump binary path

This issue went unnoticed because the systemd module always installs the
systemd-coredump binary using the right path.

2 years agofeat(fs-lib): fsck_single can now handle PARTLABEL and PARTUUID
Laszlo Gombos [Fri, 26 Aug 2022 12:10:38 +0000 (12:10 +0000)] 
feat(fs-lib): fsck_single can now handle PARTLABEL and PARTUUID

As an additional benefit, gentoo container now passing test-01.

2 years agofix(dracut.sh): use DRACUT_ARCH instead of `uname -m`
Antonio Alvarez Feijoo [Wed, 30 Nov 2022 10:20:29 +0000 (11:20 +0100)] 
fix(dracut.sh): use DRACUT_ARCH instead of `uname -m`

DRACUT_ARCH overrides `uname -m` since
https://github.com/dracutdevs/dracut/commit/a0120420

2 years agofix(base): remove grep dependency
Antonio Alvarez Feijoo [Wed, 30 Nov 2022 11:44:50 +0000 (12:44 +0100)] 
fix(base): remove grep dependency

The base module requires grep with the `rd.memdebug=1` command line parameter.
As this code is broken if grep is not added by other means and grep is only
required for this, rewriting this code to avoid the dependency.

2 years agorefactor(zfcp_rules): use read -r instead of cat
keentux [Wed, 23 Nov 2022 16:39:08 +0000 (16:39 +0000)] 
refactor(zfcp_rules): use read -r instead of cat

Fixes #1268: Bad style `var=$(cat <file>)`. Replace by `read -r var < file`

Signed-off-by: keentux <valentin.lefebvre@suse.com>
2 years agotest(TEST-99-RPM): remove test
Laszlo Gombos [Sat, 12 Nov 2022 01:39:11 +0000 (01:39 +0000)] 
test(TEST-99-RPM): remove test

This test is specific to rpm packaging and has been disabled
for a while.