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

2 years 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

2 years 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

2 years 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>
2 years 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.

2 years 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.

2 years 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.

2 years 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.

2 years 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.

2 years 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.

2 years 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)

2 years 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.

2 years 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.

2 years 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.

2 years 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

2 years 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

2 years 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>
2 years 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.

2 years 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`.

2 years 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

2 years 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

2 years 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

2 years agofix(dracut.sh): correct path for UEFI stub on split-usr systems
Mike Gilbert [Fri, 26 May 2023 23:04:27 +0000 (19:04 -0400)] 
fix(dracut.sh): correct path for UEFI stub on split-usr systems

systemd always installs the UEFI stub in ${prefix}/lib/systemd/boot/efi.

On split-usr systems, systemdutildir is ${rootprefix}/lib/systemd, which
makes dracut look in the wrong place.

Instead, grab 'prefix' from systemd.pc and store it in 'systemd_prefix'.

Bug: https://bugs.gentoo.org/765208
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
2 years agofeat(dracut-init.sh): do not print by default if an udev rule is skipped
Henrik Gombos [Sun, 4 Jun 2023 17:34:45 +0000 (17:34 +0000)] 
feat(dracut-init.sh): do not print by default if an udev rule is skipped

2 years agotest: move more makeroot dependencies into test-makeroot dracut module
Henrik Gombos [Sun, 21 May 2023 13:56:46 +0000 (13:56 +0000)] 
test: move more makeroot dependencies into test-makeroot dracut module

2 years agofix(kernel-modules): add interconnect drivers
Andrew Halaney [Mon, 5 Jun 2023 17:16:24 +0000 (12:16 -0500)] 
fix(kernel-modules): add interconnect drivers

Many devicetree based systems require interconnect drivers to function
properly. Include those in the initramfs.

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
2 years agotest(LVM-THIN): avoid thin pool size warning
Henrik Gombos [Sun, 14 May 2023 12:22:22 +0000 (12:22 +0000)] 
test(LVM-THIN): avoid thin pool size warning

Avoid the following warning by reducing thin pool size

> "Sum of all thin volume sizes exceeds the size of thin pool
> and the size of whole volume group.

2 years agoci: cleanup containers
Henrik Gombos [Fri, 2 Jun 2023 14:05:12 +0000 (14:05 +0000)] 
ci: cleanup containers

Remove /etc/profile.d/dracut-test.sh from test containers
No use to override default command
Remove references to docker. These files work just fine
with podman as well.

2 years agotest: add empty default test_cleanup implementation
Henrik Gombos [Sun, 4 Jun 2023 14:40:06 +0000 (14:40 +0000)] 
test: add empty default test_cleanup implementation

2 years agotest: move more common test code to test-functions
Henrik Gombos [Tue, 23 May 2023 22:03:08 +0000 (22:03 +0000)] 
test: move more common test code to test-functions

Move KVERSION and USE_NETWORK definition to test-functions.
Add option for qemu_add_drive_args to initialize drive with size.

2 years agofix(resolve-deps): check the existing file—not the source
Frederick Grose [Sun, 21 May 2023 22:05:12 +0000 (18:05 -0400)] 
fix(resolve-deps): check the existing file—not the source

Check for dependencies on the file actually installed, otherwise,
such as when the shebang is a link not equal to the initramfs link,
the wrong file may be tested.

2 years agofix(dracut-lib.sh): remove successful finished initqueue scripts
Martin Wilck [Wed, 3 May 2023 20:21:38 +0000 (22:21 +0200)] 
fix(dracut-lib.sh): remove successful finished initqueue scripts

If some "finished" initscripts keep failing, dracut will start
printing warnings after a while. But it will warn about all scripts
in the finished initqueue, not only those that have failed. That
makes it difficult to identify the script that has actually
caused the failure.

To avoid this, delete finished initqueue scripts when they succeed.
Also, instead of returning as soon as one of the scripts fails, try
all scripts, deleting those that succeed, and return failure if at
least one script failed.

If a previously deleted script is recreated by some other part of
the code, it will be re-run the next time the check_finished() function
is called, and will be re-deleted if it still succeeds.

The only case where I see that this might cause issues is if some
condition needs to be tested over and over again, because it succeeds
and then fails later (for example, a device showing up and then being
removed again). But I think that this is not the intended logic.
In general, when a device shows up or another "finished" condition
is met, we assume that this condition will hold at least until the
initramfs switches root and exits. If all conditions are met, the
current code will also exit the initqueue without retrying any of
the conditions again.

2 years agofix(udev-rules): remove firmware.rules
Henrik Gombos [Sun, 21 May 2023 14:05:07 +0000 (14:05 +0000)] 
fix(udev-rules): remove firmware.rules

2 years agodocs: change ext3 to ext4
Henrik Gombos [Fri, 19 May 2023 00:10:33 +0000 (00:10 +0000)] 
docs: change ext3 to ext4

Promote ext4 instead of ext3 in the manual.

2 years agofix(dracut.sh): silence the output of hardlinking files by default
Henrik Gombos [Sun, 4 Jun 2023 14:26:37 +0000 (14:26 +0000)] 
fix(dracut.sh): silence the output of hardlinking files by default

2 years agofix(github): exempt issues in a milestone
Henrik Gombos [Sun, 21 May 2023 14:17:19 +0000 (14:17 +0000)] 
fix(github): exempt issues in a milestone

2 years agofix(virtiofs): add virtio_pci kernel module to virtiofs
Sergio E. Nemirowski [Sun, 21 May 2023 22:36:05 +0000 (02:36 +0400)] 
fix(virtiofs): add virtio_pci kernel module to virtiofs

fix #2357

Signed-off-by: Sergio E. Nemirowski <sergio@outerface.net>
2 years agoci: install multipath-tools into openSuse container
Henrik Gombos [Mon, 22 May 2023 00:34:02 +0000 (00:34 +0000)] 
ci: install multipath-tools into openSuse container

2 years agotest: remove references of dhcpd3 from tests
Henrik Gombos [Fri, 19 May 2023 00:20:38 +0000 (00:20 +0000)] 
test: remove references of dhcpd3 from tests

dhcp3-server is no longer supported by Debian
and it is replaced by isc-dhcp-server.

2 years agotest: move test condition to test_check
Henrik Gombos [Wed, 17 May 2023 00:46:19 +0000 (00:46 +0000)] 
test: move test condition to test_check

This enables skipping the test instead of failing it.

2 years agotest: upgrade to ext4
Henrik Gombos [Fri, 12 May 2023 13:47:29 +0000 (13:47 +0000)] 
test: upgrade to ext4

Most users use ext4 instead of ext3 or ext2. Upgrade tests to ext4.

2 years agofix(dracut-systemd): rootfs-generator cannot write outside of generator dir
Antonio Alvarez Feijoo [Wed, 8 Mar 2023 07:25:38 +0000 (08:25 +0100)] 
fix(dracut-systemd): rootfs-generator cannot write outside of generator dir

Although it was already documented in systemd.generator(7) that generators must
not write to locations other than those passed as arguments, since
https://github.com/systemd/systemd/commit/ca6ce62d systemd executes generators
in a mount namespace "sandbox", so now the hooks created by the rootfs-generator
are lost.

These hooks are created using the root= cmdline argument, so this patch moves
the creation of these hooks to a cmdline hook.

Fixes issue #2211
Fixes issue #2225

2 years agofix(dracut-systemd): check and create generator dir outside of inner function
Antonio Alvarez Feijoo [Wed, 1 Mar 2023 11:07:29 +0000 (12:07 +0100)] 
fix(dracut-systemd): check and create generator dir outside of inner function

2 years agofix(dracut-systemd): do not hardcode the systemd generator directory
Antonio Alvarez Feijoo [Wed, 1 Mar 2023 10:21:16 +0000 (11:21 +0100)] 
fix(dracut-systemd): do not hardcode the systemd generator directory

The normal directory is the first argument passed to the systemd generator,
so use it instead of hardcoding /run/systemd/generator.

2 years agoci: add more packages to allow testing more dracut containers
Laszlo Gombos [Fri, 3 Mar 2023 05:02:38 +0000 (05:02 +0000)] 
ci: add more packages to allow testing more dracut containers

2 years agoci: simplify and sort
Laszlo Gombos [Fri, 3 Mar 2023 04:50:04 +0000 (04:50 +0000)] 
ci: simplify and sort

2 years agofix(dracut.sh): handle imagebase for uefi
keentux [Wed, 22 Mar 2023 10:40:39 +0000 (10:40 +0000)] 
fix(dracut.sh): handle imagebase for uefi

* UEFI creation didn't handle the ImageBase data for the PE file
  generation. Create an UKI thanks a stub file with a non zero BaseImage
  logs some warning ans generate a bad file offset management. The efi
  becomes unloadable.
* This commit parse the PE file header, get the data and apply the
  ImageBase on the objcopy command.

Fixes dracutdevs#2284

Signed-off-by: Valentin Lefebvre <valentin.lefebvre@suse.com>
2 years agofix(dracut-functions): avoid calling grep with PCRE (-P)
Daniel McIlvaney [Fri, 28 Apr 2023 21:02:05 +0000 (14:02 -0700)] 
fix(dracut-functions): avoid calling grep with PCRE (-P)

Invoking grep in Perl mode requires JIT'ing the Perl regex.
This can run into issues with SELinix policy which will generally try to
limit use of execmem in general purpose scripts. This occurs since the
JIT'd code will live in executable  memory.

The PCRE only '\K' command in the Perl REGEX can be replaced by a call
to awk instead.

2 years agofix(dracut-initramfs-restore.sh): handle /etc/machine-id empty or uninitialized
Antonio Alvarez Feijoo [Mon, 20 Mar 2023 13:10:35 +0000 (14:10 +0100)] 
fix(dracut-initramfs-restore.sh): handle /etc/machine-id empty or uninitialized

Handle the case where the user tries to debug the shutdown after explicitly
resetting the /etc/machine-id file.

2 years agofix(lsinitrd.sh): handle /etc/machine-id empty or uninitialized
Antonio Alvarez Feijoo [Mon, 20 Mar 2023 13:09:43 +0000 (14:09 +0100)] 
fix(lsinitrd.sh): handle /etc/machine-id empty or uninitialized

Handle the case where the user tries to query the initrd content after
explicitly resetting the /etc/machine-id file.

2 years agofix(dracut.sh): handle /etc/machine-id empty or uninitialized
Antonio Alvarez Feijoo [Tue, 7 Mar 2023 15:17:16 +0000 (16:17 +0100)] 
fix(dracut.sh): handle /etc/machine-id empty or uninitialized

Handle the case where the user tries to generate the initrd after explicitly
resetting the /etc/machine-id file.

Fixes issue #2267

2 years agofeat(systemd-creds): introducing the systemd-creds module
Antonio Alvarez Feijoo [Mon, 27 Mar 2023 13:12:05 +0000 (15:12 +0200)] 
feat(systemd-creds): introducing the systemd-creds module

Introducing the systemd-creds module.

2 years agofix(systemd-networkd): add missing conf files and services
Antonio Alvarez Feijoo [Thu, 23 Mar 2023 09:48:39 +0000 (10:48 +0100)] 
fix(systemd-networkd): add missing conf files and services

2 years agofix(dracut-functions.sh): convert mmcblk to the real kernel module name
Tao Liu [Wed, 12 Apr 2023 15:02:25 +0000 (23:02 +0800)] 
fix(dracut-functions.sh): convert mmcblk to the real kernel module name

In some x86_64 platforms such as Intel Elkhartlake, an issue of missing
necessary modules due to udevadm drivers field unmatch the real kernel module
name is found:

  $ udevadm info -a /dev/block/179:1

  looking at parent device '/devices/pci0000:00/0000:00:1a.0/mmc_host/mmc0/mmc0:0001':
    KERNELS=="mmc0:0001"
    SUBSYSTEMS=="mmc"
    DRIVERS=="mmcblk"
    ....

The DRIVERS field, aka mmcblk will be given to instmods to install the
corresponding mmc_block.ko kernel module. However mmc_block.ko cannot be
selected by string mmcblk, as a result, mmc_block.ko cannot be installed
in hostonly-mode strict, which will fail to bootup the machine such as in
kdump cases:

  $ /usr/lib/dracut/dracut-install -D /var/tmp --kerneldir /lib/modules/$(uname -r)/ -m mmcblk
  dracut-install: Failed to find module 'mmcblk'

In this patch, we will convert the string mmcblk to mmc_block, so the
kernel module can be successfully loaded.

Signed-off-by: Tao Liu <ltao@redhat.com>
2 years agofix(multipath): remove dependency on multipathd.socket
Tianhao Chai [Tue, 11 Apr 2023 00:36:12 +0000 (20:36 -0400)] 
fix(multipath): remove dependency on multipathd.socket

This reverts commit e39ff407eca1d783ab44093c44db5ee401ff5b1d, removes
an incorrect `Also=` directive from multipathd.service.

`Also=multipathd.socket` is not the correct behavior for a
socket-activated service. This directive has been removed upstream
and dracut should do the same.

This fixes #2289, #2175 where in the cleanup hook running multipath
binary triggers activation of multipathd.service after it is stopped
as dracut prepares to switch root in initrd-cleanup.service.

2 years agofeat(lsinitrd): notify user on missing compressor
Frederick Grose [Wed, 29 Mar 2023 14:29:39 +0000 (10:29 -0400)] 
feat(lsinitrd): notify user on missing compressor

Provide a notice to user if the required compressor package is
missing.  This rather than failing silently.

2 years agofix(99base): adjust to allow mksh as initrd shell
Frederick Grose [Tue, 28 Mar 2023 02:16:04 +0000 (22:16 -0400)] 
fix(99base): adjust to allow mksh as initrd shell

Use printf instead of echo in str_replace() to preserve escapes.
Find command paths while PATH includes /usr/sbin. (switch_root was
  not found after the original environment is restored on Fedora.)

2 years agofix(base): do not quote $CLINE in the `set` command
Dmitry Klochkov [Mon, 27 Mar 2023 10:25:57 +0000 (13:25 +0300)] 
fix(base): do not quote $CLINE in the `set` command

This is needed to correctly parse init arguments.

Fixes: 2fabaaa62dcfd31e593ca45e1374e55adae29d6b
2 years agofix(systemd-ac-power): correct systemd-ac-power binary path 2124/head
Antonio Alvarez Feijoo [Mon, 20 Mar 2023 11:18:20 +0000 (12:18 +0100)] 
fix(systemd-ac-power): correct systemd-ac-power binary path

`systemd-ac-power` has been moved from `/usr/lib/systemd` to `/usr/bin/` since
https://github.com/systemd/systemd/commit/251dc2f1

2 years agofix(dracut.sh): use dynamically uefi's sections offset
Valentin Lefebvre [Mon, 13 Mar 2023 11:06:13 +0000 (12:06 +0100)] 
fix(dracut.sh): use dynamically uefi's sections offset

* Uefi section are creating by `objcopy` with hardcoded sections
offset. This commit allow to have the correct offset between
each part of the efi file, needed to create an UKI. Offsets
are simply calculated so no sections overlap, as recommended
in  https://wiki.archlinux.org/title/Unified_kernel_image#Manually
Moreover, efi stub file's header is parsed to apply the correct
offsets according the section alignment factor.
* Remove EFI_SECTION_VMA_INITRD, no need anymore as initrd
section offset dynamically calculated

Fixes dracutdevs#2275

Signed-off-by: Valentin Lefebvre <valentin.lefebvre@suse.com>
2 years agofix(lvmthinpool-monitor): activate lvm thin pool before extend its size
Tao Liu [Fri, 3 Mar 2023 10:27:25 +0000 (18:27 +0800)] 
fix(lvmthinpool-monitor): activate lvm thin pool before extend its size

The state of lvm thin pool may change into inactived state when kdump into
2nd kernel. As a result, lvextend will fail to extend its size. For example:

In 1st kernel:

  $ lvs
  LV       VG         Attr       LSize   Pool     Origin Data%  Meta%
  vol      vg00       Vwi-a-tz-- 300.00m thinpool        70.54
  thinpool vg00       twi-aotz-- 236.00m                 89.67  12.50
  ...

In 2nd kernel:

  LV       VG         Attr       LSize   Pool     Origin Data%  Meta%
  vol      vg00       Vwi-aotz-- 300.00m thinpool        70.54
  thinpool vg00       twi---tz-- 236.00m                 89.67  12.50
  ...

And the lvextend failing log:
[  8.483878] start-thinpool-monitor[590]: lvextend using policy requires the thin pool to be active.

In this patch, we will first activate lvm thin pool before calling lvextend
during kdump.

Signed-off-by: Tao Liu <ltao@redhat.com>
2 years agochore(deps): bump luizm/action-sh-checker from 0.5.0 to 0.6.0
dependabot[bot] [Tue, 28 Feb 2023 18:57:06 +0000 (18:57 +0000)] 
chore(deps): bump luizm/action-sh-checker from 0.5.0 to 0.6.0

Bumps [luizm/action-sh-checker](https://github.com/luizm/action-sh-checker) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/luizm/action-sh-checker/releases)
- [Commits](https://github.com/luizm/action-sh-checker/compare/v0.5.0...v0.6.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 agofix(dmsquash-live): restore compatibility with earlier releases
Laszlo Gombos [Fri, 24 Feb 2023 01:57:19 +0000 (01:57 +0000)] 
fix(dmsquash-live): restore compatibility with earlier releases

Follow-up to 40dd5c90e0efcb9ebaa9abb42a38c7316e9706bd .

2 years agofix(dracut.sh): kmoddir does not handle trailing /
Pavel Valena [Fri, 24 Feb 2023 18:19:59 +0000 (19:19 +0100)] 
fix(dracut.sh): kmoddir does not handle trailing /

Fixes https://github.com/dracutdevs/dracut/issues/2236

+(/) only works in bash interactive mode. Using any non-interactive
bash run simply doesn't remove anything.

The solution is copied from dracut-lib.sh, trim().

2 years agofix(udev-rules): remove old eudev specific rule
Laszlo Gombos [Wed, 22 Feb 2023 04:02:17 +0000 (04:02 +0000)] 
fix(udev-rules): remove old eudev specific rule

Revert 64fb0900cbc47804b4225287e4622063169db360, no longer
needed.

2 years agofix(udev-rules): remove old redhat specific rule
Laszlo Gombos [Wed, 22 Feb 2023 03:56:37 +0000 (03:56 +0000)] 
fix(udev-rules): remove old redhat specific rule

The 40-redhat.rules rule has been removed upstream in 2010.

2 years agofix(udev-rules): remove old edd_id extra rules
Laszlo Gombos [Wed, 22 Feb 2023 03:35:46 +0000 (03:35 +0000)] 
fix(udev-rules): remove old edd_id extra rules

The 61-persistent-storage-edd.rules rule has been removed upstream
in 2012.

2 years agofix(udev-rules): remove old debian specific rules
Laszlo Gombos [Tue, 21 Feb 2023 03:09:19 +0000 (03:09 +0000)] 
fix(udev-rules): remove old debian specific rules

The last Debian release that carried 91-permissions.rules is wheezy.

2 years agofeat(test): nfs_fetch_url test into nfs test
“Masahiro [Tue, 7 Feb 2023 09:30:36 +0000 (18:30 +0900)] 
feat(test): nfs_fetch_url test into nfs test

This is to check the behavior of nfs_fetch_url() in nfs-lib.sh.
nfs_fetch_url() calls nfs_already_mounted() internally.
A file /nfs/client/root/fetchfile is on NFS server, which is fetched
from clients for testing with nfs_fetch_url().

2 years agofix(url-lib.sh): nfs_already_mounted() with trailing slash in nfs path
“Masahiro [Fri, 3 Feb 2023 03:08:26 +0000 (12:08 +0900)] 
fix(url-lib.sh): nfs_already_mounted() with trailing slash in nfs path

nfs_already_mounted() doesn't work when the installation ISO and kickstart file on a same NFS share are specified with inst.repo and inst.ks boot parameter as below.

   inst.repo=nfs:192.168.1.1:/home/data/rhel9.iso inst.ks=nfs:192.168.1.1:/home/data/ks.cfg

   NOTE: /home/data is configured for nfs share on 192.168.1.1

One problem is a file (not a directory) was passed into nfs_already_mounted().
nfs_already_mounted() is the function to judge if the given directory is already mounted.
So, filepath should be passed in nfs_fetch_url().

The other problem is about the trailing slash in the nfs path in /proc/mounts.

The /proc/mounts has an entry after nfs mount of inst.repo.

   192.168.1.1:/data/   /run/install/isodir  nfs  ro,relatime,<snip>

In this case, nfs_already_mounted() returns "/run/install/isodir//home/data/ks.cfg" wrongly. The following is from the log.

[   14.556279] localhost.localdomain dracut-initqueue[1282]: ///lib/url-lib.sh@156(nfs_fetch_url): nfs_already_mounted 192.168.122.1 /home/data/ks.cfg
[   14.556279] localhost.localdomain dracut-initqueue[1282]: ///lib/url-lib.sh@137(nfs_already_mounted): local server=192.168.122.1 path=/home/data/ks.cfg s= p=
...
[   14.654966] localhost.localdomain dracut-initqueue[1282]: ///lib/url-lib.sh@140(nfs_already_mounted): '[' 192.168.122.1 = 192.168.122.1 ']'
[   14.654966] localhost.localdomain dracut-initqueue[1282]: ///lib/url-lib.sh@141(nfs_already_mounted): '[' /home/data/ks.cfg = /home/data/ ']'
[   14.654966] localhost.localdomain dracut-initqueue[1282]: ///lib/url-lib.sh@143(nfs_already_mounted): str_starts /home/data/ks.cfg /home/data/
[   14.654966] localhost.localdomain dracut-initqueue[1282]: ///lib/dracut-lib.sh@51(str_starts): '[' ks.cfg '!=' /home/data/ks.cfg ']'
[   14.654966] localhost.localdomain dracut-initqueue[1282]: ///lib/url-lib.sh@144(nfs_already_mounted): echo /run/install/isodir//home/data/ks.cfg
...
[   14.658069] localhost.localdomain dracut-initqueue[934]: //lib/url-lib.sh@156(nfs_fetch_url): mntdir=/run/install/isodir//home/data/ks.cfg

This function doesn't expect the trailiing slash of the nfs path in /proc/mounts, so it should be removed before processing it.

2 years agoci: use CodeQL instead of LGTM
Frantisek Sumsal [Wed, 14 Sep 2022 09:33:51 +0000 (11:33 +0200)] 
ci: use CodeQL instead of LGTM

As LGTM is going to be shut down by EOY[0], let's move the code scanning to
CodeQL as recommended. Thanks to GH integration the results from such
scans will be shown both in the respective PR and in the Security ->
Code Scanning tab[1].

[0] https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/
[1] https://github.com/dracutdevs/dracut/security/code-scanning

2 years agofeat(dracut): use log level indicator in console output
Antonio Alvarez Feijoo [Tue, 27 Dec 2022 15:44:58 +0000 (16:44 +0100)] 
feat(dracut): use log level indicator in console output

Also, use the same format in messages printed to console before dracut-logger
is sourced.

Fixes issue #1065

2 years agofeat(kernel-modules): driver support for macbook keyboards
Pavel Valena [Tue, 21 Feb 2023 00:57:50 +0000 (01:57 +0100)] 
feat(kernel-modules): driver support for macbook keyboards

Discussed in: https://bugzilla.redhat.com/show_bug.cgi?id=2166209

2 years agofix(dracut-install): prevent possible infinite recursion with suppliers
Adrien Thierry [Wed, 15 Feb 2023 19:13:56 +0000 (14:13 -0500)] 
fix(dracut-install): prevent possible infinite recursion with suppliers

During search for fw_devlink suppliers, it's possible to encounter a
situation where supplier A depends on supplier B, and supplier B has a
parent node that depends on supplier A. This leads to an infinite
recursion.

To fix this, make sure suppliers are only processed once.

Signed-off-by: Adrien Thierry <athierry@redhat.com>
2 years agobuild: remove rpm spec file and build rules
John Meneghini [Tue, 14 Feb 2023 21:28:57 +0000 (16:28 -0500)] 
build: remove rpm spec file and build rules

As discussed in issue #2204 this patch removes the dracut.spec file from
the repository.  The advantage of this patch is that it creates a
dracut-version.tar.xv file that can be more easily consumed by the
downstream distributions because there's no rpm spec file included in
the distribution.

Tested with a downstream rpm spec fiie:

```
cd dracut
VERSION=`git describe --abbrev=0 --tags --always`
make clean
make dist
cp dracut-${VERSION}.tar.xz ../
cd ..

xz -d -v dracut-${VERSION}.tar.xz
tar rf dracut-${VERSION}.tar dracut.spec
xz -9 dracut-${VERSION}.tar

rm -rf rmpbuild
mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
rpmbuild -ta --define "_topdir `pwd`/rpmbuild" -v dracut-${VERSION}.tar.xz
```

Fixes issue #2204

2 years agofix(kernel-modules): add UFS drivers
Adrien Thierry [Tue, 14 Feb 2023 18:41:35 +0000 (13:41 -0500)] 
fix(kernel-modules): add UFS drivers

Add ufs to the list of block drivers as it is used in modern embedded
systems.

Signed-off-by: Adrien Thierry <athierry@redhat.com>
2 years agofix(kernel-modules): use modalias info in get_dev_module()
Adrien Thierry [Mon, 13 Feb 2023 15:43:32 +0000 (10:43 -0500)] 
fix(kernel-modules): use modalias info in get_dev_module()

When calling dracut with '--hostonly-mode=strict', get_dev_module() gets
called on the system's block devices to find the required drivers. The
driver name is retrieved using udevadm. However, the driver name
returned by udevadm is not necessarily the same as the module name.
This is the case for the Qualcomm UFS driver: udevadm returns
'ufshcd-qcom' while the module name is 'ufs-qcom', so dracut-install is
not able to find the module afterwards.

To solve this, make get_dev_module() also return the module alias info
from the modalias files contained in the sysfs directories parsed by
udevadm.

Signed-off-by: Adrien Thierry <athierry@redhat.com>
2 years agofix(crypt): add missing libraries
Jóhann B. Guðmundsson [Mon, 13 Feb 2023 20:22:56 +0000 (20:22 +0000)] 
fix(crypt): add missing libraries

Add missing libraries, closes #2137

2 years agorevert(network-manager): avoid restarting NetworkManager
Lubomir Rintel [Tue, 20 Dec 2022 12:06:43 +0000 (13:06 +0100)] 
revert(network-manager): avoid restarting NetworkManager

This reverts commit 77630365aed201a729c73a9ffda0733a75f3fee4.

Its commit message states:

  On EL8.3 the NetworkManager keep restarting even if it exits successfully
  while waiting for Clevis to unlock. This patch ensures NetworkManager runs
  only once in initrd.

Yes; NetworkManager is run multiple times, so that it's able to
configure interfaces that haven't been seen previously (because bus was
slow to scan or device took time to initialize).

It's not clear what problem was the original commit trying to fix.
I suspect there was no problem, just a misunderstanding.

2 years agofix(dracut.sh): handle sbsign errors for UEFI builds
Antonio Alvarez Feijoo [Mon, 13 Feb 2023 10:13:00 +0000 (11:13 +0100)] 
fix(dracut.sh): handle sbsign errors for UEFI builds

`sbsign` does not issue any error if there is not enough disk space to create
the signed file using its `--output` option. So, verify the signed image after
its creation using `sbverify`.

Fixes issue #2197

2 years agofix(dracut.sh): handle out of space error for UEFI builds
Antonio Alvarez Feijoo [Mon, 13 Feb 2023 10:11:09 +0000 (11:11 +0100)] 
fix(dracut.sh): handle out of space error for UEFI builds

If `cp` fails, do not continue, print an error and exit, like it's already
being done for non-UEFI builds.

2 years agofix(network): IPv6: don't wait for RA for static IPv6 assignments
Martin Wilck [Tue, 7 Feb 2023 21:24:15 +0000 (22:24 +0100)] 
fix(network): IPv6: don't wait for RA for static IPv6 assignments

This patch reverts commit
c603419 ("wait for IPv6 RA if using none/static IPv6 assignment").
It's not generally correct wait for a default route to be established
for an interface, or to wait for "proto ra" routes in general.
For example, if the system is a router itself, it will receive no
RAs. In isolated networks, no gateway may be advertized, either.
This is similar in spirit to 76f6566 ("Revert "wait for IPv6 RA
if using none/static IPv6 assignment"")

Whatever c603419 ("wait for IPv6 RA if using none/static IPv6 assignment")
was supposed to achieve, it should be done differently.

2 years agofix(network-legacy): always include af_packet
Martin Wilck [Tue, 7 Feb 2023 20:59:51 +0000 (21:59 +0100)] 
fix(network-legacy): always include af_packet

For static IPv4 configurations, we use arping to check for duplicate
IP addresses. arping requires the af_packet module to work, and if arping
fails, the IP address will not be set and booting will fail.
af_packet may not be loaded / required in the running system, for example if
the system had been booted in an IPv6 configuration, or if it had been
manually unloaded. Make sure it's included in initramfs in hostonly mode, too.

2 years agofix(network): don't assume prefix length 64 by default
Martin Wilck [Fri, 3 Feb 2023 20:39:02 +0000 (21:39 +0100)] 
fix(network): don't assume prefix length 64 by default

Assuming a default prefix length of 64 by default if no explicit
prefix length is given is wrong and known to cause connectivity
problems in some networks. A prefix length of 128 should be assumed
in this case.

See https://www.rfc-editor.org/rfc/rfc5942 (specifically section 5)
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684009

2 years agofix(iscsi): prefix syntax for static iBFT IPv6 addresses
Martin Wilck [Fri, 3 Feb 2023 20:26:28 +0000 (21:26 +0100)] 
fix(iscsi): prefix syntax for static iBFT IPv6 addresses

ibft_to_cmdline() formats a static IPv6 address like this
(without peer, gateway, hostname):

  ip="[fd09:9a46:b5c1:1fe:1::10/64]:::::ibft0:none"

This means that the "mask" field (4th) is left blank. When this is
parsed later by parse-ip-opts.sh, it bails out with the error
message "Sorry, automatic calculation of netmask is not yet supported".

parse-ip-opts.sh rather expects the prefix in the 4th field:

  ip="[fd09:9a46:b5c1:1fe:1::10]:::64::ibft0:none"

This syntax will be correctly transformed to the command

  ip addr add fd09:9a46:b5c1:1fe::10/64 dev ibft0

This patch fixes the formatting of the "ip=" line in ibft_to_cmdline().

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

In iBFT 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.

2 years agofeat(dracut-install): add fw_devlink suppliers as module dependencies
Adrien Thierry [Mon, 5 Dec 2022 21:28:17 +0000 (16:28 -0500)] 
feat(dracut-install): add fw_devlink suppliers as module dependencies

Dracut currently finds kernel module dependencies using two methods:
depmod and softdeps. However, these are often insufficient on embedded
systems where a lot of driver dependencies are only described in the
device tree. This is often the case for low-level devices such as
clocks, regulators, pinctrls, etc.

This patch allows dracut to find those device tree dependencies, by
parsing the sysfs supplier nodes populated by fw_devlink.

Signed-off-by: Adrien Thierry <athierry@redhat.com>
2 years agorefactor(dracut-install): add Hashmap cleanup function
Adrien Thierry [Mon, 21 Nov 2022 16:14:23 +0000 (11:14 -0500)] 
refactor(dracut-install): add Hashmap cleanup function

This is prep work for adding support for fw_devlink suppliers
dependencies.

Signed-off-by: Adrien Thierry <athierry@redhat.com>
2 years agorefactor(dracut-install): add function to install one dependent module
Adrien Thierry [Mon, 14 Nov 2022 16:13:57 +0000 (11:13 -0500)] 
refactor(dracut-install): add function to install one dependent module

This is prep work for adding support for fw_devlink suppliers
dependencies.

Signed-off-by: Adrien Thierry <athierry@redhat.com>
2 years agochore(deps): bump luizm/action-sh-checker from 0.2.2 to 0.5.0
dependabot[bot] [Fri, 3 Feb 2023 02:43:59 +0000 (02:43 +0000)] 
chore(deps): bump luizm/action-sh-checker from 0.2.2 to 0.5.0

Bumps [luizm/action-sh-checker](https://github.com/luizm/action-sh-checker) from 0.2.2 to 0.5.0.
- [Release notes](https://github.com/luizm/action-sh-checker/releases)
- [Commits](https://github.com/luizm/action-sh-checker/compare/v0.2.2...v0.5.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 agochore(shfmt): update to pass with shfmt v3.5.1
Laszlo Gombos [Sun, 20 Nov 2022 23:58:31 +0000 (23:58 +0000)] 
chore(shfmt): update to pass with shfmt v3.5.1

2 years agofix(fips): move fips-boot script to pre-pivot
Antonio Alvarez Feijoo [Tue, 27 Dec 2022 08:30:43 +0000 (09:30 +0100)] 
fix(fips): move fips-boot script to pre-pivot

This is needed in s390x to be able to use the same `boot=` command line
parameter in grub and zipl. Otherwise, `boot=` would need to be added only to
`grub.cfg` (not `/etc/default/grub` and thereby not to `/boot/zipl/config`).

Signed-off-by: Raymund Will <rw@suse.com>
2 years agofix(fips): only unmount /boot if it was mounted by the fips module
Antonio Alvarez Feijoo [Tue, 27 Dec 2022 08:30:09 +0000 (09:30 +0100)] 
fix(fips): only unmount /boot if it was mounted by the fips module

The `do_fips` method should only unmount /boot if it was mounted in the
`mount_boot` method.

In addition, now the `mount_boot` method checks if /boot is already mounted.

Signed-off-by: Raymund Will <rw@suse.com>
2 years agofeat(fips): add progress messages
Antonio Alvarez Feijoo [Tue, 27 Dec 2022 08:29:44 +0000 (09:29 +0100)] 
feat(fips): add progress messages

This allows to better understand at what point a FIPS integrity test failed.

Signed-off-by: Raymund Will <rw@suse.com>
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