]> git.ipfire.org Git - thirdparty/dracut.git/log
thirdparty/dracut.git
2 years agotest: move finished-false.sh from test case to test-makeroot module
Laszlo Gombos [Wed, 19 Oct 2022 00:29:15 +0000 (00:29 +0000)] 
test: move finished-false.sh from test case to test-makeroot module

2 years agotest: move common dependencies from test case to test-makeroot module
Laszlo Gombos [Wed, 19 Oct 2022 00:25:11 +0000 (00:25 +0000)] 
test: move common dependencies from test case to test-makeroot module

poweroff cp umount sync dd are commonly used by test cases to make
root filesystem.

2 years agofeat(test-makeroot): add new module to share code between tests
Laszlo Gombos [Wed, 19 Oct 2022 00:15:54 +0000 (00:15 +0000)] 
feat(test-makeroot): add new module to share code between tests

This module is used for tests to create root filesystem.

2 years agotest: move poweroff handling from test case to test module
Laszlo Gombos [Wed, 19 Oct 2022 00:05:57 +0000 (00:05 +0000)] 
test: move poweroff handling from test case to test module

2 years agofeat(test): add new module to share code between tests
Laszlo Gombos [Tue, 18 Oct 2022 23:51:32 +0000 (23:51 +0000)] 
feat(test): add new module to share code between tests

2 years agotest: shutdown is not used for running tests
Laszlo Gombos [Tue, 18 Oct 2022 23:24:37 +0000 (23:24 +0000)] 
test: shutdown is not used for running tests

2 years agoci: fix Arch container
Laszlo Gombos [Mon, 7 Nov 2022 15:13:41 +0000 (15:13 +0000)] 
ci: fix Arch container

packages should be installed with -Syu instead of -Sy.

2 years agofeat(overlayfs): add a new module called overlayfs
Laszlo Gombos [Wed, 19 Oct 2022 21:50:08 +0000 (21:50 +0000)] 
feat(overlayfs): add a new module called overlayfs

Also split ovlfs variable with two different meaning.

2 years agofix(dmsquash-live): add support for NFS
Laszlo Gombos [Sat, 20 Aug 2022 17:50:06 +0000 (17:50 +0000)] 
fix(dmsquash-live): add support for NFS

Move overlayfs mount out into its own dedicated file
so that we can call into it directly for NFS support.

Add a new test case for overlayfs on top of NFS.

2 years agoci: use prebuilt Linux kernel binaries for Gentoo container
Laszlo Gombos [Wed, 26 Oct 2022 02:27:30 +0000 (02:27 +0000)] 
ci: use prebuilt Linux kernel binaries for Gentoo container

Also remove dmsetup. It does not build and it is not required for ci.

2 years agorefactor(fs-lib.sh): udevadm info --query=property instead of --query=env
Marcos Mello [Mon, 7 Nov 2022 10:28:34 +0000 (07:28 -0300)] 
refactor(fs-lib.sh): udevadm info --query=property instead of --query=env

env is a long time deprecated alias to property, not listed in the man page for more than a decade.

2 years agofix(dracut-init.sh): instmods: wrong variable name
Marcos Mello [Sun, 6 Nov 2022 15:43:47 +0000 (12:43 -0300)] 
fix(dracut-init.sh): instmods: wrong variable name

It worked most of the time because `dracut-install -o` returns 0 in normal circumstances.

2 years agofix(dmsquash-live-ntfs): remove unnecessary command
Antonio Alvarez Feijoo [Fri, 28 Oct 2022 09:08:20 +0000 (11:08 +0200)] 
fix(dmsquash-live-ntfs): remove unnecessary command

2 years agofeat(qemu): add efi_secret driver
Cole Robinson [Fri, 4 Nov 2022 20:46:41 +0000 (16:46 -0400)] 
feat(qemu): add efi_secret driver

Despite the generic name, the only current use of the `efi_secret`
is exposing data in /sys that's been injected into a SEV/SEV-ES
virtual machine. More info:

https://docs.kernel.org/security/secrets/coco.html

This secret is probably a luks password, so we need this driver at
boot time.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2 years agofix(90kernel-modules): add (nonstandard) NVMe drivers
Jeremy Linton [Wed, 2 Nov 2022 22:17:24 +0000 (17:17 -0500)] 
fix(90kernel-modules): add (nonstandard) NVMe drivers

The M1/etc hardware has an quirky NVMe disk controller that needs
a dedicated NVMe driver. Rather than picking up just that
bit of hardware pick up drivers that register NVMe controllers.

This also picks up NVMe-OF style drivers, but seems like a better
long term solution on Arm platforms which tend to have a lot
of odd hardware.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2 years agorefactor(multipath): do not install the pidof binary
Antonio Alvarez Feijoo [Thu, 3 Nov 2022 10:09:45 +0000 (11:09 +0100)] 
refactor(multipath): do not install the pidof binary

dracut-lib.sh provides a custom version of pidof, so there is no need to install
the pidof binary. Also, source dracut-lib.sh in hook scripts when needed.

Fixes issue #2027

2 years agofix(dracut-functions.sh): suppress findmnt error msg if /etc/fstab not exist
Tao Liu [Thu, 3 Nov 2022 09:21:25 +0000 (17:21 +0800)] 
fix(dracut-functions.sh): suppress findmnt error msg if /etc/fstab not exist

When the rootfs of a virtual machine is virtiofs shared folder,
the /etc/fstab file may not exist. As a result, the "findmnt --fstab"
will complain "findmnt: can't read (null): No such file or directory"
when trying to rebuild kdump initramfs within the vm.

This patch checks if /etc/fstab exist before calling "findmnt --fstab"
to suppress the error message.

Before:
$ kdumpctl rebuild
kdump: Rebuilding /boot/initramfs-5.14.0-182.el9.x86_64kdump.img
findmnt: can't read (null): No such file or directory
findmnt: can't read (null): No such file or directory
findmnt: can't read (null): No such file or directory

After:
$ kdumpctl rebuild
kdump: Rebuilding /boot/initramfs-5.14.0-182.el9.x86_64kdump.img

Signed-off-by: Tao Liu <ltao@redhat.com>
2 years agofix(dracut-logger.sh): this fixes the dlog_init check for /dev/log
Brian C. Lane [Tue, 1 Nov 2022 17:06:20 +0000 (10:06 -0700)] 
fix(dracut-logger.sh): this fixes the dlog_init check for /dev/log

The /dev/log check was not correct, it would continue working if
/dev/log was a broken symlink. This changes the logic to be more clear
-- /dev/log needs to be a socket, and writable, and logger needs to be
available. If any of those conditions fail, turn off syslog and only use
console logging.

2 years agofeat(multipath): install tmpfiles.d config file
Martin Wilck [Wed, 26 Oct 2022 08:06:34 +0000 (10:06 +0200)] 
feat(multipath): install tmpfiles.d config file

Recent multipath-tools (0.9.2) added a tmpfiles.d template. Install it
if present.

2 years agofeat(dmsquash-live): add support for dash
Laszlo Gombos [Mon, 15 Aug 2022 22:00:03 +0000 (22:00 +0000)] 
feat(dmsquash-live): add support for dash

Using dash instead of bash saves about 0.5M initramfs size.

Co-authored-by: nabijaczleweli <nabijaczleweli@nabijaczleweli.xyz>
2 years agofeat(systemd-pcrphase): introducing the systemd-pcrphase module
Jóhann B. Guðmundsson [Sun, 23 Oct 2022 10:54:48 +0000 (10:54 +0000)] 
feat(systemd-pcrphase): introducing the systemd-pcrphase module

Introducing the systemd-pcrphase module

2 years agofix(dracut.sh): make omit-drivers option do exact match for names
Laszlo Gombos [Wed, 24 Aug 2022 19:16:26 +0000 (19:16 +0000)] 
fix(dracut.sh): make omit-drivers option do exact match for names

Modify the basic test case to use --omit-drivers and make it fail
without the PR and make it pass with the PR.

The test would fail with the following error without the PR:
FATAL: iscsiroot requested but kernel/initrd does not support iscsi

2 years agoci: integration test for openrc and musl
Laszlo Gombos [Mon, 17 Oct 2022 00:46:55 +0000 (00:46 +0000)] 
ci: integration test for openrc and musl

2 years agochore(base): remove dead code
Laszlo Gombos [Sat, 27 Aug 2022 22:05:28 +0000 (22:05 +0000)] 
chore(base): remove dead code

RD_TIMESTAMP is no longer used.
systemd-timestamp is not used.

2 years agoci(suse.conf.example): update SUSE-specific config
Antonio Alvarez Feijoo [Mon, 26 Sep 2022 07:00:36 +0000 (09:00 +0200)] 
ci(suse.conf.example): update SUSE-specific config

2 years agofeat(github): automating dependency updates
Jóhann B. Guðmundsson [Sun, 23 Oct 2022 19:08:21 +0000 (19:08 +0000)] 
feat(github): automating dependency updates

Let github's dependabot handle updating github's actions.

2 years agofix(multipath): install multipathd.socket
Tianhao Chai [Thu, 13 Oct 2022 05:50:06 +0000 (01:50 -0400)] 
fix(multipath): install multipathd.socket

2 years agoperf(90kernel-modules): use awk instead of shell monster
наб [Thu, 13 Oct 2022 16:14:53 +0000 (18:14 +0200)] 
perf(90kernel-modules): use awk instead of shell monster

~120ms -> ~2ms

Downstream: https://bugs.debian.org/1017411

2 years agofeat(systemd-portabled): introducing the systemd-portabled module
Antonio Alvarez Feijoo [Fri, 30 Sep 2022 12:37:36 +0000 (14:37 +0200)] 
feat(systemd-portabled): introducing the systemd-portabled module

Introducing the systemd-portabled module.

It's intended to work only with raw binary disk images contained in regular
files, but not with directory trees.

2 years agofix(network-manager): always install the library plugins directory
Antonio Alvarez Feijoo [Thu, 29 Sep 2022 10:02:34 +0000 (12:02 +0200)] 
fix(network-manager): always install the library plugins directory

The library plugins directory is automatically added to the initrd if either
libnm-device-plugin-team.so or libnm-settings-plugin-ifcfg-rh.so are present on
the system, but both are optional libraries, and if it does not exist, the
NetworkManager issues a warning.

2 years agofeat(dracut-init.sh): add inst_libdir_dir() helper
Antonio Alvarez Feijoo [Thu, 29 Sep 2022 10:02:16 +0000 (12:02 +0200)] 
feat(dracut-init.sh): add inst_libdir_dir() helper

This helper function is similar to inst_libdir_file(), but it installs plain
directories located on a library directory instead of files.

2 years agochore: adjust .kateconfig for C code
Marcos Mello [Sat, 27 Aug 2022 10:58:50 +0000 (07:58 -0300)] 
chore: adjust .kateconfig for C code

2 years agochore: remove editor configuration files from subdirectories
Marcos Mello [Sat, 27 Aug 2022 10:57:19 +0000 (07:57 -0300)] 
chore: remove editor configuration files from subdirectories

Keep only the toplevel ones.

Closes #1958

2 years agofix(dracut): replace invalid lzo command with lzop for LZO compression
Antonio Alvarez Feijoo [Mon, 10 Oct 2022 08:25:33 +0000 (10:25 +0200)] 
fix(dracut): replace invalid lzo command with lzop for LZO compression

Fixes issue #1999

2 years agorefactor(dracut-install): resolve_deps: improve error message
Marcos Mello [Sat, 25 Jun 2022 01:16:36 +0000 (22:16 -0300)] 
refactor(dracut-install): resolve_deps: improve error message

Prefix + error description at the end.

2 years agorefactor(shutdown): move module specific code out of base module
Laszlo Gombos [Sun, 2 Oct 2022 01:06:12 +0000 (01:06 +0000)] 
refactor(shutdown): move module specific code out of base module

dracut-lib.sh and the base module now does not have a knowledge
of oldroot and plymouth.

It improves the separation of concerns between the base module
and the shutdown module.

2 years agofix(network-legacy): check if dhclient has --timeout option
Antonio Alvarez Feijoo [Mon, 11 Jul 2022 14:14:42 +0000 (16:14 +0200)] 
fix(network-legacy): check if dhclient has --timeout option

dhclient's --timeout option is not upstream, so a pre-check is needed before
using it.

2 years agofix(man): correct typo
Antonio Alvarez Feijoo [Mon, 11 Jul 2022 07:21:05 +0000 (09:21 +0200)] 
fix(man): correct typo

2 years agofeat(dmsquash-live): add new dmsquash-live-autooverlay module
Matt Coleman [Fri, 23 Sep 2022 23:28:25 +0000 (19:28 -0400)] 
feat(dmsquash-live): add new dmsquash-live-autooverlay module

2 years agoci: revert to actions/checkout@v1 in manualtest
Matt Coleman [Sat, 15 Oct 2022 00:50:30 +0000 (20:50 -0400)] 
ci: revert to actions/checkout@v1 in manualtest

This enables checkout to work in the Gentoo container.

See: https://github.com/actions/runner/issues/2115

2 years agodocs: fix a typo in HACKING.md
Matt Coleman [Fri, 23 Sep 2022 17:37:22 +0000 (13:37 -0400)] 
docs: fix a typo in HACKING.md

2 years agofix(dracut.spec): tpm2-tools is required for crypt module to work
Pavel Valena [Thu, 8 Sep 2022 12:31:46 +0000 (14:31 +0200)] 
fix(dracut.spec): tpm2-tools is required for crypt module to work

tpm2-tools dependency can be can be pulled in case tmp2-tss package
is installed, using a soft conditional dependency.

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

2 years agofix(man): dracut.cmdline.7: clarify "rd.nvmf.discover=fc,auto"
Martin Wilck [Mon, 19 Sep 2022 16:14:01 +0000 (18:14 +0200)] 
fix(man): dracut.cmdline.7: clarify "rd.nvmf.discover=fc,auto"

2 years agofix(network): avoid double brackets around IPv6 address
Martin Wilck [Sat, 17 Sep 2022 21:56:08 +0000 (23:56 +0200)] 
fix(network): avoid double brackets around IPv6 address

This code would add brackets twice. Fix it.

2 years agofeat(nvmf): set rd.neednet=1 if tcp records encountered
Martin Wilck [Fri, 16 Sep 2022 22:24:38 +0000 (00:24 +0200)] 
feat(nvmf): set rd.neednet=1 if tcp records encountered

This is currently always the case for NBFT records.
We can do this now, as we run before parse-ip-options.sh

2 years agofix(man): dracut.cmdline(7): correct syntax for rd.nonvmf
Martin Wilck [Fri, 16 Sep 2022 23:36:57 +0000 (01:36 +0200)] 
fix(man): dracut.cmdline(7): correct syntax for rd.nonvmf

rd.nonvmf=0 is a double negation, and wrong. Fix it.

2 years agofix(network): don't use same ifname multiple times
Martin Wilck [Sat, 17 Sep 2022 21:05:39 +0000 (23:05 +0200)] 
fix(network): don't use same ifname multiple times

If multiple ibft interfaces exist, set_ifname() may reuse the same
name (usually "ibft0"), because it's usually called cmdline time,
when no interfaces exist in sysfs yet. Remember the number used
set and don't use it again.

2 years agofix(nvmf): run cmdline hook before parse-ip-opts.sh
Martin Wilck [Fri, 16 Sep 2022 22:02:16 +0000 (00:02 +0200)] 
fix(nvmf): run cmdline hook before parse-ip-opts.sh

This way we can set "rd.neednet" and have it seen by parse-ip-options.sh

2 years agofix(nvmf): avoid calling "exit" in a cmdline hook
Martin Wilck [Fri, 16 Sep 2022 22:54:25 +0000 (00:54 +0200)] 
fix(nvmf): avoid calling "exit" in a cmdline hook

"exit" should never be executed in dracut hooks, because the
hooks are sourced by the main script.

2 years agofix(nvmf): make sure "rd.nvmf.discover=fc,auto" takes precedence
Martin Wilck [Fri, 16 Sep 2022 22:51:46 +0000 (00:51 +0200)] 
fix(nvmf): make sure "rd.nvmf.discover=fc,auto" takes precedence

The command line may contain several rd.nvmf.discover options.
The "fc,auto" option should take precedence.

2 years agofix(nvmf): don't use "finished" queue for autoconnect
Martin Wilck [Fri, 16 Sep 2022 22:49:29 +0000 (00:49 +0200)] 
fix(nvmf): don't use "finished" queue for autoconnect

The "finished" initqueue is for testing if everything is alright,
not for triggering any actions.

2 years agofix(nvmf): don't create did-setup file
Martin Wilck [Fri, 16 Sep 2022 22:40:49 +0000 (00:40 +0200)] 
fix(nvmf): don't create did-setup file

did-setup files are meant to indicate that an interface setup
was successful. Don't do it here.

2 years agofix(nvmf): no need to load the nvme module
Martin Wilck [Fri, 16 Sep 2022 22:01:07 +0000 (00:01 +0200)] 
fix(nvmf): no need to load the nvme module

The module "nvme" is not required for NVMeoF.

2 years agofix(nvmf): don't try to validate network connections in cmdline hook
Martin Wilck [Fri, 16 Sep 2022 21:46:42 +0000 (23:46 +0200)] 
fix(nvmf): don't try to validate network connections in cmdline hook

The cmdline hook runs before any network interfaces have been brought
up. There's no point in trying to validate the connections at this
stage.

2 years agofix(nvmf): nvme list-subsys prints the address using commas as separator
Antonio Alvarez Feijoo [Wed, 14 Sep 2022 10:44:26 +0000 (12:44 +0200)] 
fix(nvmf): nvme list-subsys prints the address using commas as separator

nvme-cli 1.x printed the address using spaces as separator, but nvme-cli 2.x
prints the address using commas as separator (exact output from sysfs). E.g.,
output from `cat /sys/class/nvme/nvme0/address`:

traddr=nn-0x201700a09890f5bf:pn-0x201900a09890f5bf,host_traddr=nn-0x200000109b579ef5:pn-0x100000109b579ef5

Also, I suppress rd.nvmf.discover= cmdline option if all fields are empty.

2 years agoci: login and push containers as repository_owner
Laszlo Gombos [Thu, 29 Sep 2022 11:58:47 +0000 (11:58 +0000)] 
ci: login and push containers as repository_owner

2 years agotest(SYSTEMD): make the man command succeed
Laszlo Gombos [Thu, 18 Aug 2022 01:25:38 +0000 (01:25 +0000)] 
test(SYSTEMD): make the man command succeed

Document the reason of the existing workaround.

Move the existing logic to the initramfs.testing generation phase
and make the steps more generic.

This change makes the test pass on debian.

2 years agotest: do not bring up the network interface if it is not needed
Laszlo Gombos [Wed, 17 Aug 2022 04:23:08 +0000 (04:23 +0000)] 
test: do not bring up the network interface if it is not needed

Notice that TEST-04 does not explicitelly includes dhclient
and dhclient-script for the rootfs.

Apply the same principle for all local tests that do not
need networking.

This should make the tests run faster and slightly more reliable.

This change also brings us to a better place where network-legacy
files are only gets included via proper dracut module inclusion.

2 years agofix(dracut-init.sh): add missing hostonly code in the inst_multiple function
Antonio Alvarez Feijoo [Tue, 16 Aug 2022 06:23:19 +0000 (08:23 +0200)] 
fix(dracut-init.sh): add missing hostonly code in the inst_multiple function

It seems that commit https://github.com/dracutdevs/dracut/commit/4ef45f13 forgot
to add the code to handle the hostonly parameter in the inst_multiple function.

2 years agorefactor(network-manager): use more precise global variables
Antonio Alvarez Feijoo [Mon, 11 Jul 2022 11:29:56 +0000 (13:29 +0200)] 
refactor(network-manager): use more precise global variables

2 years agorefactor(network-legacy): use more precise global variables
Antonio Alvarez Feijoo [Mon, 11 Jul 2022 11:29:29 +0000 (13:29 +0200)] 
refactor(network-legacy): use more precise global variables

2 years agorefactor(systemd-timesyncd): use more precise global variables
Antonio Alvarez Feijoo [Mon, 11 Jul 2022 11:29:16 +0000 (13:29 +0200)] 
refactor(systemd-timesyncd): use more precise global variables

2 years agorefactor(systemd-networkd): use more precise global variables
Antonio Alvarez Feijoo [Mon, 11 Jul 2022 11:28:50 +0000 (13:28 +0200)] 
refactor(systemd-networkd): use more precise global variables

2 years agofix(network-manager): correct wrong local network configuration path
Antonio Alvarez Feijoo [Mon, 11 Jul 2022 11:08:57 +0000 (13:08 +0200)] 
fix(network-manager): correct wrong local network configuration path

2 years agofix(network-legacy): correct wrong local network configuration path
Antonio Alvarez Feijoo [Mon, 11 Jul 2022 11:08:40 +0000 (13:08 +0200)] 
fix(network-legacy): correct wrong local network configuration path

2 years agofix(dracut.sh): correct wrong systemd variable paths
Antonio Alvarez Feijoo [Mon, 11 Jul 2022 10:52:58 +0000 (12:52 +0200)] 
fix(dracut.sh): correct wrong systemd variable paths

systemdsystemconfdir usually expands to /etc/systemd/system, but the local
configuration of systemd-networkd, systemd-timesyncd, portablectl and systemd
users is saved into directories whose parent is /etc/systemd
(systemdutilconfdir).

Also add missing exports.

2 years agotest(DMSQUASH): add test for overlay on top of a block device
Laszlo Gombos [Mon, 15 Aug 2022 19:45:09 +0000 (19:45 +0000)] 
test(DMSQUASH): add test for overlay on top of a block device

Add a test for mounting root filesystem with overlay for /dev/sdb.

The existing test was testing mounting root filesystem with overlay
from a squashfs image file.

2 years agotest(NFS): remove a workaround for systemd v230
Laszlo Gombos [Sun, 14 Aug 2022 05:30:06 +0000 (05:30 +0000)] 
test(NFS): remove a workaround for systemd v230

Remove some more dead code.
Improve style and formatting.
Remove duplicated modules.

2 years agorefactor(base): remove `str_replace` from `dracut-lib.sh`
Laszlo Gombos [Sun, 13 Mar 2022 17:04:10 +0000 (17:04 +0000)] 
refactor(base): remove `str_replace` from `dracut-lib.sh`

Remove duplicate implementation of `str_replace` to follow-up
commit 148e420be5b5809aa8d5033f47477573bbbf3e60

2 years agoci: add Gentoo Linux container
Laszlo Gombos [Fri, 6 May 2022 13:25:16 +0000 (13:25 +0000)] 
ci: add Gentoo Linux container

The Gentoo container is configured to use openrc and musl to
test in those enviroments as well.

2 years agochore(udev-rules): remove obsolete code
Laszlo Gombos [Sun, 28 Aug 2022 12:04:12 +0000 (12:04 +0000)] 
chore(udev-rules): remove obsolete code

Arch linux no longer needs a special load-modules.sh file.

2 years agochore(base): do not output root entry while installing base
Laszlo Gombos [Sun, 28 Aug 2022 13:35:36 +0000 (13:35 +0000)] 
chore(base): do not output root entry while installing base

Silence the printing out root entry of passwd file
while including base module.

dracut: *** Including module: base ***
root:x:0:0:root:/root:/bin/bash
dracut: *** Including module: fs-lib ***

2 years agoci: improve CI for containers
Laszlo Gombos [Sun, 4 Sep 2022 23:10:11 +0000 (23:10 +0000)] 
ci: improve CI for containers

Login to GitHub Container Registry as the actor instead
of the repository owner.

Upgrade to login-action@v2 and build-push-action@v3 Github Actions.

2 years agofix(squash): build ld cache for squash loader
Hari Bathini [Tue, 12 Jul 2022 08:25:47 +0000 (13:55 +0530)] 
fix(squash): build ld cache for squash loader

Commit dc21638c3f0a fixes kdump kernel crash, due to non-conventional
library path in powerpc, by copying /etc/ld.so.cache under initdir.
While that works in general, it is vulnerable to failure because of
missing links, when the CPU is reconfigured to run in compatibility
mode of older CPU version. Avoid this by running ldconfig for squash
loader to create the necessary links & ld cache for it. Doing this
also saves a few kilobyes of space as the copied ld cache is bigger
in size than the one needed for squash loader environment.

Fixes: dc21638c3f0a ("fix(squash): keep ld cache under initdir")
Cc: Pingfan Liu <piliu@redhat.com>
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
2 years agofeat(dracut.sh): populate uefi_cmdline if no other cmdline is given
Pavel Valena [Mon, 29 Aug 2022 01:59:49 +0000 (03:59 +0200)] 
feat(dracut.sh): populate uefi_cmdline if no other cmdline is given

When creating uefi image in hostonly mode (with using --hostonly-cmdline),
it makes sense to copy current kernel commandline from /proc/cmdline,
in case there are no other options specified.

Usually, the cmdline.d/*.conf file is generated by module rootfs-block
(or other modules), but it might, not handle all cases correctly,
and specifying --kernel-cmdline every time is not much user-friendly.

2 years agofeat(systemd): install systemd-sysroot-fstab-check
Antonio Alvarez Feijoo [Thu, 1 Sep 2022 09:47:09 +0000 (11:47 +0200)] 
feat(systemd): install systemd-sysroot-fstab-check

systemd-sysroot-fstab-check is a symlink to systemd-fstab-generator added in
systemd commit https://github.com/systemd/systemd/commit/cd7ad0cb

2 years agofix(i18n): do not fail if FONT in /etc/vconsole.conf has the file extension
Antonio Alvarez Feijoo [Fri, 9 Sep 2022 11:11:14 +0000 (13:11 +0200)] 
fix(i18n): do not fail if FONT in /etc/vconsole.conf has the file extension

If the FONT option defined in /etc/vconsole.conf refers to a file with its
extension, not just the file name, dracut should not fail and install it. The
systemd-vconsole-setup service ends up calling setfont, which supports both file
names and files with extensions.

2 years agofix(load_fstype): use $1 if $2 is missing
Frederick Grose [Sat, 10 Sep 2022 03:46:29 +0000 (23:46 -0400)] 
fix(load_fstype): use $1 if $2 is missing

Use parameter expansion default value if the second argument is missing.
The current code mistakenly reuses the null second argument.

2 years agofix(dracut-initramfs-restore.sh): initramfs detection not working
Kairui Song [Mon, 19 Sep 2022 18:13:01 +0000 (02:13 +0800)] 
fix(dracut-initramfs-restore.sh): initramfs detection not working

The path detection is not working on latest Fedora and some other
distros, and it fails to extract the initramfs. It seems the if
statement is broken by a previous commit, so let's fix it.

Fixes: 3d8e1ad ('fix(dracut-initramfs-restore.sh): add missing default paths')
Signed-off-by: Kairui Song <kasong@tencent.com>
2 years agofix(systemd): add missing modprobe@.service
Antonio Alvarez Feijoo [Wed, 21 Sep 2022 09:54:17 +0000 (11:54 +0200)] 
fix(systemd): add missing modprobe@.service

sys-kernel-config.mount needs modprobe@configfs.service since systemd v246.7
(https://github.com/systemd/systemd/commit/42cc2855), so the kernel configfs
fails to mount in the initrd.

2 years agofeat(systemd-pstore): introducing the systemd-pstore module
Antonio Alvarez Feijoo [Wed, 21 Sep 2022 14:56:30 +0000 (16:56 +0200)] 
feat(systemd-pstore): introducing the systemd-pstore module

Introducing the systemd-pstore module.

2 years agoci: add workflow for manual test run
Laszlo Gombos [Thu, 18 Aug 2022 05:29:20 +0000 (05:29 +0000)] 
ci: add workflow for manual test run

This workflow allows it to run any of the 29 tests
on any of the 4 containers.

On commit, currently the CI only runs 24 tests out of the 116
possible combinations of test runs.

As the project grows, the usefulness of this tool will also grow.

2 years agodocs: correct typo
Antonio Alvarez Feijoo [Thu, 18 Aug 2022 06:42:59 +0000 (08:42 +0200)] 
docs: correct typo

2 years agofix(dracut.sh): remove duplicate "dracut:" string in logger functions
Antonio Alvarez Feijoo [Mon, 22 Aug 2022 08:23:19 +0000 (10:23 +0200)] 
fix(dracut.sh): remove duplicate "dracut:" string in logger functions

dracut-logger functions already prepend the "dracut:" prefix to the message.

2 years agorefactor(dracut.sh): use logger functions instead of printf
Antonio Alvarez Feijoo [Mon, 22 Aug 2022 08:06:34 +0000 (10:06 +0200)] 
refactor(dracut.sh): use logger functions instead of printf

dracut-logger is sourced in dracut-init, so any printf calls after sourcing
dracut-init should be replaced with logger functions.

2 years agofix(man): point man pages to github.com instead of kernel.org
Laszlo Gombos [Sun, 21 Aug 2022 13:53:46 +0000 (13:53 +0000)] 
fix(man): point man pages to github.com instead of kernel.org

2 years agodocs: fix path to CONTRIBUTING.md
Laszlo Gombos [Mon, 22 Aug 2022 18:19:39 +0000 (18:19 +0000)] 
docs: fix path to CONTRIBUTING.md

2 years agodocs: clarify that rd.break stops before the breakpoint starts
Laszlo Gombos [Mon, 22 Aug 2022 18:51:53 +0000 (18:51 +0000)] 
docs: clarify that rd.break stops before the breakpoint starts

2 years agochore: add execute permission to all scripts
Antonio Alvarez Feijoo [Tue, 23 Aug 2022 13:10:07 +0000 (15:10 +0200)] 
chore: add execute permission to all scripts

This avoids most of the rpmlint non-executable-script warnings.

2 years agotest: list only the required modules explicitly
Laszlo Gombos [Wed, 24 Aug 2022 03:30:32 +0000 (03:30 +0000)] 
test: list only the required modules explicitly

rootfs-block module would always include the following
modules: udev-rules base fs-lib

lvm module always includes rootfs-block

This is a follow-up to a1d4041cee5f7b2d8da9192338d5e81315e758ef

2 years agofix(shell-completion): add missing -p and --parallel options
Antonio Alvarez Feijoo [Thu, 25 Aug 2022 12:59:20 +0000 (14:59 +0200)] 
fix(shell-completion): add missing -p and --parallel options

2 years agofix(nfs,virtiofs): check kernel for builtin fs drivers
Laszlo Gombos [Mon, 15 Aug 2022 20:10:30 +0000 (20:10 +0000)] 
fix(nfs,virtiofs): check kernel for builtin fs drivers

Check first for fs support in `/proc/filesystems` before attempting
to load the kernel module.

This is needed in the --no-kernel use case to avoid the error:
modprobe: FATAL: Module overlay not found in directory /lib/modules/<kver>

2 years agofix(dracut-initramfs-restore.sh): hide unpack errors
Antonio Alvarez Feijoo [Wed, 17 Aug 2022 07:50:37 +0000 (09:50 +0200)] 
fix(dracut-initramfs-restore.sh): hide unpack errors

With the current "try and fail" approach, the system log contains errors until
the correct initrd compression is reached.

2 years agotest: remove dracut.conf.test
Laszlo Gombos [Wed, 17 Aug 2022 05:08:48 +0000 (05:08 +0000)] 
test: remove dracut.conf.test

Empty file and it is not used. Has not been used for over a decade :-)

2 years agofix(skipcpio): ignore broken pipe
David Tardon [Tue, 16 Aug 2022 11:30:16 +0000 (13:30 +0200)] 
fix(skipcpio): ignore broken pipe

If lsinitrd is called from a context in which SIGPIPE is ignored (e.g.,
from a systemd unit with default setting of IgnoreSIGPIPE=), the
following line will result in an error being issued:

bin="$($SKIP "$image" | { read -r -N 6 bin && echo "$bin"; })"

An example error from `kdumpctl start` (which internally just calls
`systemctl start kdump.service`):

kdumpctl[1287]: ERROR: src/skipcpio/skipcpio.c:191:main(): fwrite

A minimal reproducer:

systemd-run -t sh -c '/path/to/skipcpio /path/to/any/file | false'

2 years agotest: remove unused ci-matrix.txt file
gombi [Thu, 18 Aug 2022 04:39:30 +0000 (04:39 +0000)] 
test: remove unused ci-matrix.txt file

The ci matrix is described in .github/workflows instead.
ci-matrix.txt file is unreferenced.

2 years agodocs: create CONTRIBUTING.md
Laszlo Gombos [Wed, 17 Aug 2022 14:04:49 +0000 (10:04 -0400)] 
docs: create CONTRIBUTING.md

Note down some commonly agreed, but not yet documented guidelines
to have a baseline that can be improved later.

3 years agofix(systemd-networkd): typo in systemd-networkd.socket local conf path
Antonio Alvarez Feijoo [Tue, 5 Jul 2022 13:34:01 +0000 (15:34 +0200)] 
fix(systemd-networkd): typo in systemd-networkd.socket local conf path

3 years agofix(virtiofs): make shebangs work on split-usr systems
Mike Gilbert [Mon, 4 Jul 2022 23:08:45 +0000 (19:08 -0400)] 
fix(virtiofs): make shebangs work on split-usr systems

Fixes: c29325a982013a315418cdb2318e90cf77e387b5
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
3 years agofix(dracut-install): use stripped kernel module path as hash key
runsisi [Sat, 6 Aug 2022 02:15:48 +0000 (10:15 +0800)] 
fix(dracut-install): use stripped kernel module path as hash key

in install_dependent_modules we use &path[kerneldirlen] as the key for inserting,
let's do the same for checking.

otherwise installing kernel module has circular dependency from a custom kernel
module directory will cause infinite recursion and segfault.

$ grep ipmi kbuilt/lib/modules/5.10.121/modules.dep
kernel/drivers/char/ipmi/ipmi_msghandler.ko:
kernel/drivers/char/ipmi/ipmi_devintf.ko: kernel/drivers/char/ipmi/ipmi_msghandler.ko

$ grep ipmi kbuilt/lib/modules/5.10.121/modules.softdep
softdep ipmi_msghandler post: ipmi_devintf

$ ./dracut-install -D /tmp --kerneldir ~/working/kernel/linux-5.10.121/kbuilt/lib/modules/5.10.121 -m ipmi-devintf
Segmentation fault (core dumped)

(gdb) b install_dependent_modules
Breakpoint 1 at 0x7db0: file src/install/dracut-install.c, line 1513.
(gdb) bt
#0  install_dependent_modules (modlist=0x0) at src/install/dracut-install.c:1513
#1  0x000055555555c027 in install_dependent_modules (modlist=modlist@entry=0x555555579e90) at src/install/dracut-install.c:1553
#2  0x000055555555bf1c in install_dependent_modules (modlist=0x5555555799d0) at src/install/dracut-install.c:1548
#3  0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555557a3f0) at src/install/dracut-install.c:1554
#4  0x000055555555bf1c in install_dependent_modules (modlist=0x555555579d60) at src/install/dracut-install.c:1548
#5  0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555557b170) at src/install/dracut-install.c:1554
#6  0x000055555555bf1c in install_dependent_modules (modlist=0x55555557a0f0) at src/install/dracut-install.c:1548
#7  0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x555555575320) at src/install/dracut-install.c:1554
#8  0x000055555555bf1c in install_dependent_modules (modlist=0x55555557ab30) at src/install/dracut-install.c:1548
#9  0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555557dd60) at src/install/dracut-install.c:1554
#10 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557b640) at src/install/dracut-install.c:1548
#11 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555557e0f0) at src/install/dracut-install.c:1554
#12 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557b9d0) at src/install/dracut-install.c:1548
#13 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x555555574340) at src/install/dracut-install.c:1554
#14 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557cf70) at src/install/dracut-install.c:1548
#15 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x5555555768d0) at src/install/dracut-install.c:1554
#16 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557d750) at src/install/dracut-install.c:1548
#17 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555557e700) at src/install/dracut-install.c:1554
#18 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557de90) at src/install/dracut-install.c:1548
#19 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x555555581c90) at src/install/dracut-install.c:1554
#20 0x000055555555bf1c in install_dependent_modules (modlist=0x555555571e60) at src/install/dracut-install.c:1548
#21 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555556b620) at src/install/dracut-install.c:1554
#22 0x000055555555bf1c in install_dependent_modules (modlist=0x555555583000) at src/install/dracut-install.c:1548
#23 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555556b640) at src/install/dracut-install.c:1554
#24 0x000055555555bf1c in install_dependent_modules (modlist=0x555555571b40) at src/install/dracut-install.c:1548
#25 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x555555574100) at src/install/dracut-install.c:1554
#26 0x000055555555c4b0 in install_module (mod=mod@entry=0x555555573bc0) at src/install/dracut-install.c:1617
#27 0x000055555555c93d in install_modules (argc=argc@entry=1, argv=argv@entry=0x7fffffffd6e0) at src/install/dracut-install.c:1952
#28 0x000055555555862a in main (argc=<optimized out>, argv=0x7fffffffd6a8) at src/install/dracut-install.c:2090

Signed-off-by: runsisi <runsisi@hust.edu.cn>