Compare commits

...

984 Commits

Author SHA1 Message Date
21c9afce43 dmsquash-live: add union join overlay opt 2023-07-08 00:05:03 +02:00
Thomas Blume
52351cfa04 feat(livenet): add memory size check depending on live image size
For writeable live images, the memory must hold the complete image.
That means it must be at least the size of the image plus some RAM
necessary to run processes.
With too small RAM, the OOM Killer steps in and makes the boot hang.
This patch lets the system go into the emergency shell instead.

The default minimum RAM after subtracting the live image size is set to 1G.
The parameter rd.minmem is added to modify this.
2023-07-07 14:24:10 +02:00
Henrik Gombos
15d4f60eb1 chore(gentoo.conf): remove examples to avoid confusion
These examples are not used and not maintained and changing them
would not have an impact on Gentoo.
2023-06-29 08:25:57 +02:00
Michał Zegan
b7ef130271 fix(modsign): load keys to correct keyring
Until now, 03modsign module was loading keys from /lib/modules/keys/* into the
current session keyring.
This change makes it add keys to the secondary trusted keyring. This works
only as long as added certificate is signed by key from the same keyring.
2023-06-28 07:53:14 -04:00
Laszlo Gombos
179e1a992f fix(dmsquash-live-autooverlay): specify filesystemtype when it is already known 2023-06-26 09:56:15 -04:00
Laszlo Gombos
a71b905ef3 chore: remove git2spec.pl, it is no longer used 2023-06-26 09:54:04 -04:00
Laszlo Gombos
9aa332cad7 fix(fs-lib): remove quoting form the first argument of the e2fsck call
Fix regression.
2023-06-26 09:39:48 -04:00
Laszlo Gombos
f5cc202e99 fix(Makefile): remove leftover rpm build rules 2023-06-26 09:24:02 -04:00
Laszlo Gombos
ffc766d23d fix(Makefile): no longer upload to kernel.org 2023-06-26 09:16:12 -04:00
Martin Wilck
b490f6f7d7 feat(nvmf): add code for parsing the NBFT
Add code to parse the Nvme-oF Boot Firmware Table (NBFT) according
to the NVM Express Boot Specification 1.0 [1]. The implementation in
dracut follows a similar general approach as iBFT support in the
iscsi module.

NBFT support requires two steps:

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Martin Wilck <mwilck@suse.com>
Co-authored-by: John Meneghini <jmeneghi@redhat.com>
Co-authored-by: Charles Rose <charles.rose@dell.com>
2023-06-26 09:45:42 +02:00
Martin Wilck
f07117d68d fix(nvmf): support /etc/nvme/config.json
Since nvme-cli 2.0, configuration of subsystems to connect to is
stored under `/etc/nvme` in either `discovery.conf` or `config.json`.
Attempt discovery also if the latter exists, but not the former.
Also, install "config.json" if it's present on the root FS.

As before, "rd.nvmf.discover=fc,auto" will force either file to be ignored,
and NBFT-defined targets take precedence if found.
2023-06-26 09:45:42 +02:00
Martin Wilck
902f3a8f84 fix(nvmf): install 8021q module unconditionally
In NBFT setups, VLAN can be configured in the firmware.
Add the 8021q module in hostonly mode even if VLAN is currently
not used to be prepared for such configuration change.
2023-06-26 09:45:42 +02:00
Andrew Ammerlaan
17b8649eb9 fix(install.d): respect even more kernel-install vars, plus style fixes
- More verbose with KERNEL_INSTALL_VERBOSE=1

- Use KERNEL_INSTALL_CONF_ROOT if defined

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

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

- Styling fixes

Co-authored-by: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
2023-06-26 09:39:24 +02:00
Andrew Ammerlaan
a037634ad7 fix(install.d): respect more kernel-install env variables
- If kernel-install has defined a staging area for us
(KERNEL_INSTALL_STAGING_AREA) install generated initrd/uki.efi there.
The actual install is then handled by 90-loaderentry.install or
90-uki-copy-install.

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

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

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

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

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
2023-06-26 09:39:24 +02:00
Andrew Ammerlaan
09d3ec1648 fix(dracut.sh): also prevent fsfreeze for tmpfs
KERNEL_INSTALL_STAGING_AREA is often on tmpfs, it cannot be frozen

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
2023-06-26 09:39:24 +02:00
Laszlo Gombos
4000a1ecff fix(dmsquash-live): allow other fstypes
Use det_fs to determine fstype and provide fallback instead of
just calling blkid.

Many other dracut modules (e.g. fs-lib, btrfs, mdraid) are already
using det_fs to determine fstype.
2023-06-26 09:37:19 +02:00
Laszlo Gombos
995ac6f887 test(DMSQUASH): add test for NTFS
Add a test case for mounting the root filesystem from
a squashfs image file that is store on an NTFS drive.

The test case is using ntfs3 module to mount the NTFS drive.
2023-06-26 09:37:19 +02:00
Laszlo Gombos
d96754eaa5 test(16): check for failure after each sub-test run
The test case had a bug where it only checked for
at least one of the passing instead of all the subtests passing.
2023-06-26 09:37:19 +02:00
Laszlo Gombos
dfa408c9de fix(bluetooth): make bluetooth rules more strict
Only warn if bluetooth kernel module is loaded
at the time of initrd generation in hostonly mode.
2023-06-26 09:32:39 +02:00
Antonio Alvarez Feijoo
e84d65c5b0 fix(bluetooth): add missing files
- org.bluez.service dbus system service
- bluetooth.service override conf
2023-06-26 09:32:39 +02:00
Antonio Alvarez Feijoo
8079ceafca fix(bluetooth): include it if Appearance matches the value assigned for keyboard
Following the Bluetooth spec [1], Assigned Numbers Document, Rev. 2023-05-04,
Section 2.6.3, Appearance Sub-category, the Appearance value defined for
keyboards is 0x03C1.

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

[1] https://www.bluetooth.com/specifications/assigned-numbers/
2023-06-26 09:32:39 +02:00
Henrik Gombos
0ecb038832 fix(bluetooth): warn user instead of including it by default
Bluetooth module can result in a known race condition at boot.
Discourage its usage by default.
2023-06-22 10:31:01 -07:00
Antonio Alvarez Feijoo
765e69ce4d fix(systemd-timedated): correct typo in override path 2023-06-22 17:08:15 +02:00
Antonio Alvarez Feijoo
2d08302191 fix(systemd-resolved): correct typo in override path 2023-06-22 17:08:15 +02:00
Antonio Alvarez Feijoo
f0dc7ec96b fix(systemd-networkd): correct typos in override paths 2023-06-22 17:08:15 +02:00
Antonio Alvarez Feijoo
3e2f685ecb 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>
2023-06-22 17:08:06 +02:00
Michal Koutný
7ed765dd23 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.
2023-06-20 07:52:02 -07:00
Antonio Alvarez Feijoo
2b47a2efe9 fix(btrfs): add missing cmdline function
Otherwise `dracut --print-cmdline` does not print the command line option added
by the btrfs module.
2023-06-20 07:52:02 -07:00
Laszlo Gombos
2ff7b4702c 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.
2023-06-19 10:15:22 +02:00
Laszlo Gombos
d06153f896 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.
2023-06-19 10:15:22 +02:00
Laszlo Gombos
a9ecb5e325 ci: disable initramfs generation inside Gentoo container
Disabling initramfs generation saves installing 4 additional packages.
2023-06-19 10:15:22 +02:00
Laszlo Gombos
5803ece5c2 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.
2023-06-19 10:15:22 +02:00
Henrik Gombos
6fd6b36d5e ci: switching the musl test to 18 (uefi) 2023-06-19 09:31:55 +02:00
Henrik Gombos
af31df4b36 test(ISCSI): make test-30 use the test dracut modules
Introduce test_dracut that is meant to be shared between tests
in test-functions.
2023-06-16 19:48:14 -04:00
Henrik Gombos
dcf4665bfc 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 f32e95bcad
- 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.
2023-06-15 08:56:44 +02:00
Laszlo Gombos
ec2c7e1aa4 test(UEFI): add test case for UEFI boot
Include OVMF in containers if it is not already present.
2023-06-14 10:52:30 -04:00
Henrik Gombos
c1b3f88d50 docs: remove rd.lvm.snapsize and rd.lvm.snapshot 2023-06-12 07:58:19 -04:00
Henrik Gombos
4235c035ff fix(Makefile): execute command -v instead of which 2023-06-12 07:52:41 -04:00
lilinjie
e2f961a2bd fix(network-legacy): typo
Signed-off-by: lilinjie <lilinjie@uniontech.com>
2023-06-12 08:04:54 +02:00
Laszlo Gombos
3f8f115a27 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.
2023-06-09 08:55:48 -04:00
Antonio Alvarez Feijoo
cd6f683d63 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`.
2023-06-08 15:54:38 +02:00
Antonio Alvarez Feijoo
1ef00735ae 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
2023-06-08 15:54:38 +02:00
Antonio Alvarez Feijoo
eff2a93981 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
2023-06-08 15:54:38 +02:00
Antonio Alvarez Feijoo
925febf89d 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
2023-06-08 15:54:38 +02:00
Mike Gilbert
c1588995ae 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>
2023-06-08 08:21:54 +02:00
Henrik Gombos
aa20bbb5b1 feat(dracut-init.sh): do not print by default if an udev rule is skipped 2023-06-07 12:15:36 -04:00
Henrik Gombos
c5e036b157 test: move more makeroot dependencies into test-makeroot dracut module 2023-06-07 16:32:30 +02:00
Andrew Halaney
afb5717e67 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>
2023-06-06 16:33:02 +02:00
Henrik Gombos
d244b316f2 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.
2023-06-06 15:40:41 +02:00
Henrik Gombos
739b9e1b38 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.
2023-06-06 15:36:59 +02:00
Henrik Gombos
ae7cd94b34 test: add empty default test_cleanup implementation 2023-06-06 15:00:32 +02:00
Henrik Gombos
f1346763ab 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.
2023-06-06 15:00:32 +02:00
Frederick Grose
5ac581ef66 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.
2023-06-06 08:51:58 +02:00
Martin Wilck
07af8d5874 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.
2023-06-05 17:27:27 +02:00
Henrik Gombos
7310a641e2 fix(udev-rules): remove firmware.rules 2023-06-05 10:24:58 -04:00
Henrik Gombos
fc182ed8cf docs: change ext3 to ext4
Promote ext4 instead of ext3 in the manual.
2023-06-05 15:53:09 +02:00
Henrik Gombos
2a26eec5cc fix(dracut.sh): silence the output of hardlinking files by default 2023-06-05 15:49:15 +02:00
Henrik Gombos
c8a703aaa7 fix(github): exempt issues in a milestone 2023-06-05 14:31:21 +02:00
Sergio E. Nemirowski
07b49a3ed7 fix(virtiofs): add virtio_pci kernel module to virtiofs
fix #2357

Signed-off-by: Sergio E. Nemirowski <sergio@outerface.net>
2023-06-05 14:23:27 +02:00
Henrik Gombos
c08ae406bc ci: install multipath-tools into openSuse container 2023-05-25 13:37:03 +02:00
Henrik Gombos
d118754333 test: remove references of dhcpd3 from tests
dhcp3-server is no longer supported by Debian
and it is replaced by isc-dhcp-server.
2023-05-19 09:34:04 -04:00
Henrik Gombos
1843c16caf test: move test condition to test_check
This enables skipping the test instead of failing it.
2023-05-18 10:57:23 +02:00
Henrik Gombos
006890a2c3 test: upgrade to ext4
Most users use ext4 instead of ext3 or ext2. Upgrade tests to ext4.
2023-05-13 19:34:22 -04:00
Antonio Alvarez Feijoo
86c8a5a7c2 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
2023-05-10 08:10:01 -04:00
Antonio Alvarez Feijoo
acfa793b5c fix(dracut-systemd): check and create generator dir outside of inner function 2023-05-10 08:10:01 -04:00
Antonio Alvarez Feijoo
a7c04716a5 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.
2023-05-10 08:10:01 -04:00
Laszlo Gombos
6cd41ab517 ci: add more packages to allow testing more dracut containers 2023-05-10 08:04:08 -04:00
Laszlo Gombos
19c5439510 ci: simplify and sort 2023-05-10 08:04:08 -04:00
keentux
6178a9d83f 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>
2023-05-08 22:04:09 -04:00
Daniel McIlvaney
67591e8855 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.
2023-05-08 00:58:09 -04:00
Antonio Alvarez Feijoo
260883d96f 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.
2023-04-26 12:18:44 +00:00
Antonio Alvarez Feijoo
971b302d70 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.
2023-04-26 12:18:44 +00:00
Antonio Alvarez Feijoo
97fe09769d 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
2023-04-26 12:18:44 +00:00
Antonio Alvarez Feijoo
48c2cb457b feat(systemd-creds): introducing the systemd-creds module
Introducing the systemd-creds module.
2023-04-26 12:15:24 +00:00
Antonio Alvarez Feijoo
71e391ebdc fix(systemd-networkd): add missing conf files and services 2023-04-26 12:11:00 +00:00
Tao Liu
a62e895db9 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>
2023-04-14 04:40:04 +00:00
Tianhao Chai
297525c5c0 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.
2023-04-11 08:02:40 +02:00
Frederick Grose
1300a930e7 feat(lsinitrd): notify user on missing compressor
Provide a notice to user if the required compressor package is
missing.  This rather than failing silently.
2023-03-30 11:56:53 -04:00
Frederick Grose
a0d14d3bc6 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.)
2023-03-29 08:11:36 +02:00
Dmitry Klochkov
8b951d20d4 fix(base): do not quote $CLINE in the set command
This is needed to correctly parse init arguments.

Fixes: 2fabaaa62d
2023-03-28 07:33:37 -04:00
Antonio Alvarez Feijoo
df2458a6b8 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
2023-03-22 08:13:14 +01:00
Valentin Lefebvre
f32e95bcad 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>
2023-03-20 11:56:24 +00:00
Tao Liu
e9b4774239 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>
2023-03-06 11:45:47 +01:00
dependabot[bot]
aca5120360 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>
2023-03-01 09:16:33 +01:00
Laszlo Gombos
0e780720ef fix(dmsquash-live): restore compatibility with earlier releases
Follow-up to 40dd5c90e0 .
2023-02-28 08:34:40 +01:00
Pavel Valena
1ddcb137ea 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().
2023-02-27 08:26:40 -05:00
Laszlo Gombos
6d554d9b98 fix(udev-rules): remove old eudev specific rule
Revert 64fb0900cb, no longer
needed.
2023-02-27 11:24:52 +01:00
Laszlo Gombos
d648bf805a fix(udev-rules): remove old redhat specific rule
The 40-redhat.rules rule has been removed upstream in 2010.
2023-02-27 11:24:52 +01:00
Laszlo Gombos
6a33e677ac fix(udev-rules): remove old edd_id extra rules
The 61-persistent-storage-edd.rules rule has been removed upstream
in 2012.
2023-02-27 11:24:52 +01:00
Laszlo Gombos
1edc41af97 fix(udev-rules): remove old debian specific rules
The last Debian release that carried 91-permissions.rules is wheezy.
2023-02-27 11:24:52 +01:00
“Masahiro
8f9ad06873 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().
2023-02-24 10:06:05 -05:00
“Masahiro
966b6cec1b 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.
2023-02-24 10:06:05 -05:00
Frantisek Sumsal
f9bcd4d2c8 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
2023-02-22 15:49:56 -05:00
Antonio Alvarez Feijoo
ae88e029c6 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
2023-02-22 15:20:52 -05:00
Pavel Valena
df381b7e0c feat(kernel-modules): driver support for macbook keyboards
Discussed in: https://bugzilla.redhat.com/show_bug.cgi?id=2166209
2023-02-21 15:34:49 -05:00
Adrien Thierry
131822e26d 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>
2023-02-21 20:05:44 +00:00
John Meneghini
f3a7172db5 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
2023-02-16 20:15:37 +00:00
Adrien Thierry
89269d239f 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>
2023-02-15 12:59:13 +01:00
Adrien Thierry
87a76dbb57 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>
2023-02-15 12:59:13 +01:00
Jóhann B. Guðmundsson
c5dca3d689 fix(crypt): add missing libraries
Add missing libraries, closes #2137
2023-02-14 18:14:27 -08:00
Lubomir Rintel
61ceb35f40 revert(network-manager): avoid restarting NetworkManager
This reverts commit 77630365ae.

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.
2023-02-14 16:56:34 +01:00
Antonio Alvarez Feijoo
a6dd5bfb9a 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
2023-02-13 18:45:51 +00:00
Antonio Alvarez Feijoo
8602df7058 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.
2023-02-13 18:45:51 +00:00
Martin Wilck
726d56ca0a 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.
2023-02-13 16:17:45 +01:00
Martin Wilck
b074216be9 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.
2023-02-13 16:17:45 +01:00
Martin Wilck
7ff255a448 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
2023-02-13 16:17:45 +01:00
Martin Wilck
c3b65a493a 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().
2023-02-13 16:17:45 +01:00
Martin Wilck
aa5d9526ec 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.
2023-02-13 16:17:45 +01:00
Adrien Thierry
3de4c73132 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>
2023-02-13 13:29:12 +00:00
Adrien Thierry
f0c3b68327 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>
2023-02-13 13:29:12 +00:00
Adrien Thierry
8ea8cf5f56 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>
2023-02-13 13:29:12 +00:00
dependabot[bot]
88aeca2a38 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>
2023-02-13 12:12:21 +00:00
Laszlo Gombos
16931f5236 chore(shfmt): update to pass with shfmt v3.5.1 2023-02-13 12:08:36 +00:00
Antonio Alvarez Feijoo
d777dd3dab 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>
2023-02-13 12:00:01 +00:00
Antonio Alvarez Feijoo
ab26ad2c2a 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>
2023-02-13 12:00:01 +00:00
Antonio Alvarez Feijoo
68d0653e35 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>
2023-02-13 12:00:01 +00:00
Antonio Alvarez Feijoo
1fabbb6412 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.
2023-02-13 12:00:01 +00:00
Laszlo Gombos
c95075e2c7 chore(base): remove support for <udev-176
This reverts 579238a3ac.

Keep the support for prepare_udev_rules for out-of-tree
dracut modules and issue a deprecation warning.
2023-02-13 11:58:52 +00:00
Laszlo Gombos
d6cef3f28e 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
2023-02-13 11:18:58 +00:00
наб
e3a7112bef 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
2023-02-13 10:57:11 +00:00
Beniamino Galvani
d8a9a73df9 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.
2023-02-13 10:54:41 +00:00
Laszlo Gombos
1597076887 fix(fido2): libfido2.so depends on libz.so
Co-authored-by: cs50guy2
2023-02-13 10:51:42 +00:00
Antonio Alvarez Feijoo
9a531ca044 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
2023-02-13 10:21:53 +00:00
0x5c
7b530f2636 fix: make iso-scan trigger udev events
Fixes #2183
2023-02-13 08:56:39 +01:00
Beniamino Galvani
ab07f6d1ee ci: enable test 60
It's hopefully stable now.
2023-02-13 08:53:39 +01:00
Beniamino Galvani
3d7c0ffbd6 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.
2023-02-13 08:53:39 +01:00
Beniamino Galvani
5e846cb132 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.
2023-02-13 08:53:39 +01:00
Beniamino Galvani
8f44740f2c 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.
2023-02-13 08:53:39 +01:00
Beniamino Galvani
9fb64d96ab 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.
2023-02-07 14:40:11 +01:00
Beniamino Galvani
462d9b9254 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.
2023-02-07 14:40:11 +01:00
Beniamino Galvani
da95948333 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.
2023-02-07 14:40:11 +01:00
Beniamino Galvani
d3993c7dab 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.
2023-02-07 14:40:11 +01:00
Khem Raj
70aeb4c1a5 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>
2023-02-06 07:19:58 -05:00
dependabot[bot]
18c5fb6ae0 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>
2023-02-02 08:26:43 +01:00
Antonio Alvarez Feijoo
6f4a5c90ab 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.
2023-02-02 08:13:30 +01:00
Antonio Alvarez Feijoo
823de8fe53 refactor(dracut-init.sh): remove redundant "dracut" from "dracut module" prints
In a similar fashion than "Including module" prints.
2023-02-02 08:11:24 +01:00
Antonio Alvarez Feijoo
a10078a5c3 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.
2023-02-02 08:11:24 +01:00
Antonio Alvarez Feijoo
1f84ff882f 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.
2023-01-31 08:44:57 +01:00
Antonio Alvarez Feijoo
eb75861c2a 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.
2023-01-27 16:55:03 +01:00
Antonio Alvarez Feijoo
a109c6123f 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.
2023-01-27 16:16:35 +01:00
Antonio Alvarez Feijoo
1aafcab935 fix(dracut-init.sh): correct typo in comment 2023-01-27 08:03:54 +00:00
Antonio Alvarez Feijoo
cda6b00abc 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.
2023-01-27 08:02:57 +00:00
Antonio Alvarez Feijoo
e971c788f0 refactor(virtiofs): remove exit after die
The `die` function already ends with `exit 1`.
2023-01-27 08:01:50 +00:00
Laszlo Gombos
3c16c76fb5 ci: fix Gentoo container used for testing 2023-01-19 14:22:22 +01:00
LinkTed
e3e8108eb7 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
2023-01-06 15:07:49 -05:00
Jóhann B. Guðmundsson
f6bb4a36b7 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.
2023-01-05 23:49:37 -05:00
Laszlo Gombos
b060945c45 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.
2023-01-04 10:18:08 +01:00
Antonio Alvarez Feijoo
88fe9205de fix: shellcheck 0.8.0 2023-01-04 05:38:58 +00:00
Laszlo Gombos
9333944436 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/*"
2023-01-03 15:09:12 +01:00
Frederick Grose
10cf8e46f4 fix(load_fstype): avoid false positive searchs
Refactor to avoid substring matches
  and to speed processing.
Also avoid xtracing.
2022-12-30 09:13:00 -05:00
Laszlo Gombos
08b63a2529 fix: shellcheck 0.8.0 2022-12-30 09:10:00 -05:00
наб
94dcac7ccd refactor(dracut-install): strerror(errno) -> %m 2022-12-28 16:37:51 +01:00
наб
efd4ca271f perf(dracut-install): don't strdup() environment block 2022-12-28 16:37:51 +01:00
наб
77226cb412 perf(dracut-install): don't reallocate {src,dst}path in hmac_install() 2022-12-28 16:37:51 +01:00
наб
a20556f0e5 perf(dracut-install): don't strdup() excessively for dracut_install() 2022-12-28 16:37:51 +01:00
наб
e7ed8337bb perf(dracut-install): stat() w/unused buf -> access(F_OK) in dracut-install 2022-12-28 16:37:51 +01:00
наб
751a110f29 perf(dracut-install): multiple single-character strstr()s -> strpbrk() 2022-12-28 16:37:51 +01:00
наб
1e5237dd77 chore: remove src/install/hashmap.lo 2022-12-28 16:37:51 +01:00
Laszlo Gombos
9dbbebb133 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/
2022-12-28 08:40:23 +01:00
Jóhann B. Guðmundsson
0aa08f0ebf docs: update NEWS.md and AUTHORS 2022-12-24 16:49:27 +00:00
Jóhann B. Guðmundsson
794ce5e3ee fix(NEWS.md): add missing entries
I somehow managed to screw the update of news when making a release fixing my
mistake.
2022-12-24 16:10:39 +00:00
Antonio Alvarez Feijoo
b3d219b475 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.
```
2022-12-24 14:30:54 +00:00
Antonio Alvarez Feijoo
4fca292b95 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.
```
2022-12-24 14:30:19 +00:00
Antonio Alvarez Feijoo
7ed0461810 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.
2022-12-24 14:29:25 +00:00
Antonio Alvarez Feijoo
a540c95bbf fix(systemd-hostnamed): correct sysusers configuration
Lines of type 'g' don't take a GECOS field.
2022-12-24 14:28:28 +00:00
Laszlo Gombos
776075ea12 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.
2022-12-22 09:09:03 +01:00
Laszlo Gombos
8f10cbe77f test(FULL SYSTEMD): remove unnecessary dependencies 2022-12-22 09:09:03 +01:00
Laszlo Gombos
b55563f635 feat(overlayfs): add new overlayfs module to dracut.spec 2022-12-22 08:15:35 +01:00
Antonio Alvarez Feijoo
b4de9ee107 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.
2022-12-21 17:16:47 +00:00
Kenneth D'souza
e877be69b4 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>
2022-12-21 16:53:20 +00:00
Antonio Alvarez Feijoo
9cc7ceec1e 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.
2022-12-21 16:29:39 +00:00
Kairui Song
d460941b51 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>
2022-12-21 17:07:46 +01:00
Kairui Song
7917d7976d 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>
2022-12-21 17:07:46 +01:00
Kairui Song
d4a9d6b4c0 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>
2022-12-21 17:07:46 +01:00
Kairui Song
d3a5e6312a 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>
2022-12-21 17:07:46 +01:00
Kairui Song
6c42d378ab 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>
2022-12-21 17:07:46 +01:00
Laszlo Gombos
f66a02e5a9 ci: there is no longer a need for special handling test 04 2022-12-21 16:17:46 +01:00
Laszlo Gombos
2bb1c4f7f3 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.
2022-12-21 16:17:46 +01:00
Laszlo Gombos
58e2311589 ci: run all local tests on all containers 2022-12-21 16:17:46 +01:00
Laszlo Gombos
31938c5980 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.
2022-12-21 14:30:48 +00:00
Antonio Alvarez Feijoo
d32d221efd 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
2022-12-21 14:28:30 +00:00
Antonio Alvarez Feijoo
8d46cc01a9 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.
2022-12-21 14:14:45 +00:00
Antonio Alvarez Feijoo
e3ec51e128 fix(systemd-timesyncd): typo in systemd-time-wait-sync.service local conf path 2022-12-21 13:34:04 +00:00
Scott Moser
7d3184e430 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.
2022-12-21 12:44:50 +00:00
Laszlo Gombos
5b92eeba83 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.
2022-12-21 12:39:45 +00:00
Laszlo Gombos
1586621b19 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.
2022-12-21 12:12:04 +00:00
Antonio Alvarez Feijoo
097dd367bb 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

```
2022-12-21 12:10:01 +00:00
Laszlo Gombos
e450085eb8 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.
2022-12-21 11:31:24 +00:00
Mikhail Novosyolov
e0d57a8f5b 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
2022-12-19 07:53:15 -05:00
keentux
28f3772444 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>
2022-12-19 10:43:37 +01:00
Laszlo Gombos
376c2360b5 ci: document workaround for Gentoo 2022-12-19 10:00:52 +01:00
Laszlo Gombos
7299c14e0e test: rpc.idmapd is optional for NFS
See dracut NFS module (95nfs/module-setup.sh).
2022-12-19 10:00:52 +01:00
Laszlo Gombos
fa18c4133d ci: add networking to Gentoo test containers
nfs-utils and dhcp is needed to test nfs.
nbd is needed to test nbd.
2022-12-19 10:00:52 +01:00
Laszlo Gombos
52d14607d1 fix(network): check if ip command fails 2022-12-17 07:29:54 -05:00
tupper
1d6f42c8a4 fix(network): two bugs which cause minutes long boot times
Caused by unneeded arping to the default gateway.
2022-12-17 07:29:54 -05:00
Laszlo Gombos
037eda7ce4 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.
2022-12-15 15:23:24 +01:00
Laszlo Gombos
718e49e0f7 ci: make sure portage command working inside Gentoo container
Do not remove /var/db/repos/gentoo as it breaks portage.
2022-12-15 15:23:24 +01:00
Laszlo Gombos
55ddaef4ca ci: add mdadm to Gentoo container to run test 10 2022-12-15 15:23:24 +01:00
Laszlo Gombos
22d56ca0e4 ci: add tools for thin provisioning to Debian and Gentoo container for test 17 2022-12-15 15:23:24 +01:00
Laszlo Gombos
4797c5b9e9 ci: add dmraid to Debian and Gentoo container to run test 14 2022-12-15 15:23:24 +01:00
Laszlo Gombos
43c16bfac4 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.
2022-12-07 17:14:42 +01:00
Laszlo Gombos
8fc0dac4a4 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.
2022-12-07 17:14:42 +01:00
Antonio Alvarez Feijoo
7debf540ca 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.
2022-12-07 09:34:32 -05:00
Laszlo Gombos
a6395e4361 ci: install procps-ng into Fedora container 2022-12-07 08:49:07 +01:00
Laszlo Gombos
d0a5b039dd 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.
2022-12-05 16:24:02 +00:00
Laszlo Gombos
bf545567ab 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.
2022-12-05 15:43:08 +01:00
Laszlo Gombos
3e77f5194e ci: teach manual test workflow to run several tests
Timesaver for running tests during development and reviews.
2022-12-05 10:44:45 +01:00
Laszlo Gombos
8c0fc137ca docs: document the new release process
Release tarballs are only available on github from now on.
2022-12-05 09:57:12 +01:00
Henrik Gombos
518133714b 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.
2022-12-05 09:19:42 +01:00
Laszlo Gombos
57ace7c75c test: remove dead code regarding special handling of test 99 2022-12-03 14:46:30 +00:00
Antonio Alvarez Feijoo
4b931bfb4f 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.
2022-12-03 14:43:12 +00:00
Laszlo Gombos
d40617f720 feat(fs-lib): fsck_single can now handle PARTLABEL and PARTUUID
As an additional benefit, gentoo container now passing test-01.
2022-12-03 14:09:31 +00:00
Antonio Alvarez Feijoo
a86aea6518 fix(dracut.sh): use DRACUT_ARCH instead of uname -m
DRACUT_ARCH overrides `uname -m` since
https://github.com/dracutdevs/dracut/commit/a0120420
2022-12-03 11:33:50 +00:00
Antonio Alvarez Feijoo
240a1d34bd 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.
2022-12-03 11:31:19 +00:00
keentux
4a9b165de0 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>
2022-11-28 12:16:05 +01:00
Laszlo Gombos
fd9cd02cb2 test(TEST-99-RPM): remove test
This test is specific to rpm packaging and has been disabled
for a while.
2022-11-22 08:50:59 +01:00
Laszlo Gombos
ab23d89a20 test(16): make DMSQUASH test use the test dracut modules 2022-11-22 08:42:21 +01:00
Laszlo Gombos
fe88c3f7f1 ci: add tests 50,51,62 to the integration test suite
Test 50,51 tests root filesystem on NFS with multiple nics.
Test 62 tests skipcpio.
2022-11-22 08:34:05 +01:00
Laszlo Gombos
32f6dd1d5f fix(github): yml syntax and commit message for dependabot
Also fix commit message prefix.
chore(github):(deps): bump ... --> chore(deps): bump ...
2022-11-21 15:19:17 +00:00
Laszlo Gombos
9f6b4e5336 test: use -device instead of -watchdog to remove qemu warnings 2022-11-18 10:21:44 +00:00
Laszlo Gombos
fac851814f test: make test 01 and 02 use the test dracut modules 2022-11-18 10:21:44 +00:00
Laszlo Gombos
48641207f2 test: explicitly check if systemctl is available for systemd tests
Dracut tests already do similar checks for test 40, 62, 63 and 98.

This is useful when the full testsuite is run and systemd is not
available.
2022-11-18 10:19:50 +00:00
Laszlo Gombos
62f0981d16 chore(ci): bump docker/setup-buildx-action from 1 to 2
v2 has node 16 as default runtime.
2022-11-18 05:07:09 +00:00
Laszlo Gombos
62f7e0621a ci: add mkfs.ntfs and ntfs-3g to test containers
ntfs-3g is needed to test dmsquash-live-ntfs
2022-11-14 10:03:57 +01:00
Laura Hild
69e9fc84e2 docs: correct "rd.blacklist" 2022-11-11 19:49:44 -05:00
Antonio Alvarez Feijoo
e1058b07ea fix(dracut-systemd): run systemctl daemon-reload after remove_hostonly_files
Dependencies to systemd .device unit files are marked as "hostonly" in the
special file hostonly-files. These .device unit files can be removed using the
`rd.hostonly=0` command line parameter. But, since systemd v252
(https://github.com/systemd/systemd/pull/24054), the initrd-parse-etc.service
service does not run `systemctl daemon-reload`, so systemd keeps waiting
for these .device units to show up.
This means that if a hostonly device is not available for any reason at boot
time, using `rd.hostonly=0` has no effect and the system will not boot.
2022-11-11 20:10:30 +00:00
Laszlo Gombos
60c4b2f76a ci: upgrade to actions/checkout@v3
It resolves the following warning:
Please update the following actions to use Node.js 16: actions/checkout
2022-11-11 15:43:35 +01:00
Neal Gompa
33679fff5d fix(kernel-modules): add sysctl to initramfs to handle modprobe files
Users were seeing errors like this:

[     2.917246] dracut-pre-udev[717]: sh: line 1: /sbin/sysctl: No such file or directory

This was the result of modprobe.d files that needed to call sysctl
and failing because sysctl wasn't included in the initramfs.

This change makes it so that we have the binary included so those
modprobe configuration files work properly.
2022-11-11 11:26:13 +01:00
Laszlo Gombos
4a5785a859 test(ISCSI-NM): fix failing test
server fails to startup with /sbin/sysctl: not found
2022-11-07 18:04:47 +01:00
Laszlo Gombos
1d60dd74ee ci: remove non-existing modules from labeler 2022-11-07 18:04:47 +01:00
Laszlo Gombos
d3ac78af96 ci: teach labeler about test dracut modules 2022-11-07 18:04:47 +01:00
Laszlo Gombos
8d9868cf91 test: remove layering violation from the make system
Tests should not try to build dracut itself. Test should assume dracut
is built and availabnle to run.
2022-11-07 18:04:47 +01:00
Laszlo Gombos
2d7508dc30 test: only set basedir if it is not set by the invoker
Set basedir in test-functions instead of Makefile.
This change will allow to use a different basedir without
modifying Makefiles.
2022-11-07 18:04:47 +01:00
Laszlo Gombos
c799af4078 test: remove suppressing shellcheck messages
They are no longer needed.
2022-11-07 18:04:47 +01:00
Laszlo Gombos
10277bb606 test: move more execution to dracut command line
use the -I argument to install dd and mkfs.btrfs
use the -i argument to install the hook
btrfs is already installed by the btrfs dracut module
sfdisk is not used
2022-11-07 18:04:47 +01:00
Laszlo Gombos
f6ffda48dd test: move more common dependencies from test case to test-root module
umount setsid sync binaries are used in all test cases to build rootfs
2022-11-07 18:04:47 +01:00
Laszlo Gombos
d8dbdcc287 test: remove unused dependencies 2022-11-07 18:04:47 +01:00
Laszlo Gombos
f26275b974 test: move more execution to dracut command line 2022-11-07 18:04:47 +01:00
Laszlo Gombos
d6e8d5bc2c test: move plymouth installation from test case to test-root module 2022-11-07 18:04:47 +01:00
Laszlo Gombos
3bb8a85098 test: remove unused variable 2022-11-07 18:04:47 +01:00
Laszlo Gombos
fff80cc094 test: install debug module into what test case is booting into
This will also make some of the non-essential tools optional
instead of a hard dependency.
2022-11-07 18:04:47 +01:00
Laszlo Gombos
7eb0ac977e test: building ld cache explicitly is no longer needed
dracut.sh will build the ld cache now
2022-11-07 18:04:47 +01:00
Laszlo Gombos
9cc136728e test: move common dependencies from test case to test-root module 2022-11-07 18:04:47 +01:00
Laszlo Gombos
b17a3103a5 feat(test-root): add new module to share code between tests
Use dracut to make a root filesystem instead of each test case.
2022-11-07 18:04:47 +01:00
Laszlo Gombos
79504b6179 test: move finished-false.sh from test case to test-makeroot module 2022-11-07 18:04:47 +01:00
Laszlo Gombos
2532113c44 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.
2022-11-07 18:04:47 +01:00
Laszlo Gombos
54b963ca35 feat(test-makeroot): add new module to share code between tests
This module is used for tests to create root filesystem.
2022-11-07 18:04:47 +01:00
Laszlo Gombos
7f62a9b6c9 test: move poweroff handling from test case to test module 2022-11-07 18:04:47 +01:00
Laszlo Gombos
f5689b42bd feat(test): add new module to share code between tests 2022-11-07 18:04:47 +01:00
Laszlo Gombos
c449980741 test: shutdown is not used for running tests 2022-11-07 18:04:47 +01:00
Laszlo Gombos
ba0b1b093d ci: fix Arch container
packages should be installed with -Syu instead of -Sy.
2022-11-07 17:20:48 +01:00
Laszlo Gombos
40dd5c90e0 feat(overlayfs): add a new module called overlayfs
Also split ovlfs variable with two different meaning.
2022-11-07 15:51:45 +01:00
Laszlo Gombos
8caaad4fc2 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.
2022-11-07 15:51:45 +01:00
Laszlo Gombos
11eef2cfd2 ci: use prebuilt Linux kernel binaries for Gentoo container
Also remove dmsetup. It does not build and it is not required for ci.
2022-11-07 15:06:27 +01:00
Marcos Mello
f7079e77a1 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.
2022-11-07 12:44:57 +00:00
Marcos Mello
b12ee558f5 fix(dracut-init.sh): instmods: wrong variable name
It worked most of the time because `dracut-install -o` returns 0 in normal circumstances.
2022-11-07 09:36:21 +01:00
Antonio Alvarez Feijoo
e78f71b9da fix(dmsquash-live-ntfs): remove unnecessary command 2022-11-05 20:27:59 +00:00
Cole Robinson
8194f72af2 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>
2022-11-05 16:22:44 -04:00
Jeremy Linton
415e5519d1 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>
2022-11-04 13:41:54 -04:00
Antonio Alvarez Feijoo
1ec479006f 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
2022-11-04 14:48:48 +00:00
Tao Liu
e9ed44c886 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>
2022-11-04 08:09:30 +01:00
Brian C. Lane
6b592f581c 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.
2022-11-02 23:49:47 -04:00
Martin Wilck
cf31fcf804 feat(multipath): install tmpfiles.d config file
Recent multipath-tools (0.9.2) added a tmpfiles.d template. Install it
if present.
2022-10-27 08:33:23 +02:00
Laszlo Gombos
862ba52683 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>
2022-10-25 16:44:45 +02:00
Jóhann B. Guðmundsson
d345ca2efd feat(systemd-pcrphase): introducing the systemd-pcrphase module
Introducing the systemd-pcrphase module
2022-10-24 12:20:37 -04:00
Laszlo Gombos
444944ab37 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
2022-10-24 15:19:37 +00:00
Laszlo Gombos
cc1c0ffdaa ci: integration test for openrc and musl 2022-10-24 10:45:52 -04:00
Laszlo Gombos
f2d181b778 chore(base): remove dead code
RD_TIMESTAMP is no longer used.
systemd-timestamp is not used.
2022-10-24 14:39:11 +00:00
Antonio Alvarez Feijoo
2d9f4b481b ci(suse.conf.example): update SUSE-specific config 2022-10-24 08:47:56 -04:00
Jóhann B. Guðmundsson
bdddfd561f feat(github): automating dependency updates
Let github's dependabot handle updating github's actions.
2022-10-24 08:44:37 -04:00
Tianhao Chai
02e646fc7e fix(multipath): install multipathd.socket 2022-10-22 11:50:08 -04:00
наб
77ac95d909 perf(90kernel-modules): use awk instead of shell monster
~120ms -> ~2ms

Downstream: https://bugs.debian.org/1017411
2022-10-22 13:08:07 +00:00
Antonio Alvarez Feijoo
03babd95e2 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.
2022-10-21 21:51:59 -04:00
Antonio Alvarez Feijoo
429f9de1c7 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.
2022-10-21 21:49:56 -04:00
Antonio Alvarez Feijoo
cc669250af 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.
2022-10-21 21:49:56 -04:00
Marcos Mello
f82edfed5c chore: adjust .kateconfig for C code 2022-10-21 21:09:28 -04:00
Marcos Mello
87d7df57c7 chore: remove editor configuration files from subdirectories
Keep only the toplevel ones.

Closes #1958
2022-10-21 21:09:28 -04:00
Antonio Alvarez Feijoo
b2d7561b98 fix(dracut): replace invalid lzo command with lzop for LZO compression
Fixes issue #1999
2022-10-21 23:41:10 +00:00
Marcos Mello
144279a597 refactor(dracut-install): resolve_deps: improve error message
Prefix + error description at the end.
2022-10-21 23:27:01 +00:00
Laszlo Gombos
ba0d7591a6 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.
2022-10-21 22:36:03 +00:00
Antonio Alvarez Feijoo
23654c50b0 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.
2022-10-21 22:25:39 +00:00
Antonio Alvarez Feijoo
699e394589 fix(man): correct typo 2022-10-21 22:25:39 +00:00
Matt Coleman
a3c67d27e7 feat(dmsquash-live): add new dmsquash-live-autooverlay module 2022-10-15 14:01:27 -04:00
Matt Coleman
ef9ccd5446 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
2022-10-15 14:01:27 -04:00
Matt Coleman
61ae423bb0 docs: fix a typo in HACKING.md 2022-10-15 14:01:27 -04:00
Pavel Valena
8abffe7cca 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
2022-10-07 11:59:19 +00:00
Martin Wilck
a90efdd704 fix(man): dracut.cmdline.7: clarify "rd.nvmf.discover=fc,auto" 2022-09-30 06:02:18 +00:00
Martin Wilck
2c26b70322 fix(network): avoid double brackets around IPv6 address
This code would add brackets twice. Fix it.
2022-09-30 06:02:18 +00:00
Martin Wilck
cf8986af7d 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
2022-09-30 06:02:18 +00:00
Martin Wilck
4b69e63b74 fix(man): dracut.cmdline(7): correct syntax for rd.nonvmf
rd.nonvmf=0 is a double negation, and wrong. Fix it.
2022-09-30 06:02:18 +00:00
Martin Wilck
f4e9ea879f 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.
2022-09-30 06:02:18 +00:00
Martin Wilck
a65fab6966 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
2022-09-30 06:02:18 +00:00
Martin Wilck
a93968b075 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.
2022-09-30 06:02:18 +00:00
Martin Wilck
556ef46aa9 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.
2022-09-30 06:02:18 +00:00
Martin Wilck
e93e46520d fix(nvmf): don't use "finished" queue for autoconnect
The "finished" initqueue is for testing if everything is alright,
not for triggering any actions.
2022-09-30 06:02:18 +00:00
Martin Wilck
03921ec09e 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.
2022-09-30 06:02:18 +00:00
Martin Wilck
a3cf4ec922 fix(nvmf): no need to load the nvme module
The module "nvme" is not required for NVMeoF.
2022-09-30 06:02:18 +00:00
Martin Wilck
b3ff3f3fbc 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.
2022-09-30 06:02:18 +00:00
Antonio Alvarez Feijoo
9664e98b5d 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.
2022-09-30 06:02:18 +00:00
Laszlo Gombos
b17128465f ci: login and push containers as repository_owner 2022-09-30 05:42:27 +00:00
Laszlo Gombos
bc1bf6a19d 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.
2022-09-29 05:45:47 +00:00
Laszlo Gombos
31c4aac32d 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.
2022-09-29 05:44:19 +00:00
Antonio Alvarez Feijoo
e2fdb30b56 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.
2022-09-29 05:41:17 +00:00
Antonio Alvarez Feijoo
0661a6a25b refactor(network-manager): use more precise global variables 2022-09-29 05:37:07 +00:00
Antonio Alvarez Feijoo
cd19da33f8 refactor(network-legacy): use more precise global variables 2022-09-29 05:37:07 +00:00
Antonio Alvarez Feijoo
1922b1264f refactor(systemd-timesyncd): use more precise global variables 2022-09-29 05:37:07 +00:00
Antonio Alvarez Feijoo
cbf7f4bc5b refactor(systemd-networkd): use more precise global variables 2022-09-29 05:37:07 +00:00
Antonio Alvarez Feijoo
744c6de5cd fix(network-manager): correct wrong local network configuration path 2022-09-29 05:37:07 +00:00
Antonio Alvarez Feijoo
2eb733cc11 fix(network-legacy): correct wrong local network configuration path 2022-09-29 05:37:07 +00:00
Antonio Alvarez Feijoo
b9dc999f87 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.
2022-09-29 05:37:07 +00:00
Laszlo Gombos
027eee902d 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.
2022-09-29 05:27:49 +00:00
Laszlo Gombos
d091014f88 test(NFS): remove a workaround for systemd v230
Remove some more dead code.
Improve style and formatting.
Remove duplicated modules.
2022-09-29 05:25:42 +00:00
Laszlo Gombos
0da80a1841 refactor(base): remove str_replace from dracut-lib.sh
Remove duplicate implementation of `str_replace` to follow-up
commit 148e420be5
2022-09-29 05:23:07 +00:00
Laszlo Gombos
d7d80af981 ci: add Gentoo Linux container
The Gentoo container is configured to use openrc and musl to
test in those enviroments as well.
2022-09-29 05:21:06 +00:00
Laszlo Gombos
2a2c689740 chore(udev-rules): remove obsolete code
Arch linux no longer needs a special load-modules.sh file.
2022-09-29 05:16:08 +00:00
Laszlo Gombos
97345f0627 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 ***
root0:0:root:/root:/bin/bash
dracut: *** Including module: fs-lib ***
2022-09-29 05:14:52 +00:00
Laszlo Gombos
b96f1afa4d 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.
2022-09-29 05:13:13 +00:00
Hari Bathini
bc1b23c292 fix(squash): build ld cache for squash loader
Commit dc21638c3f 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: dc21638c3f ("fix(squash): keep ld cache under initdir")
Cc: Pingfan Liu <piliu@redhat.com>
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
2022-09-29 04:57:14 +00:00
Pavel Valena
1157143d67 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.
2022-09-26 10:05:33 +00:00
Antonio Alvarez Feijoo
23684e4a2b 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
2022-09-26 10:02:41 +00:00
Antonio Alvarez Feijoo
e1de5bd2d7 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.
2022-09-26 09:47:31 +00:00
Frederick Grose
401158e58c 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.
2022-09-26 09:46:03 +00:00
Kairui Song
481b87fa7a 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>
2022-09-26 09:12:51 +00:00
Antonio Alvarez Feijoo
928252a145 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.
2022-09-26 09:09:36 +00:00
Antonio Alvarez Feijoo
758f2e6937 feat(systemd-pstore): introducing the systemd-pstore module
Introducing the systemd-pstore module.
2022-09-26 09:08:35 +00:00
Laszlo Gombos
4012314f20 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.
2022-08-26 08:18:03 +00:00
Antonio Alvarez Feijoo
639fb95d7e docs: correct typo 2022-08-26 08:00:08 +00:00
Antonio Alvarez Feijoo
8410ee2290 fix(dracut.sh): remove duplicate "dracut:" string in logger functions
dracut-logger functions already prepend the "dracut:" prefix to the message.
2022-08-26 07:58:36 +00:00
Antonio Alvarez Feijoo
f082dad903 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.
2022-08-26 07:58:36 +00:00
Laszlo Gombos
d6d555845e fix(man): point man pages to github.com instead of kernel.org 2022-08-26 07:54:19 +00:00
Laszlo Gombos
d87572ed8e docs: fix path to CONTRIBUTING.md 2022-08-26 07:49:44 +00:00
Laszlo Gombos
61275141df docs: clarify that rd.break stops before the breakpoint starts 2022-08-26 07:45:17 +00:00
Antonio Alvarez Feijoo
da2a092894 chore: add execute permission to all scripts
This avoids most of the rpmlint non-executable-script warnings.
2022-08-26 07:44:16 +00:00
Laszlo Gombos
1573bb815a 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 a1d4041cee
2022-08-26 07:24:55 +00:00
Antonio Alvarez Feijoo
b30a00c2a2 fix(shell-completion): add missing -p and --parallel options 2022-08-26 07:06:34 +00:00
Laszlo Gombos
78cafe465d 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>
2022-08-18 06:25:20 +00:00
Antonio Alvarez Feijoo
4f20ae2620 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.
2022-08-18 06:20:45 +00:00
Laszlo Gombos
bd13e0ae36 test: remove dracut.conf.test
Empty file and it is not used. Has not been used for over a decade :-)
2022-08-18 06:09:31 +00:00
David Tardon
aa0369a4a3 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'
2022-08-18 06:08:45 +00:00
gombi
bdef7793ba test: remove unused ci-matrix.txt file
The ci matrix is described in .github/workflows instead.
ci-matrix.txt file is unreferenced.
2022-08-18 06:05:51 +00:00
Laszlo Gombos
025906de23 docs: create CONTRIBUTING.md
Note down some commonly agreed, but not yet documented guidelines
to have a baseline that can be improved later.
2022-08-18 06:03:53 +00:00
Antonio Alvarez Feijoo
d4732be877 fix(systemd-networkd): typo in systemd-networkd.socket local conf path 2022-08-15 16:03:36 +00:00
Mike Gilbert
27b316df1f fix(virtiofs): make shebangs work on split-usr systems
Fixes: c29325a982013a315418cdb2318e90cf77e387b5
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
2022-08-15 16:00:47 +00:00
runsisi
2f791b401b 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>
2022-08-15 15:38:08 +00:00
Laszlo Gombos
c73e7b99db fix(virtiofs): ismounted has a dependency on the base module
When dracut.sh is called with "--modules virtiofs", make sure
dracut-lib.sh is installed by making the base module a dependency.
2022-08-15 15:36:48 +00:00
Lukas Nykryn
85149b8596 fix(drm): add video drivers needed on hyper-v and similar
Due to non-availability of Hyper-V video driver hyperv_drm in kdump
initramfs, the console seems to be in hang state with no text over it.

We should also go through the /sys/bus/vmbus/devices and include drivers
referenced there.
2022-08-15 15:34:06 +00:00
Lukas Nykryn
bc965cd889 fix(kernel-modules): always include nvmem driver on nvmem_on_arm
These drivers are needed to boot on some SoCs like NXP i.MX
We should include them so installation images will work.
2022-08-15 15:32:30 +00:00
David Tardon
101b683e1a refactor(convertfs): drop duplicate def. of ismounted() 2022-08-15 08:29:34 +00:00
Laszlo Gombos
922c9e28ed fix(dmsquash-live): check kernel for built-in squashfs drivers
Check first for squashfs in `/proc/filesystems`.
This is needed in the --no-kernel use case to avoid the error:
modprobe: FATAL: Module overlay not found in directory /lib/modules/<kver>

Introduce load_fstype function to make it easier to check `/proc/filesystems`
before calling modprobe.
2022-08-15 06:07:39 +00:00
Laszlo Gombos
ec333c30ac ci: dependencies for testing nfs module for Debian
This change allows executing TEST-20-NFS on Debian.
2022-08-15 05:48:07 +00:00
Laszlo Gombos
22ab797948 fix(test): remove unnecessary setup steps
var/lib/nfs/rpc_pipefs is only needed for NFS mounts.
2022-08-15 05:47:24 +00:00
Laszlo Gombos
b8ffc87d13 test(16-DMSQUASH): make it pass on arch
Include additional kernel drivers and install squashfs-tools
into the arch container.
2022-08-15 05:25:54 +00:00
Laszlo Gombos
3adbcc0b71 docs(README.md): update wiki link
Point to the github (and remove kernel.org). Add link to News.
Remove broken badge links.
2022-08-15 05:18:25 +00:00
Jonathan Lebon
2334031a89 fix(90multipath): use RemainAfterExit=yes for multipathd-configure.service
Services of type `oneshot` should almost always use
`RemainAfterExit=yes`. This is a one-time action that we don't want to
rerun if the unit gets pulled in multiple times in the systemd
transaction.
2022-08-12 11:59:06 +00:00
Jonathan Lebon
0940be9058 fix(90multipath): create /etc/multipath only
The dropins path is `/etc/multipath/conf.d`, not
`/etc/multipath/multipath.conf.d`:

686797b7d0/Makefile.inc (L100)

But anyway, we don't need to create that directory. We only need to
create `/etc/multipath`.

While we're here, add a comment to explain this.
2022-08-12 11:59:06 +00:00
Antonio Alvarez Feijoo
da55e26634 fix(systemd): set right permissions for the machine-id file
Fixes issue #1864
2022-08-12 11:48:33 +00:00
Marcos Mello
ebbcf97dc7 fix(dracut-install): do not try to copy files from the root directory
HWCAP library path needs at least two parent directories, for example:

/lib64/power6x/libc.so.6
/lib64/glibc-hwcaps/power9/libpthread-2.28.so (glibc 2.33+)

Before:

dracut-install: Lib install: '/lib64/libz.so.1'
dracut-install: dracut_install('/lib64/libz.so', '/lib64/libz.so', 0, 0, 1)
dracut-install: dracut_install('//libz.so.1', '//libz.so.1', 0, 0, 1)
dracut-install: dracut_install('//libz.so', '//libz.so', 0, 0, 1)

After:

dracut-install: Lib install: '/lib64/libz.so.1'
dracut-install: dracut_install('/lib64/libz.so', '/lib64/libz.so', 0, 0, 1)
2022-08-12 11:45:59 +00:00
Marcos Mello
7f2b09339c refactor(dracut-install): do not call dirname() directly
Avoid its horrible API. Borrow dirname_malloc() from systemd:

https://github.com/systemd/systemd/blob/v251/src/basic/path-util.c#L775
https://github.com/systemd/systemd/blob/v251/src/basic/path-util.h#L150

(licence is LGPLv2.1 or later)
2022-08-12 11:45:59 +00:00
Pavel Valena
b72d0d7f9b fix(dracut.sh): do not fail on irregular files
If file is not a regular file (test -f), dracut.sh fails,
which is unexpected change of behaviour.
The workaround would be to create an empty file.

Fixes: #1835
2022-08-12 11:14:05 +00:00
joamonwx
897e5effe0 feat(dracut.sh): pass engine flag to sbsign allowing use with hardware devices 2022-08-12 11:12:41 +00:00
Brian C. Lane
c8f819e6c1 fix(dmsquash-live): run checkisomd5 on correct device
When the new grub2 iso is written to a usb drive the disk label points
to a partition that does not include the full iso image. This causes
checkisomd5 to run with the wrong data and it fails.

This patch adds a check that will test to see if there is a parent
device that is a disk, and to run checkisomd5 on it instead of on the
partition pointed to by the label.

When running from an iso this will return the original
/dev/disk/by-label/ path, and when running from a usb drive it will
return the parent device (eg. /dev/sda).

Resolves: rhbz#2107858
2022-08-12 10:46:36 +00:00
Antonio Alvarez Feijoo
72b700e3cb fix(dracut-init.sh): correct dracut-install source path 2022-08-12 10:30:15 +00:00
Antonio Alvarez Feijoo
5eb996a993 fix(lsinitrd.sh): correct skipcpio source path 2022-08-12 10:30:15 +00:00
Antonio Alvarez Feijoo
d2f6f445ed fix(dracut-init.sh): propagate the result code returned by dracut-install
Currently only the inst_multiple function propagates the result code returned by
dracut-install.
This was missing since 043 (e.g.: https://github.com/dracutdevs/dracut/blob/043/dracut-functions.sh#L751)
2022-08-12 10:25:56 +00:00
Frederick Grose
d0cd7cd387 fix(dmsquash-live-root): check kernel for built-in overlay drivers
Do not assume that `overlay` is always a module.  Check first for
`overlay` in `/proc/filesystems`. This is needed in the --no-kernel
use case to avoid the error: modprobe:
  FATAL: Module overlay not found in directory /lib/modules/<kver>

Signed-off-by: Federico Vaga <federico.vaga@cern.ch>
2022-08-12 10:25:00 +00:00
Laszlo Gombos
5a5f9c5d4e ci: add glibc to the Arch Linux container
tgt has a dependency on glibc
2022-08-12 10:19:39 +00:00
David Tardon
1343d21d8c refactor(url-lib): write curl output directly to file
The redirection to stdout was originally added to workaround
https://bugzilla.redhat.com/show_bug.cgi?id=989133 (curl would create no
file if the source was empty), but I don't see that problem with current
curl.

A nice side-effect of this change is that curl shows download progress.
2022-08-12 10:15:04 +00:00
Antonio Alvarez Feijoo
fe8fa2b0ca fix(i18n): add required includes for keymaps
Commit https://github.com/dracutdevs/dracut/commit/f3441cc7 removed shell
options but didn't adapt all the code that requires nullglob and globstar.
This caused the initrd to be generated without the required includes for
keymaps.
2022-07-08 04:48:55 +00:00
Antonio Alvarez Feijoo
7fa0094c00 fix(man): correct typo
Fixes issue #1852
2022-06-24 20:28:51 +00:00
наб
13736c50c7 fix(dracut-install): correctly waitpid() for cp 2022-06-24 20:28:17 +00:00
наб
d010fa0d7f refactor(dracut-install): fork() instead of popen(), sanitise line reading
Also set LC_ALL=C to fix ldd output pattern matching in non-english locales.
2022-06-24 20:28:17 +00:00
наб
d2648f6dd8 perf(dracut-install): convert_abs_rel: don't allocate target parent realpath 2022-06-24 20:27:08 +00:00
наб
53dd6a9bbb feat(dracut-install): convert_abs_rel: canonicalise parent of from, too
This fixes, for example, .so versioning links:
  diff --git a/cur b/new3
  index 3804a347..22d089a9 100644
  --- a/cur
  +++ b/new3
  -Image: /boot/initrd.img-5.10.0-13-amd64: 15M
  +Image: initrd: 15M
  -console-setup
  -crw-rw-rw-   1 root     root       1,   3 date etc/console-setup/null
  -drwxr-xr-x  13 root     root            0 date etc
  +drwxr-xr-x  12 root     root            0 date etc
  -drwxr-xr-x   2 root     root            0 date etc/console-setup
  --rw-r--r--   1 root     root       122498 date etc/console-setup/cached_UTF-8_del.kmap
  --rw-r--r--   1 root     root         6240 date etc/ld.so.cache
  +-rw-r--r--   1 root     root         6308 date etc/ld.so.cache
  --rw-r--r--   1 root     root          152 Dec 15  2020 etc/udev/rules.d/10-console.rules
  --rwxr-xr-x   1 root     root        98048 Mar  3  2021 usr/bin/gzip
  --rwxr-xr-x   1 root     root        14976 Oct 11  2020 usr/bin/kbd_mode
  --rwxr-xr-x   1 root     root       220304 Oct 11  2020 usr/bin/loadkeys
  --rwxr-xr-x   1 root     root          229 date usr/bin/setupcon
  -lrwxrwxrwx   1 root     root           32 date usr/lib32/libnss_files.so.2 -> ../../lib32/libnss_files-2.31.so
  +lrwxrwxrwx   1 root     root           20 date usr/lib32/libnss_files.so.2 -> libnss_files-2.31.so
  -lrwxrwxrwx   1 root     root           37 date usr/lib64/ld-linux-x86-64.so.2 -> ../../lib/x86_64-linux-gnu/ld-2.31.so
  +lrwxrwxrwx   1 root     root           34 date usr/lib64/ld-linux-x86-64.so.2 -> ../lib/x86_64-linux-gnu/ld-2.31.so
  --rw-r--r--   1 root     root          185 date usr/lib/dracut/modules.txt
  +-rw-r--r--   1 root     root          171 date usr/lib/dracut/modules.txt
  -lrwxrwxrwx   1 root     root           46 date usr/lib/i386-linux-gnu/libnss_dns.so.2 -> ../../../lib/i386-linux-gnu/libnss_dns-2.31.so
  +lrwxrwxrwx   1 root     root           18 date usr/lib/i386-linux-gnu/libnss_dns.so.2 -> libnss_dns-2.31.so
  -lrwxrwxrwx   1 root     root           48 date usr/lib/i386-linux-gnu/libnss_files.so.2 -> ../../../lib/i386-linux-gnu/libnss_files-2.31.so
  +lrwxrwxrwx   1 root     root           20 date usr/lib/i386-linux-gnu/libnss_files.so.2 -> libnss_files-2.31.so
  +-rw-r--r--   1 root     root        19187 date usr/lib/modules/5.10.0-13-amd64/kernel/crypto/blake2b_generic.ko
  -drwxr-xr-x  21 root     root            0 date usr/lib/modules/5.10.0-13-amd64/kernel/drivers
  +-rw-r--r--   1 root     root        25083 date usr/lib/modules/5.10.0-13-amd64/kernel/crypto/xor.ko
  +drwxr-xr-x  22 root     root            0 date usr/lib/modules/5.10.0-13-amd64/kernel/drivers
  +drwxr-xr-x   2 root     root            0 date usr/lib/modules/5.10.0-13-amd64/kernel/drivers/block
  +-rw-r--r--   1 root     root        74667 date usr/lib/modules/5.10.0-13-amd64/kernel/drivers/block/loop.ko
  -drwxr-xr-x   4 root     root            0 date usr/lib/modules/5.10.0-13-amd64/kernel/fs
  +drwxr-xr-x   5 root     root            0 date usr/lib/modules/5.10.0-13-amd64/kernel/fs
  +drwxr-xr-x   2 root     root            0 date usr/lib/modules/5.10.0-13-amd64/kernel/fs/overlayfs
  +-rw-r--r--   1 root     root       285667 date usr/lib/modules/5.10.0-13-amd64/kernel/fs/overlayfs/overlay.ko
  --rw-r--r--   1 root     root        69130 date usr/lib/modules/5.10.0-13-amd64/modules.alias
  --rw-r--r--   1 root     root        64959 date usr/lib/modules/5.10.0-13-amd64/modules.alias.bin
  +-rw-r--r--   1 root     root        69907 date usr/lib/modules/5.10.0-13-amd64/modules.alias
  +-rw-r--r--   1 root     root        65907 date usr/lib/modules/5.10.0-13-amd64/modules.alias.bin
  --rw-r--r--   1 root     root        19517 date usr/lib/modules/5.10.0-13-amd64/modules.dep
  --rw-r--r--   1 root     root        28161 date usr/lib/modules/5.10.0-13-amd64/modules.dep.bin
  --rw-r--r--   1 root     root          131 date usr/lib/modules/5.10.0-13-amd64/modules.devname
  +-rw-r--r--   1 root     root        19635 date usr/lib/modules/5.10.0-13-amd64/modules.dep
  +-rw-r--r--   1 root     root        28409 date usr/lib/modules/5.10.0-13-amd64/modules.dep.bin
  +-rw-r--r--   1 root     root          157 date usr/lib/modules/5.10.0-13-amd64/modules.devname
  --rw-r--r--   1 root     root       107148 date usr/lib/modules/5.10.0-13-amd64/modules.symbols
  --rw-r--r--   1 root     root       129343 date usr/lib/modules/5.10.0-13-amd64/modules.symbols.bin
  +-rw-r--r--   1 root     root       107260 date usr/lib/modules/5.10.0-13-amd64/modules.symbols
  +-rw-r--r--   1 root     root       129476 date usr/lib/modules/5.10.0-13-amd64/modules.symbols.bin
  -lrwxrwxrwx   1 root     root           44 date usr/lib/systemd/system/ctrl-alt-del.target -> ../../../../lib/systemd/system/reboot.target
  +lrwxrwxrwx   1 root     root           13 date usr/lib/systemd/system/ctrl-alt-del.target -> reboot.target
  -lrwxrwxrwx   1 root     root           20 date usr/lib/systemd/systemd-udevd -> ../../../bin/udevadm
  +lrwxrwxrwx   1 root     root           17 date usr/lib/systemd/systemd-udevd -> ../../bin/udevadm
  -lrwxrwxrwx   1 root     root           87 date usr/lib/systemd/system/sockets.target.wants/systemd-journald-audit.socket -> ../../../../../lib/systemd/system/sockets.target.wants/../systemd-journald-audit.socket
  -lrwxrwxrwx   1 root     root           89 date usr/lib/systemd/system/sockets.target.wants/systemd-journald-dev-log.socket -> ../../../../../lib/systemd/system/sockets.target.wants/../systemd-journald-dev-log.socket
  -lrwxrwxrwx   1 root     root           81 date usr/lib/systemd/system/sockets.target.wants/systemd-journald.socket -> ../../../../../lib/systemd/system/sockets.target.wants/../systemd-journald.socket
  -lrwxrwxrwx   1 root     root           86 date usr/lib/systemd/system/sockets.target.wants/systemd-udevd-control.socket -> ../../../../../lib/systemd/system/sockets.target.wants/../systemd-udevd-control.socket
  -lrwxrwxrwx   1 root     root           85 date usr/lib/systemd/system/sockets.target.wants/systemd-udevd-kernel.socket -> ../../../../../lib/systemd/system/sockets.target.wants/../systemd-udevd-kernel.socket
  +lrwxrwxrwx   1 root     root           32 date usr/lib/systemd/system/sockets.target.wants/systemd-journald-audit.socket -> ../systemd-journald-audit.socket
  +lrwxrwxrwx   1 root     root           34 date usr/lib/systemd/system/sockets.target.wants/systemd-journald-dev-log.socket -> ../systemd-journald-dev-log.socket
  +lrwxrwxrwx   1 root     root           26 date usr/lib/systemd/system/sockets.target.wants/systemd-journald.socket -> ../systemd-journald.socket
  +lrwxrwxrwx   1 root     root           31 date usr/lib/systemd/system/sockets.target.wants/systemd-udevd-control.socket -> ../systemd-udevd-control.socket
  +lrwxrwxrwx   1 root     root           30 date usr/lib/systemd/system/sockets.target.wants/systemd-udevd-kernel.socket -> ../systemd-udevd-kernel.socket
  -lrwxrwxrwx   1 root     root           83 date usr/lib/systemd/system/sysinit.target.wants/kmod-static-nodes.service -> ../../../../../lib/systemd/system/sysinit.target.wants/../kmod-static-nodes.service
  -lrwxrwxrwx   1 root     root           91 date usr/lib/systemd/system/sysinit.target.wants/systemd-ask-password-console.path -> ../../../../../lib/systemd/system/sysinit.target.wants/../systemd-ask-password-console.path
  -lrwxrwxrwx   1 root     root           82 date usr/lib/systemd/system/sysinit.target.wants/systemd-journald.service -> ../../../../../lib/systemd/system/sysinit.target.wants/../systemd-journald.service
  -lrwxrwxrwx   1 root     root           86 date usr/lib/systemd/system/sysinit.target.wants/systemd-modules-load.service -> ../../../../../lib/systemd/system/sysinit.target.wants/../systemd-modules-load.service
  -lrwxrwxrwx   1 root     root           80 date usr/lib/systemd/system/sysinit.target.wants/systemd-sysctl.service -> ../../../../../lib/systemd/system/sysinit.target.wants/../systemd-sysctl.service
  -lrwxrwxrwx   1 root     root           92 date usr/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup-dev.service -> ../../../../../lib/systemd/system/sysinit.target.wants/../systemd-tmpfiles-setup-dev.service
  -lrwxrwxrwx   1 root     root           88 date usr/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup.service -> ../../../../../lib/systemd/system/sysinit.target.wants/../systemd-tmpfiles-setup.service
  -lrwxrwxrwx   1 root     root           79 date usr/lib/systemd/system/sysinit.target.wants/systemd-udevd.service -> ../../../../../lib/systemd/system/sysinit.target.wants/../systemd-udevd.service
  -lrwxrwxrwx   1 root     root           86 date usr/lib/systemd/system/sysinit.target.wants/systemd-udev-trigger.service -> ../../../../../lib/systemd/system/sysinit.target.wants/../systemd-udev-trigger.service
  +lrwxrwxrwx   1 root     root           28 date usr/lib/systemd/system/sysinit.target.wants/kmod-static-nodes.service -> ../kmod-static-nodes.service
  +lrwxrwxrwx   1 root     root           36 date usr/lib/systemd/system/sysinit.target.wants/systemd-ask-password-console.path -> ../systemd-ask-password-console.path
  +lrwxrwxrwx   1 root     root           27 date usr/lib/systemd/system/sysinit.target.wants/systemd-journald.service -> ../systemd-journald.service
  +lrwxrwxrwx   1 root     root           31 date usr/lib/systemd/system/sysinit.target.wants/systemd-modules-load.service -> ../systemd-modules-load.service
  +lrwxrwxrwx   1 root     root           25 date usr/lib/systemd/system/sysinit.target.wants/systemd-sysctl.service -> ../systemd-sysctl.service
  +lrwxrwxrwx   1 root     root           37 date usr/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup-dev.service -> ../systemd-tmpfiles-setup-dev.service
  +lrwxrwxrwx   1 root     root           33 date usr/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup.service -> ../systemd-tmpfiles-setup.service
  +lrwxrwxrwx   1 root     root           24 date usr/lib/systemd/system/sysinit.target.wants/systemd-udevd.service -> ../systemd-udevd.service
  +lrwxrwxrwx   1 root     root           31 date usr/lib/systemd/system/sysinit.target.wants/systemd-udev-trigger.service -> ../systemd-udev-trigger.service
  --rwxr-xr-x   1 root     root           20 Dec 15  2020 usr/lib/udev/console-setup
  -lrwxrwxrwx   1 root     root           48 date usr/lib/x86_64-linux-gnu/libacl.so.1 -> ../../../lib/x86_64-linux-gnu/libacl.so.1.1.2253
  -lrwxrwxrwx   1 root     root           48 date usr/lib/x86_64-linux-gnu/libacl.so -> ../../../lib/x86_64-linux-gnu/libacl.so.1.1.2253
  +lrwxrwxrwx   1 root     root           18 date usr/lib/x86_64-linux-gnu/libacl.so.1 -> libacl.so.1.1.2253
  +lrwxrwxrwx   1 root     root           18 date usr/lib/x86_64-linux-gnu/libacl.so -> libacl.so.1.1.2253
  -lrwxrwxrwx   1 root     root           50 date usr/lib/x86_64-linux-gnu/libapparmor.so.1 -> ../../../lib/x86_64-linux-gnu/libapparmor.so.1.6.3
  +lrwxrwxrwx   1 root     root           20 date usr/lib/x86_64-linux-gnu/libapparmor.so.1 -> libapparmor.so.1.6.3
  -lrwxrwxrwx   1 root     root           49 date usr/lib/x86_64-linux-gnu/libattr.so.1 -> ../../../lib/x86_64-linux-gnu/libattr.so.1.1.2448
  -lrwxrwxrwx   1 root     root           49 date usr/lib/x86_64-linux-gnu/libattr.so -> ../../../lib/x86_64-linux-gnu/libattr.so.1.1.2448
  +lrwxrwxrwx   1 root     root           19 date usr/lib/x86_64-linux-gnu/libattr.so.1 -> libattr.so.1.1.2448
  +lrwxrwxrwx   1 root     root           19 date usr/lib/x86_64-linux-gnu/libattr.so -> libattr.so.1.1.2448
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libaudit.so.1 -> ../../../lib/x86_64-linux-gnu/libaudit.so.1.0.0
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libaudit.so -> ../../../lib/x86_64-linux-gnu/libaudit.so.1.0.0
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libaudit.so.1 -> libaudit.so.1.0.0
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libaudit.so -> libaudit.so.1.0.0
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libblkid.so.1 -> ../../../lib/x86_64-linux-gnu/libblkid.so.1.1.0
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libblkid.so -> ../../../lib/x86_64-linux-gnu/libblkid.so.1.1.0
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libblkid.so.1 -> libblkid.so.1.1.0
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libblkid.so -> libblkid.so.1.1.0
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/libbpf.so.0 -> ../../../lib/x86_64-linux-gnu/libbpf.so.0.3.0
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/libbpf.so.0 -> libbpf.so.0.3.0
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libbsd.so.0 -> ../../../lib/x86_64-linux-gnu/libbsd.so.0.11.3
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libbsd.so -> ../../../lib/x86_64-linux-gnu/libbsd.so.0.11.3
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libbsd.so.0 -> libbsd.so.0.11.3
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libbsd.so -> libbsd.so.0.11.3
  -lrwxrwxrwx   1 root     root           48 date usr/lib/x86_64-linux-gnu/libcap-ng.so.0 -> ../../../lib/x86_64-linux-gnu/libcap-ng.so.0.0.0
  -lrwxrwxrwx   1 root     root           48 date usr/lib/x86_64-linux-gnu/libcap-ng.so -> ../../../lib/x86_64-linux-gnu/libcap-ng.so.0.0.0
  +lrwxrwxrwx   1 root     root           18 date usr/lib/x86_64-linux-gnu/libcap-ng.so.0 -> libcap-ng.so.0.0.0
  +lrwxrwxrwx   1 root     root           18 date usr/lib/x86_64-linux-gnu/libcap-ng.so -> libcap-ng.so.0.0.0
  -lrwxrwxrwx   1 root     root           44 date usr/lib/x86_64-linux-gnu/libcap.so.2 -> ../../../lib/x86_64-linux-gnu/libcap.so.2.44
  -lrwxrwxrwx   1 root     root           44 date usr/lib/x86_64-linux-gnu/libcap.so -> ../../../lib/x86_64-linux-gnu/libcap.so.2.44
  +lrwxrwxrwx   1 root     root           14 date usr/lib/x86_64-linux-gnu/libcap.so.2 -> libcap.so.2.44
  +lrwxrwxrwx   1 root     root           14 date usr/lib/x86_64-linux-gnu/libcap.so -> libcap.so.2.44
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libcrypto.so -> ../../../lib/x86_64-linux-gnu/libcrypto.so.1.1
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libcrypto.so -> libcrypto.so.1.1
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libcrypt.so.1 -> ../../../lib/x86_64-linux-gnu/libcrypt.so.1.1.0
  -lrwxrwxrwx   1 root     root           43 date usr/lib/x86_64-linux-gnu/libcrypt.so -> ../../../lib/x86_64-linux-gnu/libcrypt.so.1
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libcrypt.so.1 -> libcrypt.so.1.1.0
  +lrwxrwxrwx   1 root     root           13 date usr/lib/x86_64-linux-gnu/libcrypt.so -> libcrypt.so.1
  -lrwxrwxrwx   1 root     root           42 date usr/lib/x86_64-linux-gnu/libc.so.6 -> ../../../lib/x86_64-linux-gnu/libc-2.31.so
  +lrwxrwxrwx   1 root     root           12 date usr/lib/x86_64-linux-gnu/libc.so.6 -> libc-2.31.so
  -lrwxrwxrwx   1 root     root           43 date usr/lib/x86_64-linux-gnu/libdl.so.2 -> ../../../lib/x86_64-linux-gnu/libdl-2.31.so
  -lrwxrwxrwx   1 root     root           40 date usr/lib/x86_64-linux-gnu/libdl.so -> ../../../lib/x86_64-linux-gnu/libdl.so.2
  +lrwxrwxrwx   1 root     root           13 date usr/lib/x86_64-linux-gnu/libdl.so.2 -> libdl-2.31.so
  +lrwxrwxrwx   1 root     root           10 date usr/lib/x86_64-linux-gnu/libdl.so -> libdl.so.2
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/libelf.so.1 -> ../../../lib/x86_64-linux-gnu/libelf-0.183.so
  -lrwxrwxrwx   1 root     root           41 date usr/lib/x86_64-linux-gnu/libelf.so -> ../../../lib/x86_64-linux-gnu/libelf.so.1
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/libelf.so.1 -> libelf-0.183.so
  +lrwxrwxrwx   1 root     root           11 date usr/lib/x86_64-linux-gnu/libelf.so -> libelf.so.1
  -lrwxrwxrwx   1 root     root           49 date usr/lib/x86_64-linux-gnu/libgcrypt.so.20 -> ../../../lib/x86_64-linux-gnu/libgcrypt.so.20.2.8
  -lrwxrwxrwx   1 root     root           49 date usr/lib/x86_64-linux-gnu/libgcrypt.so -> ../../../lib/x86_64-linux-gnu/libgcrypt.so.20.2.8
  +lrwxrwxrwx   1 root     root           19 date usr/lib/x86_64-linux-gnu/libgcrypt.so.20 -> libgcrypt.so.20.2.8
  +lrwxrwxrwx   1 root     root           19 date usr/lib/x86_64-linux-gnu/libgcrypt.so -> libgcrypt.so.20.2.8
  -lrwxrwxrwx   1 root     root           52 date usr/lib/x86_64-linux-gnu/libgpg-error.so.0 -> ../../../lib/x86_64-linux-gnu/libgpg-error.so.0.29.0
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libgpg-error.so -> ../../../lib/x86_64-linux-gnu/libgpg-error.so.0
  +lrwxrwxrwx   1 root     root           22 date usr/lib/x86_64-linux-gnu/libgpg-error.so.0 -> libgpg-error.so.0.29.0
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libgpg-error.so -> libgpg-error.so.0
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libip4tc.so.2 -> ../../../lib/x86_64-linux-gnu/libip4tc.so.2.0.0
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libip4tc.so.2 -> libip4tc.so.2.0.0
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libkmod.so.2 -> ../../../lib/x86_64-linux-gnu/libkmod.so.2.3.6
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libkmod.so.2 -> libkmod.so.2.3.6
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libkmod.so -> libkmod.so.2.3.6
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/liblz4.so.1 -> ../../../lib/x86_64-linux-gnu/liblz4.so.1.9.3
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/liblz4.so -> ../../../lib/x86_64-linux-gnu/liblz4.so.1.9.3
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/liblz4.so.1 -> liblz4.so.1.9.3
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/liblz4.so -> liblz4.so.1.9.3
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/liblzma.so.5 -> ../../../lib/x86_64-linux-gnu/liblzma.so.5.2.5
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/liblzma.so -> ../../../lib/x86_64-linux-gnu/liblzma.so.5.2.5
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/liblzma.so.5 -> liblzma.so.5.2.5
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/liblzma.so -> liblzma.so.5.2.5
  -lrwxrwxrwx   1 root     root           44 date usr/lib/x86_64-linux-gnu/libmd.so.0 -> ../../../lib/x86_64-linux-gnu/libmd.so.0.0.4
  -lrwxrwxrwx   1 root     root           44 date usr/lib/x86_64-linux-gnu/libmd.so -> ../../../lib/x86_64-linux-gnu/libmd.so.0.0.4
  +lrwxrwxrwx   1 root     root           14 date usr/lib/x86_64-linux-gnu/libmd.so.0 -> libmd.so.0.0.4
  +lrwxrwxrwx   1 root     root           14 date usr/lib/x86_64-linux-gnu/libmd.so -> libmd.so.0.0.4
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/libmnl.so.0 -> ../../../lib/x86_64-linux-gnu/libmnl.so.0.2.0
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/libmnl.so -> ../../../lib/x86_64-linux-gnu/libmnl.so.0.2.0
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/libmnl.so.0 -> libmnl.so.0.2.0
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/libmnl.so -> libmnl.so.0.2.0
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libmount.so.1 -> ../../../lib/x86_64-linux-gnu/libmount.so.1.1.0
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libmount.so -> ../../../lib/x86_64-linux-gnu/libmount.so.1.1.0
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libmount.so.1 -> libmount.so.1.1.0
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libmount.so -> libmount.so.1.1.0
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libmpfr.so.6 -> ../../../lib/x86_64-linux-gnu/libmpfr.so.6.1.0
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libmpfr.so.6 -> libmpfr.so.6.1.0
  -lrwxrwxrwx   1 root     root           42 date usr/lib/x86_64-linux-gnu/libm.so.6 -> ../../../lib/x86_64-linux-gnu/libm-2.31.so
  +lrwxrwxrwx   1 root     root           12 date usr/lib/x86_64-linux-gnu/libm.so.6 -> libm-2.31.so
  -lrwxrwxrwx   1 root     root           48 date usr/lib/x86_64-linux-gnu/libnss_dns.so.2 -> ../../../lib/x86_64-linux-gnu/libnss_dns-2.31.so
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/libnss_dns.so -> ../../../lib/x86_64-linux-gnu/libnss_dns.so.2
  +lrwxrwxrwx   1 root     root           18 date usr/lib/x86_64-linux-gnu/libnss_dns.so.2 -> libnss_dns-2.31.so
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/libnss_dns.so -> libnss_dns.so.2
  -lrwxrwxrwx   1 root     root           50 date usr/lib/x86_64-linux-gnu/libnss_files.so.2 -> ../../../lib/x86_64-linux-gnu/libnss_files-2.31.so
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libnss_files.so -> ../../../lib/x86_64-linux-gnu/libnss_files.so.2
  +lrwxrwxrwx   1 root     root           20 date usr/lib/x86_64-linux-gnu/libnss_files.so.2 -> libnss_files-2.31.so
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libnss_files.so -> libnss_files.so.2
  -lrwxrwxrwx   1 root     root           48 date usr/lib/x86_64-linux-gnu/libnvpair.so.3 -> ../../../lib/x86_64-linux-gnu/libnvpair.so.3.0.0
  +lrwxrwxrwx   1 root     root           18 date usr/lib/x86_64-linux-gnu/libnvpair.so.3 -> libnvpair.so.3.0.0
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libpam.so.0 -> ../../../lib/x86_64-linux-gnu/libpam.so.0.85.1
  -lrwxrwxrwx   1 root     root           41 date usr/lib/x86_64-linux-gnu/libpam.so -> ../../../lib/x86_64-linux-gnu/libpam.so.0
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libpam.so.0 -> libpam.so.0.85.1
  +lrwxrwxrwx   1 root     root           11 date usr/lib/x86_64-linux-gnu/libpam.so -> libpam.so.0
  -lrwxrwxrwx   1 root     root           50 date usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 -> ../../../lib/x86_64-linux-gnu/libpcre2-8.so.0.10.1
  -lrwxrwxrwx   1 root     root           50 date usr/lib/x86_64-linux-gnu/libpcre2-8.so -> ../../../lib/x86_64-linux-gnu/libpcre2-8.so.0.10.1
  +lrwxrwxrwx   1 root     root           20 date usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 -> libpcre2-8.so.0.10.1
  +lrwxrwxrwx   1 root     root           20 date usr/lib/x86_64-linux-gnu/libpcre2-8.so -> libpcre2-8.so.0.10.1
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libpcre.so.3 -> ../../../lib/x86_64-linux-gnu/libpcre.so.3.13.3
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libpcre.so.3 -> libpcre.so.3.13.3
  -lrwxrwxrwx   1 root     root           48 date usr/lib/x86_64-linux-gnu/libpthread.so.0 -> ../../../lib/x86_64-linux-gnu/libpthread-2.31.so
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/libpthread.so -> ../../../lib/x86_64-linux-gnu/libpthread.so.0
  +lrwxrwxrwx   1 root     root           18 date usr/lib/x86_64-linux-gnu/libpthread.so.0 -> libpthread-2.31.so
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/libpthread.so -> libpthread.so.0
  -lrwxrwxrwx   1 root     root           48 date usr/lib/x86_64-linux-gnu/libreadline.so.8 -> ../../../lib/x86_64-linux-gnu/libreadline.so.8.1
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libreadline.so -> ../../../lib/x86_64-linux-gnu/libreadline.so.8
  +lrwxrwxrwx   1 root     root           18 date usr/lib/x86_64-linux-gnu/libreadline.so.8 -> libreadline.so.8.1
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libreadline.so -> libreadline.so.8
  -lrwxrwxrwx   1 root     root           43 date usr/lib/x86_64-linux-gnu/librt.so.1 -> ../../../lib/x86_64-linux-gnu/librt-2.31.so
  -lrwxrwxrwx   1 root     root           40 date usr/lib/x86_64-linux-gnu/librt.so -> ../../../lib/x86_64-linux-gnu/librt.so.1
  +lrwxrwxrwx   1 root     root           13 date usr/lib/x86_64-linux-gnu/librt.so.1 -> librt-2.31.so
  +lrwxrwxrwx   1 root     root           10 date usr/lib/x86_64-linux-gnu/librt.so -> librt.so.1
  -lrwxrwxrwx   1 root     root           49 date usr/lib/x86_64-linux-gnu/libseccomp.so.2 -> ../../../lib/x86_64-linux-gnu/libseccomp.so.2.5.1
  +lrwxrwxrwx   1 root     root           19 date usr/lib/x86_64-linux-gnu/libseccomp.so.2 -> libseccomp.so.2.5.1
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/libselinux.so -> ../../../lib/x86_64-linux-gnu/libselinux.so.1
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/libselinux.so -> libselinux.so.1
  -lrwxrwxrwx   1 root     root           49 date usr/lib/x86_64-linux-gnu/libsigsegv.so.2 -> ../../../lib/x86_64-linux-gnu/libsigsegv.so.2.0.6
  +lrwxrwxrwx   1 root     root           19 date usr/lib/x86_64-linux-gnu/libsigsegv.so.2 -> libsigsegv.so.2.0.6
  -lrwxrwxrwx   1 root     root           51 date usr/lib/x86_64-linux-gnu/libsmartcols.so.1 -> ../../../lib/x86_64-linux-gnu/libsmartcols.so.1.1.0
  +lrwxrwxrwx   1 root     root           21 date usr/lib/x86_64-linux-gnu/libsmartcols.so.1 -> libsmartcols.so.1.1.0
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/libtinfo.so.6 -> ../../../lib/x86_64-linux-gnu/libtinfo.so.6.2
  -lrwxrwxrwx   1 root     root           43 date usr/lib/x86_64-linux-gnu/libtinfo.so -> ../../../lib/x86_64-linux-gnu/libtinfo.so.6
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/libtinfo.so.6 -> libtinfo.so.6.2
  +lrwxrwxrwx   1 root     root           13 date usr/lib/x86_64-linux-gnu/libtinfo.so -> libtinfo.so.6
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libtspi.so.1 -> ../../../lib/x86_64-linux-gnu/libtspi.so.1.2.0
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libtspi.so.1 -> libtspi.so.1.2.0
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libudev.so.1 -> ../../../lib/x86_64-linux-gnu/libudev.so.1.7.0
  -lrwxrwxrwx   1 root     root           42 date usr/lib/x86_64-linux-gnu/libudev.so -> ../../../lib/x86_64-linux-gnu/libudev.so.1
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libudev.so.1 -> libudev.so.1.7.0
  +lrwxrwxrwx   1 root     root           12 date usr/lib/x86_64-linux-gnu/libudev.so -> libudev.so.1
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libuuid.so.1 -> ../../../lib/x86_64-linux-gnu/libuuid.so.1.3.0
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libuuid.so -> ../../../lib/x86_64-linux-gnu/libuuid.so.1.3.0
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libuuid.so.1 -> libuuid.so.1.3.0
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libuuid.so -> libuuid.so.1.3.0
  -lrwxrwxrwx   1 root     root           47 date usr/lib/x86_64-linux-gnu/libuutil.so.3 -> ../../../lib/x86_64-linux-gnu/libuutil.so.3.0.0
  +lrwxrwxrwx   1 root     root           17 date usr/lib/x86_64-linux-gnu/libuutil.so.3 -> libuutil.so.3.0.0
  -lrwxrwxrwx   1 root     root           50 date usr/lib/x86_64-linux-gnu/libzfs_core.so.3 -> ../../../lib/x86_64-linux-gnu/libzfs_core.so.3.0.0
  +lrwxrwxrwx   1 root     root           20 date usr/lib/x86_64-linux-gnu/libzfs_core.so.3 -> libzfs_core.so.3.0.0
  -lrwxrwxrwx   1 root     root           45 date usr/lib/x86_64-linux-gnu/libzfs.so.4 -> ../../../lib/x86_64-linux-gnu/libzfs.so.4.1.0
  +lrwxrwxrwx   1 root     root           15 date usr/lib/x86_64-linux-gnu/libzfs.so.4 -> libzfs.so.4.1.0
  -lrwxrwxrwx   1 root     root           44 date usr/lib/x86_64-linux-gnu/libz.so.1 -> ../../../lib/x86_64-linux-gnu/libz.so.1.2.11
  -lrwxrwxrwx   1 root     root           44 date usr/lib/x86_64-linux-gnu/libz.so -> ../../../lib/x86_64-linux-gnu/libz.so.1.2.11
  +lrwxrwxrwx   1 root     root           14 date usr/lib/x86_64-linux-gnu/libz.so.1 -> libz.so.1.2.11
  +lrwxrwxrwx   1 root     root           14 date usr/lib/x86_64-linux-gnu/libz.so -> libz.so.1.2.11
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libzstd.so.1 -> ../../../lib/x86_64-linux-gnu/libzstd.so.1.4.8
  -lrwxrwxrwx   1 root     root           46 date usr/lib/x86_64-linux-gnu/libzstd.so -> ../../../lib/x86_64-linux-gnu/libzstd.so.1.4.8
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libzstd.so.1 -> libzstd.so.1.4.8
  +lrwxrwxrwx   1 root     root           16 date usr/lib/x86_64-linux-gnu/libzstd.so -> libzstd.so.1.4.8
  --rwxr-xr-x   1 root     root       517176 Nov  2  2019 usr/local/lib/libgmp.so.10.3.0
  +-rwxr-xr-x   1 root     staff      517176 Nov  2  2019 usr/local/lib/libgmp.so.10.3.0
  -lrwxrwxrwx   1 root     root           14 date usr/sbin/depmod -> ../../bin/kmod
  +lrwxrwxrwx   1 root     root           11 date usr/sbin/depmod -> ../bin/kmod
  -lrwxrwxrwx   1 root     root           19 date usr/sbin/halt -> ../../bin/systemctl
  +lrwxrwxrwx   1 root     root           16 date usr/sbin/halt -> ../bin/systemctl
  -lrwxrwxrwx   1 root     root           14 date usr/sbin/insmod -> ../../bin/kmod
  +lrwxrwxrwx   1 root     root           11 date usr/sbin/insmod -> ../bin/kmod
  -lrwxrwxrwx   1 root     root           12 date usr/sbin/ip -> ../../bin/ip
  +lrwxrwxrwx   1 root     root            9 date usr/sbin/ip -> ../bin/ip
  -lrwxrwxrwx   1 root     root           14 date usr/sbin/lsmod -> ../../bin/kmod
  -lrwxrwxrwx   1 root     root           14 date usr/sbin/modinfo -> ../../bin/kmod
  -lrwxrwxrwx   1 root     root           14 date usr/sbin/modprobe -> ../../bin/kmod
  +lrwxrwxrwx   1 root     root           11 date usr/sbin/lsmod -> ../bin/kmod
  +lrwxrwxrwx   1 root     root           11 date usr/sbin/modinfo -> ../bin/kmod
  +lrwxrwxrwx   1 root     root           11 date usr/sbin/modprobe -> ../bin/kmod
  -lrwxrwxrwx   1 root     root           19 date usr/sbin/poweroff -> ../../bin/systemctl
  +lrwxrwxrwx   1 root     root           16 date usr/sbin/poweroff -> ../bin/systemctl
  -lrwxrwxrwx   1 root     root           19 date usr/sbin/reboot -> ../../bin/systemctl
  -lrwxrwxrwx   1 root     root           14 date usr/sbin/rmmod -> ../../bin/kmod
  +lrwxrwxrwx   1 root     root           16 date usr/sbin/reboot -> ../bin/systemctl
  +lrwxrwxrwx   1 root     root           11 date usr/sbin/rmmod -> ../bin/kmod

Closes #1781
2022-06-24 20:27:08 +00:00
наб
06d316171c fix(dracut-install): convert_abs_rel: return valid path on error
convert_abs_rel() gets
  from  =/var/tmp/dracut.8dxnpY/initramfs/lib/x86_64-linux-gnu/libuuid.so.1.3.0
  target=/var/tmp/dracut.8dxnpY/initramfs/lib/x86_64-linux-gnu/libuuid.so
returning from is invalid; skip over the destdir:
  /lib/x86_64-linux-gnu/libuuid.so.1.3.0
2022-06-24 20:27:08 +00:00
наб
e7d6a1e30c perf(dracut-install): strdup()+[dirlen]=0 => strndup 2022-06-24 20:27:08 +00:00
Daan De Meyer
846a845375 fix(install.d): add --verbose if KERNEL_INSTALL_VERBOSE=1
If KERNEL_INSTALL_VERBOSE=1, let's make sure dracut also produces
extended output for debugging purposes.
2022-06-21 23:06:57 +00:00
Kairui Song
e4f1dbcc00 fix(dracut): typo error 'aggresive' -> 'aggressive'
This option was introduced not long ago, but unfortunately it was
misspelled and have affected following up commits. It's not a commonly
used option, at least not yet, so just rename and fix it.

Signed-off-by: Kairui Song <kasong@tencent.com>
2022-06-21 19:33:49 +00:00
Alberto Planas
90585c624a fix(integrity): do not enable EVM if there is no key
Track when a key is successfully loaded, and return 1 if no key has been
loaded.  This will not enable EVM if there are no keys available in the
system.

Fix #1847

Signed-off-by: Alberto Planas <aplanas@suse.com>
2022-06-21 07:05:01 +00:00
Alberto Planas
9d1004a4e9 fix(integrity): remove unused variable
Drop X509ID variable inside the `if`, and use the same comparison that
is already in evm_enable.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2022-06-21 07:05:01 +00:00
Jóhann B. Guðmundsson
ad7d5bc8ea fix(Makefile): reduce the number of shell invocations
Makefile uses recursively expanded macros and as can be seen by simply
adding $(warning Call to shell) in front of $(shell ...) Foo's in the
Makefile, we are calling out to shell 9 times just to get the working
directory, a working directory which doesn't change during Make!

Let's save few pony's and reduce it to 2...
2022-06-21 05:40:09 +00:00
Jóhann B. Guðmundsson
29e9718f11 docs: update NEWS.md and AUTHORS 2022-06-19 22:35:26 +00:00
Martin Wilck
6d92326201 feat(dracut): support parallel execution with --parallel
Add an option --parallel which can currently be used with
--regenerate-all. With --regenerate-all --parallel, dracut will be
run in parallel for all kernels found.

Also introduce a config file equivalent setting: parallel="yes".
Making this work requires moving the code block that handles --regenerate-all
behind the code block for reading the config files.

Signed-off-by: Martin Wilck <mwilck@suse.com>
2022-06-17 16:47:44 +00:00
Tao Liu
d9812fc4ae feat(lvm): add new module lvmthinpool-monitor
Previously dracut didn't support the feature of lvm thinpool autoextend.

The feature is useful to cases such as kdump, when vmcore to be saved to a
lvm thin volume. The thinpool should be able to autoextend, otherwise an
IO error will be caused and leaves an incomplete vmcore.

There is lvm2-monitor.service and dmeventd avaliable, however
considering [1], it is not suitable for kdump and memory limited cases.

This patch achieves the same by parallel looping a shell function in the
background, which calls lvextend periodically. If thredshold reaches,
autoextend it, if not then nothing happens.

[1]: https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org/message/YF254ZO3PJ3U56P4OKHV3JNYP2PJUMYX/

Signed-off-by: Tao Liu <ltao@redhat.com>
2022-06-17 13:09:45 +00:00
наб
09a1e5afd2 fix(bluetooth): accept compressed firmwares in inst_multiple 2022-06-09 23:46:52 +00:00
наб
9d8387ed80 feat(dracut-install): support ZSTD-compressed firmware with .zst suffix
Coming in 5.19:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-next&id=23cfbc6ec44e5e80d5522976ff45ffcdcddfb230
2022-06-09 23:46:52 +00:00
наб
95aeed8975 fix(dracut): default to correct firmware search paths
1. /sys/module/firmware_class/parameters/path (fw_path_para), if any
2. /lib/firmware/updates/$(uname -r)
3. /lib/firmware/updates
4. /lib/firmware/$(uname -r)
5. /lib/firmware

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/base/firmware_loader/main.c?h=v5.17#n406
2022-06-09 23:46:52 +00:00
Laszlo Gombos
a1d4041cee test: list only the required modules explicitly
Test for module dependencies and increase test coverage.
2022-06-02 13:43:59 +00:00
Laszlo Gombos
6ee2baf314 fix(test): dmsquash-live test without an iso
Remove fedore specific parts and use squash filesystem as live root.
2022-06-02 13:42:20 +00:00
Conrad Hoffmann
1354d6339a fix(Makefile): use of potentially unset variable
`CWD` is not a Make variable. This may have worked accidentally for some
people if their shell happend to provide `CWD` and Make picked it up.

As is, this tends to pick up git versions of unrelated parent
directories, e.g. when packaging for distributions.
2022-06-02 12:25:44 +00:00
Antonio Alvarez Feijoo
77420527b0 docs(dracut.cmdline): add missing rd.nonvmf option
This is a specific option of the nvmf module.
2022-06-02 09:58:52 +00:00
Antonio Alvarez Feijoo
e405501e23 fix(nvmf): deprecate old nvmf cmdline options
Fixes issue #1831
2022-06-02 09:58:52 +00:00
Antonio Alvarez Feijoo
f63f411d52 fix(integrity): do not display any error if there is no IMA certificate
IMA appraisal can be used without digital signatures, just by storing hash
digests instead.
2022-05-26 19:22:13 +00:00
Antonio Alvarez Feijoo
b4522705c8 docs(dracut.cmdline): add missing evmx509 option
This is a specific option of the integrity module.
2022-05-26 19:22:13 +00:00
Laszlo Gombos
1befc64167 feat(gensplash): remove module
splashutils Gentoo package (a dependency for the gensplash dracut module)
is non existent in the official Gentoo repositories.
2022-05-16 19:01:17 +00:00
Antonio Alvarez Feijoo
e455273187 docs(dracut.conf): regenerate_all not supported
The regenerate_all option is used before sourcing the configuration files.
2022-05-16 19:00:27 +00:00
Antonio Alvarez Feijoo
9bef71094e fix(dracut.sh): format usage and add missing options
Set common format to each option and add missing options:
    --no-machineid
2022-05-11 04:43:10 +00:00
Antonio Alvarez Feijoo
a6c497dc7a docs(dracut): format and add missing options
Set common format to each option, correct default compression options and add
missing options:
    --rebuild
    --aggresive-strip
    --hostonly-mode
    --hostonly-nics
    --noimageifnotneeded
2022-05-11 04:43:10 +00:00
Antonio Alvarez Feijoo
20eba720a5 docs(dracut.conf): format and add missing options
Set common format to each option, add/correct default values and add missing
options:
    force_add_dracutmodules
    libdirs
    squash_compress
    aggresive_strip
    do_hardlink
    prefix
    hostonly_mode
    hostonly_nics
    sshkey
    regenerate_all
    noimageifnotneeded
    uefi
    machine_id
    enhanced_cpio
2022-05-11 04:43:10 +00:00
Antonio Alvarez Feijoo
1199f990bb fix(shell-completion): add missing options 2022-05-11 04:43:10 +00:00
Laszlo Gombos
0b339d7351 ci(integration): maintain only Fedora latest
Alphabetically ordering the distributions in the container section
2022-05-07 08:56:32 +00:00
German Maglione
8348c5636a ci(virtiofs): add virtiofs label
Add the label virtiofs to the label trigger file.

Signed-off-by: German Maglione <gmaglione@redhat.com>
2022-05-05 22:21:33 +00:00
German Maglione
4632f79995 feat(virtiofs): virtiofs root filesystem support
Currently dracut can't mount virtiofs as root filesystem.
Make possible to boot virtual machines off virtiofs,
passing "root=virtiofs:<mtag>", using the mount tag <mtag>
as root filesystem. Alternatively this module also supports
"rootfstype=virtiofs root=<mtag>"

Signed-off-by: German Maglione <gmaglione@redhat.com>
2022-05-05 22:21:33 +00:00
Wenchao Hao
319dc7fe10 fix(iscsi): do not exit in handle_netroot() if discovery failed
User may specify multiple netroot in cmdline, failed to connect one netroot
do not mean all netroot are not accessible. So if one netroot failed, do
not exit the discovery and login flow.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2022-05-05 20:40:00 +00:00
Laszlo Gombos
b3ab3037e8 fix(test): remove stale comments 2022-05-04 21:36:04 +00:00
Laszlo Gombos
a7dfdf6acb fix(test): add support for dpkg to pass the test on debian 2022-05-04 07:30:45 +00:00
Antonio Alvarez Feijoo
d6343146c1 fix(lsinitrd.sh): always check that MACHINE_ID is not empty 2022-05-03 22:12:13 +00:00
Antonio Alvarez Feijoo
527fdfa151 fix(dracut.sh): always check that MACHINE_ID is not empty
On new installations, /etc/machine-id may exist and be empty, and
also /efi or /boot/efi may be a mount point, leading to an invalid
initramfs output file.
2022-05-03 22:12:13 +00:00
Laszlo Gombos
7f7dc9173d ci: on debian, default shell is not bash 2022-05-03 21:41:31 +00:00
Laszlo Gombos
ab798f6785 ci: install sudo for the debian container 2022-05-02 05:46:10 +00:00
Morten Linderud
8abd45d288 docs(dracut.usage): fix dracut.cmdline reference from section 5 to 7
Signed-off-by: Morten Linderud <morten@linderud.pw>
2022-05-01 11:56:07 +00:00
Laszlo Gombos
08ed7b2d00 fix(dmsquash-live): mount live device with the correct type
fstype is not the correct type for the live device.
2022-04-29 22:12:05 +00:00
Laszlo Gombos
080f3e2e29 ci: add Debian Linux to limited tests 2022-04-29 22:10:44 +00:00
Antonio Alvarez Feijoo
012d7db27d fix(dracut.sh): avoid calling dfatal before dracut-logger is sourced
dracut-logger is sourced in dracut-init, so any earlier calls to logger
functions before dracut-init is sourced fail.

Fix issue #1758
2022-04-29 21:49:23 +00:00
Jóhann B. Guðmundsson
d0c6ab21d9 fix(dracut.spec): add connman module
Add the connman module to the spec file
2022-04-29 20:53:54 +00:00
David Tardon
42e8f17c24 feat(dracut-systemd): use Documentation= to point to man page 2022-04-26 18:24:15 +00:00
David Tardon
77c28b3020 fix(dracut-systemd): drop misleading man page reference
dracut-shutdown.service is not a part of the boot process, therefore the
reference to dracut.bootup(7) is misleading.
2022-04-26 18:24:15 +00:00
Masahiro Matsuya
485413627f fix(fedora.conf): vi binary is missing
/usr/bin/vi is just a wrapper shell script to run /usr/libexec/vi which is the vi binary.
/usr/bin/vi is available in initrd.img, but /usr/libexec/vi is missing.
As as result, vi command never works.
This PR is to add /usr/libexec/vi.
2022-04-26 07:09:15 +00:00
Antonio Alvarez Feijoo
ffc1985cb2 fix(man): add missing default paths 2022-04-25 21:29:30 +00:00
Antonio Alvarez Feijoo
49ea6c42db fix(lsinitrd.sh): add missing default paths 2022-04-25 21:29:30 +00:00
Antonio Alvarez Feijoo
28ef3bc6a6 fix(dracut.sh): add missing default output file paths 2022-04-25 21:29:30 +00:00
Coiby Xu
ab6f57339a fix(kernel-network-modules): allow specifying empty --hostonly-nics
Commit 1e92f728 ("Add a --hostonly-nics option") allows only installing
the network drivers for specified NICs. But it doesn't allow an emtpy
--hostonly-nics. Specifying empty hostonly-nics is needed to address the
following use cases,
 - drivers/s390/net is installed regardless of --hostonly-nics. There is
   no need to repeat it.
 - get_dev_module couldn't find the driver for a bond or a bridge
   network interface so it's better for a module to install a bond
   or bridge driver itself
 - dracut kdump module wants to install the needed network drivers by
   itself because it can't add the --hostonly-nics option to dracut when
   itself is a dracut module

This patch distinguishes between an empty --hostonly-nics and --hostonly-nics
not added so a user can pass an empty --hostonly-nics option.
2022-04-24 05:28:16 +00:00
Antonio Alvarez Feijoo
d615934311 fix(nfs): give /run/rpcbind ownership to rpc user
Avoid errors when rpcbind tries to write to the /run/rpcbind directory.
2022-04-21 06:42:27 +00:00
Antonio Alvarez Feijoo
0e4df7a39d fix(nfs): require and install needed binaries
parse-nfsroot.sh requires sed, chmod and chown.
2022-04-21 06:42:27 +00:00
Antonio Alvarez Feijoo
79f9d9e1c2 fix(lvm): add missing grep requirement
Since commit https://github.com/dracutdevs/dracut/commit/7ffc5e38
lvm_scan.sh needs grep.
2022-04-11 07:33:31 +00:00
Antonio Alvarez Feijoo
a7a4b76c4a fix(resume): correct call to block_is_netdevice function
The block_is_netdevice function requires the device in <maj:min>
format, but the swap_devs array is populated with the content of
/proc/swaps, which prints the devices using their paths from /dev.

This causes the check method to never detect if swap is mounted on a
network device.
2022-04-09 08:11:46 +00:00
Antonio Alvarez Feijoo
0afa840e11 fix(dracut-functions.sh): correct wrong comment 2022-04-09 08:11:46 +00:00
наб
27071e9a0e fix(dracut.cmdline.7): {=> must} also be specified 2022-04-09 08:10:35 +00:00
Antonio Alvarez Feijoo
7103c4bce9 fix(ifcfg): avoid calling unavailable dracut-logger functions
The dracut-logger functions are only available during the initrd
generation. For internal initrd scripts that run at boot,
dracut-lib provides warn() and info().
2022-04-09 08:09:24 +00:00
Antonio Alvarez Feijoo
b7059aef59 fix(network-manager): avoid calling unavailable dracut-logger functions
The dracut-logger functions are only available during the initrd
generation. For internal initrd scripts that run at boot,
dracut-lib provides warn() and info().
2022-04-09 08:09:24 +00:00
Nicolas Porcel
65e41b5460 feat(man): add documentation for rd.luks.key.tout 2022-04-09 07:55:11 +00:00
Nicolas Porcel
6c11a8fcee fix(crypt): add missing is_keysource parameter to cryptroot-ask
Without this change, rd.luks.key.tout is used, which is the number of
times cryptroot tries to find the key.
2022-04-09 07:54:06 +00:00
Antonio Alvarez Feijoo
a90dbd958b fix(man): add missing --libdirs section 2022-04-09 07:35:54 +00:00
Antonio Alvarez Feijoo
352e591731 fix(dracut.sh): add missing --libdirs usage 2022-04-09 07:35:54 +00:00
Benjamin Gilbert
25a92885a9 fix(nvmf): set executable bit on nvmf-autoconnect.sh
It's installed in /sbin, and run via initqueue in the special case of FC
transport without a discovery.conf and without kernel arguments.  If the
executable bit is not set, initqueue fails with "Invalid command".

Caught by CI checking for non-executable files in binary directories.
2022-04-09 07:35:13 +00:00
James Morris
90032a4631 feat(url-lib.sh): add --retry-connrefused to default curl arguments
Trigger the existing retry condition on connection refused
to mitigate transient connectivity issues.
2022-04-09 07:34:36 +00:00
Antonio Alvarez Feijoo
9ef73b6ad0 fix(dracut-install): copy files preserving ownership attributes
While the "clone copy" operation changes the ownership of the cloned
files, the "normal copy" using cp does not preserve it.
2022-04-04 18:21:18 +00:00
Pavel Valena
79170aafba docs: do not mention nullglob in cases where it's not needed 2022-04-04 08:00:10 +00:00
Pavel Valena
f3441cc7c5 fix(10i18n): stop leaking shell options
Avoid using shell options in findkeymap, instead of using a wrapper[*]
to restore the previous options. Using mapfile and find to generate the list
of files also has the benefit of being more readable in this case.

[*] Reverted commit 35064768eb
Original issue description from Michal Hecko <mhecko@redhat.com>:

The findkeymap function manipulates the shell options and relies on
restoring them using the trap. However, as the function might be called
recursively, each recursive invocation changes the signal handler to its
own. As the recursion is entered with shell options already modified,
the changed trap handler is replaced with restoration to the modified
shell options, not the original ones.
2022-04-04 08:00:10 +00:00
Pavel Valena
f63faaa68f revert(10i18n): stop leaking shell options
This reverts commit 35064768eb, to replace
the implementation.
2022-04-04 08:00:10 +00:00
Pavel Valena
c7b3ac2bd1 fix(test): nullglob should not be needed 2022-04-04 08:00:10 +00:00
Pavel Valena
bd1a5ca9ae fix(dracut-install): do not fail when SOURCE is optional and missing
When running dracut-install with '-o' (optional source), and nullglob
at the same time, when all of the arguments evaluate <null>, dracut-install
should not fail even when the source is not specified.
2022-04-04 08:00:10 +00:00
Pavel Valena
36aaa74f36 fix(bluetooth): nullglob should not be needed 2022-04-04 08:00:10 +00:00
Pavel Valena
c7cfdf7703 ci: obsolete Dockerfile with Fedora 33 2022-04-04 05:50:52 +00:00
Pavel Valena
92277cc8da ci: add Dockerfile for Fedora 35 2022-04-04 05:50:52 +00:00
Antonio Alvarez Feijoo
4688695621 fix(dracut-initramfs-restore.sh): unpack uncompressed initrd as last option
Attempting to unpack the initrd assuming it is uncompressed when
it is delays the shutdown process by several seconds. This must
be the last check.
2022-03-30 21:25:15 +00:00
Shreenidhi Shedi
0ef40d8812 fix(configure): check for SYS-gettid during configure
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2022-03-30 12:00:58 +00:00
David Teigland
7e03d81fe3 fix(lvm): ignore expected error message from lvm config
The "lvm config" commands that check the filter settings will
often find nothing set and report an error message:
"Configuration node devices/filter not found"
Direct these messages to /dev/null so they do not appear as
noise in system logs.
2022-03-29 02:38:48 +00:00
Zoltán Böszörményi
f6d83f9f5c fix(connman): copy netroot.sh from the network module and install it
As requested by johannbg.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
2022-03-28 08:01:46 +00:00
Zoltán Böszörményi
f30d03513f feat(connman): introduce connman support module
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
2022-03-28 08:01:46 +00:00
Antonio Alvarez Feijoo
42e9d18892 fix(plymouth): hide dpkg-architecture stderr messages
dpkg-architecture prints warnings and errors to stderr. If the system does
not have gcc installed, it issues a warning:

dpkg-architecture: warning: cannot determine CC system type, falling back to default (native compilation)

This fix checks only the value of the queried variable.
2022-03-27 18:37:39 +00:00
nkraetzschmar
70112297d8 style: remove accidental whitespace in front of comment line 2022-03-27 18:36:55 +00:00
nkraetzschmar
8391a99303 feat: add aarch64 uefi support 2022-03-27 18:36:55 +00:00
Laszlo Gombos
aebeb2ecdf fix(udev-rules): add cdrom udev rules by default
Include cdrom udev rules by default, even if
systemd-udevd or dmsquash-live dracut modules
are not installed.
2022-03-25 20:09:14 +00:00
David Tardon
24d8f35b9c fix(dracut-initramfs-restore.sh): check if SELINUXTYPE is set
It can happen that SELINUXTYPE is not set, e.g., in Fedora/RHEL
installation images /etc/selinux/config is an empty file. That means
that setfiles fails, which makes dracut-initramfs-restore fail too
because it uses "set -x", which means that dracut-shutdown.service
fails. But, after commit 7ab1d00227, a
failure of dracut-shutdown.service means that the final switch back into
initrd is skipped. Let's just add an additional sanity check to
workaround that.
2022-03-18 06:37:23 +00:00
Antonio Alvarez Feijoo
a38d9ec032 fix(bluetooth): make $dbussystem/bluetooth.conf optional
Do not display an error message if $dbussystem/bluetooth.conf file don't exist.
2022-03-17 19:40:23 +00:00
David Tardon
85fdff1212 fix(dracut-systemd): correct service dependencies
dracut-systemd.service is not an early boot service, therefore it should
not use DefaultDependencies=no. This also fixes the service's ordering
dependencies, as in its current state it is missing
Before=shutdown.target umount.target
2022-03-17 05:30:27 +00:00
Michal Hecko
35064768eb fix(10i18n): stop leaking shell options
The findkeymap function manipulates the shell options and relies on
restoring them using the trap. However, as the function might be called
recursively, each recursive invocation changes the signal handler to its
own. As the recursion is entered with shell options already modified,
the changed trap handler is replaced with restoration to the modified
shell options, not the original ones. This patch wraps the findkeymap
function so that the shellopts are manipulated and restored outside the
recursion.
2022-03-09 04:09:53 +00:00
David Tardon
3385989266 fix(dracut.sh): drop restorecon call
AFAICT there is no need for it. cp already applies appropriate label on
the target file (unless --preserve=context is used).
2022-03-09 04:03:32 +00:00
Laszlo Gombos
9a884b3afc fix(dmsquash-live): permanent overlay on the same drive as LiveCD .iso
An example kernel command line arguments for this configuration
iso-scan/filename=distro.iso root=live:CDLABEL=ISO
rd.live.image rd.live.overlay=/dev/sda:/overlay.img

iso-scan would mount /dev/sda first and keep it mounted. The change
allows detecting if the permanent overlay drive is already mounted.
It also ensures that the mount is writable, as permanent overlay
requires writable storage.
2022-03-01 22:37:09 +00:00
Laszlo Gombos
ce55a85ed5 fix(install): restore musl support
__GLIBC_PREREQ is only defined in glibc.
2022-03-01 22:25:53 +00:00
Jóhann B. Guðmundsson
8fd37d20f4 fix(github): remove packit
It's been a year since I initially made the PR to include packit.

Having it has resulted in increasing the project's cost of development
( CoD ) thus defeating the initial purpose of including it, which was an attempt
to do the opposite as in to reduce it, thus removing it.

My take on this after a year in use is that the concept is flawed,
limited to a single distribution and cannot work in practice without
adding to upstreams and it's contributors CoD but other projects milage
may vary.
2022-03-01 21:00:51 +00:00
Savyasachee Jha
9582f02773 feat(dracut): add zfs detection
zfs detection is currently done by the zfs dracut module installed by
downstream, resulting in a lot of duplicated code. This commit puts zfs
detection into the core dracut logic, allowing for detection of zfs
partitions to be done at the same time as all others. It also allows for
dracut to correctly create a `root=` cmdline parameter for zfs.

Signed-off-by: Savyasachee Jha <hi@savyasacheejha.com>
2022-02-28 21:22:38 +00:00
Antonio Alvarez Feijoo
4c355d0558 fix(dracut.sh): error exporting sysctl variables
- Typo assigning depmodd and depmodconfdir.
- Typo exporting a variable called sysctl instead of sysctld.
2022-02-26 09:08:15 +00:00
Lee Duncan
a33a8df43d fix(iscsi): remove unneeded iscsi NOP-disable code
Commit 7374943ae3 ("fix(iscsi): add support for the new iscsiadm
"no-wait" (-W) command") added some code to try to disable iscsi's
NOPs, since they are considered "bad" for an iscsi root disc,
but that code doesn't work because the session is already established
at this point. Open-iscsi will change so that it automatically
disables NOPs for the root disc, so this code can just go away.
2022-02-26 08:13:29 +00:00
Antonio Alvarez Feijoo
d3ab20615e fix(systemd-journald): remove duplicate entry in inst_multiple 2022-02-23 06:21:55 +00:00
Antonio Alvarez Feijoo
28b6adcb27 fix(systemd-timesyncd): add systemd-sysusers dependency
This systemd-timesyncd module depends on systemd-sysusers after the split of
systemd sysuser configs (fec93bb221).
2022-02-23 06:19:34 +00:00
Antonio Alvarez Feijoo
ce82e969f8 fix(systemd-coredump): add systemd-sysusers dependency
The systemd-coredump module depends on systemd-sysusers after the split of
systemd sysuser configs (fec93bb221).
2022-02-23 06:19:34 +00:00
Tao Liu
e2aee2d436 feat(squash): add shell completion for --squash-compressor option
Signed-off-by: Tao Liu <ltao@redhat.com>
2022-02-22 17:32:29 +00:00
Tao Liu
3693bfef2f feat(squash): update the manual page for --squash-compressor
Signed-off-by: Tao Liu <ltao@redhat.com>
2022-02-22 17:32:29 +00:00
Tao Liu
90d9ae8ca8 feat(squash): decouple the compressor for dracut and dracut-squash
Previously dracut-squash module inherits the compressor
name from dracut, but actually the compressors are totally
different. For dracut, the compressor is zstd/gzip/lzop
cmdline tools, for dracut-squash, the compressor is the
libzstd/libz/liblzo libraries integrated by mksquashfs.

However mksquashfs support less compressors than dracut,
such as bzip2, which is not supported by mksquashfs, so
compressor decoupling seems to be a good idea to handle this.

This patch introduces a new dracut cmdline argument
--squash-compressor, by which the compressor and compressor
specific options can be passed to mksquashfs as
--squash-compressor "lzo -Xalgorithm lzo1x_1_15".

Signed-off-by: Tao Liu <ltao@redhat.com>
2022-02-22 17:32:29 +00:00
Harald Hoyer
631d5f72a2 docs: update NEWS.md and AUTHORS
Signed-off-by: Harald Hoyer <harald@profian.com>
2022-02-18 12:32:53 +01:00
David Disseldorp
acc629abb0 fix(cpio): correct dev_t -> rmajor/rminor mapping
dev_t -> major/minor number mapping is more complicated than the
incorrect major=(dev_t >> 8) minor=(dev_t & 0xff) mapping that we
currently perform. Fix mapping to match Linux / glibc behaviour.

Fixes: https://github.com/dracutdevs/dracut/issues/1695
Reported-by: Ethan Wu <ethanwu10@gmail.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
2022-02-17 19:28:33 +00:00
David Disseldorp
8bd7ddf819 ci(cpio): add test_archive_dev_maj_min
This tests dracut-cpio's handling of rmajor / rminor values compared to
GNU cpio. The test requires root, due to mknod invocation for block
device node creation.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2022-02-17 19:28:33 +00:00
David Disseldorp
80e70f76d9 ci(cpio): add TempWorkDir.create_tmp_mknod helper
This will be used for future device major/minor testing. Convert the
current fifo test to use it.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2022-02-17 19:28:33 +00:00
Thomas Blume
5de6e4d56e fix(dasd_rules): correct udev dasd rules parsing 2022-02-12 08:19:07 +00:00
Thomas Blume
5925266832 fix(zfcp_rules): correct udev zfcp rules parsing 2022-02-12 08:19:07 +00:00
Jóhann B. Guðmundsson
dcaff88ac9 feat(pcsc): introducing the pcsc module 2022-02-08 04:36:00 +00:00
Antonio Alvarez Feijoo
d03fb675d8 fix(bluetooth): make hostonly configuration files optional
Do not fail if any of the expected configuration files don't exist.
2022-02-05 19:52:26 +00:00
Jóhann B. Guðmundsson
34b1dd2e26 fix(bluetooth): dbus configuration path fixes
Add a missing /usr/share path ( fixes #1627 )
Use variable instead of hard path
2022-02-05 19:49:16 +00:00
Henrik Gombos
51ce8893d9 fix(img-lib): install rmdir
rmdir is used in img-lib module.
2022-02-05 13:02:23 +00:00
Jóhann B. Guðmundsson
4753738b62 fix(fido2): add a missing library 2022-02-05 11:49:40 +00:00
Jóhann B. Guðmundsson
c656b612b1 fix(tpm2-tss): add a missing library 2022-02-05 11:49:40 +00:00
Martin Wilck
d754e1c6f0 fix(dracut-functions.sh): ip route parsing
The code for determining local interface and address works
only for peers that are reachable in a single hop.

This is parsed correctly:
192.168.110.1 dev br0 src 192.168.110.160 uid 0 \    cache

But this isn't:
192.168.1.4 via 192.168.110.1 dev br0 src 192.168.110.160 uid 0 \    cache

Fix it.

Fixes: ceca74cc ("dracut-functions: add ip_params_for_remote_addr() helper")
2022-02-04 18:35:33 +00:00
Antonio Alvarez Feijoo
9371dcaba3 fix(fedora.conf.example): rename misspelled variable
There is a typo in the dbussystemconfdir variable.
2022-02-04 13:27:31 +01:00
Renaud Métrich
22a80629b4 fix(dracut): be more robust when using 'set -u'
From bash manpage, FUNCNAME exists only inside functions. When in debug
mode, make sure to use an empty default value as FUNCNAME[0] when
outside of functions.

With bash4 this wasn't an issue, but is with bash5 with hardening option
'set -u' used, as shown in the example below:

Incorrect:

$ bash -u -c 'echo -n ${FUNCNAME[0]}'
bash: line 1: FUNCNAME[0]: unbound variable
$

Correct:

$ bash -u -c 'echo -n ${FUNCNAME[0]-}'
$

This hardening enables sourcing dracut-lib.sh from external utilities
executing in the initramfs such as clevis-luks-askpass, which uses
hardening option 'set -u' internally.
(see Clevis PR https://github.com/latchset/clevis/pull/340)

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2022-02-04 12:24:22 +00:00
Jóhann B. Guðmundsson
c5907f82d8 feat(pkcs11): include the module in the spec file
Adding the module to the spec file
2022-02-02 23:14:00 +00:00
Jóhann B. Guðmundsson
83ea8cf001 feat(pkcs11): introducing the pkcs11 module
This module allows unlocking of an encrypted filesystem using pkcs11.
2022-02-02 23:14:00 +00:00
Jóhann B. Guðmundsson
56f4fb6cb7 feat(crypt): check if pkcs11 module is needed in hostonly mode
In hostonly mode, include the pkcs11 module if any encrypted volumes
are configured to be decrypted using pkcs11.
2022-02-02 23:14:00 +00:00
Antonio Alvarez Feijoo
857b17f090 fix(fips): missing sourcing of dracut-lib
Make sure dracut-lib is sourced inside the fips-noboot script.
2022-02-02 23:02:03 +00:00
Antonio Alvarez Feijoo
e8121bfddd fix(fips): add and remove local variables 2022-02-02 23:02:03 +00:00
Antonio Alvarez Feijoo
7f10c483b6 fix(fips): wrong error message
When /dev/urandom cannot be created, the error message displays /dev/random instead.
2022-02-02 23:02:03 +00:00
Lubomir Rintel
bc4f196f98 fix(dracut-init): unbreak a comment
A dreadful copy & paste or kill-ring-save & yank error, most surely.
2022-02-02 23:00:48 +00:00
Kairui Song
67fc670a88 feat(dracut.sh): add --aggresive-strip option
Dracut currently calls `eu-strip` or `strip` with -g, which only strips
out .debug_* sections. symtab and strtab are kept, but are not required
for runtime, and people will rarely need to do binary level debugging
work in initramfs.

So introduce a --aggresive-strip options, try strip out all sections
that are not required for runtime. This can help reduce the binary size
by a lot.

For example, the size of libc.so is reduced by a lot when stripped
with no option than with -g.

    3014184 libc-2.28.orig.so
    2970920 libc-2.28.strip-g.so
    1460904 libc-2.28.strip.so

Signed-off-by: Kairui Song <kasong@tencent.com>
2022-02-02 22:59:27 +00:00
Antonio Alvarez Feijoo
22e683077a fix(network): wrong test of wicked unit
The test for the wicked service is never met because it
does not have execute permission.
2022-02-02 22:56:23 +00:00
Antonio Alvarez Feijoo
e86397de24 fix(dracut-initramfs-restore.sh): add missing compression options
The unpack fails if the initrd is not compressed or compressed with
bzip2 or LZO.

Fix issue #1463
2022-02-02 22:55:49 +00:00
Renaud Métrich
7ab1d00227 fix(dracut-shutdown): add cleanup handler on failure
It may happen that dracut-shutdown.service fails, for example on timeout
due to very low bandwidth.
In such case, for hardening purposes, a new dracut-shutdown-onfailure.service
unit doing dracut-shutdown.service cleanup needs to execute to make sure
switching root to an incomplete initramfs won't occur later.

See also RHBZ #1924587 (https://bugzilla.redhat.com/show_bug.cgi?id=1924587).
2022-02-02 22:53:31 +00:00
Thomas Blume
d40c49a8df fix(zfcp_rules): remove collect based udev rule creators
The collect binary has been removed, so the rules are broken
2022-02-02 22:52:19 +00:00
Thomas Blume
ebafbd8241 fix(dasd_rules): remove collect based udev rule creators
The collect binary has been removed, so the rules are broken
2022-02-02 22:52:19 +00:00
Kairui Song
35822f3997 fix(memstrack): drop bash runtime requirement
Use nohup instead of disown, and let systemd track the service properly.
This makes the scripts POSIX compatible and bash is no longer needed.

Signed-off-by: Kairui Song <kasong@tencent.com>
2022-02-02 22:51:54 +00:00
Dirk Müller
b3d2dcb71e fix(kernel-modules-extra): handle zstd module extension
The regular expression here is trying to handle various kernel
module compression schemas and was missing the zst extension
which indicates use of zstd.
2022-02-02 22:50:41 +00:00
Adrien Thierry
0e80ff72e0 fix(kernel-modules): add mailbox drivers for arm
Mailbox drivers might be needed by some of the devices used in the
initrd. For example, on the Raspberry Pi 4, the MMC 'sdhci-iproc' driver
depends on 'bcm2835-mailbox'.

Signed-off-by: Adrien Thierry <athierry@redhat.com>
2022-02-02 22:48:59 +00:00
David Teigland
164e5ebb11 fix(lvm): restore setting LVM_MD_PV_ACTIVATED
The 69-dm-lvm-metad.rules udev rule has been removed from
the initrd, because it's been dropped by recent upstream
lvm versions, and it never performed any primary function
within the initrd.  But, it did have the job of setting
LVM_MD_PV_ACTIVATED=1 for active md devices used by PVs.
That step needs to be restored, and is now included in
64-lvm.rules.
2022-02-02 22:48:13 +00:00
David Teigland
1af4674319 feat(lvm): only run lvchange for LV that is seen on devices
Change the command listing LVs from lvscan to lvs, and list
only the LV names that are being activated.  Before attempting
to activate an LV, check that that LV name appears in the
lvs command output.  This avoids wasting time running an
lvchange command that we know will fail.
2022-02-02 22:48:13 +00:00
David Teigland
7ffc5e388b feat(lvm): use generated filter when none is set
Previously, the lvm device filter generated by dracut
would not be used if any lvm.conf file existed in the
initrd.  Change this so that the generated filter will
be used when the included lvm.conf has no filter set.
2022-02-02 22:48:13 +00:00
David Teigland
c0a54f2993 feat(lvm): update lvm command options
Drop checking for options that have been available for
at least ten years.  This simplifies code maintenance.

Add the new --nohints option (when available) to disable
the use of hints which is not useful during startup.
2022-02-02 22:48:13 +00:00
David Teigland
97543cca48 fix(lvm): replace --partial option
The --partial option will activate a linear (or other) LV
without segments for missing devices, which is unlikely to
be useful. The intention was to activate raid LVs in a useful
form while missing devices, which is specified with the option
--activationmode degraded.
2022-02-02 22:48:13 +00:00
David Teigland
50e7466843 revert(lvm): remove 69-dm-lvm-metad.rules
This udev rule runs pvscan to autoactivate VGs, which dracut
does not want to do, and previously disabled by editing the
rule file and commenting out lines.

This also stops /dev/disk/by-id/lvm-pv-uuid-* symlinks from
being created in the initrd.
2022-02-02 22:48:13 +00:00
David Teigland
f6f393f550 revert(lvm): remove lvmetad config changes
Remove support for modifying use_lvmetad and locking_type
settings in lvm.conf for lvm versions 2.2.*.  Recent lvm
versions (2.3.*) do not include lvmetad or locking_type.
This cleanup simplifies code maintenance.

To use the lvm module with older versions (2.2), a user
would need to ensure that lvmetad settings are disabled
in the initrd's lvm.conf rather than relying on the lvm
dracut mode to modify their lvm.conf.
2022-02-02 22:48:13 +00:00
David Teigland
1549d5e898 revert(lvm): remove snapshot feature
The feature of managing lvm snapshots has no known
recent usage.  It is unknown if it works.  The lvm
developers do not wish to maintain or support it.
2022-02-02 22:48:13 +00:00
Martin Wilck
4318533e14 fix(multipath): check if mpathconf is available
Not all distributions utilize and ship the mpathconf utilitiy.
Avoid error messages and systemd complaints about
multipathd-configure.service in this case.
2022-02-02 22:47:25 +00:00
Martin Wilck
6246da400f fix(multipathd.service): drop dependencies on iscsi and iscsid
These dependencies are redundant and will be dropped in upstream
multipath-tools, too.
2022-02-02 22:47:25 +00:00
Martin Wilck
a247d2bc0d fix(multipathd.service): adapt to upstream multipath-tools unit file
In the long run, it's desirable to be able to drop dracut's copy of
multipathd.service and use the upstream one from multipath-tools instead.
This patch makes a step in that direction.

With these changes, the only remaining difference is the support for
rd.multipath=0 and rd_NO_MULTIPATH, which must obviously be ignored in the
upstream unit.

The modifications in this patch are minor and will have no effect in the
initramfs.
2022-02-02 22:47:25 +00:00
Martin Wilck
371b338a5f fix(multipathd.service): remove dependency on systemd-udev-settle
The dependency of multipathd on "udev settle" has recently been removed in
c9689b6 ("multipathd: Remove dependency on systemd-udev-settle.service").

But this dependency has never been necessary in the initramfs environment. It
was only required after switching root, because multipathd would potentially
tear down valid multipath maps after switching from initrd to root FS. This can
happen because dm devices "survive" the root FS switch in the udev data
base (they have the "db_persist" flag set), whereas their component devices
(SCSI etc) do not. But this can only happen after initrd-udevadm-cleanup-db.service
has been run, which happens after initrd processing.

The only dependency that's really needed is that on
systemd-udevd-kernel.socket, because multipathd depends on uevents for
devices being delivered via systemd-udevd.
2022-02-02 22:47:25 +00:00
Martin Wilck
3f2c76bb14 fix(40network): consistent use of "$gw" for gateway
Replace wrong use of $gateway with $gw.

Signed-off-by: Martin Wilck <mwilck@suse.com>
2022-02-02 22:40:07 +00:00
Tony Asleson
fe8df0240a feat(spec): add systemd-integritysetup module
Signed-off-by: Tony Asleson <tasleson@redhat.com>
2022-01-14 14:17:18 +00:00
Tony Asleson
33cf47a608 feat(systemd-integritysetup): introducing the systemd-integritysetup module
Module to allow root FS to be a dm-integrity volume.  Utilizes
functionality added with: https://github.com/systemd/systemd/pull/20902

Information on dm-integrity:
https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/dm-integrity.html

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2022-01-14 14:17:18 +00:00
joshuacov1
4e85874108 fix(base): do not change the provided UUID
During boot dracut parses the provided UUID to lower case and thus starts an
endless loop wating for the devise to appear. The device is actually mapped
correctly by the kernel (which doesn't tweak the UUID) but because we are
waiting for a name with lower charachters the expeted device never appers which
drops us at the emergency shell leaving the system unbootable.
This happens especially on nfts/fat filesystems because technically those don't
have a UUID but searial numbers which are used by the linux tools as UUID.
2022-01-09 18:23:11 +00:00
Laszlo Gombos
813577e2ba fix(dmsquash-live): option to use overlayfs on a block device root
An example kernel command line option for this configuration
root=/dev/sda1 ro rd.live.image rd.live.overlay.overlayfs=1

The change checks if $FSIMG is empty and adds a symlink from
/run/rootfsbase to /run/initramfs/live and changes the place
of the creation of the required mount point directories.
2021-12-11 11:05:02 -05:00
Antonio Alvarez Feijoo
7de9ffc057 fix(dracut.sh): do not ignore invalid config file or dir path
Fix issue #1136
2021-12-11 15:58:50 +00:00
Jóhann B. Guðmundsson
3d8e1ad2ae fix(dracut-initramfs-restore.sh): add missing default paths
Adding missing default paths.
Fixes #1628
2021-12-11 10:58:18 -05:00
Antonio Alvarez Feijoo
d3b5bc17eb fix(network-wicked): multiple path corrections
Since wicked-0.6.67, its dbus configuration files can be installed in /etc or /usr/share.

Also, check if it's using libexec or lib instead of displaying always an error.
2021-12-11 14:32:49 +00:00
David Disseldorp
0af11c5ea5 fix(cpio): write zeros instead of seek for padding and alignment
This is a workaround for GRUB2's Btrfs implementation, which doesn't
correctly handle gaps between extents.

A fix has already been proposed upstream via
https://lists.gnu.org/archive/html/grub-devel/2021-10/msg00206.html

Given that this bug is severe, it makes sense to include this minimal
workaround.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-12-10 08:06:40 -05:00
Laszlo Gombos
3326e4c957 fix(rootfs-block): make the base module dependency explicit
When dracut.sh is called with "--modules rootfs-block",
make sure dracut-lib.sh is installed by making the base module an
explicit dependency.
2021-12-10 08:01:02 -05:00
Cornelius Hoffmann
fec93bb221 fix(systemd-sysusers): use split systemd sysuser configs
Fixes the regression introduced by https://github.com/systemd/systemd/pull/20056
As discussed in #1656 and #1657
2021-12-10 12:59:09 +00:00
Cornelius Hoffmann
dcbe23c14d fix(systemd-sysusers): override systemd-sysusers.service
Fixes a regression with systemd not running units with ConditionNeedsUpdate set in initrds
2021-12-10 12:58:35 +00:00
Antonio Alvarez Feijoo
e3bb1815bb fix(url-lib): improve ca-bundle detection
The current detection routine for openssl-based libcurl assumes that
libcurl has its own hardcoded path to the ca-bundle. Fix the
cases where curl is compiled with:

  --with-ca-fallback --without-ca-path --without-ca-bundle

In this case, we must also grep in OpenSSLs libcrypto.

Other changes:
  - Filter reported but non-existant paths.
  - Strip nul bytes returned by grep.
  - Consider that ca-bundles might use '.pem' instead of '.crt'.

Original-patch-by: Daniel Molkentin <daniel.molkentin@suse.com>
2021-12-10 12:56:14 +00:00
Glenn Morris
d9c3c77437 fix(network-manager): skip non-directories in /sys/class/net
There can be files in this directory, eg "bonding_masters" if a
network bond is in use.
2021-12-10 12:54:32 +00:00
Hans de Goede
14d97a6a28 fix(drm): add privacy screen modules to the initrd
Starting with kernel 5.17 the kernel supports the builtin privacy screens
built into the LCD panel of some new laptop models.

This means that the drm drivers will now return -EPROBE_DEFER from their
probe() method on models with a builtin privacy screen when the privacy
screen provider driver has not been loaded yet.

Make dracut add the privacy screen providing drivers to the initrd
(when necessary for hostmode=yes), so that drm drivers on affected
drivers can probe() successfully.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-12-10 12:40:17 +00:00
Martin Wilck
475497b1bd fix(dracut.sh): check kernel zstd support early
Rather than checking late and falling back to "cat" if the kernel
doesn't support zstd decompression, do this early, and use the
fallback code path.
2021-11-26 17:01:45 +00:00
Martin Wilck
bdac657bf6 fix(dracut.sh): check availability of configured compression
If the configured compression command is unavailable, reset $compress,
and fall back to auto-detection. This allows building an initramfs
even if the configured compression command is not installed. This can
happen e.g. if the distribution uses a preconfigured default, but the
user deinstalled the respective tool.
2021-11-26 17:01:45 +00:00
Martin Wilck
06d47ded67 fix(dracut.sh): inform user about auto-selected compression method
If the compression method is unset, or had to be reset because of
missing dependencies, inform the user what's being used. Also,
replace the printf in the "cat" case with a dwarn.
2021-11-26 17:01:45 +00:00
Martin Wilck
586d3e7664 fix(dracut.sh): drop pointless check for module compression method
There's no need to decompress the kernel modules in dracut, and
"$kcompress" is never referenced. dracut can build the initramfs
just fine if there's no tool for decompressing modules.
2021-11-26 17:01:45 +00:00
Pavel Valena
7938935267 fix(network): add errors and warnings when network interface does not exist
End with error, or show a warning when nonexistent device is specified for network setup like
`ip=10.12.8.12::10.12.255.254:255.255.0.0:xk12:eth0:off`.

I've added the error only for `write-ifcfg.sh`, as I think no such setup should be written.

Resolves: #1712424
2021-11-25 08:58:37 +00:00
Jóhann B. Guðmundsson
5b18b06c7d ci: remove Fedora 33 container
Fedora 33 is scheduled to reach end-of-life (EOL) on 2021-11-30.
No new dracut releases should be ending up in that Fedora release at this point.
2021-11-25 09:23:58 +01:00
José María Fernández
c459373448 fix(resume): resume using /usr/lib64/suspend
Now resume binary is detected in case it is at
/usr/lib64/suspend (like it happens in Gentoo).
2021-11-24 12:17:27 +00:00
José María Fernández
e8c18c9f7f fix(base): add default device choice
when the device is no one of the previous patterns,
substitute the empty default by the input,
to return the same input
2021-11-24 12:17:27 +00:00
Antonio Alvarez Feijoo
d5fd030cc2 feat(crypt): check if fido2 module is needed in hostonly mode
In hostonly mode, include the fido2 module if any encrypted volumes
are configured to be decrypted using a FIDO2 security token.
2021-11-24 12:15:42 +00:00
Antonio Alvarez Feijoo
dc3b976f33 fix(dracut-functions.sh): get block device driver if in a virtual subsystem
dracut does not install the kernel module of the block device that contains
the root filesystem if the following preconditions are met:
- Running in host-only mode.
- Symlinks of all block devices needed to boot the system pointing to virtual
subsystems.

The get_dev_module function uses "udevadm info -a" to get the corresponding
kernel modules of a /sys/class/*/* or /dev/* device. This function is called
in modules.d/90kernel-modules/module-setup.sh to detect if dracut must install
block device drivers in host-only mode. The symlinks in /sys/dev/block/
usually point to "real" devices in /sys/devices/pci*. But, we have come across
some NVMe systems where the kernel creates the symlinks in /sys/dev/block/
pointing to "virtual" devices instead. In this case, udevadm never finds any
"driver" attributes following up the chain of parent devices.
2021-11-24 11:15:25 +01:00
Alexander Wenzel
d364ce8334 fix(mdraid): allow UUID comparison for more than one UUID
If the system provides more than one UUID, the _MD_UUID var
contains a line break after each UUID. Therefore the strstr
function could not find any UUID, caused by the additional
spaces provided to the function.

Furthermore this could lead to a boot interruption, because
the start of a degraded raid1 won't be executed. So, manual
interaction is necessary.
2021-11-24 11:15:11 +01:00
David Disseldorp
8104bf0e83 ci(TEST-63-DRACUT-CPIO): kernel extraction tests for dracut-cpio
dracut-cpio already carries a bunch of unit tests covering compression
and GNU cpio extraction. The purpose of these tests is to exercise the
dracut.sh --enhanced-cpio code-paths as well as kernel cpio archive
extraction.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp
afe4a6dbb7 feat(dracut.sh): add "--enhanced-cpio" option for calling dracut-cpio
The new dracut-cpio binary is capable of performing copy-on-write
optimized initramfs archive creation, but due to the rust dependency
isn't built / installed by default.
This change adds a new "--enhanced-cpio" parameter for dracut which
sees dracut-cpio called for archive creation instead of GNU cpio.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp
51d21c6b37 feat(Makefile): cargo wrapper for dracut-cpio build
If configured with --enable-dracut-cpio, call cargo to build the
dracut-cpio release binary.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp
a9c6704643 feat(cpio): add newc archive creation utility
dracut-cpio is a minimal cpio archive creation utility written in Rust.
It provides support for a minimal set of features needed to create
performant and space-efficient initramfs archives:
- "newc" archive format only
- reproducible; inode numbers, uid/gid and mtime can be explicitly set
- data segment copy-on-write reflinks
  + using Rust io::copy()'s native copy_file_range() support[1]
  + optional archive data segment alignment for optimal reflink use[2]
- hardlink support
- comprehensive tests asserting GNU cpio binary output compatibility

1. Rust io::copy() copy_file_range()
   https://github.com/rust-lang/rust/pull/75272

2. Data segment alignment
   We're bending the newc spec a bit to inject zeros after the file path
   to provide data segment alignment. These zeros are accounted for in
   the namesize, but some applications may only expect a single
   zero-terminator (and 4 byte alignment). GNU cpio and Linux initramfs
   handle this fine as long as PATH_MAX isn't exceeded.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp
94fc50262f feat(cpio): add rust argument parsing library from crosvm
Crosvm's rust argument library is very small and simple, while still
providing helpful functionality. It will be consumed by dracut-cpio in a
subsequent commit.

The unmodified, BSD licensed argument.rs source is lifted as-is from
https://chromium.googlesource.com/chromiumos/platform/crosvm
(release-R92-13982.B b6ae6517aeef9ae1e3a39c55b52f9ac6de8edb31).
The one-line crosvm.rs wrapper is needed to ensure that crosvm::argument
imports continue to work.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp
3a0f423309 ci(TEST-62-SKIPCPIO): add simple skipcpio test
Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp
86bba3d4d4 ci(test): export basedir and testdir as absolute paths
Individual test scripts may change working directory, so relative paths
should be avoided.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp
1c3f79fb0a ci(TEST-60-BONDBRIDGEVLANIFCFG): use toplevel Makefile
Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
Brandon Sloane
5789abcbe0 fix(fips.sh): repsect rd.fips.skipkernel
Support for this flag was broken in 4257798f8a
2021-11-24 11:14:39 +01:00
Dan Horák
0b97790626 fix(resume): check for presence of /sys/power/resume
On platforms where the kernel is built without suspend/resume support we
see "cat: /sys/power/resume: No such file or directory" message when
creating an initrd image. Check for the presence of /sys/power/resume
first before reading it.

Signed-off-by: Dan Horák <dan@danny.cz>
2021-11-24 09:56:27 +00:00
Alexander Wenzel
4855242ce5 fix(man): default value of rd.retry was increased to 180 seconds
The man page still states the old value of 30 seconds,
which does not reflect the current situation of 180 seconds.
2021-11-24 09:55:51 +00:00
Antonio Alvarez Feijoo
049973b708 feat(fido2): introducing the fido2 module
This module allows to unlock an encrypted filesystem using a FIDO2
security token.
2021-11-24 09:54:44 +00:00
Antonio Alvarez Feijoo
5d990a004b feat(crypt): check if tpm2-tss module is needed in hostonly mode
In hostonly mode, include the tpm2-tss module if any encrypted volumes
are configured to be decrypted using the TPM2 device.
2021-11-24 06:49:39 +00:00
Laszlo Gombos
bf8738d31c fix(dmsquash-live): do not install systemd files when systemd is not enabled
Systemd is an optional module for the dmsquash-live module. This scenario
is properly handled for other modules (for example livenet module) but not
for dmsquash-live module.
2021-11-23 05:53:33 +00:00
Thomas Blume
f905c3a72c fix(s390_rules): drop collect installation
/usr/lib/udev/collect has been removed from udev-v246, so remove it
from the initrd too
2021-11-22 18:09:55 +00:00
Laszlo Gombos
75ad269931 fix(dmsquash-live-ntfs): fuse3 no longer requires ulockmgr_server
fuse3 no longer includes ulockmgr_server.
https://github.com/libfuse/libfuse/blob/master/ChangeLog.rst#libfuse-300-2016-12-08
2021-11-22 09:40:05 +00:00
Renaud Métrich
b9ba3c8bb8 fix(shutdown): be robust against forced shutdown
When a forced shutdown is issued through sending a burst of Ctrl-Alt-Del
keys, systemd sends SIGTERM to all processes. This ends up killing
dracut-initramfs-restore as well, preventing the script from detecting
that the unpack of the initramfs is incomplete, which later causes a
crash to happen when "shutdown" tries to execute from the unpacked
initramfs.

This fix makes sure dracut-initramfs-restore remains alive to detect
the unpack failed (because cpio was killed by systemd too).

Refs:
 * https://bugzilla.redhat.com/show_bug.cgi?id=2023665
2021-11-16 18:29:32 +00:00
Frantisek Sumsal
3f56d481e8 test: don't use -cpu max in GH Actions
There appears to be an issue with newer QEMU versions (spotted with Arch
Linux and C9S containers) which causes the respective GH Action to hang
when booting a QEMU VM in combination with the `-cpu max` parameter.

During (a particularly painful) debugging session I once managed to get
some output from such "frozen" machine (using `earlycon` and
`earlyprintk` kernel cmdline options), and in that particular case the
VM died with a trap caused by an invalid opcode.

I couldn't reproduce this locally, only in GH Actions environment with
Arch Linux and C9S containers. Also, so far I haven't found out which
specific CPUID flag causes this, but using the `IvyBridge-v2` feature
set seems to mitigate the issue.
2021-11-15 11:37:22 +00:00
Andrey Sokolov
5c2f72f152 fix(install): segfault on popen error 2021-11-09 07:01:25 +00:00
Peter Robinson
1539845868 fix(90kernel-modules): add isp1760 USB controller
Like the dwc/chipidea controllers the isp1760 can act in either
host or gadget mode so it ends up in it's own directory. Add this
driver into the initrd as it's part of some arm platforms and
is needed to be able to boot off USB storage.

Fixes issue #1619

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2021-10-28 08:52:03 +02:00
Beniamino Galvani
f6e6be245d fix(network-manager): disable tty output if the console is not usable
The network-manager module also writes logs to the console, so that it's easier
to debug network-related boot issues. If systemd can't open the console, the
service fails and network doesn't get configured.

Add a check to disable tty output when the console is not present or not
usable.

https://github.com/coreos/fedora-coreos-tracker/issues/943
2021-10-21 13:38:41 +00:00
Beniamino Galvani
e07b7ad0e7 fix(network-manager): show output on console only with rd.debug enabled
The module should show the output on console only when initrd debugging is
enabled.
2021-10-21 13:38:41 +00:00
Harald Hoyer
51c06d9fea chore: change my email address
Signed-off-by: Harald Hoyer <harald@profian.com>
2021-10-13 09:07:39 +02:00
Renaud Métrich
d502d2a816 feat(systemd): enable support for systemd compiled with ASAN
When systemd is compiled with ASAN library to troubleshoot memory issues
within systemd code, the libasan library expects to have /proc be
available as soon as systemd starts, which isn't the case currently,
causing an assertion to fail, systemd to crash and kernel to panic:

==1==AddressSanitizer CHECK failed: ../../../../libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:75 "((data_.proc_self_maps.len)) > ((0))" (0x0, 0x0)
    <empty stack>

X.XXXXXXX Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[...]
2021-10-12 18:52:06 +02:00
David Disseldorp
96f3177c33 refactor(install): use check_hashmap helper consistently
Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-10-12 13:39:17 +00:00
Peter Robinson
a1287c627f fix(90kernel-modules): add Type-C USB drivers for generic initrd
We need to pull in Type-C USB drivers as they can provide a number of
differnet bits of functionality in early boot including input, display
(altmode DP) and storage so we need to have them available to ensure
functionality attached to those buses/interfaces are available in early
boot.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2021-10-12 13:29:27 +00:00
Laszlo Gombos
e19e38904c fix(dmsquash-live): iso-scan requires rmdir 2021-10-12 13:29:03 +00:00
Harald Hoyer
0c631efb10 fix(dmsquash-live): correct regression introduced with shellcheck changes
`"$opt"` with empty `opt` will give errors for `losetup`.

https://github.com/dracutdevs/dracut/issues/1576

Rename the variable and set the arguments dynamically, if the variable
is set.
2021-10-06 18:08:01 +02:00
David Disseldorp
5c5b73c681 chore(.gitignore): update src and man paths
.gitignore wasn't updated when things were shuffled under src and man
subdirectories.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-10-02 06:57:28 +00:00
Luca BRUNO
9491e59928 fix(multipath): drop ExecStop= setting from service unit
This removes the 'ExecStop=' field from `multipathd.service`.
Sometimes CI runs do encounter a failure related to this
service in initrd, which seems to be stemming from a socket
I/O race between the client and the server on shutdown.
It looks like the client (`multipathd shutdown`) can lose the race,
hit an I/O error, and cause the whole unit to fail (even if the server
managed to shutdown properly already).

Notably, the upstream unit does not have such stop command
as the daemon can already perform a graceful exit through
its signal handler.

As such, this commit partially re-aligns the two units,
trying to sidestep any of the existing races.

Refs:
 * https://github.com/coreos/fedora-coreos-tracker/issues/803
 * https://github.com/opensvc/multipath-tools/blob/0.8.7/multipathd/multipathd.service
2021-09-23 09:45:27 +00:00
David Tardon
10ed204f87 fix(install): extend hwcaps library handling to libraries under glibc-hwcaps/ 2021-09-13 12:26:14 +00:00
Antonio Alvarez Feijoo
591118c56d feat(dracut.sh): check if target kernel has zstd support compiled in
If compression option is zstd, check if target kernel supports it.
Otherwise, do not compress the initramfs image.
2021-09-11 06:44:40 +00:00
Antonio Alvarez Feijoo
768dd59ef0 ci(suse.conf.example): change default compression option for SUSE
Due to an internal company decision, SUSE aims to change the default compression
method of the initramfs image to zstd.
2021-09-11 06:44:40 +00:00
Antonio Alvarez Feijoo
acfd97a943 fix(dracut.sh): change misspelled variable name 2021-09-09 10:14:27 +00:00
Antonio Alvarez Feijoo
f1245b5bc1 fix(dracut.sh): remove wrong $ in loop sequence 2021-09-09 06:43:02 +00:00
Shreenidhi Shedi
3fb8723ce0 fix(skipcpio): calculate and use CPIO_MAGIC_LEN
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-27 17:25:35 +00:00
Shreenidhi Shedi
f6d16b6bbd fix(skipcpio): improve error checking
Some other minor tweaks

Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-27 17:25:35 +00:00
Andre Russ
dfbfd33b24 fix(base): tr needs to be installed 2021-08-25 23:58:12 +00:00
Andre Russ
a93fbc4ae0 fix(crypt-gpg): tr needs to be installed 2021-08-25 23:58:12 +00:00
Charles Rose
655c65e6ce fix(nvmf): validate_ip_conn
Fix how ifname for a given local_address is found.
Fix logic to detect presence of ifname and route.

Signed-off-by: Charles Rose <charles.rose@dell.com>
2021-08-23 20:20:11 +00:00
Alexander Tsoy
4afdcba212 fix(usrmount): do not empty _dev variable
Currently $_dev is always overridden with the value returned by
label_uuid_to_dev(). This results in an empty value if $_dev is a
device path. Fix this by calling label_uuid_to_dev() conditionally.

Bug: https://bugs.gentoo.org/807971
Fixes: d3532978de
2021-08-17 07:48:15 +00:00
Thomas Blume
7374943ae3 fix(iscsi): add support for the new iscsiadm "no-wait" (-W) command
remove connection timeout for iscsi firmware targets serving system root
2021-08-17 07:47:20 +00:00
Pingfan Liu
c86f4d2860 fix(kernel-modules): detect block device's hardware driver
On hostonly mode, the platform driver is not copied blindless. There
should be a way to detect the real hardware driver, which probes a block
device.

/sys/dev/block/major:minor is a symbol link, which points to the real
device, recording the hardware stack. And those info can help to
identify the associated drivers for the hardware stack.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
---
v2 -> v3:
  address shellcheck in dracut-functions.sh
v1 -> v2:
  remove local variable _extra_mod
  shorten subject
2021-08-13 11:36:25 +00:00
Lukas Nykryn
b292ce7295 fix(kernel-modules): add blk_mq_alloc_disk and blk_cleanup_disk to blockfuncs
Since kernel 5-14 those are used by many drivers for example:
xen-blkfront, loop, nbd, pd
2021-08-13 11:27:15 +00:00
Beniamino Galvani
38320fce56 fix(network-manager): write DHCP filename option to dhcpopts file
Anaconda parses the 'filename' variable [1] set in /tmp/net.$netif.dhcpopts to
determine the name of the kickstart file to use.

[1] https://github.com/rhinstaller/anaconda/blob/anaconda-35.21-1/dracut/fetch-kickstart-net.sh#L31-L34
2021-08-10 15:16:48 +00:00
Shreenidhi Shedi
55468a2d40 fix(install): use size_t to avoid -Wsign-compare warning
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-09 17:11:22 +00:00
Shreenidhi Shedi
ef0f848a67 fix(install): improve gettid definition
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-09 17:11:22 +00:00
Shreenidhi Shedi
19537f8943 fix(install): validate return values log.c
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-09 17:11:22 +00:00
Shreenidhi Shedi
b5cf7ec784 fix(install): rectify unused function args in log.c
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-09 17:11:22 +00:00
Shreenidhi Shedi
e2a61595d2 fix(install): use wrapper for asprintf
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-09 17:11:22 +00:00
Kairui Song
5ab18dee99 fix(squash): apply FIPS and libpthread workaround
There are some workarounds in dracut.sh for FIPS/libpthread covering
some hidden lib dependency issues. These workarounds didn't take effect
for the squash loader since the squash loader is installed
independently. So apply these workarounds again.

Also skip the lib detection code, since these extra installed libs
are small, and squash loader contents are dropped after switch root,
won't be an issue to be always installed. And this makes the code
cleaner.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-08-09 17:08:52 +00:00
Beniamino Galvani
07977ee5c5 fix(cms): reload NetworkManager connections
When NetworkManager is running as systemd service, it's not enough to write
connection files; the module should also tell NetworkManager to reload the
connections from disk so that any new connection can be auto-activated.

https://bugzilla.redhat.com/show_bug.cgi?id=1975929
2021-08-09 17:07:50 +00:00
Beniamino Galvani
5ee7e249b8 fix(network-manager): check for nm-initrd-generator in both /usr/{libexec,lib}
Sice commit 22d6863ef1 ("fix(network-manager): cope with distributions not
using `libexec`") nm-initrd-generator can be installed in either /usr/libexec
or /usr/lib. Change other modules to check for the binary in both locations.
2021-08-09 17:07:50 +00:00
Shreenidhi Shedi
74a4179948 fix(install): use unsigned int instead of unsigned
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-07 20:14:03 +00:00
Shreenidhi Shedi
b0bf8187d5 fix(install): reduce cppcheck warnings
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-07 20:14:03 +00:00
Thomas Haller
e509c638e6 fix(network-manager): ensure safe content of /tmp/dhclient."$ifname".dhcpopts
NetworkManager leaves state files behind in "/run/NetworkManager/devices".
These files are in keyfile format (glib's GKeyFile API [1]).

From the statefile, the dracut module writes a .dhcpopts file. And other users
want to parse that file, for example anaconda ([2]). To be fair,
anaconda seems to parse a different file, so I am a bit confused who
uses this file how. In any case, it seems somebody might be tempted to
execute this as a script.

We need to write the .dhcpopts file in a format that is defined and easy
to handle from a shell script. As already previously, this format is
a bash script that sets certain variables. That means, to load the file,
the user could execute it as bash script. But this is dangerous, as the
file contains potentially untrusted data from the network.
Optimally, users still don't trust the .dhcpopts file to be safe for
executing! It would be better if users too try to parse the file
instead of executing it. That is not trivial however because in face
of special characters, as we use bash's `printf '%q'` to escape the values
and parsing bash escaping is not trivial.

Anyway, make sure we properly quote and handle the content so that also
executing is safe. In the best case, there are no special characters
that require escaping, and naive parsing can be done with `sed`.
Otherwise, executing is now also supposed to be safe.

In this case we parse DHCP options from the state file. They are themselves
backslash escaped UTF-8 strings (C escape sequences), which then are stored
via keyfile API. The properly parse them, we would first need to load the file
with GKeyFile (which undoes one level of backslash escaping) and then
use g_str_compress() (to undo the second level). We mimic that with
shell.

[1] b3411d6780/dracut/fetch-kickstart-net.sh (L30)
[2] https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
2021-08-07 19:56:07 +00:00
Beniamino Galvani
c868feb1b1 docs: add a note about other network modules in 'man dracut.cmdline' 2021-08-06 15:59:29 +02:00
Stefan Berger
9da76af8e7 fix(integrity): add support for loading multiple EVM x509 certs
Add support for loading EVM x509 certs from a directory that the user can
specify with the EVMKEYSDIR variable in the evm config file. By default
the additional certs are loaded from /etc/keys/evm.

Support for multiple EVM keys allows the usage in a system of files with
signed metadata from multiple parties.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com>
2021-08-06 13:58:01 +00:00
Mike Gilbert
f649cd10b2 fix(base): do not quote $initargs for switch_root
We want word splitting to occur so that the arguments are passed
separately, and we don't end up passing an empty string if no arguments
are specified.

Bug: https://bugs.gentoo.org/803548
Fixes: 2fabaaa62d
2021-08-06 13:52:19 +00:00
Kairui Song
cbd85597e3 fix(squash): remove tailing '/' when installing ld.so.conf.d
This tailing '/' will result in following error:

dracut-install: ERROR: installing '/etc/ld.so.conf.d/'
dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.kEFQLs/initramfs -d /etc/ld.so.conf.d/

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-08-06 13:41:23 +00:00
Beniamino Galvani
0e5905315e fix(network-manager): include nm-daemon-helper binary
Since version 1.32, NetworkManager launches a tiny external helper to determine
the hostname via reverse DNS resolution through glibc's nss-dns. Include the
binary.
2021-08-06 13:40:56 +00:00
Zoltán Böszörményi
d7acf107f2 fix(base): repair installing dracut-util
inst_binary uses ${dracutsysrootdir} internally to find the source
file.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
2021-07-23 13:11:17 +00:00
Andreas Schwab
3cc9f1c10c fix(kernel-modules): add more modules on RISC-V
Include the same extra modules for ARM also on RISC-V and add drivers/mmc/host
and drivers/spi to the list.
2021-07-21 15:10:00 +00:00
Zbigniew Jędrzejewski-Szmek
a7f5429cb8 fix(dracut-systemd): do not use Requires for vconsole-setup.service
systemd-vconsole-setup.service may fail if the user specifies a missing keymap,
see [1,2,3], or font. This is unfortunate, but the system should not refuse
boot. It is better to continue, possible without the desired font or keymap.
All other systemd services that depend on systemd-vconsole-setup.service do so
without a hard Requires=.

(In particular, systemd-vconsole-setup internally will try to do as much setup
as possible, and will load the font even if it cannot load the keymap and vice
versa.)

[1] https://fedoraproject.org/wiki/Common_F34_bugs#kbd-legacy-media
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1955162
[3] https://bugzilla.redhat.com/show_bug.cgi?id=1955793
2021-07-20 20:53:19 +02:00
Pingfan Liu
dc21638c3f fix(squash): keep ld cache under initdir
When running kdump on PowerPC, the following bug is hit:
[    0.391629] Freeing unused kernel memory: 5568K
[    0.391634] This architecture does not have kernel memory protection.
/bin/sh: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
[    0.392214] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[    0.392214]
[    0.392223] CPU: 6 PID: 1 Comm: init Not tainted 4.18.0-319.el8.ppc64le #1
[    0.392228] Call Trace:
[    0.392234] [c00000000c703c10] [c000000008ecb94c] dump_stack+0xb0/0xf4 (unreliable)
[    0.392243] [c00000000c703c50] [c000000008167324] panic+0x148/0x3c4
[    0.392249] [c00000000c703cf0] [c000000008170474] do_exit+0xcd4/0xd40
[    0.392255] [c00000000c703dc0] [c0000000081705b0] do_group_exit+0x60/0x110
[    0.392261] [c00000000c703e00] [c000000008170684] sys_exit_group+0x24/0x30
[    0.392268] [c00000000c703e20] [c00000000800b408] system_call+0x5c/0x70

This is due to the non-conventional library path:
ldd /bin/bash
        linux-vdso64.so.1 (0x00007fffbdc90000)
        libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007fffbda80000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fffbda50000)
        libc.so.6 => /lib64/glibc-hwcaps/power9/libc-2.28.so (0x00007fffbd830000)
                            ^^^
        /lib64/ld64.so.2 (0x00007fffbdcb0000)

ldd finds the path by libc.so.6 -> /usr/lib64/libc.so.6 ->
/usr/lib64/glibc-hwcaps/power9/libc-2.28.so and cache the result. So
when dracut_install, it only saw
'/usr/lib64/glibc-hwcaps/power9/libc-2.28.so' and blind to
'/usr/lib64/libc.so.6'

In the final kdumpimg, the symlink /usr/lib64/libc.so.6 is not created,
hence ld.so can not find the /usr/lib64/glibc-hwcaps/power9/libc-2.28.so

On the other hand, during the process of building kdumpimg, all of dynamic library info
have been cached in ld.so.cache. Hence this bug can be simplely resolved
by keeping ld cache under $initdir/etc.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
---
v3 -> v4:
  use inst() instead of copy
v2 -> v3:
  fix format by shfmt -s -w modules.d/99squash/module-setup.sh
v1 -> v2:
  cp -r /etc/ld.so* instead of move, since after switch-root, initdir
can not be seen any longer
2021-07-20 12:41:58 +00:00
Zoltán Böszörményi
1beeaf3b71 fix(dracut-install): tweaks to get_real_file()
Fix potential memory leaks in two locations and use
_exit(EXIT_FAILURE) if asprintf(&abspath, ...) fails.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
2021-07-19 19:39:57 +00:00
Coiby Xu
6c71ba4121 fix(qeth_rules): check the existence of /sys/devices/qeth/*/online beforehand
On s390x KVM machines, the follow errors occurred,
    $ kdumpctl rebuild
    kdump: Rebuilding /boot/initramfs-4.18.0-321.el8.s390xkdump.img
    /usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory
    /usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory

because s390x KVM uses virtual devices and /sys/devices/qeth/*/online
doesn't exist. Eliminate this error by checking the existence
beforehand.
2021-07-14 12:46:23 +00:00
Dusty Mabe
a0f12fb6a0 fix(network-manager): don't pull in systemd-udev-settle
We get a nice warning about it being deprecated:

```
systemd-udev-settle.service is deprecated. Please fix nm-initrd.service not to pull it in.
```

The service is deprecated because its purpose was to wait for the
discovery of all hardware, but it didn't guarantee that (see the
systemd-udev-settle man page).

NM now runs as an independent service and can deal with devices showing
up at any point, but it does need udev to be started. For now just
Want/After systemd-udev-trigger.
2021-07-01 10:34:37 +02:00
Masahiro Matsuya
ec50cec3bd fix: SC2046: Quote this to prevent word splitting 2021-06-29 22:03:38 +00:00
Masahiro Matsuya
acb18869e9 fix: SC2086: Double quote to prevent globbing and word splitting 2021-06-29 22:03:38 +00:00
Masahiro Matsuya
2f091b1707 fix(url-lib): make pre-pivot hook separetely per nfs mount 2021-06-29 22:03:38 +00:00
Tomasz Paweł Gajc
f806a628aa fix(mksh): requires printf 2021-06-30 00:01:41 +02:00
LinkTed
6610093698 fix(crypt-gpg): execute --card-status on each try
If the gpg card is not inserted before the --card-status command is
executed then the public key is not linked with the card. Therefore,
the LUKS partition cannot be decrypted. To solve this, the
--card--status command is executed on each try.
2021-06-29 22:00:03 +00:00
Kairui Song
c7fbc0c890 fix(dracut.sh): handle symlinks appropriately while using '-i' option
[[ -d $symlink ]] will return true if the symlink points to a directory.
So the symlink will not be copied, instead a directory is created with
the symlink name and the content is copied.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-06-29 09:53:19 +02:00
Hari Bathini
f1138012c9 fix(dracut.sh): handle '-i' option to include files beginning with '.'
While including a directory using '--include' option, the file and
subdirectory names that begin with '.' are not included. Also, dracut
throws a warning message when a subdirectory is empty or only has
files or subdirectories that begin with '.'.

For example, while trying to include /tmpdata directory with the
below tree:

  # tree -a /tmpdata
  /tmpdata
  ├── .anothertestdir
  ├── testdir
  │   └── .testsubdir
  └── .testfile

dracut throws the below warning message:

  # dracut --include /tmpdata /root
  cp: cannot stat '/tmpdata/testdir/*': No such file or directory
  #

and this is how the included /tmpdata directory tree looks:

  # tree -a root
  root
  └── testdir

No file or directory beginning with '.' is included & also, copying
/tmpdata/testdir reported "No such file or directory" warning. Using
'.' instead of '*' in the below command will fix the warning whether
the directory being copied is empty or only has files or directories
that begin with dot:

  $DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/*

Also, enable 'dotglob' temporarily to include files and directories
beginning with a `.' in the results of pathname expansion of source
directory being included.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
2021-06-29 09:53:19 +02:00
Dusty Mabe
a97d2cedcf fix(network-manager): support teaming under NM+systemd
Previously when NM was run without dbus then teaming would come
up appropriately [1], but now that dbus exists we also need to
include some supporting infrastructure to allow for it to work
again.

[1] d689380cfc
2021-06-28 11:30:34 +00:00
Kairui Song
a2b6be4479 fix(squash): create relative symlinks
Don't use absolute path, or it may resolve to wrong files after unpack
the initramfs to a sub path on a running system.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-06-28 11:25:58 +00:00
Jonathan Lebon
78557f05a6 fix(fips): handle s390x OSTree systems
On s390x, the `BOOT_IMAGE` karg injected by the bootloader is not a path
to the kernel image, but rather an integer describing the index of the
menu entry selected. Because of the way the s390x bootloader works,
there is no information retained about e.g. the path of the kernel that
was loaded.

This causes issues for the FIPS code which assumes that `BOOT_IMAGE` is
a path to the kernel image to derive the HMAC path. In non-OSTree
systems, this ends up working anyway, because the kernel is located at
the root of the boot partition.  In OSTree systems, this is not the
case. However, OSTree systems use BLS configs, and they are named in
reverse order of precedence (i.e. menu ordering). So from the
`BOOT_IMAGE` integer, we can figure out which BLS entry was selected.

Add some code to do just this on s390x. This isn't completely foolproof,
because it presumes that (1) BLS configs were used to populate the
bootloader (and that they were exactly in the same state they currently
are when `zipl` was run), and (2) there are no other menu entries
originating from outside the BLS configs. However, if these assumptions
are wrong we would simply fail the boot, which is currently what is
happening anyway.

See also:
https://github.com/openshift/os/pull/546
https://github.com/ibm-s390-linux/s390-tools/issues/78

Tested-by: Muhammad Adeel <muhammad.adeel@ibm.com>
2021-06-28 11:25:20 +00:00
David Tardon
2e3c5444d2 fix(multipath): get config. dir from configuration 2021-06-28 13:21:33 +02:00
Frantisek Sumsal
6a44426162 fix(install): add a missing ret value assignment
Spotted when reconfiguring LGTM for RHEL 9 dracut repo.
2021-06-28 11:20:21 +00:00
Dusty Mabe
a97d6e2b13 fix(network-manager): pull in network.target in nm-initrd.service
Otherwise units with `After=network.target` won't have any effect.
2021-06-28 10:58:10 +00:00
Kairui Song
563f543424 feat(squash): install umount util
Also install umount binary, make it possible to cleanup squash overlay
mounts. This is useful for other tools reusing the dracut initramfs built
with squash module enabled.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-06-25 21:11:58 +02:00
Matthias Berndt
8b17105bed fix(tpm2-tss): typo in depends()
There is no systemd-udev module, only systemd-udevd
2021-06-22 15:32:28 +02:00
lapseofreason
e0abf88a15 fix(crypt): remove quotes from cryptsetupopts
Fixes #1528.
2021-06-08 19:28:45 +00:00
Harald Hoyer
86bf2533d7 docs: update NEWS.md and AUTHORS 2021-05-27 14:34:19 +02:00
Tomasz Paweł Gajc
12beeac741 fix(fs-lib): install fsck utilities 2021-05-27 09:13:04 +02:00
Stefan Berger
b12d91c431 fix(integrity): require ALLOW_METADATA_WRITES to come from EVM config file
Upcoming versions of EVM will not require the ALLOW_METADATA_WRITES anymore,
therefore we remove it from the script and require it to be set in the EVM
config file variable EVM_ACTIVATION_BITS for those versions that need it.

Patch 9 in this patch set deprecates the EVM_ALLOW_METADATA_WRITES flag:
https://lore.kernel.org/linux-integrity/20210514152753.982958-1-roberto.sassu@huawei.com/

Suggested-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-05-26 17:11:07 +02:00
Marcos Mello
5eb24aa21d fix(install): configure logging earlier
There are log_error() and log_debug() calls in parse_argv().
2021-05-26 09:22:09 +02:00
Jóhann B. Guðmundsson
7d205598c6 fix(warpclock): minor cleanups
- Removing shell mode lines
- Remove uncessary file requirements
- Remove hard coded path to binary
- Add missing license header
- Document sections
- refactor install section
2021-05-25 14:00:52 +02:00
Jóhann B. Guðmundsson
f4ea5f8734 fix(dash): minor cleanups
- Remove hard coded path to binary
- Add missing license header
- Document sections
- refactor install section
2021-05-25 11:59:08 +00:00
Jóhann B. Guðmundsson
6c673298f3 fix(mksh): minor cleanups
- Remove hard coded path to binary
- Add missing license header
- Document sections
- refactor install section
2021-05-25 11:58:43 +00:00
Marcos Mello
4cb086fa29 feat(install): add default value for --firmwaredirs
If not specified, use /lib/firmware.
2021-05-25 11:48:59 +02:00
Harald Hoyer
a277a5fc7a fix(dracut-functions): get_maj_min without get_maj_min_cache_file set
If `get_maj_min_cache_file` is unset `get_maj_min()` would error out.

Fix it to work without a cache file set.
2021-05-21 14:17:07 +02:00
Harald Hoyer
0a6007bf4f fix(dracut): pipe hardlink output to dinfo
Otherwise the output is cluttered with:
```
Mode:           real
Files:          1364
Linked:         5 files
Compared:       0 xattrs
Compared:       384 files
Saved:          12.84 KiB
Duration:       0.052674 seconds
```
2021-05-21 14:16:43 +02:00
Marcos Mello
c1ab36139d fix(install): sane default --kerneldir
If --kerneldir is not specified, use /lib/modules/$(uname -r).

Fixes #1505
2021-05-20 23:56:40 +00:00
Jóhann B. Guðmundsson
9355cb8ea5 fix(bash): minor cleanups
- Remove hard coded path to binary
- Add missing license header
- Document sections
- refactor install section
2021-05-19 10:29:34 +00:00
Kairui Song
636d6df313 fix(squash): don't mount the mount points if already mounted
It is possible that user setup some early mount in the rootfs even
earlier, so just be more robust and cover that case too.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-05-19 08:46:34 +00:00
Harald Hoyer
fa63c9be13 ci: add shfmt to Fedora containers 2021-05-18 11:33:27 +02:00
Harald Hoyer
148e420be5 fix(base): add missing str_replace to dracut-dev-lib.sh
```
dracut-dev-lib.sh: line 92: str_replace: command not found
dracut-dev-lib.sh: line 98: /var/tmp/dracut.sabKZg/initramfs/initqueue/finished/devexists-.sh: No such file or directory
dracut-dev-lib.sh: line 83: /var/tmp/dracut.sabKZg/initramfs/emergency/80-.sh: No such file or directory
```
2021-05-18 11:31:16 +02:00
Harald Hoyer
7275c6f6a0 feat(dracut.sh): detect running in a container
Don't try to `mknod` by setting DRACUT_NO_MKNOD.
Don't try to `cp` extended attributrs by setting DRACUT_NO_XATTR.
2021-05-17 16:23:00 +02:00
Harald Hoyer
c08bc8109d fix(base): split out dracut-dev-lib.sh
To share the `wait_for_dev` function and use it without side effects on
install time, split out the needed functions in an extra library.
2021-05-17 16:22:49 +02:00
Lars Wendler
b9b6f0ee5b fix(dracut-util): print error message with trailing newline
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
2021-05-14 15:48:32 +00:00
Jóhann B. Guðmundsson
f634448b29 fix(packit): downstream has renamed the master branch to main 2021-05-14 15:50:38 +02:00
Harald Hoyer
53337dfdc3 docs: update NEWS.md and AUTHORS 2021-05-14 15:21:11 +02:00
Harald Hoyer
b2cf61d97f ci: run the integration tests on more distributions
Add OpenSuse and Arch Linux to limited tests.

Only run the full tests against the latest stable Fedora version
to reduce the workload.

Also remove the `hung_task_panic=1` on the kernel command line, as qemu
tends to be really slow in non-kvm mode.
2021-05-14 13:08:07 +02:00
Harald Hoyer
12d0213885 ci: create a fedora rawhide container
Remove Fedora 34 for now, as it is fedora:latest
2021-05-14 12:39:40 +02:00
Jóhann B. Guðmundsson
fc88af5413 feat(systemd-sysext): introducing the systemd-sysext module
Introducing the systemd-sysext module.
2021-05-14 11:35:34 +02:00
Harald Hoyer
5a04bd2dd3 docs: document testing with containers 2021-05-14 08:35:39 +02:00
Harald Hoyer
de0c0872fc fix(dracut): prevent symbolic links containing //
Results in `usr/lib64 -> ..//usr/lib` for Arch Linux otherwise.
2021-05-14 08:35:30 +02:00
Harald Hoyer
22d6863ef1 fix(network-manager): cope with distributions not using libexec 2021-05-14 08:35:22 +02:00
Harald Hoyer
3ad3b3a40d fix: cope with distributions with /usr/etc files 2021-05-14 08:35:09 +02:00
Harald Hoyer
6209edeb5c fix(nbd): assume nbd version >= 3.8
This reduces the quirks.
2021-05-14 08:34:59 +02:00
Harald Hoyer
66b920c651 fix(iscsi): replace sed call with bash internals
This removes a fork/exec and additionally gives more information in debug logs.
2021-05-14 08:34:48 +02:00
Harald Hoyer
8b2afb08ba fix: make testsuite pass on OpenSuse and Arch
This removes some hard assumptions about the file system layout.

It also hardens the tests with network interface renaming rules and
guards.
2021-05-14 08:34:38 +02:00
Harald Hoyer
44fd1c1355 fix(crypt-gpg): cope with different scdaemon location
On Arch things are different for some reason.
2021-05-14 08:34:27 +02:00
Mikhail Novosyolov
5f6be51595 fix(url-lib): fix passing args
Fixes: 8e84fa726 ("fix(url-lib): shellcheck for modules.d/45url-lib")

Behaviour introduced by that commit made the following to be run:
curl "--globoff --location --retry 3 --fail --show-error" http://192.168.1.173:8000/test.ks
instead of:
curl --globoff --location --retry 3 --fail --show-error http://192.168.1.173:8000/test.ks

This broke downloading kickstart file in anaconda-dracut.
2021-05-14 08:33:22 +02:00
Jóhann B. Guðmundsson
61f4564358 fix: adding crc32c for ext3
Noticed that ext3 is still being used in the wild so let's add it to the crc32c list
so downstream does not have to carry a patch for it.
2021-05-14 08:18:40 +02:00
Harald Hoyer
805686930b ci: ensure pigz is installed in the CI containers
pigz speeds up things considerably. Although pigz is already installed
by default, explicitely adding it makes sure, it will not disappear
unnoticed.
2021-05-12 15:48:53 +02:00
Harald Hoyer
e0c0791594 ci: add cpio and pigz to arch container 2021-05-12 15:26:07 +02:00
Harald Hoyer
d24e67e24d ci: really, really cleanup the arch container 2021-05-12 14:59:42 +02:00
Harald Hoyer
886b04abfe ci: cleanup the arch container 2021-05-12 14:34:31 +02:00
Harald Hoyer
c7d8334d26 ci: don't use rpm to determine the kernel version
for `/etc/profile.d/dracut-test.sh`
2021-05-12 14:21:00 +02:00
Harald Hoyer
3c67644fe6 ci: build container images and push to ghcr.io 2021-05-12 13:26:06 +02:00
Jóhann B. Guðmundsson
5c94cf41e8 fix: deprecate gummiboot
Gummiboot was merged into systemd and official became systemd-boot in 2015 ( 6 years ago )
and no longer was being maintained as Gummiboot from that point.

It's safe to say distribution should have migrated to sd-boot by now so let's deprecate
it.
2021-05-11 17:13:09 +02:00
Jaroslav Jindrak
d1a36d3d80 fix(install): handle $LIB in ldd output parsing
The ldd output can contain the variable $LIB, which is a documented feature of
ldd. In a previous commit [0], dracut-install received support for this
variable, but that was later reverted [1] due to issues [2][3] on Gentoo ARM64.

The part before '=>' does not necessarily refer to an existing file (e.g. due
to the usage of $LIB) and thus [1] could be seen as a regression to anyone
that uses this ldd feature. This PR combines both cases together and whenever
it find a '$' character (i.e. a variable) on the left side of the '=>' symbol,
it uses the right hand path (and thus uses evaluation done by ldd), otherwise
falls back to the behavior set by [1].

Reproducer that was presented to me:

$ grep "ibz.so" /etc/ld.so.preload || cat << EOF >> /etc/ld.so.preload
/\$LIB/libz.so.1.2.11
EOF
$ mkdir -p /var/tmp/dracut.xitk6p/initramfs
$ strace /usr/lib/dracut/dracut-install -D /var/tmp/dracut.xitk6p/initramfs -l /bin/bash 2>&1|grep ibz
$ rm -rf /var/tmp/dracut.xitk6p/

[0] 45404a2
[1] 6d886bb
[2] #471
[3] https://bugs.gentoo.org/667752
2021-05-10 15:55:41 +02:00
Jóhann B. Guðmundsson
3697891b75 feat(systemd-journald): introducing the systemd-journald module 2021-05-06 16:59:38 +02:00
Jóhann B. Guðmundsson
0eca191405 chore(tree): move html files to the dosc directory
Moving the html files into the docs directory.
2021-05-06 16:59:14 +02:00
Jóhann B. Guðmundsson
3420a70dee chore(install): move install to src directory
Moving install to the src directory
2021-05-06 16:25:32 +02:00
Jóhann B. Guðmundsson
215365441e feat(systemd-rfkill): introducing the systemd-rfkill module
Introducing the systemd-rfkill module
2021-05-06 15:50:15 +02:00
Jóhann B. Guðmundsson
563c434ecb feat(systemd-ldconfig): introducing the systemd-ldconfig module
Introducing the systemd-ldconfig module
2021-05-06 15:49:48 +02:00
Jóhann B. Guðmundsson
8849dd8d1a fix: add a missing tmpfilesconfdir global variable
Adding a missing tmpfilesconfdir global variable
2021-05-06 15:49:18 +02:00
Jóhann B. Guðmundsson
2b61be32b8 feat(systemd-tmpfiles): introducing the systemd-tmpfiles module
Introducing the systemd-tmpfiles module
2021-05-06 15:49:18 +02:00
Jóhann B. Guðmundsson
9ffe2e4c4b refactor(systemd-networkd): cosmetic move to 01
Moving systemd-networkd to 01 systemd namespace to keep everything in
order.
2021-05-06 15:48:13 +02:00
Harald Hoyer
6feaaabc22 fix(base): suppress calls to getarg in build phase
Setting `DEBUG_MEM_LEVEL` in the build phase prevents
`setmemdebug()` to call `getargnum`, which would use `dracut-getarg`
in the initrd runtime phase.

No more:

```
modules.d/99base/dracut-lib.sh: line 217: dracut-getarg: command not found
```
2021-05-06 10:39:34 +02:00
Renaud Métrich
c3bb9d18dc fix(dracut-functions): implement a cache for get_maj_min
On systems with a large number of devices, usually multipath devices,
dracut can spend a lot of time stat'ing the devices to collect the
major/minor numbers, leading to huge slowness rebuilding the initramfs
when stat'ing devices is slow (seen with oracleasm file systems in
particular).
This commit implements a basic cache stored in a file under
DRACUT_TMPDIR storing the major:minor corresponding to the specified
device.

Reproducer: create N loopback devices used as a LVM extension to volume
group hosting the root file system

  # LVMVG="rhel"
  # NDEVICES=200
  # mkdir devices; for i in $(seq 1 $NDEVICES); do
    truncate -s 10m devices/$i; losetup loop$i devices/$i
  done
  # vgextend $LVMVG $(/bin/ls -1 /dev/loop[0-9]*)

With standard code (tested with RHEL8.3 dracut):

  # dracut -f --debug /tmp/initramfs.img $(uname -r) >/tmp/debug 2>&1
  # grep -c "stat -L -c" /tmp/debug
  2440

With this code:

  # dracut -f --debug /tmp/initramfs.img $(uname -r) >/tmp/debug_optim 2>&1
  # grep -c "stat -L -c" /tmp/debug_optim
  205

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2021-05-06 09:14:10 +02:00
David Tardon
543b8014fc fix(fips): add dh and ecdh ciphers 2021-05-05 16:24:18 +02:00
Harald Hoyer
909961d048 fix: shellcheck 0.7.2
github action `luizm/action-sh-checker@v0.2.2` uses `shellcheck-0.7.2`,
which detects more non-posix shell code and complains accordingly.
2021-05-05 14:55:30 +02:00
Harald Hoyer
0dc87f7b9e docs: install which in Arch container 2021-05-04 18:39:31 +02:00
Mikhail Novosyolov
ce9af251af feat: support ZSTD-compressed kernel modules
Modern Linux kernels support zstd-compressed modules, which was added
by commit 73f3d1b48f50 ("lib: Add zstd modules").

Commit c3d7ef377eb ("kbuild: add support for zstd compressed modules")
added support of compressing modules with zstd to kernel Makefiles.

libkmod >= 28 built with libzstd is also required.
2021-05-04 15:55:19 +00:00
Harald Hoyer
4a76c187d0 docs: document how to run the test suite in podman on Fedora and Arch 2021-05-04 16:34:10 +02:00
Harald Hoyer
373eadaa9c style: make indent and let shfmt fail again
The bump of removed the `-d` option for `shfmt`. Readd it until upstream
is fixed.

See also:
https://github.com/luizm/action-sh-checker/issues/44
2021-05-04 15:39:55 +02:00
Jóhann B. Guðmundsson
0620677238 chore(tree): move package build files in their own directory
Creating pkgbuild directory and move relevant files there.
2021-05-04 15:39:34 +02:00
Harald Hoyer
82e780af25 test(NFS): let it run in an Arch container
`dhclient` on Arch does not understand the `--timeout` parameter.

`/etc/virc` does not need to be installed in tests. This is a debugging
leftover.
2021-05-04 13:47:03 +02:00
Harald Hoyer
7f63374713 fix: include modules.builtin.alias in the initramfs
Let's also resolve the compiled in aliases to builtin modules.
2021-05-04 13:34:16 +02:00
Harald Hoyer
ece67c7e2d test(FULL SYSTEMD): try pacman rather than rpm on Arch
If there is no `rpm`, try `pacman` to get a full list of systemd files
to install into the real test root.
2021-05-04 13:23:56 +02:00
Harald Hoyer
50a01dd4b2 fix: install all depmod relevant configuration files
This is important for running `depmod` in the initrd.
2021-05-04 13:15:49 +02:00
Harald Hoyer
87c4c17850 fix: add modules.builtin.modinfo to the initramfs
This solves all issues, where builtin kernel modules are not recognized
as such.

Fixes: https://github.com/dracutdevs/dracut/issues/1146
Fixes: https://github.com/dracutdevs/dracut/issues/1099
2021-05-04 11:45:53 +02:00
Harald Hoyer
10f9e569c5 fix(crypt): install all crypto modules in the generic initrd
Just install all `=crypto` drivers in the generic initramfs, because who
are we to decide which combinations are allowed in current and future
`cryptsetup`. We only could install blacklist filter in the future, if
there are modules, which are definetely not used and are huge in size.
2021-05-04 11:25:55 +02:00
Harald Hoyer
33e27fab59 feat: also restore the initramfs from /lib/modules
Fallback to /lib/modules/$(uname -r)/initrd, if present and all other
files don't exist.
2021-05-04 11:25:32 +02:00
Harald Hoyer
625f11dca7 chore: skip rpmbuild, if there is no rpmbuild installed
On non-rpm distributions this does not make sense.
2021-05-04 10:39:41 +02:00
Harald Hoyer
44ca04c843 chore: fix indent-c path for src directory 2021-05-04 10:39:28 +02:00
Harald Hoyer
060e1f192e test: use uname -m to determine qemu-system
E.g. `uname -i` does not work in Arch Linux containers.
2021-05-04 10:14:08 +02:00
Jóhann B. Guðmundsson
7359ba8aca fix(systemd-sysusers): misc fixes and cleanup
- module-setup.sh file permission corrected
- comment section cleaned up
- removal of dependency on systemd module
- added inclution of the unit into the sysinit target
- removal of systemctl enablement of type unit
2021-05-04 10:05:25 +02:00
Jóhann B. Guðmundsson
9f9bf8a178 chore(tree): move src into their own src directory
Moving sources into their src directory
2021-05-04 10:02:04 +02:00
Jóhann B. Guðmundsson
a02d17f7af chore(tree): move tools into their own directory
Moving tools into their own directory
2021-05-04 10:01:14 +02:00
Jóhann B. Guðmundsson
a876c27085 chore(tree): move docs into the docs directory
Consolidating all the projects documentation into the docs
directory with the exception of news and readme.
2021-05-04 09:31:11 +02:00
Jóhann B. Guðmundsson
49717458e8 chore(tree): move kernel install files into its own directory
Move kernel install files into it's own directory within the tree.
2021-05-04 09:24:16 +02:00
Jóhann B. Guðmundsson
e5ac28a5be chore(tree): move man pages into a man directory
Moving man pages into it's own man directory within the tree
2021-05-04 09:23:51 +02:00
Jóhann B. Guðmundsson
b544bd6bfa chore(tree): move shell completion into a directory
Moving shell completion into it's own directory for a more organized and
cleaner tree.
2021-05-04 09:22:22 +02:00
Jóhann B. Guðmundsson
86b756346a fix(mdraid): remove dependency statements
mdadm 4.1 was released 2 years ago so it's safe to assume
that everyone are on 4.1.X branch now...
2021-05-03 13:44:29 +02:00
Jóhann B. Guðmundsson
12bef83cda fix(systemd-resolved): remove nss libraries
Removing inclution of nss libraries since they are part of
the systemd module now.
2021-05-03 10:16:48 +02:00
Jóhann B. Guðmundsson
b3bbf5fb6a fix(systemd): include all nss libraries
Include all nss libraries so other modules dont have to.
2021-05-03 10:16:22 +02:00
Jóhann B. Guðmundsson
562cb77b5a fix(systemd-udevd): add udev id program files
Adding missing udev id program files
2021-05-03 10:14:37 +02:00
Stefan Berger
4bdd7eb23a fix(integrity): properly set up EVM when using an x509 cert
The current EVM script does not handle the EVM setup properly when X509
certificates are involved. In this patch we extend the setup and add
the necessary flags for support of EVM activation that include
x509 certificates, possibly in conjunction with an HMAC key. We also
first try activating EVM for x509 certificates using
EVM_ALLOW_METADATA_WRITES for newer kernels, then without it for older
ones that did not support this flag.

We add support for additional EVM activation bits to be set, such
as EVM_SETUP_COMPLETE (0x80000000) via the config file and
EVM_ACTIVATION_BITS variable.

To avoid error messages related to unloading the HMAC key if none is
used, only attempt to unload the HMAC key if one was actually set.

We add documentation about the variables that can be set in the EVM
config file.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Cc: Roberto Sassu <roberto.sassu@huawei.com>
2021-05-03 08:13:48 +00:00
Jóhann B. Guðmundsson
8f99fadabe fix(tpm2-tss): add tpm2 requirement 2021-05-03 10:08:51 +02:00
Jóhann B. Guðmundsson
8743b07356 feat(tpm2-tss): introducing the tpm2-tss module
Introducing the tpm2-tss module
2021-05-03 10:08:51 +02:00
Jóhann B. Guðmundsson
69f4e7cdc3 fix(udev-rules): remove sourcing of network link files
Removing sourcing of network link files from the udev-rules module.
What always should be included should be placed in the systemd-network
module and other modules that provide/require spesific link files
should add them, themselves via their relevant include section.
2021-05-03 10:07:48 +02:00
Jóhann B. Guðmundsson
fd883a58d1 fix(systemd-udev): use global vars instead of fixed path 2021-04-30 10:18:02 +02:00
Harald Hoyer
851a801178 ci: switch to action-sh-checker v0.2.0
See also:
https://github.com/luizm/action-sh-checker/pull/40#issuecomment-829260125
2021-04-29 16:09:02 +02:00
Harald Hoyer
1ffbcadad4 ci: remove label cron job
With the event called pull_request_target added to GitHub Actions, the
cron job can be removed.

See:
https://www.jclem.net/posts/labeling-prs-on-public-github-repositories
2021-04-29 14:57:44 +02:00
Jóhann B. Guðmundsson
f35d479d2b fix(dracut): adding missing globalvars for udev
Adding missing global variables for udev
udevconfdir --> /etc/udev
udevrulesdir --> /usr/lib/udev/rules.d
udevrulesconfdir --> /etc/udev/rules.d
2021-04-29 14:39:51 +02:00
Jóhann B. Guðmundsson
3534789cc4 feat(systemd-udevd): introducing the systemd-udevd module
Introducing the systemd-udevd module
2021-04-29 14:39:21 +02:00
Jóhann B. Guðmundsson
57eefcf705 fix(network): use wicked unit instead of find_binary
dracut-install triggers "ERROR: installing '/usr/lib/wicked/bin/*'"
when find_binary is being used to determine if wicked is installed
so let's just check for the wicked type service unit instead.
2021-04-28 13:21:57 +02:00
Harald Hoyer
3c244c7ca3 fix(multipath): stop multipath before udev db cleanup
All device-mapper based devices, including device-mapper-multipath,
do reuse the udev db from the initramfs after switching to the root fs.

Therefore device-mapper devices have to be correctly initialized before
the udev daemon is stopped, to have the correct entries in the udev db.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1949076
2021-04-28 13:19:33 +02:00
Jóhann B. Guðmundsson
abfd547a85 fix(network-legacy): add missing options to dhclient.conf
Adding the following commonly used options to dhclient.conf
- netbios-name-servers
- netbios-scope
- ntp-servers
- dhcp6.domain-search
- dhcp6.fqdn
- dhcp6.name-servers
- dhcp6.sntp-servers
2021-04-28 09:03:48 +02:00
Jóhann B. Guðmundsson
ba92d1fcad fix(systemd-verity): incorrect reference to cryptsetup target
Incorrect include of remote-cryptsetup.target in hostonly.
Corrected to point to remote-veritysetup.target
2021-04-27 15:05:12 +02:00
Jóhann B. Guðmundsson
0267f3c355 fix(systemd-verity): re-naming module to veritysetup
Renaming the module from systemd-verity to systemd-veritysetup to be inline
with the systemd-cryptsetup module.
2021-04-27 15:05:12 +02:00
Jóhann B. Guðmundsson
3d4dea58f9 feat(systemd-verity): introducing the systemd-verity module
Introducing the systemd-verity module.
2021-04-27 10:32:24 +02:00
Harald Hoyer
ec18a3eb83 ci: reorder the tests 2021-04-26 17:31:54 +02:00
Harald Hoyer
bb6770f1a4 fix(iscsi): add iscsid.service requirements
Since Fedora 34, iscsid.service requires:
- iscsi-init.service
- iscsi-shutdown.service
- a non-empty /var/lib/iscsi/nodes/.dracut
2021-04-26 15:34:24 +02:00
Harald Hoyer
2c5bb67d83 test(ISCSI): fix the watchdog loop
Test for `pidof tgtd` and not the shell background jobs.
2021-04-26 14:13:41 +02:00
Kairui Song
3fdc734a5c fix: search for btrfs devices from actual mount poiont
Currently when dracut search for btrfs device used for initramfs, it
assumes the mount points passed in with "--mount" are all mounted with
given mount path. If user want the device to be mounted to a different
location in initramfs, this will not be true.

eg. with "--mount '/dev/mapper/vol /sysroot btrfs rw,relatime,subvolid=256,subvol=/root'"
and having '/dev/mapper/vol' currently mounted on '/', will raise an
error:
    ERROR: cannot access '/sysroot': No such file or directory

So search for actual mount point of given device.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-04-26 13:41:15 +02:00
Harald Hoyer
b92af86bd5 test: don't fail on modprobe btrfs in create-root.sh 2021-04-26 13:13:59 +02:00
Harald Hoyer
f5721c5921 ci: run all Fedora CI in a matrix
Also automatically cancel it, if the PR is updated
2021-04-26 12:48:27 +02:00
Harald Hoyer
0eb87d7810 fix(iscsi): only rely on socket activiation
Only rely on socket activation. This speeds up in case iscsi isn't used
and also prevents failures, where iscsiuio stopping somehow disables
iscsi.
2021-04-26 11:12:31 +02:00
Jóhann B. Guðmundsson
5eb736103d feat(systemd-initrd): add initrd-usr-fs.target
Adding a new systemd initrd-usr-fs.target to the systemd-initrd module
2021-04-23 11:19:58 +02:00
Jóhann B. Guðmundsson
aaea54c732 fix: quotes in systemd modules
Fixing quotes around *.conf in systemd modules
2021-04-23 10:56:51 +02:00
Jóhann B. Guðmundsson
2f217abdb3 refactor: check() in systemd modules
Refactoring require_binaries in check() for systemd modules
2021-04-23 10:48:54 +02:00
Harald Hoyer
8a51ee1fa6 fix(network-manager): set timeout via command line option
With Fedora 32, only the command line option works for `nm-online`.
2021-04-22 16:17:11 +02:00
Jóhann B. Guðmundsson
e942d86c9d feat(systemd-network-management): introducing systemd-network-management module
Introducing the systemd-network-management meta module which will
allow distribution users and vendors to easily include
systemd + systemd's network management modules by simply include this
module instead of systemd network modules individually.

Obviously if the intent is to glue together somekind of network stack
out of random existing modules such as NetworkManager and or Wicked,
this meta module should not be enabled.
2021-04-22 16:00:16 +02:00
Jóhann B. Guðmundsson
4982e16dd5 fix(network): user variable for sdnetworkd instead of path
Use globalvariable for systemd networkd instead of path
2021-04-22 15:40:58 +02:00
Jóhann B. Guðmundsson
2aa652349c fix(systemd-hostnamed): extra quote 2021-04-22 15:10:15 +02:00
Jóhann B. Guðmundsson
ea779750c3 fix(systemd-networkd): make systemd-networkd a proper network provider
Make systemd-networkd a proper network service provider. Fixes #737
2021-04-22 14:45:23 +02:00
Jóhann B. Guðmundsson
020212534b feat(systemd-timedated): add systemd-timedated module to the spec file 2021-04-22 14:25:36 +02:00
Jóhann B. Guðmundsson
1c41cc90c5 feat(systemd-timedated): introducing the systemd-timedated module
Introducing the systemd-timedated module
2021-04-22 14:25:36 +02:00
Harald Hoyer
4d03404f49 fix(network-manager): run after dracut-cmdline
dracut-cmdline runs `nm-config.sh`, which generates the configurations.

Also remove the now unused `nm-run.service`.
2021-04-22 13:10:19 +02:00
Lev Veyde
85eb96802c fix(img-lib): ignored null byte in input
The system currently throws numerous nasty warning messages during
the boot, about ignored null bytes in input.

This patch adds a filter to the dd command, to filter these null
bytes out, and thus to prevent these warning messages.

Signed-off-by: Lev Veyde <lveyde@redhat.com>
2021-04-22 11:23:22 +02:00
Jóhann B. Guðmundsson
782ac8f1f6 fix(systemd-modules-load): misc repairs
- Removing dependency on the systemd meta module since it causes circular dependency,
  prevents the existance of multiple systemd based meta modules and is redunant.

- Removing directory creation for modules-load since it should not be
  necessary and if it turns out that it is, it will be re-introduced in the
  form of a systemd tmpfile instead of inst_dir.

- Add a missing inclusion of configuration files placed in /usr/lib/modules-load.d
  and /etc/modules-load.d ( hostonly ) directories.

- Fix a spelling error in the systemd type unit file conf directory overwrite
  in the hostonly section.
2021-04-22 10:50:20 +02:00
Jóhann B. Guðmundsson
b7d3caef67 feat(systemd-resolved): introducing the systemd-resolved module
Introducing the systemd-resolved module
2021-04-22 10:48:56 +02:00
Jóhann B. Guðmundsson
bf273e3e86 feat(systemd-hostnamed): introducing the systemd-hostnamed module
Introducing the systemd-hostnamed module.
2021-04-22 10:47:35 +02:00
Jóhann B. Guðmundsson
e740723069 feat(systemd-ac-power): introducing the systemd-ac-power module
Introducing the systemd-ac-power module
2021-04-22 10:44:29 +02:00
Jóhann B. Guðmundsson
afef455718 fix(systemd-modules): remove dependency on systemd meta module
Depending on systemd meta module causes circular dependency,
prevents the existance of multiple systemd based meta modules
and is redunant.
2021-04-22 10:40:48 +02:00
Jóhann B. Guðmundsson
2257d54583 feat(systemd-timesyncd): introducing the systemd-timesyncd module
Introducing the systemd-timesyncd module
2021-04-22 10:39:59 +02:00
Harald Hoyer
49b614961d fix(network-manager): create /run directories
Create the `/run/NetworkManager/initrd` directory before creating
`/run/NetworkManager/initrd/neednet`. Somehow on Fedora 32 this
directory is missing, when the script is running.

This fixes all NetworkManager tests for Fedora 32.
2021-04-22 09:28:35 +02:00
Harald Hoyer
b80ee08093 ci: use /dev/disk/by-id
Due to parallel probing of the linux kernel `/dev/sd*` can't be used to
reliably address a hard disk. This can be seen by the many spurious
failures of the dracut CI, where `mdadm` failed with error 524 or tests
failed due to the success marker message written to the wrong disk.

* don't rely on `/dev/sd*` but use disk ids and `/dev/disk/by-id/ata-disk_<name>`

* specify the exact qemu machine architecture `-M q35` needed for the
  disk ids. A later patch will move this to `run-qemu`, when all tests are converted

* due to `-M q35` the interface names have changed from
  `ens2` -> `enp0s1` and `ens3` -> `enp0s2`
2021-04-22 02:55:31 +02:00
Jóhann B. Guðmundsson
5912f4fbc0 fix(systemd): include hosts and nsswitch.conf in hostonly mode
Adding /etc/hosts and /etc/nsswitch.conf to the hostonly install section.
2021-04-21 15:13:35 +02:00
Peter Robinson
3a60c036db fix(90kernel-modules): add watchdog drivers for generic initrd
The watchdog module pulls in the device specific watchdog if that
module is enabled, but in the case where we need a generic initrd
we don't get all watchdog drivers which means if we have a watchdog
enabled for that usecase it may get kicked too late in the boot
process so we need the drivers in the initrd for the generic case too.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2021-04-21 14:31:30 +02:00
Jóhann B. Guðmundsson
b37c90c8e0 fix(examples): remove the examples directory and reference to it
Let's leave it up to the yocto community to keep and maintain their own
examples.
2021-04-21 09:02:35 +02:00
Jóhann B. Guðmundsson
ec4539c606 fix(dracut.sh): add global vars for modules-load
Adding modulesload modulesloadconfdir global variables
2021-04-20 16:10:12 +02:00
Jóhann B. Guðmundsson
02acedd09e fix(systemd-sysctl): sysctl global variables 2021-04-20 10:52:45 +02:00
Jóhann B. Guðmundsson
3ca9aa1d7b fix(dracut): sysctl global variables 2021-04-20 10:52:45 +02:00
Jóhann B. Guðmundsson
fd15dbad6e fix(nbd): remove old udev version requirements 2021-04-20 10:51:31 +02:00
Jóhann B. Guðmundsson
be30d98751 fix(fips): remove old udev version requirements 2021-04-20 10:51:31 +02:00
Jóhann B. Guðmundsson
fc53987bec fix(systemd): remove old systemd version requirements 2021-04-20 10:51:31 +02:00
Harald Hoyer
7790644362 fix(nbd): make nbd work again with systemd
* Correct the systemd generated sysroot.mount unit with the options
received by the DHCP request and do a `daemon-reload`.

* Inject the `nbd-client -check /dev/nbd0` in the finished initqueue.

* Reactivate the NBD tests and prepare them for NetworkManager tests.
2021-04-19 22:41:01 +02:00
Harald Hoyer
8cd50230d9 ci: use disk ids for TEST 35 ISCSI MULTI
Due to parallel probing of the linux kernel `/dev/sd*` can't be used to
reliably address a hard disk. This can be seen by the many spurious
failures of the dracut CI, where `mdadm` failed with error 524 or tests
failed due to the success marker message written to the wrong disk.

* don't rely on `/dev/sd*` but use disk ids and `/dev/disk/by-id/ata-disk_<name>`

* specify the exact qemu machine architecture `-M q35` needed for the
  disk ids. A later patch will move this to `run-qemu`, when all tests are converted

* due to `-M q35` the interface names have changed from
  `ens2` -> `enp0s1` and `ens3` -> `enp0s2`
2021-04-19 22:32:00 +02:00
Harald Hoyer
2cfd778a45 ci: add function to generate qemu disk arguments
`qemu_add_drive_args` can be used to generate arguments to specify disks
for a qemu machine (`-M q35`).

This is mostly useful to address those raw disks via `/dev/disk/by-id`,
because due to parallel probing in the kernel `/dev/sd*` can point to
anything.
2021-04-19 22:32:00 +02:00
Harald Hoyer
97b86d37f9 fix(bluetooth): shellcheck and hostonly corrections
Don't install files from `/var` in the non-hostonly case.

Use fileglobs, instead of `find`.
2021-04-17 14:07:41 +02:00
Harald Hoyer
ae4fbb3db4 fix(dbus-daemon): only error out in install()
Don't hard exit in `check()`. The transaction logic only checks if it
should/can include the module. Just return `255` and the `dbus` meta
module will pick its dependency.
2021-04-17 13:22:58 +02:00
Adam Alves
64ee2a5386 feat(bluetooth): implement bluetooth support in initrd
- Included a bluetooth module that installs modules, firmware, udev rules and bluetoothd.
- systemd and dbus are required by bluetoothd
- Include bluetooth by default if BT keyboard or combo found
2021-04-16 18:43:31 +00:00
Harald Hoyer
4baedd019b fix(TEST ISCSI): try to debug md error 524
While creating the striped md raid0 sometimes this error occures:

```
mdadm: Defaulting to version 1.2 metadata
mdadm: RUN_ARRAY failed: Unknown error 524
  Failed to clear hint file.
  Device /dev/md0 not found.
Powering off.
```

Add debug output with the size of the disks.

Also create disks with multiple of 4096.
2021-04-16 16:27:16 +02:00
Harald Hoyer
31612c7337 ci: remove packit config causing errors
remove the offending parameters, which cause errors described in
https://github.com/dracutdevs/dracut/issues/1346

until we found the correct config to be used.
2021-04-16 16:26:23 +02:00
Beniamino Galvani
112f03f9e2 feat(network-manager): run as daemon with D-Bus
This commit changes how NM is started inside the initrd. Instead of running NM
in the special --configure-and-quit=initrd mode, which sets up network and
quits, start it as a daemon.

This has multiple advantages. First, we no longer need to run NM in a special
mode that requires additional code and maintenance. NetworkManager works
exactly as in the real root.

One problem of the current configure-and-quit approach is that once NM has
quit, dynamic addresses can expire if the initrd setup takes longer than the
DHCP lease interval or than the IPv6 address lifetime. Running NM as a service
solves this problem.

Now NM runs with D-Bus support and therefore its API can be used by other
modules. This open the possibility, for example, to integrate nm-cloud-setup to
automatically configure networking based on cloud metadata.

Use the NetworkManager-wait-online.service, ordered before
dracut-initqueue.service, to delay the initqueue until NM has terminated its
configuration.
2021-04-16 16:15:00 +02:00
Dusty Mabe
6a37c6f630 fix(network-manager): use /run/NetworkManager/initrd/neednet in initqueue
We don't want to start NetworkManager if networking is not needed.
Right now nm-config.sh lays down /usr/lib/dracut/hooks/initqueue/finished/nm.sh
which will cause the initqueue to run. If nothing exists in
/usr/lib/dracut/hooks/initqueue/finished/ then it will short circuit and
the initqueue won't run anything. But what if something else needed
something to run in the initqueue? nm-run.sh would still get started,
even though /usr/lib/dracut/hooks/initqueue/finished/nm.sh didn't exist.
In this case let's just trigger off of /run/NetworkManager/initrd/neednet
like we are doing in the systemd unit (nm-run.service).
2021-04-16 11:12:49 +02:00
Dusty Mabe
ac0e8f7dcc fix(network-manager): only run NetworkManager if rd.neednet=1
Don't run the new systemd unit (nm-run.service) if rd.neednet=1
isn't set. nm-initrd-generator will generate configuration even
without rd.neednet=1 so determining if we should start based on
just if connection profiles exist isn't enough. We need some other
indicator. In this case we lay down a /run/NetworkManager/initrd/neednet
if rd.neednet=1, which is used by nm-run.service to determine the
need to run.
2021-04-16 11:12:49 +02:00
Dusty Mabe
1f21fac646 fix(network-manager): nm-run.service: don't kill forked processes
If teaming is set up via NetworkManager we don't want systemd to take
down the userspace teamd process when NetworkManager quits. `KillMode=process`
will allow it to leave those processes behind.

This is fallout from the change to run NetworkManager via systemd (c17c5b7).

With `KillMode=process` we get something like:

```
sh-5.1# journalctl -u nm-run -o cat | tail
<info>  [1618411262.7030] quitting now that startup is complete
<info>  [1618411262.7030] device (team0): carrier: link connected
<info>  [1618411262.7033] device (team0): team port ens2 was released
<info>  [1618411262.7033] device (team0): team port ens3 was released
<info>  [1618411262.7033] manager: NetworkManager state is now CONNECTED_SITE
<info>  [1618411262.7034] exiting (success)
nm-run.service: Deactivated successfully.
nm-run.service: Unit process 476 (teamd) remains running after unit stopped.
Finished nm-run.service.
```
2021-04-15 13:07:07 +02:00
Dusty Mabe
4fbccde504 fix(dracut-logger.sh): double dash trigger unknown logger warnings during run
There are a bunch of `logger: unknown facility name: --user` errors
during a run. This is because logger is getting passed something like:

```
logger -p --user.info
```

Where it should be something like:

```
logger -p user.info
```
2021-04-15 12:58:49 +02:00
Đoàn Trần Công Danh
651fe01e79 fix(i18n): skip if data is missing
On system that doesn't have either consolefonts, consoletrans, keymaps,
or unimaps, "kbddir" is empty, thus the followed installation will
broken with errors like:

	cp: cannot stat '/consolefonts/*': No such file or directory

Let's report the checks as failure if "kbddir" is empty.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2021-04-13 11:12:37 +02:00
Jóhann B. Guðmundsson
96c313333d fix(dracut.sh): omission is an addition to other omissions in conf files
When omitting a module from the command line via -o or --omit
it's expected that it behaves in the same manner as adding a module from the
command line as in it does not overwrite existing omissions of other modules in
configuration file(s).
2021-04-12 09:18:25 +02:00
Kairui Song
122657b2fe fix(dracut-functions): word splitting issue for sed in get_ucode_file
This unquated regex could be splitted into two arguments and sed will
not work. I've see giving error of wrong arguments being used on my
desktop.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-04-12 09:17:18 +02:00
Harald Hoyer
2d83bce21b fix(nbd): shellcheck regression
`$opts`, `$preopts` and `$nbdport` shouldn't have been quoted as they
can expand to multiple options.

Fixes: https://github.com/dracutdevs/dracut/issues/1270
2021-03-31 21:32:36 +02:00
Harald Hoyer
bb69aff14d docs: clarify netroot=dhcp
`root=dhcp` does not work with systemd, so `netroot=dhcp` should be
used.
2021-03-31 21:32:23 +02:00
Harald Hoyer
7fcc495588 fix(dracut-systemd): regression on root=block:
Commit 3532978de04c7 introduced a regression, where the `root` could be
`root=block:block:/dev/foo`.
2021-03-31 21:31:57 +02:00
Harald Hoyer
8059bcb2c8 fix(base): source hooks without exec
Patch 2fabaaa62d changed the behaviour for `dash`
under the assumption, that dash does not take parameters for `.` aka
`source`. Although this is true, the original positional parameters of
the `source_all` function are still in place, so everything is
fine with the old way of sourcing.
2021-03-31 21:31:00 +02:00
Harald Hoyer
36af0518b3 fix(network): correct regression in iface_has_carrier
Commit e25c536c70 introduced a regression in iface_has_carrier
due to unclear variable naming.
2021-03-31 21:29:52 +02:00
Harald Hoyer
ba4bcf5f4f fix(network-manager): no default deps for nm-run.service
Otherwise nm-run.service will run only in basic.target, which is too
late in the initramfs.
2021-03-31 21:29:33 +02:00
Harald Hoyer
56606b0a1b fix(lunmask): shellcheck regression
`parse-lunmask.sh` is not a bash script
and dash doesn't understand `read -a`.

Revert to the initial code.

Fixes: https://github.com/dracutdevs/dracut/issues/1271
2021-03-31 12:13:31 +02:00
Harald Hoyer
fd4b04da66 fix(lvmmerge): depend on bash 2021-03-31 11:32:48 +02:00
Harald Hoyer
5b965f6308 fix(livenet): fetch-liveupdate.sh does not require bash 2021-03-31 11:32:29 +02:00
Harald Hoyer
fd3698aa42 fix(cms): require bash 2021-03-31 11:32:00 +02:00
Harald Hoyer
3402142e34 fix(network-manager): nm-lib.sh does not require bash 2021-03-31 11:31:47 +02:00
Harald Hoyer
6b499ec14b fix(zipl): don't depend on grub2
There is no grub2 dracut module.
2021-03-31 11:31:30 +02:00
Harald Hoyer
09356085b6 ci: enable shellcheck for everything 2021-03-31 11:31:17 +02:00
Harald Hoyer
1dc61299f7 fix(kernel-modules): shellcheck regression
`$_hostonly_drvs` contained multiple arguments and was quoted.

This patch converts `_hostonly_drvs` into an associative array, which
enables easy deduplication and proper quoting in bash.

Fixes: https://github.com/dracutdevs/dracut/issues/1276
2021-03-31 11:30:49 +02:00
Harald Hoyer
7b8c78ff43 fix(multipath): revise multipathd-stop
A shellcheck regression quoted `HARD` in
```shell
    kill "$HARD" "$pid" > /dev/null 2>&1
```

which would error on an empty "HARD".

Instead of fixing this, use `pkill` instead and also add it to the
non-optional list of binaries to install, which was revised also.

Fixes: https://github.com/dracutdevs/dracut/issues/1275
2021-03-31 11:30:10 +02:00
Harald Hoyer
85378f44af fix(multipath): shellcheck regression
`$_allow` should not have been quoted, because it can be multiple options.

Instead of unquoting it, convert it to an associative array with easy
deduplication and prefix every device with the `--allow` option.

Fixes: https://github.com/dracutdevs/dracut/issues/1274
2021-03-31 11:29:31 +02:00
Harald Hoyer
af3cd22425 fix(nvdimm): shellcheck regression
`_provider_dirs` should not have been quoted, because it should expand
to multiple arguments.

Just remove the whole variable and add those arguments.

Fixes: https://github.com/dracutdevs/dracut/issues/1273
2021-03-31 11:29:07 +02:00
Harald Hoyer
f450ebfdf2 fix(convertfs): require bash 2021-03-31 11:05:29 +02:00
Harald Hoyer
f5046e56bc fix(caps): require bash 2021-03-31 11:04:52 +02:00
Harald Hoyer
007df5adc1 test: mark the whole test subdir as shellcheck'ed 2021-03-31 09:33:03 +02:00
Harald Hoyer
29f335070a fix(dracut-initramfs-restore.sh): shellcheck for dracut-initramfs-restore.sh 2021-03-31 09:32:33 +02:00
Harald Hoyer
7ee8dfca6a fix(examples/yocto): shellcheck again 2021-03-31 09:32:07 +02:00
Harald Hoyer
cd8db54a3d fix(dasd_rules): add bash dependency 2021-03-30 21:10:44 +00:00
Harald Hoyer
23d303f8a0 fix(fcoe-uefi): add bash dependency 2021-03-30 21:04:48 +00:00
Harald Hoyer
c864f8938c fix(TEST MULTINIC): shellcheck 2021-03-30 22:59:46 +02:00
Harald Hoyer
f9b9faf433 fix(fcoe): remove needless bash dependency 2021-03-30 20:04:52 +00:00
Harald Hoyer
f0c606f91d fix(lunmask): remove needless bash dependency 2021-03-30 21:21:01 +02:00
Jóhann B. Guðmundsson
a4cc196467 fix(crypt): include cryptsetups tmpfile 2021-03-30 19:14:38 +00:00
Harald Hoyer
beb3e54ece fix(TEST BASIC): shellcheck 2021-03-30 21:09:06 +02:00
Harald Hoyer
d174e18d2a fix(TEST SYSTEMD): shellcheck 2021-03-30 21:06:09 +02:00
Harald Hoyer
4c4cd24b7c fix(TEST USR-MOUNT): shellcheck 2021-03-30 20:57:04 +02:00
Harald Hoyer
7e140a407b fix(TEST FULL-SYSTEMD): shellcheck 2021-03-30 20:54:26 +02:00
Harald Hoyer
6e7db0467a fix(TEST RAID): shellcheck 2021-03-30 20:48:22 +02:00
Harald Hoyer
34600bbead fix(TEST LVM): shellcheck 2021-03-30 20:38:52 +02:00
Harald Hoyer
cdebbcc684 fix(TEST RAID-DEG): shellcheck 2021-03-30 20:16:02 +02:00
Harald Hoyer
07c944b48c fix(TEST IMSM): shellcheck 2021-03-30 19:56:28 +02:00
Harald Hoyer
92798d7d1b fix(TEST DMSQUASH): shellcheck 2021-03-30 19:33:37 +02:00
Harald Hoyer
d0c9fd6609 fix(TEST LVM-THIN): shellcheck 2021-03-30 19:24:10 +02:00
Harald Hoyer
1c6dd0ddfd fix(TEST NFS): shellcheck 2021-03-30 19:20:45 +02:00
Harald Hoyer
2aa97ff299 fix(TEST ISCSI): shellcheck 2021-03-30 19:06:07 +02:00
Harald Hoyer
7c77835cd6 fix(zfcp_rules): require bash 2021-03-30 17:55:15 +02:00
Harald Hoyer
c2ecc4d131 fix(memstrack): correct dependencies
memstrack does not need to depend on `bash` but does on `systemd`.
2021-03-30 17:51:55 +02:00
Harald Hoyer
e6e78b14dd ci: disable fedora-eln for now
Seems like there is a missing glib2 build in the pipeline, so
fedora-eln only fails, and therefore is of no use for us.
2021-03-30 16:48:48 +02:00
Harald Hoyer
957ab750f0 fix(usrmount): shellcheck for modules.d/98usrmount 2021-03-30 16:35:31 +02:00
Harald Hoyer
f7844c296a fix(TEST ENC-RAID-LVM): shellcheck 2021-03-30 16:34:17 +02:00
Harald Hoyer
79f9b17feb fix(TEST BTRFSRAID): shellcheck 2021-03-30 16:31:54 +02:00
Harald Hoyer
f9f1314acb fix(TEST ISCSI-MULTI): shellcheck 2021-03-30 15:54:54 +02:00
Harald Hoyer
77854c6d2d fix(TEST NBD): shellcheck 2021-03-30 15:53:47 +02:00
Harald Hoyer
6e5878188b fix(TEST BONDBRIDGEVLANIFCFG): shellcheck 2021-03-30 15:53:21 +02:00
Harald Hoyer
90b9c00695 fix(TEST GETARG): shellcheck 2021-03-30 14:57:52 +02:00
Harald Hoyer
718ad799ac fix(TEST RPM): shellcheck 2021-03-30 14:55:29 +02:00
Beniamino Galvani
df1e5f06a5 fix(dbus-broker): enable the service
dbus-broker.service has a 'dbus.service' alias which is installed when the
service gets enabled.

If the alias is not present in the initrd image, services requiring D-Bus in
the initrd fail to start because they depend on dbus.service, which doesn't
exist.

Therefore, enable the service to create the alias.
2021-03-30 14:45:47 +02:00
Harald Hoyer
dd3cac269b fix(examples/yocto): shellcheck 2021-03-30 13:02:21 +02:00
Harald Hoyer
0ce54e8033 fix(lsinitrd.sh): shellcheck for lsinitrd.sh 2021-03-30 12:59:06 +02:00
Harald Hoyer
43df4ee274 feat(mkinitrd): remove mkinitrd
It was not working anyway, so nobody used it for years.
If it is not used, just remove it.
mkinitrd-suse.sh will be maintained by SUSE as it is SUSE specific
anyway.
2021-03-30 12:38:11 +02:00
Harald Hoyer
baa4acd402 fix(test/test-functions): shellcheck for test/test-functions 2021-03-30 12:30:41 +02:00
Harald Hoyer
e010f45524 fix(test/run-qemu): shellcheck for test/run-qemu 2021-03-30 12:26:14 +02:00
Harald Hoyer
51b6784217 fix(fedora-test.sh): shellcheck for fedora-test.sh 2021-03-30 10:47:05 +02:00
Harald Hoyer
f6597b0d51 fix(dm): shellcheck for modules.d/90dm 2021-03-30 10:28:54 +02:00
Harald Hoyer
2536a9eaff fix(install): handle builtin modules
If a `kmod_module` is missing the `path`, it is `builtin`.
2021-03-30 10:27:02 +02:00
Harald Hoyer
8c0fcdd931 fix(network-legacy): shellcheck for modules.d/35network-legacy 2021-03-30 10:14:34 +02:00
Harald Hoyer
6bc9942b41 fix(systemd-modules-load): shellcheck for modules.d/01systemd-modules-load 2021-03-30 10:13:10 +02:00
Harald Hoyer
c94bd1cd82 fix(busybox): shellcheck for modules.d/05busybox 2021-03-30 10:11:24 +02:00
Harald Hoyer
428ef5e471 fix(securityfs): shellcheck for modules.d/96securityfs 2021-03-30 10:07:31 +02:00
Harald Hoyer
a490409702 fix(iscsi): shellcheck for modules.d/95iscsi 2021-03-30 08:56:18 +02:00
Harald Hoyer
77fa33017d fix(mdraid): shellcheck for modules.d/90mdraid 2021-03-30 04:16:57 +02:00
Harald Hoyer
ae9aa8f174 fix(TEST-30-ISCSI): add sync to client root creation 2021-03-30 04:05:34 +02:00
Harald Hoyer
4148f08bd3 fix(cifs): shellcheck for modules.d/95cifs 2021-03-30 03:39:47 +02:00
Harald Hoyer
d97f88f28b test(FULL-SYSTEMD): add fuse kernel module in test root
systemd wants to use it
2021-03-29 16:16:09 +02:00
Harald Hoyer
94b0d89f17 fix(dmsquash-live): shellcheck for modules.d/90dmsquash-live 2021-03-29 15:00:07 +02:00
Harald Hoyer
b130927514 fix(crypt-gpg): shellcheck for modules.d/91crypt-gpg 2021-03-29 14:45:07 +02:00
Harald Hoyer
eb0d3fb9c1 fix(fcoe-uefi): shellcheck for modules.d/95fcoe-uefi 2021-03-29 14:23:02 +02:00
Harald Hoyer
3a04fdff87 fix(fstab-sys): shellcheck for modules.d/95fstab-sys 2021-03-29 13:36:58 +02:00
Harald Hoyer
d8d0b03cb4 fix(lunmask): shellcheck for modules.d/95lunmask 2021-03-29 13:36:38 +02:00
Harald Hoyer
a201be999e fix(nbd): shellcheck for modules.d/95nbd 2021-03-29 13:36:20 +02:00
Harald Hoyer
c5dd11f99f fix(fcoe): shellcheck for modules.d/95fcoe 2021-03-29 13:21:55 +02:00
Harald Hoyer
11e82f3ecc fix(nfs): shellcheck for modules.d/95nfs 2021-03-29 11:40:39 +02:00
Harald Hoyer
c305877c58 fix(nvmf): shellcheck for modules.d/95nvmf 2021-03-29 11:39:52 +02:00
Harald Hoyer
d15441cef4 fix(qeth_rules): shellcheck for modules.d/95qeth_rules 2021-03-29 11:39:07 +02:00
Harald Hoyer
88a83e0db1 fix(resume): shellcheck for modules.d/95resume 2021-03-29 11:37:56 +02:00
Harald Hoyer
4cbe12a31f fix(rootfs-block): shellcheck for modules.d/95rootfs-block 2021-03-29 11:35:08 +02:00
Harald Hoyer
a15a7a1a34 fix(ssh-client): shellcheck for modules.d/95ssh-client 2021-03-29 11:34:46 +02:00
Harald Hoyer
0c4b5cabcf fix(udev-rules): shellcheck for modules.d/95udev-rules 2021-03-29 11:34:31 +02:00
Harald Hoyer
e72c1310fa fix(virtfs): shellcheck for modules.d/95virtfs 2021-03-29 11:34:13 +02:00
Harald Hoyer
2e3e2e0820 fix(zfcp): shellcheck for modules.d/95zfcp 2021-03-29 11:31:55 +02:00
Harald Hoyer
032ecd95c9 fix(zfcp_rules): shellcheck for modules.d/95zfcp_rules 2021-03-29 11:31:31 +02:00
Harald Hoyer
c0efaeca11 fix(znet): shellcheck for modules.d/95znet 2021-03-29 11:30:55 +02:00
Harald Hoyer
f07e695fc5 fix(masterkey): shellcheck for modules.d/97masterkey 2021-03-29 11:30:31 +02:00
Harald Hoyer
7b584edac0 fix(dracut-systemd): shellcheck for modules.d/98dracut-systemd 2021-03-29 11:30:05 +02:00
Harald Hoyer
94157eec8e fix(ecryptfs): shellcheck for modules.d/98ecryptfs 2021-03-29 11:21:35 +02:00
Harald Hoyer
895dd4eb25 fix(integrity): shellcheck for modules.d/98integrity 2021-03-29 11:21:13 +02:00
Harald Hoyer
a2faaf8652 fix(pollcdrom): shellcheck for modules.d/98pollcdrom 2021-03-29 11:20:08 +02:00
Harald Hoyer
cdf927d3ba fix(selinux): shellcheck for modules.d/98selinux 2021-03-29 11:19:47 +02:00
Harald Hoyer
005a7bda8d fix(img-lib): shellcheck for modules.d/99img-lib 2021-03-29 11:19:26 +02:00
Harald Hoyer
f5a14d0f30 fix(memstrack): shellcheck for modules.d/99memstrack 2021-03-29 11:18:14 +02:00
Harald Hoyer
56ea45bd5a fix(shutdown): shellcheck for modules.d/99shutdown 2021-03-29 11:17:11 +02:00
Harald Hoyer
3e1248da7d fix(syslog): shellcheck for modules.d/98syslog 2021-03-29 11:16:05 +02:00
Harald Hoyer
82d9fbf193 fix(fs-lib): shellcheck for modules.d/99fs-lib 2021-03-29 11:15:27 +02:00
Harald Hoyer
4fdc34e503 fix(uefi-lib): shellcheck for modules.d/99uefi-lib 2021-03-29 10:59:40 +02:00
Harald Hoyer
f732667d14 fix(dcssblk): shellcheck for modules.d/95dcssblk 2021-03-29 10:56:39 +02:00
Harald Hoyer
a19ab29197 fix(dasd_rules): shellcheck for modules.d/95dasd_rules 2021-03-29 10:56:21 +02:00
Harald Hoyer
f1c7833a56 fix(dasd_mod): shellcheck for modules.d/95dasd_mod 2021-03-29 10:55:46 +02:00
Harald Hoyer
9dd4d42265 fix(dasd): shellcheck for modules.d/95dasd 2021-03-29 10:55:34 +02:00
Harald Hoyer
d75b029a8c fix(zipl): shellcheck for modules.d/91zipl 2021-03-29 10:54:23 +02:00
Harald Hoyer
2d98cb6f63 fix(crypt-loop): shellcheck for modules.d/91crypt-loop 2021-03-29 10:53:56 +02:00
Harald Hoyer
ad4f8d13f1 fix(qemu): shellcheck for modules.d/90qemu 2021-03-29 10:53:27 +02:00
Harald Hoyer
e601a1ee46 fix(ppcmac): shellcheck for modules.d/90ppcmac 2021-03-29 10:53:07 +02:00
Harald Hoyer
352d6110d0 fix(nvdimm): shellcheck for modules.d/90nvdimm 2021-03-29 10:52:44 +02:00
Harald Hoyer
80f5e83ed5 fix(multipath): shellcheck for modules.d/90multipath 2021-03-29 10:52:28 +02:00
Harald Hoyer
37b1f66f00 fix(lvm): shellcheck for modules.d/90lvm 2021-03-29 10:51:34 +02:00
Harald Hoyer
0315e16955 fix(livenet): shellcheck for modules.d/90livenet 2021-03-29 10:50:51 +02:00
Harald Hoyer
f0ad24623a fix(kernel-network-modules): shellcheck for modules.d/90kernel-network-modules 2021-03-29 10:50:16 +02:00
Harald Hoyer
27f5e75893 fix(kernel-modules-extra): shellcheck for modules.d/90kernel-modules-extra 2021-03-29 10:49:52 +02:00
Harald Hoyer
a26e12cefc fix(kernel-modules): shellcheck for modules.d/90kernel-modules 2021-03-29 10:46:46 +02:00
Harald Hoyer
1b3b55894e fix(dmraid): shellcheck for modules.d/90dmraid 2021-03-29 10:45:33 +02:00
Harald Hoyer
e08c644ee6 fix(cms): shellcheck for modules.d/80cms 2021-03-29 10:43:55 +02:00
Harald Hoyer
a4cdc25210 fix(plymouth): shellcheck for modules.d/50plymouth 2021-03-29 10:42:20 +02:00
Harald Hoyer
91f49acd1c fix(gensplash): shellcheck for modules.d/50gensplash 2021-03-29 10:41:38 +02:00
Harald Hoyer
0ba7a48695 fix(drm): shellcheck for modules.d/50drm 2021-03-29 10:12:46 +02:00
Harald Hoyer
8e84fa7262 fix(url-lib): shellcheck for modules.d/45url-lib 2021-03-29 10:12:19 +02:00
Harald Hoyer
8df14af245 fix(ifcfg): shellcheck for modules.d/45ifcfg 2021-03-29 10:11:15 +02:00
Harald Hoyer
e8857c59b1 fix(lvmmerge): shellcheck for modules.d/80lvmmerge 2021-03-29 10:10:06 +02:00
Harald Hoyer
abc9879c9d fix(cio_ignore): shellcheck for modules.d/81cio_ignore 2021-03-29 10:09:51 +02:00
Harald Hoyer
640458bbf6 fix(btrfs): shellcheck for modules.d/90btrfs 2021-03-29 10:09:26 +02:00
Harald Hoyer
682b297207 fix(crypt): shellcheck for modules.d/90crypt 2021-03-29 10:08:59 +02:00
Harald Hoyer
e25c536c70 fix(network): shellcheck for modules.d/40network 2021-03-29 09:57:50 +02:00
Harald Hoyer
d76a2cfe21 fix(network-wicked): shellcheck for modules.d/35network-wicked 2021-03-29 09:57:23 +02:00
Harald Hoyer
00ca6bed37 fix(i18n): shellcheck for modules.d/10i18n 2021-03-29 09:56:49 +02:00
Harald Hoyer
2b5ddc7722 fix: shellcheck for dracut*.sh 2021-03-29 09:54:52 +02:00
Harald Hoyer
0342a7d11c docs: add docs/BASH.md
Add a little document providing help in common bash problems.
2021-03-26 16:08:49 +01:00
Harald Hoyer
10616019de fix(systemd): shellcheck for modules.d/00systemd 2021-03-26 15:16:07 +01:00
Harald Hoyer
25f6841344 fix(network-manager): shellcheck for modules.d/35network-manager 2021-03-26 15:02:59 +01:00
Harald Hoyer
ec12017055 fix(convertfs): shellcheck for modules.d/30convertfs 2021-03-26 13:44:20 +01:00
Harald Hoyer
4042816955 fix(dbus-daemon): shellcheck for modules.d/06dbus-daemon 2021-03-26 13:24:45 +01:00
Harald Hoyer
5a420e6183 fix(watchdog): shellcheck for modules.d/04watchdog 2021-03-26 13:24:17 +01:00
Harald Hoyer
7193b6f0cb fix(dbus-broker): shellcheck for modules.d/06dbus-broker 2021-03-26 13:23:59 +01:00
Harald Hoyer
95729721cc fix(watchdog-modules): shellcheck for modules.d/04watchdog-modules 2021-03-26 13:22:53 +01:00
Harald Hoyer
fac7505b69 fix(modsign): shellcheck for modules.d/03modsign 2021-03-26 13:14:16 +01:00
Harald Hoyer
231917e9b5 fix(systemd-networkd): shellcheck for modules.d/02systemd-networkd 2021-03-26 13:02:57 +01:00
Harald Hoyer
3dbc6c3d44 fix(caps): shellcheck for modules.d/02caps 2021-03-26 13:01:34 +01:00
Harald Hoyer
8bf6861b58 fix(systemd-sysusers): shellcheck for modules.d/01systemd-sysusers 2021-03-26 13:01:17 +01:00
Harald Hoyer
8e10fa7d27 fix(systemd-sysctl): shellcheck for modules.d/01systemd-sysctl 2021-03-26 12:59:52 +01:00
Harald Hoyer
ddc7bf456a fix(systemd-repart): shellcheck for modules.d/01systemd-repart 2021-03-26 12:59:20 +01:00
Harald Hoyer
c3a9a8cf3d fix(systemd-initrd): shellcheck for modules.d/01systemd-initrd 2021-03-26 12:27:24 +01:00
Harald Hoyer
b8ca67280f fix(systemd-coredump): shellcheck for modules.d/01systemd-coredump 2021-03-26 12:24:22 +01:00
Harald Hoyer
3f114d3e31 fix(systemd-ask-password): shellcheck for modules.d/01systemd-ask-password 2021-03-26 12:21:09 +01:00
Harald Hoyer
6aa59dd8ab fix(fips): shellcheck for modules.d/01fips 2021-03-26 12:20:15 +01:00
Harald Hoyer
f8e90c8f70 fix(warpclock): shellcheck for modules.d/00warpclock 2021-03-26 12:17:19 +01:00
Harald Hoyer
2fabaaa62d fix(base): shellcheck for modules.d/99base
Also remove some functions, which are not used and broken anyway.
2021-03-26 12:17:00 +01:00
Harald Hoyer
cbef7cf3da fix(squash): shellcheck for modules.d/99squash 2021-03-26 11:26:02 +01:00
Harald Hoyer
f274cf4c81 fix(biosdevname): shellcheck for modules.d/97biosdevname 2021-03-26 11:23:23 +01:00
Harald Hoyer
2097e38490 fix(terminfo): shellcheck for modules.d/95terminfo 2021-03-26 11:22:09 +01:00
Harald Hoyer
3736ed7ca4 fix(debug): shellcheck for modules.d/95debug 2021-03-26 11:19:13 +01:00
Harald Hoyer
fb3a30efbf fix(qemu-net): shellcheck for modules.d/90qemu-net 2021-03-26 11:17:07 +01:00
Harald Hoyer
8109b6c0d4 fix(dmsquash-live-ntfs): shellcheck for modules.d/90dmsquash-live-ntfs 2021-03-26 11:13:04 +01:00
Harald Hoyer
1ce0eeffab fix(dbus): shellcheck for modules.d/09dbus 2021-03-26 11:07:59 +01:00
Harald Hoyer
74668e212d fix(rngd): shellcheck for modules.d/06rngd 2021-03-26 11:07:45 +01:00
Harald Hoyer
f32b5e582e fix(rescue): shellcheck for modules.d/03rescue 2021-03-26 11:06:05 +01:00
Harald Hoyer
f506c4268b fix(mksh): shellcheck for modules.d/00mksh 2021-03-26 10:56:54 +01:00
Harald Hoyer
b470a79c18 fix(dash): shellcheck for modules.d/00dash 2021-03-26 10:55:53 +01:00
Harald Hoyer
dafdf37268 fix(bash): shellcheck for modules.d/00bash 2021-03-26 10:55:36 +01:00
Harald Hoyer
90c679e753 ci: shellcheck all directories with .sh 2021-03-26 09:35:30 +01:00
Harald Hoyer
d376b98537 test: add shellcheck to Makefile 2021-03-26 09:35:30 +01:00
Harald Hoyer
cc914eaa8b style: use shfmt 3.2.4 2021-03-19 11:34:05 +01:00
David Hildenbrand
f3dcb60619 feat(qemu): include the virtio_mem kernel module
This adds support for virtio-mem devices, which provide a dynamic
amount of memory in a VM. Right now, the driver gets loaded and any
memory gets added to the system when loading the kernel module from disk.

While not strictly required to boot, we want to be able to
1) add virito-mem provided memory to the system early while booting up
2) add virtio-mem provided memory even when booting without a disk
3) add virtio-mem devices without adding actual memory in kdump
   environments such that we can query things like:
 a) is a certain PFN currently plugged in the hypervisor and, therefore,
    should actually be read when creating a system dump. (kexec-tools
    prepares the vmcore header, like on x86-64)
 b) which ranges of a virtio-mem device are currently plugged in the
    hypervisor and, therefore, should be added to the dump. (vmcore header
    gets prepared by the crashkernel, like on s390x)
 Note that loading virtio-mem in kdump environments currently fails with
 -EBUSY -- but there are plans to install proper hooks instead to support
  especially a) in the near future.

1) and 2) are only really effective when memory hotplug is configured to
automatically online all added system RAM in the kernel (and not late,
via udev rules): e.g., via "mhp_default_state=online" on the kernel
cmdline or via CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE in the kernel.

Especially 2) and 3) require the module to be present inside the initial
ramdisk. The primary use case for including it in the initial ramdisk
is 3).

Signed-off-by: David Hildenbrand <david@redhat.com>
2021-03-18 15:04:10 +01:00
Harald Hoyer
2ec7fa190e style(install): astyle post correction 2021-03-15 15:37:08 +01:00
Harald Hoyer
b7b8eedab5 docs: document astyle in HACKING.md 2021-03-15 15:37:08 +01:00
Harald Hoyer
f1ed92c348 style: use astyle for C formatting 2021-03-15 15:37:08 +01:00
Harald Hoyer
5667978e7b style: use astyle instead of indent 2021-03-15 15:37:08 +01:00
Harald Hoyer
0850cf532d style(install): use block for the FOREACH macros 2021-03-15 15:37:08 +01:00
Harald Hoyer
9e587f0008 ci: splitout indent-c from indent
... to be able to call it from CI
2021-03-15 15:37:08 +01:00
Harald Hoyer
07b65603ff test: check for shfmt in Makefile 2021-03-15 15:37:08 +01:00
Jóhann B. Guðmundsson
01126a209a chore(.packit.yml): adding all fedora release + centos to packit
With this config change,copr builds will happen on pull requests
for all fedora development branches and the next major RHEL release
( fedora-eln ) and on commits, copr builds will happen on all fedora
release and the next major RHEL release.
2021-03-15 10:20:08 +01:00
Harald Hoyer
567c455753 fix(udev-rules): add btrfs udev rules by default
Install `64-btrfs.rules` unconditionally to mark btrfs devices ready or
not.

In case no `btrfs` kernel module is available in the initramfs, the
device should not be ready.

Depends on: https://github.com/systemd/systemd/pull/18802

Fixes: https://github.com/dracutdevs/dracut/issues/947
2021-03-13 20:13:13 +01:00
Harald Hoyer
d4caa86aba feat(btrfs): add 64-btrfs-dm.rules rules 2021-03-13 19:12:54 +00:00
Harald Hoyer
d85b7e4edd ci: add lint for C and shell format 2021-03-13 20:10:43 +01:00
Harald Hoyer
0561f953c4 docs: document code formatting in HACKING.md 2021-03-13 20:10:43 +01:00
Harald Hoyer
9bc5282e30 style: make indent for C 2021-03-13 20:10:43 +01:00
Harald Hoyer
2b50b67c50 style: shfmt post reformat 2021-03-13 20:10:43 +01:00
Harald Hoyer
75d758e8f1 style: shfmt -s reformat
reproducible with:

```
$ shfmt_version=3.0.1
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w -s .
```
2021-03-13 20:10:43 +01:00
Harald Hoyer
9a52c3fdb0 style: shfmt reformat
reproducible with:

```
$ shfmt_version=3.0.1
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w .
```
2021-03-13 20:10:43 +01:00
Harald Hoyer
560402c3dc style: shfmt pre correction 2021-03-13 20:10:43 +01:00
Harald Hoyer
e0a0fa6174 feat: extend Makefile indent target
- extend the C indent file pattern
- add shfmt, if installed
2021-03-13 20:10:43 +01:00
Harald Hoyer
eddca44221 chore: add .shellcheckrc 2021-03-13 20:10:43 +01:00
Harald Hoyer
9012f3996b fix: set vimrc and emacs indention according to .editorconfig 2021-03-13 20:10:43 +01:00
Harald Hoyer
1f621aba37 feat: customize .editorconfig according to shfmt 2021-03-13 20:10:43 +01:00
Harald Hoyer
5d99b4d0eb test: fix test 98 getarg
Fix a mis-replaced comparison.
2021-03-12 09:20:32 +01:00
Harald Hoyer
60a34d8b11 fix(network-legacy): silence getargs 2021-03-10 19:31:19 +01:00
Harald Hoyer
72cba8aecd test: sync and poweroff in create-root.sh 2021-03-10 19:31:19 +01:00
Harald Hoyer
1b61cfdbec fix: use getargs with _cryptgetargsname 2021-03-10 19:31:19 +01:00
Harald Hoyer
455329cf71 test: change the LABEL to include spaces
Test for root device with a LABEL, which includes spaces.
2021-03-10 19:31:19 +01:00
Harald Hoyer
b800edd698 fix(base): wait_for_dev quote shell variables 2021-03-10 19:31:19 +01:00
Harald Hoyer
d3532978de refactor: factor out label_uuid_to_dev 2021-03-10 19:31:19 +01:00
Harald Hoyer
40fc0ad40d chore: update .gitignore 2021-03-10 19:31:19 +01:00
Harald Hoyer
501d82f796 fix: correctly handle kernel parameters
The kernel has an odd way to handle `"` surrounded parameters.
To handle the parameters as the kernel would do, no simple shell script
suffices, so a new utility `dracut-util` is introduced. Written in "C"
it handles `dracut-getarg` and `dracut-getargs` as the old shell script
functions `_dogetarg` and `_dogetargs` would.
2021-03-10 19:31:19 +01:00
Harald Hoyer
d643156d56 fix: remove dracut.pc on make clean 2021-03-10 17:58:37 +01:00
Harald Hoyer
d8a454a537 fix: honor KVERSION environment in the Makefile 2021-03-10 17:58:08 +01:00
Jonas Jelten
b12f8188a4 feat(nbd): support ipv6 link local nbds 2021-03-09 13:58:10 +00:00
Kairui Song
7c0bc0b2fd perf: disable initrd compression when squash module is enabled
With squash module, the initramfs is double compressed, which slow down
the build progress and doesn't shrink the size much.
2021-03-09 13:40:35 +00:00
Kairui Song
5d05ffbd87 feat: squash module follow --compress option
Try to make mksquashfs follow --compress option if squash module is
included, if not specified or invalid, fall back to use mksquashfs's
default compressor.
2021-03-09 13:40:35 +00:00
Kairui Song
a9345f6800 refactor: delay compressor detection
No function change, decide which compressor to use right before
compressing the initramfs.

This may delay the print of this message:
"dracut: no compression tool available. Initramfs image is going to be big."
but should be OK, this message is not an error.
2021-03-09 13:40:35 +00:00
Kairui Song
90f269f6af feat(squash): use busybox for early setup if available
Use busybox can help reduce the size of early setup environment.

With this change, everything is packed in the squash image, and
the setup files will be dropped once squash image setup is done,
so initramfs stage memory usage is reduced to the minimun,
and initramfs decompress is also faster.

File layout of a squash initramfs looks like this:

========================================================================
drwxr-xr-x   1 root     root            0 Feb 15 14:07 .
-rwxr-xr-x   1 root     root          946 Feb 15 14:07 init
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 lib -> usr/lib
drwxr-xr-x   1 root     root            0 Feb 15 14:07 squash
-rw-r--r--   1 root     root     91000832 Feb 15 14:07 squash-root.img
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/bin
-rwxr-xr-x   1 root     root      1293688 Jul 27  2020 usr/bin/busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/echo -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/mkdir -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/modprobe -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/mount -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/sh -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/switch_root -> busybox
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/dracut
-rw-r--r--   1 root     root           23 Feb 15 14:07 usr/lib/dracut/build-parameter.txt
-rw-r--r--   1 root     root           31 Feb 15 14:07 usr/lib/dracut/dracut-051-93.git20210215.fc33
-rw-r--r--   1 root     root          358 Feb 15 14:07 usr/lib/dracut/modules.txt
-rw-r--r--   1 root     root            0 Feb 15 14:07 usr/lib/dracut/need-initqueue
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64/kernel
<... kernel module misc files skipped ... >
========================================================================
2021-03-09 13:40:35 +00:00
Kairui Song
8f7c332e48 refactor(squash): structure in a cleaner way
Simplify the squash mount layout. Instead of overlay on each top
directory (/etc, /usr), just mount and switch_root into the squash
image, with a overlay on top of it.

Also install the binaries and setup scripts separately, so the squash
setup code and the squash image content is independent of each other,
all squash setup script and binaries can be deleted safely upon
switch_root.

With this change, previous squash clean up service and other tricky
implementations are all gone.

This commit depends on systemd commits from:
https://github.com/systemd/systemd/pull/18124

Previouly systemd doesn't recognize non-ramfs initramfs, now this is
doable with SYSTEMD_IN_INITRD=lenient

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-03-09 13:40:35 +00:00
Kairui Song
bdd194bb8c refactor(squash): don't record mount points in text file
The squasn mount points are recorded in text file so later clean up
script can umount them, this is not needed, the mount points are fixed
so just detect the umount by hardcoded pattern.
2021-03-09 13:40:35 +00:00
Kairui Song
5a18b24a8b feat(squash): install and depmod modules seperately
Separately install the modules required for squash image setup.
These modules can be deleted after squash image setup to save
memory.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-03-09 13:40:35 +00:00
Kairui Song
f9f4264d03 refactor(squash): move all setup code to init-squash.sh
Seperate of init.sh and setup-squash.sh is pointless, merge them into one.
2021-03-09 13:40:35 +00:00
Kairui Song
8c8aecdc63 fix(squash): post install should be the last step before stripping
Ensure dracut squash module doesn't effect other steps, and stripping
can cover the new binaries installed by it.
2021-03-09 13:40:35 +00:00
Kairui Song
95ea16aa60 refactor(squash): move the post install scripts into the module-setup.sh
No function change, just move the post install code to 99squash to clean
up dracut.sh.
2021-03-09 13:40:35 +00:00
Kairui Song
c552c99ef8 fix(squash): this module shouldn't depend on bash
Any other shell should just work.
2021-03-09 13:40:35 +00:00
Jóhann B. Guðmundsson
28545cda45 chore(labeler): remove the needs review label
There is no longer need to have pull requests labeled with the needs
review label since reviews are now mandatory on pull request.
2021-03-03 13:23:15 +00:00
Jóhann B. Guðmundsson
9cf7b1c529 fix: always use mkdir -p
Ensuring that directory creations dont trigger error if directory
previously existed as well as create parent directories if needed.
2021-03-03 13:06:02 +01:00
Daniel Molkentin
92e6a8f879 fix(kernel-modules): optionally add /usr/lib/modules.d to initramfs
On SUSE, there is no /lib/modules.d, only /usr/lib/modules.d.

Upstream-Bug: http://bugzilla.opensuse.org/show_bug.cgi?id=1180822

Reference: bsc#1180822
2021-03-03 11:42:09 +01:00
Lennart Poettering
a96900a82c fix(dracut-systemd): don't refuse root=tmpfs when systemd is used
A match for systemd PR#18847
2021-03-02 21:23:03 +00:00
Renaud Métrich
d8e47e201a fix(dracut.sh): harden dracut against GZIP environment variable
When a GZIP environment variable is set, this leads to various breakage:

In case 'pigz' is installed and GZIP is defined as a path, e.g.
/usr/local/bin/gzip, then dracut will fail with the following message:

   "
   pigz: abort: cannot provide files in GZIP environment variable
   "

In case 'pigz' isn't installed and regular 'gzip' is used and GZIP is
defined as a path, e.g. /usr/local/bin/gzip, then the path will be
zipped and dracut will fail for no obvious reason.  Trying again, dracut
will then fail with following message:

   "
   gzip: /usr/local/bin/gzip.gz already exists;	not overwritten
   "

In any case, GZIP environment should be unset to avoid breakage or
unwanted behaviour. This variable is anyway obsolescent, from gzip(1)
manpage.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2021-03-02 11:05:52 +01:00
Harald Hoyer
630334950c feat(skipcpio): speed up and harden skipcpio
Before:
```
Benchmark #1: ./skipcpio/skipcpio test-5.10.15-200.fc33.x86_64.img >/dev/null
  Time (mean ± σ):     125.5 ms ±   0.9 ms    [User: 97.4 ms, System: 27.9 ms]
  Range (min … max):   124.8 ms … 129.4 ms    23 runs
```

After:
```
Benchmark #1: ./skipcpio/skipcpio test-5.10.15-200.fc33.x86_64.img >/dev/null
  Time (mean ± σ):      12.2 ms ±   0.3 ms    [User: 2.7 ms, System: 9.5 ms]
  Range (min … max):    11.7 ms …  13.6 ms    212 runs
```

Besides the speedup, skipcpio now parses the cpio header and is not
falsely ending when the early cpio payload contains `TRAILER!!!`.

Fixes: https://github.com/dracutdevs/dracut/issues/1123
2021-02-25 14:48:22 +01:00
630 changed files with 20901 additions and 15300 deletions

9
.astylerc Normal file
View File

@@ -0,0 +1,9 @@
lineend=linux
style=linux
indent=spaces=8
convert-tabs
min-conditional-indent=0
max-instatement-indent=120
align-pointer=name
max-code-length=120

View File

@@ -21,5 +21,5 @@
(sh-indentation . 4)))
(awk-mode . ((c-basic-offset . 8)))
(nil . ((indent-tabs-mode . nil)
(tab-width . 8)
(tab-width . 4)
(fill-column . 79))) )

View File

@@ -12,6 +12,12 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4
switch_case_indent = true
function_next_line = false
binary_next_line = true
space_redirects = true
# Match config files, set indent to spaces with width of eight.
[*.{c,h}]
@@ -22,6 +28,10 @@ indent_size = 8
[*.sh]
indent_style = space
indent_size = 4
switch_case_indent = true
function_next_line = false
binary_next_line = true
space_redirects = true
# Match xml man pages, set indent to spaces with width of two.
[man/*.xml]

14
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
version: 2
# Maintain dependencies for GitHub Actions
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "tuesday"
commit-message:
prefix: "chore"
include: "scope"
ignore:
- dependency-name: "Manual test"

20
.github/labeler.yml vendored
View File

@@ -1,6 +1,3 @@
needs review:
- "*"
repository:
- ./*
@@ -24,9 +21,6 @@ modules:
bash:
- modules.d/00bash/*
bootchart:
- modules.d/00bootchart/*
dash:
- modules.d/00dash/*
@@ -90,9 +84,6 @@ url-lib:
drm:
- modules.d/50drm/*
gensplash:
- modules.d/50gensplash/*
plymouth:
- modules.d/50plymouth/*
@@ -147,6 +138,9 @@ multipath:
nvdimm:
- modules.d/90nvdimm/*
overlayfs:
- modules.d/90overlayfs/*
ppcmac:
- modules.d/90ppcmac/*
@@ -156,9 +150,6 @@ qemu:
qemu-net:
- modules.d/90qemu-net/*
stratis:
- modules.d/90stratis/*
crypt-gpg:
- modules.d/91crypt-gpg/*
@@ -231,6 +222,9 @@ udev-rules:
virtfs:
- modules.d/95virtfs/*
virtiofs:
- modules.d/95virtiofs/*
zfcp:
- modules.d/95zfcp/*
@@ -294,3 +288,5 @@ uefi-lib:
test:
- test/*
- test/**/*
- modules.d/80test*
- modules.d/80test*/*

8
.github/stale.yml vendored
View File

@@ -2,6 +2,8 @@
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Ignore if in a milestone
exemptMilestones: true
# Issues with these labels will never be considered stale
exemptLabels:
- documents
@@ -13,9 +15,9 @@ exemptLabels:
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue is being marked as stale because it has not had any recent activity.
It will be closed if no further activity occurs.
If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days.
This issue is being marked as stale because it has not had any recent activity.
It will be closed if no further activity occurs.
If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days.
Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

53
.github/workflows/codeql.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
---
# vi: ts=2 sw=2 et:
# SPDX-License-Identifier: LGPL-2.1-or-later
#
name: "CodeQL"
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ matrix.language }}-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['cpp', 'python']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-extended,security-and-quality
- name: Install dependencies
run: |
sudo apt -y update
sudo apt -y install asciidoc gcc libkmod-dev libsystemd-dev pkg-config
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

54
.github/workflows/container.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Container
on:
schedule:
- cron: '30 11 * * *' # every day at 4:40
push:
branches: [ master ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'
pull_request:
branches: [ master ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'
permissions:
packages: write
contents: read
jobs:
push_to_registry:
name: Build and push containers image to GitHub Packages
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
config:
- { dockerfile: 'Dockerfile-Fedora-latest', tag: 'fedora:latest' }
- { dockerfile: 'Dockerfile-OpenSuse-latest', tag: 'opensuse:latest' }
- { dockerfile: 'Dockerfile-Arch', tag: 'arch:latest' }
- { dockerfile: 'Dockerfile-Debian', tag: 'debian:latest' }
- { dockerfile: 'Dockerfile-Gentoo', tag: 'gentoo:latest' }
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up env
run: echo "repository_owner=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
- name: Build and Push Container
uses: docker/build-push-action@v4
with:
file: test/container/${{ matrix.config.dockerfile }}
tags: ghcr.io/${{env.repository_owner}}/${{ matrix.config.tag }}
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}

View File

@@ -1,48 +0,0 @@
## The test container is created with https://github.com/dracutdevs/fedora-container
name: Fedora-32
on:
push:
branches:
- 'master'
jobs:
test:
runs-on: ubuntu-latest
container:
image: quay.io/haraldh/dracut-fedora:32
options: "-v /dev/kvm:/dev/kvm"
timeout-minutes: 45
strategy:
matrix:
test: [
"01",
"02",
"03",
"04",
"10",
"11",
"12",
"13",
"14",
"15",
"17",
"20",
"21",
"30",
"31",
"35",
"36",
"40",
"41",
]
fail-fast: false
steps:
- name: "Checkout Repository"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "TEST-${{ matrix.test }}"
run: ./fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}

View File

@@ -1,49 +0,0 @@
## The test container is created with https://github.com/dracutdevs/fedora-container
name: Fedora-33
on:
push:
branches:
- 'master'
pull_request:
jobs:
test:
runs-on: ubuntu-latest
container:
image: quay.io/haraldh/dracut-fedora:33
options: "-v /dev/kvm:/dev/kvm"
timeout-minutes: 45
strategy:
matrix:
test: [
"01",
"02",
"03",
"04",
"10",
"11",
"12",
"13",
"14",
"15",
"17",
"20",
"21",
"30",
"31",
"35",
"36",
"40",
"41",
]
fail-fast: false
steps:
- name: "Checkout Repository"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "TEST-${{ matrix.test }}"
run: ./fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}

View File

@@ -1,48 +0,0 @@
## The test container is created with https://github.com/dracutdevs/fedora-container
name: Fedora-latest
on:
push:
branches:
- 'master'
jobs:
test:
runs-on: ubuntu-latest
container:
image: quay.io/haraldh/dracut-fedora:latest
options: "-v /dev/kvm:/dev/kvm"
timeout-minutes: 45
strategy:
matrix:
test: [
"01",
"02",
"03",
"04",
"10",
"11",
"12",
"13",
"14",
"15",
"17",
"20",
"21",
"30",
"31",
"35",
"36",
"40",
"41",
]
fail-fast: false
steps:
- name: "Checkout Repository"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "TEST-${{ matrix.test }}"
run: ./fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}

116
.github/workflows/integration.yml vendored Normal file
View File

@@ -0,0 +1,116 @@
name: Integration Test
on:
pull_request:
branches: [ master ]
env:
DEBUGFAIL: "${{ secrets.ACTIONS_STEP_DEBUG && 'rd.debug' }}"
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}
cancel-in-progress: true
strategy:
matrix:
container: [
"arch:latest",
"debian:latest",
"fedora:latest",
"opensuse:latest",
]
test: [
"01",
"02",
"03",
"04",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"62",
"98",
]
fail-fast: false
container:
image: ghcr.io/dracutdevs/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "${{ matrix.container }} TEST-${{ matrix.test }}"
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
network:
runs-on: ubuntu-latest
timeout-minutes: 45
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}-${{ matrix.network }}
cancel-in-progress: true
strategy:
matrix:
container: [
"fedora:latest",
]
network: [
"network-manager",
"network-legacy",
#"systemd-networkd",
#"connman",
]
test: [
"20",
"30",
"35",
"40",
"60",
# "50", # times out
]
fail-fast: false
container:
image: ghcr.io/dracutdevs/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "${{ matrix.container }} TEST-${{ matrix.test }}"
run: USE_NETWORK=${{ matrix.network }} ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
openrc-musl:
runs-on: ubuntu-latest
timeout-minutes: 45
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}
cancel-in-progress: true
strategy:
matrix:
container: [
"gentoo:latest",
]
test: [
"18",
]
fail-fast: false
container:
image: ghcr.io/dracutdevs/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: "${{ matrix.container }} TEST-${{ matrix.test }}"
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}

View File

@@ -1,15 +1,11 @@
name: Label the Pull Requests automatically via Cron
name: "Pull Request Labeler"
on:
schedule:
- cron: '*/15 * * * *'
on: pull_request_target
jobs:
label:
runs-on: ubuntu-18.04
triage:
runs-on: ubuntu-latest
steps:
- uses: paulfantom/periodic-labeler@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
LABEL_MAPPINGS_FILE: .github/labeler.yml
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

38
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Lint
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
lint-c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install tools
run: sudo apt-get install astyle
- name: indent
run: make indent-c
- name: check formatting
run: git diff --exit-code
lint-shell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: shfmt
uses: luizm/action-sh-checker@v0.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHFMT_OPTS: -s # arguments to shfmt.
with:
sh_checker_shellcheck_disable: false
sh_checker_comment: true

37
.github/workflows/manualtest.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Manual test
on:
workflow_dispatch:
inputs:
test:
description: "Array of tests to run, such as [11,12]"
default: "['04']"
required: true
container:
type: choice
description: 'distro'
default: 'fedora'
options:
- "fedora"
- "arch"
- "debian"
- "opensuse"
- "gentoo"
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
matrix:
test: ${{ fromJSON(inputs.test) }}
container:
image: ghcr.io/dracutdevs/${{ inputs.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: "${{ inputs.container }} ${{ matrix.test }}"
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check-out the repo under $GITHUB_WORKSPACE
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run Commisery
uses: dracutdevs/commisery-action@master

20
.gitignore vendored
View File

@@ -1,11 +1,14 @@
/Makefile.inc
/dracut.8
/dracut-catimages.8
/dracut.conf.5
/man/dracut.8
/man/dracut-catimages.8
/man/dracut.conf.5
/dracut.conf.d/*.conf
/dracut-gencmdline.8
/man/dracut.cmdline.7
/dracut.html
/dracut.kernel.7
/man/dracut.kernel.7
/man/dracut.bootup.7
/man/dracut.modules.7
/man/lsinitrd.1
/dracut.pc
/dracut-install
/modules.d/99base/switch_root
@@ -15,10 +18,13 @@ test*.img
/.buildpath
/.project
/dracut-version.sh
/install/dracut-install
/src/install/dracut-install
/*.rpm
/*.[0-9]
/modules.d/98dracut-systemd/*.service.8
/*.sign
*.o
skipcpio/skipcpio
/src/skipcpio/skipcpio
/src/util/util
/dracut-util
.idea/

View File

@@ -1 +1,2 @@
kate: space-indent on; tab-width 4; indent-width 4; replace-tabs on; eol unix;
kate-mimetype(text/x-c): tab-width 8; indent-width 8;

View File

@@ -2,9 +2,10 @@ Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer-omB+W0Dpw2o@public.gm
Seewer Philippe <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
Victor Lowther <victor.lowther@gmail.com> <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Harald Hoyer <harald@redhat.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Harald Hoyer <harald@redhat.com> <harald@eeepc.(none)>
Harald Hoyer <harald@redhat.com> <harald@hoyer.xyz>
Harald Hoyer <harald@profian.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Harald Hoyer <harald@profian.com> <harald@eeepc.(none)>
Harald Hoyer <harald@profian.com> <harald@hoyer.xyz>
Harald Hoyer <harald@profian.com> <harald@redhat.com>
Mike Snitzer <snitzer@redhat.com> <msnitzer@redhat.com>
Amerigo Wang <amwang@redhat.com> <xiyou.wangcong@gmail.com>
Andrey Borzenkov <arvidjaar@gmail.com> <arvidjaar@mail.ru>

View File

@@ -1,58 +0,0 @@
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
# The name of the upstream package
upstream_package_name: dracut
# The upstream tag versioning scheme
upstream_tag_template: "{version}"
# The URL of the upstream project
upstream_project_url: https://github.com/dracutdevs/dracut
# Relative path to a spec file within the upstream repository
specfile_path: dracut.spec
# Name of the downstream package
downstream_package_name: dracut
# The URL of the downstream project
dist_git_base_url: https://src.fedoraproject.org/
# Sync file(s) from upstream repo to dist-git
synced_files:
# The dracut spec file is maintained upstream so we sync it downstream.
- dracut.spec
# We sync the packit file downstream be able to optionally use the sync-from-downstream command
- .packit.yaml
# We want new releases to be automatically built on rawhide and have few jobs
# on copr.
create_pr: false
jobs:
- job: propose_downstream
trigger: release
metadata:
dist_git_branches: master
- job: tests
trigger: pull_request
metadata:
targets:
- fedora-rawhide
- job: copr_build
trigger: pull_request
metadata:
targets:
- fedora-rawhide
- job: copr_build
trigger: commit
metadata:
targets:
- fedora-rawhide
branch: master
owner: "@dracut"
project: Dracut
preserve_project: True

34
.shellcheckrc Normal file
View File

@@ -0,0 +1,34 @@
# SC2039: In POSIX sh, 'local' is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC2039
disable=SC2039
# SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
# https://github.com/koalaman/shellcheck/wiki/SC2166
disable=SC2166
# SC2154: Variable is referenced but not assigned
# https://github.com/koalaman/shellcheck/wiki/SC2154
disable=SC2154
# SC1091: Not following <file>
# https://github.com/koalaman/shellcheck/wiki/SC1091
disable=SC1091
# SC2174: When used with -p, -m only applies to the deepest directory.
# https://github.com/koalaman/shellcheck/wiki/SC2174
disable=SC2174
# SC3043: In POSIX sh, 'local' is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC3043
# ... but dash supports it
disable=SC3043
# SC3013: In POSIX sh, -ef is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC3013
# ... but dash supports it
disable=SC3013
# SC3045: In POSIX sh, read -p is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC3045
# ... but dash supports it
disable=SC3045

10
.vimrc
View File

@@ -1,15 +1,15 @@
" Vim can use per directory configuration files like this.
" Vim can use per directory configuration files like this.
" To enable that feature two lines are needed in your ~/.vimrc
" set exrc " enables per-directory .vimrc files
" set secure " disable unsafe commands in local .vimrc files
" Characters width is set to 109 for .c and XML but for everything else 79.
" If you update this file make sure to update .dir-locals.el & .editorconfig
" If you update this file make sure to update .dir-locals.el & .editorconfig
set tabstop=8
set shiftwidth=8
set tabstop=4
set shiftwidth=4
set expandtab
set makeprg=GCC_COLORS=\ make
set tw=79
au BufRead,BufNewFile *.xml set tw=109 shiftwidth=2 smarttab
au FileType sh set tw=80 shiftwidth=4 smarttab
au FileType c set tw=109
au FileType c set tw=109 shiftwidth=8 tabstop=8 smarttab expandtab

View File

@@ -1,65 +0,0 @@
#!/bin/bash
COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"
# If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory.
# So, let's skip to create initrd.
if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
exit 0
fi
if [[ -d "$BOOT_DIR_ABS" ]]; then
INITRD="initrd"
else
BOOT_DIR_ABS="/boot"
INITRD="initramfs-${KERNEL_VERSION}.img"
fi
ret=0
case "$COMMAND" in
add)
INITRD_IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd
if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
# we found an initrd at the same place as the kernel
# use this and don't generate a new one
cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$INITRD" \
&& chown root:root "$BOOT_DIR_ABS/$INITRD" \
&& chmod 0600 "$BOOT_DIR_ABS/$INITRD" \
&& exit 0
fi
if [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
else
declare -a BOOT_OPTIONS
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi
unset noimageifnotneeded
for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
# shellcheck disable=SC1001
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
noimageifnotneeded="yes"
break
fi
done
dracut -f ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
ret=$?
;;
remove)
rm -f -- "$BOOT_DIR_ABS/$INITRD"
ret=$?
;;
esac
exit $ret

119
AUTHORS
View File

@@ -1,54 +1,67 @@
Harald Hoyer <harald@redhat.com>
Harald Hoyer <harald@profian.com>
Victor Lowther <victor.lowther@gmail.com>
Jóhann B. Guðmundsson <johannbg@gmail.com>
Laszlo Gombos <laszlo.gombos@gmail.com>
Amadeusz Żołnowski <aidecoe@aidecoe.name>
Hannes Reinecke <hare@suse.com>
Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Daniel Molkentin <daniel.molkentin@suse.com>
Hannes Reinecke <hare@suse.com>
Kairui Song <kasong@redhat.com>
Will Woods <wwoods@redhat.com>
Philippe Seewer <philippe.seewer@bfh.ch>
Warren Togami <wtogami@redhat.com>
Jóhann B. Guðmundsson <johannbg@gmail.com>
Kairui Song <kasong@redhat.com>
Dave Young <dyoung@redhat.com>
Jeremy Katz <katzj@redhat.com>
Lukas Nykryn <lnykryn@redhat.com>
David Dillow <dave@thedillows.org>
Martin Wilck <mwilck@suse.de>
Lubomir Rintel <lkundrak@v3.sk>
Michal Soltys <soltys@ziu.info>
Colin Guthrie <colin@mageia.org>
Amerigo Wang <amwang@redhat.com>
Thomas Renninger <trenn@suse.com>
Alexander Tsoy <alexander@tsoy.me>
Martin Wilck <mwilck@suse.de>
Frederick Grose <fgrose@sugarlabs.org>
WANG Chao <chaowang@redhat.com>
Beniamino Galvani <bgalvani@redhat.com>
Jonathan Lebon <jonathan@jlebon.com>
Yu Watanabe <watanabe.yu+github@gmail.com>
Andrey Borzenkov <arvidjaar@gmail.com>
Hans de Goede <hdegoede@redhat.com>
Jonathan Lebon <jonathan@jlebon.com>
Peter Jones <pjones@redhat.com>
Andreas Thienemann <andreas@bawue.net>
David Tardon <dtardon@redhat.com>
Peter Robinson <pbrobinson@fedoraproject.org>
David Disseldorp <ddiss@suse.de>
Hans de Goede <hdegoede@redhat.com>
Frantisek Sumsal <frantisek@sumsal.cz>
Peter Jones <pjones@redhat.com>
Thomas Blume <thomas.blume@suse.com>
Andreas Thienemann <andreas@bawue.net>
Marcos Mello <marcosfrm@gmail.com>
Renaud Métrich <rmetrich@redhat.com>
наб <nabijaczleweli@nabijaczleweli.xyz>
Pavel Valena <pvalena@redhat.com>
Tomasz Paweł Gajc <tpgxyz@gmail.com>
Brian C. Lane <bcl@redhat.com>
Fabian Vogt <fvogt@suse.com>
Nicolas Chauvet <kwizart@gmail.com>
Zoltán Böszörményi <zboszor@pr.hu>
Colin Walters <walters@verbum.org>
John Reiser <jreiser@bitwagon.com>
Luca Berra <bluca@vodka.it>
Tomasz Paweł Gajc <tpgxyz@gmail.com>
Shreenidhi Shedi <sshedi@vmware.com>
Xunlei Pang <xlpang@redhat.com>
Brian C. Lane <bcl@redhat.com>
Daniel Drake <drake@endlessm.com>
David Teigland <teigland@redhat.com>
Dusty Mabe <dusty@dustymabe.com>
Kairui Song <kasong@tencent.com>
Angelo "pallotron" Failla <pallotron@fb.com>
Beniamino Galvani <bgalvani@redhat.com>
Thomas Blume <thomas.blume@suse.com>
Dan Horák <dhorak@redhat.com>
Ville Skyttä <ville.skytta@iki.fi>
Böszörményi Zoltán <zboszor@pr.hu>
Cristian Rodríguez <crrodriguez@opensuse.org>
Dan Horák <dhorak@redhat.com>
Javier Martinez Canillas <javierm@redhat.com>
Mike Gilbert <floppym@gentoo.org>
Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Ondrej Mosnacek <omosnace@redhat.com>
Renaud Métrich <rmetrich@redhat.com>
Baoquan He <bhe@redhat.com>
Brendan Germain <brendan.germain@nasdaqomx.com>
Jonas Witschel <diabonas@gmx.de>
@@ -56,30 +69,32 @@ Leho Kraav <leho@kraav.com>
Moritz Maxeiner <moritz@ucworks.org>
Nathan Rini <nate@ucar.edu>
Radek Vykydal <rvykydal@redhat.com>
David Tardon <dtardon@redhat.com>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Fabian Deutsch <fabiand@fedoraproject.org>
Kamil Rytarowski <n54@gmx.com>
Lidong Zhong <lidong.zhong@suse.com>
Marc Grimme <grimme@atix.de>
Mike Gilbert <floppym@gentoo.org>
NeilBrown <neilb@suse.de>
Peter Rajnoha <prajnoha@redhat.com>
Tao Liu <ltao@redhat.com>
Thorsten Behrens <tbehrens@suse.com>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
q66 <daniel@octaforge.org>
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Adam Williamson <awilliam@redhat.com>
Chao Wang <chaowang@redhat.com>
Frederic Crozat <fcrozat@suse.com>
James Lee <jlee@thestaticvoid.com>
Jesse Keating <jkeating@redhat.com>
Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Masahiro Matsuya <mmatsuya@redhat.com>
Milan Broz <mbroz@redhat.com>
Mimi Zohar <zohar@linux.vnet.ibm.com>
Norbert Lange <norbert.lange@andritz.com>
Pingfan Liu <piliu@redhat.com>
Roberto Sassu <roberto.sassu@polito.it>
Stefan Reimer <it@startux.de>
Takashi Iwai <tiwai@suse.de>
Tony Asleson <tasleson@redhat.com>
Zoltán Böszörményi <zboszor@gmail.com>
Anton Blanchard <anton@samba.org>
Bill Nottingham <notting@redhat.com>
Chapman Flack <g2@anastigmatix.net>
@@ -93,13 +108,15 @@ Jiri Konecny <jkonecny@redhat.com>
Jon Ander Hernandez <jonan.h@gmail.com>
Juan RP <xtraeme@gmail.com>
Lance Albertson <lance@osuosl.org>
Marcos Mello <marcosfrm@gmail.com>
Marian Ganisin <mganisin@redhat.com>
Matt Coleman <matt@datto.com>
Matthias Gerstner <matthias.gerstner@suse.de>
Max Resch <resch.max@gmail.com>
Michael Ploujnikov <plouj@somanetworks.com>
Nicolas Porcel <nicolasporcel06@gmail.com>
Pratyush Anand <panand@redhat.com>
Silvio Fricke <silvio.fricke@gmail.com>
Stefan Berger <stefanb@linux.ibm.com>
Steven Brudenell <steven.brudenell@gmail.com>
Stig Telfer <stelfer@cray.com>
Thomas Backlund <tmb@mageia.org>
@@ -108,30 +125,40 @@ Vasiliy Tolstov <v.tolstov@selfip.ru>
Wim Muskee <wimmuskee@gmail.com>
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Alan Pevec <apevec@redhat.com>
Alberto Planas <aplanas@suse.com>
Alex Harpin <development@landsofshadow.co.uk>
Alexander Wenzel <alexander.wenzel@qbeyond.de>
Alexey Shabalin <shaba@altlinux.org>
Andre Russ <andre.russ@sap.com>
Andreas Schwab <schwab@suse.de>
Ankit Kumar <ankit@linux.vnet.ibm.com>
Antony Messerli <amesserl@rackspace.com>
Chao Fan <cfan@redhat.com>
Coiby Xu <coxu@redhat.com>
Cornelius Hoffmann <coding@hoffmn.de>
Daniel Cordero <dracut@0xdc.io>
Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Daniel Schaal <farbing@web.de>
Denis Silakov <dsilakov@virtuozzo.com>
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
Dusty Mabe <dusty@dustymabe.com>
Erwan Velu <erwan.velu@enovance.com>
Evgeny Vereshchagin <evvers@ya.ru>
German Maglione <gmaglione@redhat.com>
Guido Trentalancia <guido@trentalancia.net>
Hari Bathini <hbathini@linux.ibm.com>
Hari Bathini <hbathini@linux.vnet.ibm.com>
Henrik Gombos <henrik99999@gmail.com>
Ian Dall <ian@beware.dropbear.id.au>
Imran Haider <imran1008@gmail.com>
James Buren <ryuo@frugalware.org>
Jan Macku <jamacku@redhat.com>
Joey Boggs <jboggs@redhat.com>
José María Fernández <josemariafg@gmail.com>
Julian Wolf <juwolf@suse.com>
Koen Kooi <koen@dominion.thruhere.net>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Kyle McMartin <kmcmarti@redhat.com>
Lee Duncan <lduncan@suse.com>
Luiz Angelo Daros de Luca <luizluca@gmail.com>
Lukas Wunner <lukas@wunner.de>
Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
@@ -144,27 +171,28 @@ Nikoli <nikoli@gmx.us>
Patrick Talbert <ptalbert@redhat.com>
Pedro Monreal <pmgdeb@gmail.com>
Petr Pavlu <petr.pavlu@suse.com>
Pingfan Liu <piliu@redhat.com>
Przemysław Rudy <prudy1@o2.pl>
Robert LeBlanc <robert@leblancnet.us>
Robert Scheck <robert@fedoraproject.org>
Stefan Berger <stefanb@us.ibm.com>
Thomas Lange <lange@informatik.uni-koeln.de>
Till Maas <opensource@till.name>
Tony Asleson <tasleson@redhat.com>
Vivek Goyal <vgoyal@redhat.com>
Vladislav Bogdanov <bubble@hoster-ok.com>
keentux <valentin.lefebvre@suse.com>
nkraetzschmar <nkraetzschmar@users.noreply.github.com>
Érico Rolim <erico.erc@gmail.com>
наб <nabijaczleweli@nabijaczleweli.xyz>
A. Wilcox <AWilcox@Wilcox-Tech.com>
Adam Alves <adamoa@gmail.com>
Adrien Thierry <athierry@redhat.com>
Alexander Kurtz <alexander@kurtz.be>
Alexander Miroshnichenko <alex@millerson.name>
Alexander Sosedkin <asosedkin@redhat.com>
Alexander Todorov <atodorov@redhat.com>
Alexey Kodanev <alexey.kodanev@oracle.com>
Andreas Schwab <schwab@suse.de>
Andreas Stieger <astieger@suse.com>
Andrew J. Hesford <ajh@sideband.org>
Andrey Sokolov <keremet@altlinux.org>
Andy Lutomirski <luto@mit.edu>
Anjali Kulkarni <anjali.k.kulkarni@oracle.com>
Anssi Hannula <anssi@mageia.org>
@@ -174,23 +202,30 @@ Artem Savkov <asavkov@redhat.com>
Attila Bruncsak <bruncsak@users.noreply.github.com>
B. Wilson <x@wilsonb.com>
Ben Howard <ben.howard@redhat.com>
Benjamin Gilbert <bgilbert@redhat.com>
Benjamin Marzinski <bmarzins@redhat.com>
Brandon Philips <brandon@ifup.co>
Brandon Sloane <btsloane@verizon.net>
Bruno E. O. Meneguele <bmeneg@redhat.com>
Bryn M. Reeves <bmr@redhat.com>
Canek Peláez Valdés <caneko@gmail.com>
Carlo Caione <carlo@endlessm.com>
Chad Dupuis <chad.dupuis@cavium.com>
Charles Rose <charles.rose@dell.com>
Christian Heinz <christian.ch.heinz@gmail.com>
Cole Robinson <crobinso@redhat.com>
Cong Wang <amwang@redhat.com>
Conrad Hoffmann <ch@bitfehler.net>
Daan De Meyer <daan.j.demeyer@gmail.com>
Dan Fuhry <dfuhry@datto.com>
Dave Jones <davej@redhat.com>
David Disseldorp <ddiss@suse.de>
David Hildenbrand <david@redhat.com>
David Michael <david.michael@coreos.com>
Denis Volkov <denis@simpletexting.net>
Dennis Schridde <devurandom@gmx.net>
Derek Hageman <hageman@inthat.cloud>
Derek Higgins <derekh@redhat.com>
Dirk Müller <dirk@dmllr.de>
Donovan Tremura <neurognostic@protonmail.ch>
Duane Griffin <duaneg@dghda.com>
Elan Ruusamäe <glen@delfi.ee>
@@ -204,8 +239,10 @@ Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
Florian Gamböck <mail@floga.de>
Frank Deng <frank.deng@oracle.com>
François Cami <fcami@fedoraproject.org>
Frederick Grose <4335897+FGrose@users.noreply.github.com>
Gerd von Egidy <gerd.von.egidy@intra2net.com>
Glen Gray <slaine@slaine.org>
Glenn Morris <rgm@stanford.edu>
GuoChuang <guo.chuang@zte.com.cn>
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Hendrik Brueckner <brueckner@linux.ibm.com>
@@ -216,20 +253,30 @@ Hui Wang <john.wanghui@huawei.com>
Ignaz Forster <iforster@suse.com>
Jacob Wen <jian.w.wen@oracle.com>
James Laska <jlaska@redhat.com>
James Morris <morisja@gmail.com>
Jan Stodola <jstodola@redhat.com>
Jaroslav Jindrak <dzejrou@gmail.com>
Jason Dana <jasondana@quarksecurity.com>
Jens Heise <46450477+heisej@users.noreply.github.com>
Jeremy Linton <jlinton@redhat.com>
Jeremy Linton <lintonrjeremy@gmail.com>
Jiri Pirko <jiri@resnulli.us>
Joe Lawrence <Joe.Lawrence@stratus.com>
Johannes Thumshirn <jthumshirn@suse.com>
Jonas Jelten <jj@sft.lol>
Jonas Jonsson <jonas@websystem.se>
Jonas Witschel <diabonas@archlinux.org>
Kenneth D'souza <kennethdsouza94@gmail.com>
Kevin Yung <Kevin.Yung@myob.com>
Lars R. Damerow <lars@pixar.com>
Lee Duncan <lduncan@suse.com>
Lars Wendler <polynomial-c@gentoo.org>
Laura Hild <lsh@jlab.org>
Lennart Poettering <lennart@poettering.net>
Lennert Buytenhek <buytenh@wantstofly.org>
Lev Veyde <lveyde@redhat.com>
Lianbo Jiang <lijiang@redhat.com>
LinkTed <link.ted@mailbox.org>
Luca BRUNO <luca.bruno@coreos.com>
Lucas C. Villa Real <lucasvr@gmail.com>
Major Hayden <major@mhtx.net>
Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
@@ -238,15 +285,18 @@ Marian Csontos <mcsontos@redhat.com>
Mark Fasheh <mfasheh@suse.de>
Matt <smoothsailing72@hotmail.com>
Matt Smith <shadowfax@gmx.com>
Matthias Berndt <matthias_berndt@gmx.de>
Mei Liu <liumbj@linux.vnet.ibm.com>
Michael Chapman <mike@very.puzzling.org>
Michael McCracken <michael.mccracken@gmail.com>
Michal Hecko <mhecko@redhat.com>
Michal Schmidt <mschmidt@redhat.com>
Michal Sekletar <msekleta@redhat.com>
Mike Gorse <mgorse@suse.com>
Moritz 'Morty' Strübe <morty@gmx.net>
Morten Linderud <morten@linderud.pw>
Munehiro Matsuda <haro@kgt.co.jp>
Nicolas Porcel <nicolasporcel06@gmail.com>
Neal Gompa <neal@gompa.dev>
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Olivier Blin <dev@blino.org>
Ondrej Dubaj <odubaj@redhat.com>
@@ -268,6 +318,8 @@ Robert Buchholz <rbu@goodpoint.de>
Ruben Kerkhof <ruben@rubenkerkhof.com>
Rumbaut Thomas <Thomas.Rumbaut@digipolis.gent>
Rusty Bird <rustybird@openmailbox.org>
Savyasachee Jha <genghizkhan91@hawkradius.com>
Scott Moser <smoser@brickies.net>
Sebastian Mitterle <smitterl@redhat.com>
Sergei Iudin <tsipa740@gmail.com>
Sergey Fionov <fionov@gmail.com>
@@ -278,6 +330,8 @@ Sullivan (CTR), Austin <austin.sullivan.ctr@progeny.net>
Thierry Vignaud <thierry.vignaud@gmail.com>
Thilo Bangert <thilo.bangert@gmx.net>
Thomas Abraham <tabraham@suse.com>
Thomas Haller <thaller@redhat.com>
Tianhao Chai <cth451@gmail.com>
Tobias Geerinckx <tobias.geerinckx@gmail.com>
Tobias Klauser <tklauser@distanz.ch>
Tom Gundersen <teg@jklm.no>
@@ -287,17 +341,22 @@ Vadim Kuznetsov <vadimk@gentoo.org>
Vaughan Cao <vaughan.cao@oracle.com>
Vladius25 <vkorol2509@icloud.com>
Vratislav Podzimek <vpodzime@redhat.com>
Wenchao Hao <haowenchao@huawei.com>
Yang Liu <50459973+ly4096x@users.noreply.github.com>
Yanko Kaneti <yaneti@declera.com>
Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
Ziyue Yang <ziyang@redhat.com>
foopub <45460217+foopub@users.noreply.github.com>
gaoyi <ymuemc@163.com>
gombi <gombi@>
honza801 <honza801@gmail.com>
jbash aka John Bashinski <jbash@velvet.com>
jloeser <jloeser@suse.de>
joamonwx <unknown>
johannes <johannes.brechtmann@gmail.com>
jonathan-teh <30538043+jonathan-teh@users.noreply.github.com>
joshuacov1 <joshuacov@gmail.com>
lapseofreason <lapseofreason0@gmail.com>
leo-lb <lle-bout@zaclys.net>
logan <logancaldwell23@gmail.com>
masem <matej.semian@gmail.com>
@@ -307,5 +366,7 @@ mwberry <mwberry@users.noreply.github.com>
nabijaczleweli <nabijaczleweli@gmail.com>
privb0x23 <privb0x23@users.noreply.github.com>
realtime-neil <neil@rtr.ai>
runsisi <runsisi@hust.edu.cn>
tupper <tupper.bob@gmail.com>
xtraeme <xtraeme@voidlinux.eu>
Дамјан Георгиевски <gdamjan@gmail.com>

22
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,22 @@
We welcome contributions from everyone. However, please follow the following guidelines when posting a GitHub Pull Request or filing a GitHub Issue on the dracut project:
By participating in this project, you agree to abide by the [code of conduct](docs/CODE_OF_CONDUCT.md).
# Filing Issues
We use GitHub Issues exclusively for tracking bugs and feature requests of dracut.
We only track bugs in the two most recently released versions of dracut in the GitHub Issue tracker.
If you are using an older version of dracut, please contact your distribution's bug tracker instead (see below). See GitHub Release Page for the list of most recent releases.
When filing an issue, specify the dracut version you are experiencing the issue with. Also, indicate which distribution you are using.
Please include an explanation how to reproduce the issue you are pointing out.
For more information on Coding Style and Commit messages see [Dracut Developer Guidelines](docs/HACKING.md).
# Older or downstream versions
For older or downstream versions that are still supported by your distribution please use respective downstream tracker:
[Debian](https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=dracut)
[Fedora](https://bugzilla.redhat.com/buglist.cgi?quicksearch=dracut)
[Gentoo](https://bugs.gentoo.org/buglist.cgi?quicksearch=dracut)
[openSUSE](https://bugzilla.opensuse.org/buglist.cgi?quicksearch=dracut)

203
Makefile
View File

@@ -1,16 +1,21 @@
-include dracut-version.sh
DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
DRACUT_MAIN_VERSION := $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
ifeq ($(DRACUT_MAIN_VERSION),)
DRACUT_MAIN_VERSION = $(DRACUT_VERSION)
endif
DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
DRACUT_FULL_VERSION := $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --tags --always 2>/dev/null || :)
ifeq ($(DRACUT_FULL_VERSION),)
DRACUT_FULL_VERSION = $(DRACUT_VERSION)
endif
HAVE_SHELLCHECK ?= $(shell command -v shellcheck >/dev/null 2>&1 && echo yes)
HAVE_SHFMT ?= $(shell command -v shfmt >/dev/null 2>&1 && echo yes)
-include Makefile.inc
KVERSION ?= $(shell uname -r)
prefix ?= /usr
libdir ?= ${prefix}/lib
datadir ?= ${prefix}/share
@@ -22,18 +27,16 @@ CFLAGS ?= -O2 -g -Wall -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format
bashcompletiondir ?= ${datadir}/bash-completion/completions
pkgconfigdatadir ?= $(datadir)/pkgconfig
man1pages = lsinitrd.1
man1pages = man/lsinitrd.1
man5pages = dracut.conf.5
man5pages = man/dracut.conf.5
man7pages = dracut.cmdline.7 \
dracut.bootup.7 \
dracut.modules.7
man7pages = man/dracut.cmdline.7 \
man/dracut.bootup.7 \
man/dracut.modules.7
man8pages = dracut.8 \
dracut-catimages.8 \
mkinitrd.8 \
mkinitrd-suse.8 \
man8pages = man/dracut.8 \
man/dracut-catimages.8 \
modules.d/98dracut-systemd/dracut-cmdline.service.8 \
modules.d/98dracut-systemd/dracut-initqueue.service.8 \
modules.d/98dracut-systemd/dracut-mount.service.8 \
@@ -45,47 +48,68 @@ man8pages = dracut.8 \
manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
.PHONY: install clean archive rpm srpm testimage test all check AUTHORS CONTRIBUTORS doc dracut-version.sh
.PHONY: install clean archive testimage test all check AUTHORS CONTRIBUTORS doc dracut-version.sh
all: dracut-version.sh dracut.pc dracut-install skipcpio/skipcpio
all: dracut-version.sh dracut.pc dracut-install src/skipcpio/skipcpio dracut-util
%.o : %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(KMOD_CFLAGS) $< -o $@
DRACUT_INSTALL_OBJECTS = \
install/dracut-install.o \
install/hashmap.o\
install/log.o \
install/strv.o \
install/util.o
src/install/dracut-install.o \
src/install/hashmap.o\
src/install/log.o \
src/install/strv.o \
src/install/util.o
# deps generated with gcc -MM
install/dracut-install.o: install/dracut-install.c install/log.h install/macro.h \
install/hashmap.h install/util.h
install/hashmap.o: install/hashmap.c install/util.h install/macro.h install/log.h \
install/hashmap.h
install/log.o: install/log.c install/log.h install/macro.h install/util.h
install/util.o: install/util.c install/util.h install/macro.h install/log.h
install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h install/log.h
src/install/dracut-install.o: src/install/dracut-install.c src/install/log.h src/install/macro.h \
src/install/hashmap.h src/install/util.h
src/install/hashmap.o: src/install/hashmap.c src/install/util.h src/install/macro.h src/install/log.h \
src/install/hashmap.h
src/install/log.o: src/install/log.c src/install/log.h src/install/macro.h src/install/util.h
src/install/util.o: src/install/util.c src/install/util.h src/install/macro.h src/install/log.h
src/install/strv.o: src/install/strv.c src/install/strv.h src/install/util.h src/install/macro.h src/install/log.h
install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
src/install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(FTS_LIBS) $(KMOD_LIBS)
logtee: logtee.c
logtee: src/logtee/logtee.c
$(CC) $(LDFLAGS) -o $@ $<
dracut-install: install/dracut-install
dracut-install: src/install/dracut-install
ln -fs $< $@
SKIPCPIO_OBJECTS= \
skipcpio/skipcpio.o
SKIPCPIO_OBJECTS = src/skipcpio/skipcpio.o
skipcpio/skipcpio.o: src/skipcpio/skipcpio.c
skipcpio/skipcpio: $(SKIPCPIO_OBJECTS)
skipcpio/skipcpio.o: skipcpio/skipcpio.c
skipcpio/skipcpio: skipcpio/skipcpio.o
UTIL_OBJECTS = src/util/util.o
util/util.o: src/util/util.c
util/util: $(UTIL_OBJECTS)
indent:
indent -i8 -nut -br -linux -l120 install/dracut-install.c
indent -i8 -nut -br -linux -l120 skipcpio/skipcpio.c
dracut-util: src/util/util
cp -a $< $@
.PHONY: indent-c
indent-c:
astyle -n --quiet --options=.astylerc $(wildcard *.[ch] */*.[ch] src/*/*.[ch])
.PHONY: indent
indent: indent-c
ifeq ($(HAVE_SHFMT),yes)
shfmt -w -s .
endif
src/dracut-cpio/target/release/dracut-cpio: src/dracut-cpio/src/main.rs
cargo --offline build --release --manifest-path src/dracut-cpio/Cargo.toml
dracut-cpio: src/dracut-cpio/target/release/dracut-cpio
ln -fs $< $@
ifeq ($(enable_dracut_cpio),yes)
all: dracut-cpio
endif
doc: $(manpages) dracut.html
@@ -101,17 +125,18 @@ endif
@rm -f -- "$@"
asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $<
dracut.8: dracut.usage.asc dracut.8.asc
dracut.8: man/dracut.8.asc \
man/dracut.usage.asc
dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
dracut.html: man/dracut.asc $(manpages) docs/dracut.css man/dracut.usage.asc
@rm -f -- dracut.xml
asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \
-a "version=$(DRACUT_FULL_VERSION)" \
-a numbered \
-d book -b docbook -o dracut.xml dracut.asc
-d book -b docbook -o dracut.xml man/dracut.asc
@rm -f -- dracut.html
xsltproc -o dracut.html --xinclude -nonet \
--stringparam custom.css.source dracut.css \
--stringparam custom.css.source docs/dracut.css \
--stringparam generate.css.header 1 \
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
@rm -f -- dracut.xml
@@ -132,7 +157,6 @@ install: all
mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(bindir)/mkinitrd
install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
@@ -153,6 +177,7 @@ ifneq ($(enable_documentation),no)
endif
if [ -n "$(systemdsystemunitdir)" ]; then \
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown-onfailure.service; \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \
ln -s ../dracut-shutdown.service \
@@ -172,24 +197,30 @@ endif
$(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \
done \
fi
if [ -f install/dracut-install ]; then \
install -m 0755 install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
if [ -f src/install/dracut-install ]; then \
install -m 0755 src/install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
fi
if [ -f skipcpio/skipcpio ]; then \
install -m 0755 skipcpio/skipcpio $(DESTDIR)$(pkglibdir)/skipcpio; \
if [ -f src/skipcpio/skipcpio ]; then \
install -m 0755 src/skipcpio/skipcpio $(DESTDIR)$(pkglibdir)/skipcpio; \
fi
if [ -f dracut-util ]; then \
install -m 0755 dracut-util $(DESTDIR)$(pkglibdir)/dracut-util; \
fi
ifeq ($(enable_dracut_cpio),yes)
install -m 0755 dracut-cpio $(DESTDIR)$(pkglibdir)/dracut-cpio
endif
mkdir -p $(DESTDIR)${prefix}/lib/kernel/install.d
install -m 0755 50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install
install -m 0755 51-dracut-rescue.install $(DESTDIR)${prefix}/lib/kernel/install.d/51-dracut-rescue.install
install -m 0755 install.d/50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install
install -m 0755 install.d/51-dracut-rescue.install $(DESTDIR)${prefix}/lib/kernel/install.d/51-dracut-rescue.install
mkdir -p $(DESTDIR)${bashcompletiondir}
install -m 0644 dracut-bash-completion.sh $(DESTDIR)${bashcompletiondir}/dracut
install -m 0644 lsinitrd-bash-completion.sh $(DESTDIR)${bashcompletiondir}/lsinitrd
install -m 0644 shell-completion/bash/dracut $(DESTDIR)${bashcompletiondir}/dracut
install -m 0644 shell-completion/bash/lsinitrd $(DESTDIR)${bashcompletiondir}/lsinitrd
mkdir -p $(DESTDIR)${pkgconfigdatadir}
install -m 0644 dracut.pc $(DESTDIR)${pkgconfigdatadir}/dracut.pc
dracut-version.sh:
@rm -f dracut-version.sh
@echo "DRACUT_VERSION=$(DRACUT_FULL_VERSION)" > dracut-version.sh
@printf "#!/bin/sh\n# shellcheck disable=SC2034\nDRACUT_VERSION=%s\n" "$(DRACUT_FULL_VERSION)" > dracut-version.sh
clean:
$(RM) *~
@@ -197,11 +228,14 @@ clean:
$(RM) */*/*~
$(RM) $(manpages:%=%.xml) dracut.xml
$(RM) test-*.img
$(RM) dracut-*.rpm dracut-*.tar.bz2 dracut-*.tar.xz
$(RM) dracut-*.tar.bz2 dracut-*.tar.xz
$(RM) dracut-version.sh
$(RM) dracut-install install/dracut-install $(DRACUT_INSTALL_OBJECTS)
$(RM) dracut-install src/install/dracut-install $(DRACUT_INSTALL_OBJECTS)
$(RM) skipcpio/skipcpio $(SKIPCPIO_OBJECTS)
$(RM) dracut-util util/util $(UTIL_OBJECTS)
$(RM) $(manpages) dracut.html
$(RM) dracut.pc
$(RM) dracut-cpio src/dracut-cpio/target/release/dracut-cpio*
$(MAKE) -C test clean
dist: dracut-$(DRACUT_MAIN_VERSION).tar.xz
@@ -216,28 +250,6 @@ dracut-$(DRACUT_MAIN_VERSION).tar.xz: doc syncheck
xz -9 dracut-$(DRACUT_MAIN_VERSION).tar
rm -f -- dracut-$(DRACUT_MAIN_VERSION).tar
rpm: dracut-$(DRACUT_MAIN_VERSION).tar.xz syncheck
rpmbuild=$$(mktemp -d -p /var/tmp rpmbuild-dracut.XXXXXX); src=$$(pwd); \
cp dracut-$(DRACUT_MAIN_VERSION).tar.xz "$$rpmbuild"; \
LC_MESSAGES=C $$src/git2spec.pl $(DRACUT_MAIN_VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
(cd "$$rpmbuild"; \
wget https://www.gnu.org/licenses/lgpl-2.1.txt; \
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
( mv "$$rpmbuild"/{,$$(uname -m)/}*.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
srpm: dracut-$(DRACUT_MAIN_VERSION).tar.xz syncheck
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
cp dracut-$(DRACUT_MAIN_VERSION).tar.xz "$$rpmbuild"; \
LC_MESSAGES=C $$src/git2spec.pl $(DRACUT_MAIN_VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
(cd "$$rpmbuild"; \
[ -f $$src/lgpl-2.1.txt ] && cp $$src/lgpl-2.1.txt . || wget https://www.gnu.org/licenses/lgpl-2.1.txt; \
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
--define "_rpmdir $$PWD" -bs dracut.spec; ) && \
( mv "$$rpmbuild"/*.src.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
syncheck:
@ret=0;for i in dracut-initramfs-restore.sh modules.d/*/*.sh; do \
[ "$${i##*/}" = "module-setup.sh" ] && continue; \
@@ -246,50 +258,49 @@ syncheck:
[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi; \
[ $$V ] && echo "checking for echo -n: $$i"; if grep -Fq 'echo -n ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains echo -n"; fi \
done;exit $$ret
@ret=0;for i in *.sh mkinitrd-dracut.sh modules.d/*/*.sh \
modules.d/*/module-setup.sh; do \
@ret=0;for i in *.sh modules.d/*/*.sh modules.d/*/module-setup.sh; do \
[ $$V ] && echo "bash syntax check: $$i"; bash -n "$$i" ; ret=$$(($$ret+$$?)); \
done;exit $$ret
ifeq ($(HAVE_SHELLCHECK),yes)
ifeq ($(HAVE_SHFMT),yes)
shellcheck $$(shfmt -f .)
else
find . -name '*.sh' -print0 | xargs -0 shellcheck
endif
endif
check: all syncheck rpm
check: all syncheck
@[ "$$EUID" == "0" ] || { echo "'check' must be run as root! Please use 'sudo'."; exit 1; }
@$(MAKE) -C test check
testimage: all
./dracut.sh -N -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh -N -l -a debug -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
debugtestimage: all
./dracut.sh --debug -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh --debug -l -a debug -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
testimages: all
./dracut.sh -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
./dracut.sh -l -a debug --kernel-only -f test-kernel-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
./dracut.sh -l -a debug --no-kernel -f test-dracut.img $(KVERSION)
@echo wrote test-dracut.img
debughostimage: all
./dracut.sh --debug -H -l -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh --debug -H -l -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
hostimage: all
./dracut.sh -H -l -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh -H -l -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
efi: all
./dracut.sh --uefi -H -l -f linux-$(shell uname -r).efi $(shell uname -r)
@echo wrote linux-$(shell uname -r).efi
./dracut.sh --uefi -H -l -f linux-$(KVERSION).efi $(KVERSION)
@echo wrote linux-$(KVERSION).efi
AUTHORS:
git shortlog --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo $$rest;done > AUTHORS
CONTRIBUTORS:
@git shortlog $(DRACUT_MAIN_VERSION).. --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo "- $$rest";done
dracut.html.sign: dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut.html
gpg-sign-all dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut.html
upload: dracut.html.sign
kup put dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut-$(DRACUT_MAIN_VERSION).tar.sign /pub/linux/utils/boot/dracut/
kup put dracut.html dracut.html.sign /pub/linux/utils/boot/dracut/

801
NEWS.md
View File

@@ -1,4 +1,803 @@
Rendered view: https://github.com/dracutdevs/dracut/blob/master/NEWS.md
[Rendered view](https://github.com/dracutdevs/dracut/blob/master/NEWS.md)
dracut-059
==========
#### Bug Fixes
* **NEWS.md:** add missing entries ([794ce5e3](https://github.com/dracutdevs/dracut/commit/794ce5e3ee55f1b78be32873a054aed422346f4c))
#### Contributors
- Jóhann B. Guðmundsson <johannbg@gmail.com>
dracut-058
==========
#### Bug Fixes
* **90kernel-modules:**
* MMC and NVMe on kernels 6.0+ ([e0d57a8f](https://github.com/dracutdevs/dracut/commit/e0d57a8f5b15847a7fbae2ed3df29ec2c5d25ec7))
* add (nonstandard) NVMe drivers ([415e5519](https://github.com/dracutdevs/dracut/commit/415e5519d19e24d123378710abe47a2df2b22e7b))
* **90multipath:**
* use RemainAfterExit=yes for multipathd-configure.service ([2334031a](https://github.com/dracutdevs/dracut/commit/2334031a890a1101c78f986681236c76ba806d91))
* create `/etc/multipath` only ([0940be90](https://github.com/dracutdevs/dracut/commit/0940be905843e93111e96c0d70c56389240fbc04))
* **Makefile:** reduce the number of shell invocations ([ad7d5bc8](https://github.com/dracutdevs/dracut/commit/ad7d5bc8ea181ef805f65ae690681ebe5ba29bbe))
* **base:**
* do not require chroot inside initramfs ([51813371](https://github.com/dracutdevs/dracut/commit/518133714b769160448a51c512d5e152ea6332da))
* remove grep dependency ([240a1d34](https://github.com/dracutdevs/dracut/commit/240a1d34bd5d98fb8a7d75cd1053d8abf1c73f64))
* **dbus-broker:** add missing sockets.target.wants/dbus.socket ([7ed04618](https://github.com/dracutdevs/dracut/commit/7ed0461810602bfbd4d5492fc9ed82f15e57fa9f))
* **dmsquash-live:**
* add support for NFS ([8caaad4f](https://github.com/dracutdevs/dracut/commit/8caaad4fc2d75982eb87f5ebc72a4c276986f756))
* check kernel for built-in squashfs drivers ([922c9e28](https://github.com/dracutdevs/dracut/commit/922c9e28ed87815cf6ae0b5ee911ff0ef616d1b0))
* run checkisomd5 on correct device ([c8f819e6](https://github.com/dracutdevs/dracut/commit/c8f819e6c1c38e525e4b491b4215a939ee6e00df))
* **dmsquash-live-ntfs:** remove unnecessary command ([e78f71b9](https://github.com/dracutdevs/dracut/commit/e78f71b9da29828ee4cd8444d4841ee127ef8614))
* **dmsquash-live-root:** check kernel for built-in `overlay` drivers ([d0cd7cd3](https://github.com/dracutdevs/dracut/commit/d0cd7cd38711b5425777c3b1595dbf4288beaa23))
* **dracut:**
* allow to set persistent policy based on /dev/mapper device names ([9cc7ceec](https://github.com/dracutdevs/dracut/commit/9cc7ceec1e9b4028d1a72bf51f9ea488d7ca11ac))
* shellcheck regression in DRACUT_INSTALL calls ([097dd367](https://github.com/dracutdevs/dracut/commit/097dd367bbd61da1577a182c535c5aacdfd07031))
* replace invalid lzo command with lzop for LZO compression ([b2d7561b](https://github.com/dracutdevs/dracut/commit/b2d7561b98d08c7e4018aa22dc36dc1242e50f09))
* typo error 'aggresive' -> 'aggressive' ([e4f1dbcc](https://github.com/dracutdevs/dracut/commit/e4f1dbcc0061113cb58e555724f76a7243788236))
* **dracut-functions.sh:**
* check_kernel_module should follow dracutsysrootdir ([6c42d378](https://github.com/dracutdevs/dracut/commit/6c42d378abe528ee6f10c8272080eec5f3f44acb))
* suppress findmnt error msg if /etc/fstab not exist ([e9ed44c8](https://github.com/dracutdevs/dracut/commit/e9ed44c8864445d85018e31064cd888c358f1daf))
* **dracut-init:** make require_kernel_modules ignore no kernel build ([d460941b](https://github.com/dracutdevs/dracut/commit/d460941b51d0178683b9098e62ad57e43fb71011))
* **dracut-init.sh:**
* instmods: wrong variable name ([b12ee558](https://github.com/dracutdevs/dracut/commit/b12ee558f5660073ad26415794570188e8a427b0))
* add missing hostonly code in the inst_multiple function ([e2fdb30b](https://github.com/dracutdevs/dracut/commit/e2fdb30b56305aed9d3be32f394352c7c3fdbcef))
* correct dracut-install source path ([72b700e3](https://github.com/dracutdevs/dracut/commit/72b700e3cb8a0d74033e6e20b2435d9254b36efe))
* propagate the result code returned by dracut-install ([d2f6f445](https://github.com/dracutdevs/dracut/commit/d2f6f445edb5de033d52ece0e982db38ac2614e2))
* **dracut-initramfs-restore.sh:**
* initramfs detection not working ([481b87fa](https://github.com/dracutdevs/dracut/commit/481b87fa7a82be54663071ad9ad76c34e378ddc7))
* hide unpack errors ([4f20ae26](https://github.com/dracutdevs/dracut/commit/4f20ae2620a9067270fe3e5f191ada6bff7b0ec1))
* **dracut-install:**
* use stripped kernel module path as hash key ([2f791b40](https://github.com/dracutdevs/dracut/commit/2f791b401b287f67f2421452b5f82cdb5285a637))
* do not try to copy files from the root directory ([ebbcf97d](https://github.com/dracutdevs/dracut/commit/ebbcf97dc7267f47ae568909305bcb05de2876b4))
* correctly waitpid() for cp ([13736c50](https://github.com/dracutdevs/dracut/commit/13736c50c797d63ab75468ded17bc7935d7f1f94))
* convert_abs_rel: return valid path on error ([06d31617](https://github.com/dracutdevs/dracut/commit/06d316171cd5e0e86c21006f93776ba9f49087cc))
* **dracut-logger.sh:** this fixes the dlog_init check for /dev/log ([6b592f58](https://github.com/dracutdevs/dracut/commit/6b592f581c1a5ec489acee95779867e0485770fd))
* **dracut-systemd:** run systemctl daemon-reload after remove_hostonly_files ([e1058b07](https://github.com/dracutdevs/dracut/commit/e1058b07ea2acb1bdb2d52f778639e093b1ed8a6))
* **dracut.sh:**
* split drivers_dir check ([d32d221e](https://github.com/dracutdevs/dracut/commit/d32d221efd77dcc0afa1d39230f7bdc2958ffca5))
* use DRACUT_ARCH instead of `uname -m` ([a86aea65](https://github.com/dracutdevs/dracut/commit/a86aea65186b47ac210a3947c966311bb5371aeb))
* make omit-drivers option do exact match for names ([444944ab](https://github.com/dracutdevs/dracut/commit/444944ab37c2446adf07dd163225707e90aabef3))
* correct wrong systemd variable paths ([b9dc999f](https://github.com/dracutdevs/dracut/commit/b9dc999f87a477af53e379d7fb1053d13d6dbe88))
* remove duplicate "dracut:" string in logger functions ([8410ee22](https://github.com/dracutdevs/dracut/commit/8410ee22903403cd673a22692a084125c835cbe9))
* do not fail on irregular files ([b72d0d7f](https://github.com/dracutdevs/dracut/commit/b72d0d7f9be53c1ad04f132daf0297aff7581e9c))
* **dracut.spec:** tpm2-tools is required for crypt module to work ([8abffe7c](https://github.com/dracutdevs/dracut/commit/8abffe7cca2e210e15c618beeffe7450be357f73))
* **drm:** add video drivers needed on hyper-v and similar ([85149b85](https://github.com/dracutdevs/dracut/commit/85149b85961aa535a3c61d492cd3594794e5cc3f))
* **github:** yml syntax and commit message for dependabot ([32f6dd1d](https://github.com/dracutdevs/dracut/commit/32f6dd1d5f0b7c24bda8bf950df176a0791045cb))
* **i18n:**
* do not fail if FONT in /etc/vconsole.conf has the file extension ([e1de5bd2](https://github.com/dracutdevs/dracut/commit/e1de5bd2d711df2c6814a3c3ab8472cdb4de9101))
* add required includes for keymaps ([fe8fa2b0](https://github.com/dracutdevs/dracut/commit/fe8fa2b0cadbb33e27c8dd8b5851548dcd65835c))
* **install.d:** add --verbose if KERNEL_INSTALL_VERBOSE=1 ([846a8453](https://github.com/dracutdevs/dracut/commit/846a845375b8a9ea48741079d523e6b464950ea7))
* **integrity:**
* do not enable EVM if there is no key ([90585c62](https://github.com/dracutdevs/dracut/commit/90585c624af15ba0abb7f32b0c2afc2b122dd019))
* remove unused variable ([9d1004a4](https://github.com/dracutdevs/dracut/commit/9d1004a4e9883ecabdca478a809efb5501a1e47a))
* **iscsi:** don't install the module if kernel doesn't support iscsi ([7917d797](https://github.com/dracutdevs/dracut/commit/7917d7976ded6384433ef8fb2ce1905f0a76358e))
* **kernel-modules:**
* add sysctl to initramfs to handle modprobe files ([33679fff](https://github.com/dracutdevs/dracut/commit/33679fff5deb733f9dfe8d005066ac98e107c083))
* always include nvmem driver on nvmem_on_arm ([bc965cd8](https://github.com/dracutdevs/dracut/commit/bc965cd8890013a6362733d217c18756134bbcdf))
* **load_fstype:** use $1 if $2 is missing ([401158e5](https://github.com/dracutdevs/dracut/commit/401158e58c47b2e1278a47b9cd236f501cfe2732))
* **lsinitrd.sh:**
* add a missing path to image ([e877be69](https://github.com/dracutdevs/dracut/commit/e877be69b41199ee4384ccb6352754bb9edfbba4))
* correct skipcpio source path ([5eb996a9](https://github.com/dracutdevs/dracut/commit/5eb996a9936a87918a4320963a8681975ed86be4))
* **lvm:** drop dm-eventd binary and libs from initramfs ([7d3184e4](https://github.com/dracutdevs/dracut/commit/7d3184e430823f7eee4acee87576acdcf02746c2))
* **man:**
* correct typo ([699e3945](https://github.com/dracutdevs/dracut/commit/699e39458962bc1a06a096f24ad86ffb87e8779e))
* dracut.cmdline.7: clarify "rd.nvmf.discover=fc,auto" ([a90efdd7](https://github.com/dracutdevs/dracut/commit/a90efdd704271dab6717329e88b3a1c9e850d23b))
* dracut.cmdline(7): correct syntax for rd.nonvmf ([4b69e63b](https://github.com/dracutdevs/dracut/commit/4b69e63b7414567a03e8da79acc2efe32e0a6a94))
* point man pages to github.com instead of kernel.org ([d6d55584](https://github.com/dracutdevs/dracut/commit/d6d555845e53dca0b083d59c8cedf465e6b70b71))
* correct typo ([7fa0094c](https://github.com/dracutdevs/dracut/commit/7fa0094c0087a827a22f30ec62f03f243b000bf3))
* **multipath:** install multipathd.socket ([02e646fc](https://github.com/dracutdevs/dracut/commit/02e646fc7ec91e1fbaa0f2097f35781ae41da937))
* **network:**
* check if ip command fails ([52d14607](https://github.com/dracutdevs/dracut/commit/52d14607d18d99c0c2c3242a64561b1af6a332d1))
* two bugs which cause minutes long boot times ([1d6f42c8](https://github.com/dracutdevs/dracut/commit/1d6f42c8a4029380c2147018e64fb7ebc9e175e7))
* avoid double brackets around IPv6 address ([2c26b703](https://github.com/dracutdevs/dracut/commit/2c26b703223bb65822954264bcd6ca7934c98b4a))
* don't use same ifname multiple times ([f4e9ea87](https://github.com/dracutdevs/dracut/commit/f4e9ea879f38bea92069e9397028caa5d81e5aee))
* **network-legacy:**
* check if dhclient has --timeout option ([23654c50](https://github.com/dracutdevs/dracut/commit/23654c50b003612d1b6e4b09c0bde7dd88239fd8))
* correct wrong local network configuration path ([2eb733cc](https://github.com/dracutdevs/dracut/commit/2eb733cc11c09358b79e2c73218953f5bb64da93))
* **network-manager:**
* always install the library plugins directory ([429f9de1](https://github.com/dracutdevs/dracut/commit/429f9de1c767c816301097a42cec762dc82d67da))
* correct wrong local network configuration path ([744c6de5](https://github.com/dracutdevs/dracut/commit/744c6de5cde38d012f93bc53f9076bf9c37b8b72))
* **nfs,virtiofs:** check kernel for builtin fs drivers ([78cafe46](https://github.com/dracutdevs/dracut/commit/78cafe465d972ed52cc9d847c9895716a5f44e7e))
* **nvmf:**
* run cmdline hook before parse-ip-opts.sh ([a65fab69](https://github.com/dracutdevs/dracut/commit/a65fab69662d3adf52eb968411f59ebc5a173f7c))
* avoid calling "exit" in a cmdline hook ([a93968b0](https://github.com/dracutdevs/dracut/commit/a93968b07567a654d18b8ef2144337d803186eca))
* make sure "rd.nvmf.discover=fc,auto" takes precedence ([556ef46a](https://github.com/dracutdevs/dracut/commit/556ef46aa96650d72b2fd850a09fa04dff64bbb8))
* don't use "finished" queue for autoconnect ([e93e4652](https://github.com/dracutdevs/dracut/commit/e93e46520dd89a7357a15441ab6b141ff9ff9aeb))
* don't create did-setup file ([03921ec0](https://github.com/dracutdevs/dracut/commit/03921ec09e95ea49f89ae307dcca4e2e3d1bc6d6))
* no need to load the nvme module ([a3cf4ec9](https://github.com/dracutdevs/dracut/commit/a3cf4ec92202df43adf368c7fdd12e35d304a0e4))
* don't try to validate network connections in cmdline hook ([b3ff3f3f](https://github.com/dracutdevs/dracut/commit/b3ff3f3fbce6878a754332cd4a05374e5e1156c8))
* nvme list-subsys prints the address using commas as separator ([9664e98b](https://github.com/dracutdevs/dracut/commit/9664e98b5db603567d42d4d0c6e6ea1bd3d5bf24))
* **shell-completion:** add missing -p and --parallel options ([b30a00c2](https://github.com/dracutdevs/dracut/commit/b30a00c2a2815517e79eeaeef5f76fd6f923e61f))
* **skipcpio:** ignore broken pipe ([aa0369a4](https://github.com/dracutdevs/dracut/commit/aa0369a4a31764fde06214358b0774fb1095af01))
* **squash:** build ld cache for squash loader ([bc1b23c2](https://github.com/dracutdevs/dracut/commit/bc1b23c29202023dd7852f4c3e3e97aaaf94da92))
* **systemd:**
* add missing modprobe@.service ([928252a1](https://github.com/dracutdevs/dracut/commit/928252a145ca44627ba5873e01245eabe246992f))
* set right permissions for the machine-id file ([da55e266](https://github.com/dracutdevs/dracut/commit/da55e2663499f6218d28783076c5449a9a6b8ec9))
* **systemd-coredump:** correct systemd-coredump binary path ([4b931bfb](https://github.com/dracutdevs/dracut/commit/4b931bfb4f594834d06787b3506c4a0ddbbe48ac))
* **systemd-hostnamed:**
* add missing dbus-org.freedesktop.hostname1.service ([4fca292b](https://github.com/dracutdevs/dracut/commit/4fca292b957c8ec256111442ba0db4e539442ac8))
* correct sysusers configuration ([a540c95b](https://github.com/dracutdevs/dracut/commit/a540c95bbf9496f7b9d6e86aa5080173d73dff78))
* **systemd-networkd:** typo in systemd-networkd.socket local conf path ([d4732be8](https://github.com/dracutdevs/dracut/commit/d4732be87782016c2699fbf980d63ac366819942))
* **systemd-timedated:** add missing dbus-org.freedesktop.timedate1.service ([b3d219b4](https://github.com/dracutdevs/dracut/commit/b3d219b475c8f695ccfb8b741282583da710befa))
* **systemd-timesyncd:** typo in systemd-time-wait-sync.service local conf path ([e3ec51e1](https://github.com/dracutdevs/dracut/commit/e3ec51e128135d56c3995d87ca2a4ff65b253391))
* **test:** remove unnecessary setup steps ([22ab7979](https://github.com/dracutdevs/dracut/commit/22ab79794852eced9caaccd8763332b870e97032))
* **virtiofs:**
* make shebangs work on split-usr systems ([27b316df](https://github.com/dracutdevs/dracut/commit/27b316df1f001949675fbeddaeab6ff56bc449d2))
* ismounted has a dependency on the base module ([c73e7b99](https://github.com/dracutdevs/dracut/commit/c73e7b99db8c759d89236d0791145d6919abd2bc))
* **zipl:** remove trailing spaces from zipl boot device name ([b4de9ee1](https://github.com/dracutdevs/dracut/commit/b4de9ee107742c8b0b8a86dcc22aa4fd366b068e))
#### Features
* **dmsquash-live:**
* add support for dash ([862ba526](https://github.com/dracutdevs/dracut/commit/862ba52683834f87722cae7a6692a59d09271ec3))
* add new dmsquash-live-autooverlay module ([a3c67d27](https://github.com/dracutdevs/dracut/commit/a3c67d27e75223bb45df19f850d246ced9a09938))
* **dracut-init.sh:**
* introduce a new helper require_kernel_modules ([d3a5e631](https://github.com/dracutdevs/dracut/commit/d3a5e6312a84b29bcb10fd5d28e1314f1acbc78f))
* add inst_libdir_dir() helper ([cc669250](https://github.com/dracutdevs/dracut/commit/cc669250affa0176ed2bba866d8e933fb0668f4c))
* **dracut-install:** convert_abs_rel: canonicalise parent of from, too ([53dd6a9b](https://github.com/dracutdevs/dracut/commit/53dd6a9bbb0eb91dea0e56bec556bf865a920b2e), closes [#1781](https://github.com/dracutdevs/dracut/issues/1781))
* **dracut.sh:**
* populate uefi_cmdline if no other cmdline is given ([1157143d](https://github.com/dracutdevs/dracut/commit/1157143d67b02ccf95602ae082f6fbfd1a20f342))
* pass engine flag to sbsign allowing use with hardware devices ([897e5eff](https://github.com/dracutdevs/dracut/commit/897e5effe08f15de6b20099caeda7bc1167b7026))
* **fs-lib:** fsck_single can now handle PARTLABEL and PARTUUID ([d40617f7](https://github.com/dracutdevs/dracut/commit/d40617f720ce7d895be4f6297ac4342d4492c39a))
* **github:** automating dependency updates ([bdddfd56](https://github.com/dracutdevs/dracut/commit/bdddfd561f38469b3f51d7e6af196ff1f190e2a2))
* **kernel-modules:** exclude USB drivers in strict hostonly mode ([7debf540](https://github.com/dracutdevs/dracut/commit/7debf540ca69d9171cb86b4752c882bac997c26e))
* **multipath:** install tmpfiles.d config file ([cf31fcf8](https://github.com/dracutdevs/dracut/commit/cf31fcf804be4dc0fa31885f5185a59b6012cdf4))
* **nvmf:** set rd.neednet=1 if tcp records encountered ([cf8986af](https://github.com/dracutdevs/dracut/commit/cf8986af7d9a3ce73f330de23d5312f924acea34))
* **overlayfs:**
* add new overlayfs module to dracut.spec ([b55563f6](https://github.com/dracutdevs/dracut/commit/b55563f635fb8aad5e141c4fa5d3e486dc2b0b60))
* add a new module called overlayfs ([40dd5c90](https://github.com/dracutdevs/dracut/commit/40dd5c90e0efcb9ebaa9abb42a38c7316e9706bd))
* **qemu:** add efi_secret driver ([8194f72a](https://github.com/dracutdevs/dracut/commit/8194f72af2e9b6ab3cdb01412381023b0a58c852))
* **squash:** use require_kernel_modules for better module checking ([d4a9d6b4](https://github.com/dracutdevs/dracut/commit/d4a9d6b4c006a375e0b89396251e8ad1aecc0b16))
* **systemd:** install systemd-sysroot-fstab-check ([23684e4a](https://github.com/dracutdevs/dracut/commit/23684e4a2bb024595ad63d9f49d83b4693537110))
* **systemd-pcrphase:** introducing the systemd-pcrphase module ([d345ca2e](https://github.com/dracutdevs/dracut/commit/d345ca2efd5e017be5cc80cfc96137a7f0bee425))
* **systemd-portabled:** introducing the systemd-portabled module ([03babd95](https://github.com/dracutdevs/dracut/commit/03babd95e28bc884e87fd0885edafb2ee91f8935))
* **systemd-pstore:** introducing the systemd-pstore module ([758f2e69](https://github.com/dracutdevs/dracut/commit/758f2e69374d7865bf55a74ee218a1d52df20123))
* **test:** add new module to share code between tests ([f5689b42](https://github.com/dracutdevs/dracut/commit/f5689b42bdb9dfcb0f1b610d7db845ceac985061))
* **test-makeroot:** add new module to share code between tests ([54b963ca](https://github.com/dracutdevs/dracut/commit/54b963ca35a3a4cc8bcdb35e5e9ebb74af09191e))
* **test-root:** add new module to share code between tests ([b17a3103](https://github.com/dracutdevs/dracut/commit/b17a3103a516b5a45af954b1e2969a5256fffebc))
#### Performance
* **90kernel-modules:** use awk instead of shell monster ([77ac95d9](https://github.com/dracutdevs/dracut/commit/77ac95d9091afcfdbd1fe0372389613914dd1bc6))
* **dracut-install:**
* convert_abs_rel: don't allocate target parent realpath ([d2648f6d](https://github.com/dracutdevs/dracut/commit/d2648f6dd8277c3d9a0b8d05ca66a212da47070e))
* strdup()+[dirlen]=0 => strndup ([e7d6a1e3](https://github.com/dracutdevs/dracut/commit/e7d6a1e30c34134d27c0ae921b7d18525ddf3dea))
* **dracut.sh:** do not mkdir $initdir/lib/dracut within a loop ([8d46cc01](https://github.com/dracutdevs/dracut/commit/8d46cc01a95afc6902e8c86a795db082622a3c74))
#### Contributors
- Laszlo Gombos <laszlo.gombos@gmail.com>
- Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
- Martin Wilck <mwilck@suse.de>
- Kairui Song <kasong@tencent.com>
- Marcos Mello <marcosfrm@gmail.com>
- наб <nabijaczleweli@nabijaczleweli.xyz>
- David Tardon <dtardon@redhat.com>
- Jóhann B. Guðmundsson <johannbg@gmail.com>
- Matt Coleman <matt@datto.com>
- Pavel Valena <pvalena@redhat.com>
- Alberto Planas <aplanas@suse.com>
- Brian C. Lane <bcl@redhat.com>
- Jonathan Lebon <jonathan@jlebon.com>
- Lukas Nykryn <lnykryn@redhat.com>
- keentux <valentin.lefebvre@suse.com>
- Cole Robinson <crobinso@redhat.com>
- Daan De Meyer <daan.j.demeyer@gmail.com>
- Frederick Grose <4335897+FGrose@users.noreply.github.com>
- Frederick Grose <fgrose@sugarlabs.org>
- Hari Bathini <hbathini@linux.ibm.com>
- Henrik Gombos <henrik99999@gmail.com>
- Jeremy Linton <jlinton@redhat.com>
- Kenneth D'souza <kennethdsouza94@gmail.com>
- Laura Hild <lsh@jlab.org>
- Mike Gilbert <floppym@gentoo.org>
- Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
- Neal Gompa <neal@gompa.dev>
- Scott Moser <smoser@brickies.net>
- Tao Liu <ltao@redhat.com>
- Tianhao Chai <cth451@gmail.com>
- gombi <gombi@>
- joamonwx <unknown>
- runsisi <runsisi@hust.edu.cn>
- tupper <tupper.bob@gmail.com>
dracut-057
==========
#### Bug Fixes
* **10i18n:**
* stop leaking shell options ([f3441cc7](https://github.com/dracutdevs/dracut/commit/f3441cc7c577554dde04a9fe90638f779bb0a411))
* stop leaking shell options ([35064768](https://github.com/dracutdevs/dracut/commit/35064768ebf14d3ec6bf3f7df52580fb4920ea3d))
* **Makefile:** use of potentially unset variable ([1354d633](https://github.com/dracutdevs/dracut/commit/1354d6339a2e603fe0787bc028f9e7e1d49cbf82))
* **bluetooth:**
* accept compressed firmwares in inst_multiple ([09a1e5af](https://github.com/dracutdevs/dracut/commit/09a1e5afd2eaa7f8e9f3beaf8a48283357e7fea0))
* nullglob should not be needed ([36aaa74f](https://github.com/dracutdevs/dracut/commit/36aaa74f3641d375cb435298864fad1945444893))
* make $dbussystem/bluetooth.conf optional ([a38d9ec0](https://github.com/dracutdevs/dracut/commit/a38d9ec0320f3819a3b70dc5bb59f6d2fc570149))
* **configure:** check for SYS-gettid during configure ([0ef40d88](https://github.com/dracutdevs/dracut/commit/0ef40d88124fe67726b8b5d8321dce064c727447))
* **connman:** copy netroot.sh from the network module and install it ([f6d83f9f](https://github.com/dracutdevs/dracut/commit/f6d83f9f5cd4850468f26048f8eed015dc2bd0e0))
* **crypt:** add missing is_keysource parameter to cryptroot-ask ([6c11a8fc](https://github.com/dracutdevs/dracut/commit/6c11a8fcee08c297a34bd5c5215a7a29d3529b85))
* **dmsquash-live:**
* mount live device with the correct type ([08ed7b2d](https://github.com/dracutdevs/dracut/commit/08ed7b2d0035eaa699c139bc9719f90190f6ffc1))
* permanent overlay on the same drive as LiveCD .iso ([9a884b3a](https://github.com/dracutdevs/dracut/commit/9a884b3afce1ebc8c6a6e5f62594ce708486a826))
* **dracut:** default to correct firmware search paths ([95aeed89](https://github.com/dracutdevs/dracut/commit/95aeed8975dd5a2af782ec986f2af6176b585c59))
* **dracut-functions.sh:** correct wrong comment ([0afa840e](https://github.com/dracutdevs/dracut/commit/0afa840e111e63da14edcb655886734b45d61c4b))
* **dracut-initramfs-restore.sh:**
* unpack uncompressed initrd as last option ([46886956](https://github.com/dracutdevs/dracut/commit/46886956211f8a436e2e9f81fc4972d2a297c3a3))
* check if SELINUXTYPE is set ([24d8f35b](https://github.com/dracutdevs/dracut/commit/24d8f35b9c162f42c58abd27fe9c75bbf76cbfe7))
* **dracut-install:**
* copy files preserving ownership attributes ([9ef73b6a](https://github.com/dracutdevs/dracut/commit/9ef73b6ad08c19c3906564e5a15c7908ed9a81c8))
* do not fail when SOURCE is optional and missing ([bd1a5ca9](https://github.com/dracutdevs/dracut/commit/bd1a5ca9ae9e347061e67e51be29335ab074ad95))
* **dracut-systemd:**
* drop misleading man page reference ([77c28b30](https://github.com/dracutdevs/dracut/commit/77c28b3020b7dede848d8282151f609d80905b05))
* correct service dependencies ([85fdff12](https://github.com/dracutdevs/dracut/commit/85fdff1212e708d335f035926f3c2a6b87bb1c3c))
* **dracut.cmdline.7:** {=> must} also be specified ([27071e9a](https://github.com/dracutdevs/dracut/commit/27071e9a0e7928bccc45469eb659cdafb20f134b))
* **dracut.sh:**
* format usage and add missing options ([9bef7109](https://github.com/dracutdevs/dracut/commit/9bef71094eba84a9eac161fc45386ccd73bd2b34))
* always check that MACHINE_ID is not empty ([527fdfa1](https://github.com/dracutdevs/dracut/commit/527fdfa1517b7f010afa049fe6add71e4c916cdd))
* avoid calling dfatal before dracut-logger is sourced ([012d7db2](https://github.com/dracutdevs/dracut/commit/012d7db27da7416471ed49ee2ca666ab95837f47))
* add missing default output file paths ([28ef3bc6](https://github.com/dracutdevs/dracut/commit/28ef3bc6a6f1efcd8d8c16228a6dee9d563342e7))
* add missing --libdirs usage ([352e5917](https://github.com/dracutdevs/dracut/commit/352e59173152f13b242c598a735243f0f2850ff1))
* drop restorecon call ([33859892](https://github.com/dracutdevs/dracut/commit/3385989266ddb1c0685f9f7501f1835e9ce49730))
* error exporting sysctl variables ([4c355d05](https://github.com/dracutdevs/dracut/commit/4c355d05587b0432a6dc551b8693dbdc51a07962))
* **dracut.spec:** add connman module ([d0c6ab21](https://github.com/dracutdevs/dracut/commit/d0c6ab21d906cc5b0e05e1107c48baffcbedb02c))
* **fedora.conf:** vi binary is missing ([48541362](https://github.com/dracutdevs/dracut/commit/485413627f04fdc0c5c29958ce437718b262a99c))
* **github:** remove packit ([8fd37d20](https://github.com/dracutdevs/dracut/commit/8fd37d20f4b7cc08ee0970e0249aac4cd5b47a4e))
* **ifcfg:** avoid calling unavailable dracut-logger functions ([7103c4bc](https://github.com/dracutdevs/dracut/commit/7103c4bce9240d5896a0d207c216e0f6270ad2e8))
* **install:** restore musl support ([ce55a85e](https://github.com/dracutdevs/dracut/commit/ce55a85ed5d902c19d75895508856f96ec2ceb1a))
* **integrity:** do not display any error if there is no IMA certificate ([f63f411d](https://github.com/dracutdevs/dracut/commit/f63f411d52df613936082d646ab072447b8b9d7f))
* **iscsi:**
* do not exit in handle_netroot() if discovery failed ([319dc7fe](https://github.com/dracutdevs/dracut/commit/319dc7fe10585a19d1a051f8ad1ba0190f86ff1f))
* remove unneeded iscsi NOP-disable code ([a33a8df4](https://github.com/dracutdevs/dracut/commit/a33a8df43d33c9bdf85d7a5b7392585129a690f5))
* **kernel-network-modules:** allow specifying empty --hostonly-nics ([ab6f5733](https://github.com/dracutdevs/dracut/commit/ab6f57339ad77b5bc116400f7b66580745bfc563))
* **lsinitrd.sh:**
* always check that MACHINE_ID is not empty ([d6343146](https://github.com/dracutdevs/dracut/commit/d6343146c1db69fc724ca666a5d9321af7fd0d46))
* add missing default paths ([49ea6c42](https://github.com/dracutdevs/dracut/commit/49ea6c42db7180eec5ba57e082a38d116f2d17a5))
* **lvm:**
* add missing grep requirement ([79f9d9e1](https://github.com/dracutdevs/dracut/commit/79f9d9e1c29a9c8fc046ab20765e5bde2aaa3428))
* ignore expected error message from lvm config ([7e03d81f](https://github.com/dracutdevs/dracut/commit/7e03d81fe3df932558d2b7280fa57da24ba955c0))
* **man:**
* add missing default paths ([ffc1985c](https://github.com/dracutdevs/dracut/commit/ffc1985cb26894c50487b7db2703e8715a4a7537))
* add missing --libdirs section ([a90dbd95](https://github.com/dracutdevs/dracut/commit/a90dbd958b19778044047f17559449fffdb94cc2))
* **network-manager:** avoid calling unavailable dracut-logger functions ([b7059aef](https://github.com/dracutdevs/dracut/commit/b7059aef5962aad1dc8d96a0f600105a40867380))
* **nfs:**
* give /run/rpcbind ownership to rpc user ([d6159343](https://github.com/dracutdevs/dracut/commit/d615934311e25146bb37943bf1385a19dfdbd9e8))
* require and install needed binaries ([0e4df7a3](https://github.com/dracutdevs/dracut/commit/0e4df7a39dda388dc71ff6f749c8197cba4442b9))
* **nvmf:**
* deprecate old nvmf cmdline options ([e405501e](https://github.com/dracutdevs/dracut/commit/e405501e23462d151bba252133f4a6179bf79cf0))
* set executable bit on nvmf-autoconnect.sh ([25a92885](https://github.com/dracutdevs/dracut/commit/25a92885a9519701cc480298c2b082e2e2bf5ebe))
* **plymouth:** hide dpkg-architecture stderr messages ([42e9d188](https://github.com/dracutdevs/dracut/commit/42e9d1889298c3d8badfb6f95e16e048ad83a1f6))
* **resume:** correct call to block_is_netdevice function ([a7a4b76c](https://github.com/dracutdevs/dracut/commit/a7a4b76c4ad5794f5f8a24ecd5b495f1512d05f7))
* **shell-completion:** add missing options ([1199f990](https://github.com/dracutdevs/dracut/commit/1199f990bb93b4e6bd56fa3df050b17fc7e6c378))
* **systemd-coredump:** add systemd-sysusers dependency ([ce82e969](https://github.com/dracutdevs/dracut/commit/ce82e969f8faaccbb57be178833ef4e39f01cdf9))
* **systemd-journald:** remove duplicate entry in inst_multiple ([d3ab2061](https://github.com/dracutdevs/dracut/commit/d3ab20615ef94370e43b042d913d5f787dd52430))
* **systemd-timesyncd:** add systemd-sysusers dependency ([28b6adcb](https://github.com/dracutdevs/dracut/commit/28b6adcb27fb5240c01f7d41511ce02597aa27bd))
* **test:**
* dmsquash-live test without an iso ([6ee2baf3](https://github.com/dracutdevs/dracut/commit/6ee2baf314fc6aa3bb88ca52d11c9f599223eb77))
* remove stale comments ([b3ab3037](https://github.com/dracutdevs/dracut/commit/b3ab3037e8b9272498ed40131f30bf1831acab73))
* add support for dpkg to pass the test on debian ([a7dfdf6a](https://github.com/dracutdevs/dracut/commit/a7dfdf6acbf7a87fd2735541f06a062126966f69))
* nullglob should not be needed ([c7b3ac2b](https://github.com/dracutdevs/dracut/commit/c7b3ac2bd115521855b3ad8ce287cb1a9afca128))
* **udev-rules:** add cdrom udev rules by default ([aebeb2ec](https://github.com/dracutdevs/dracut/commit/aebeb2ecdf76b7716fadbab8b216b8805d36a461))
#### Features
* add aarch64 uefi support ([8391a993](https://github.com/dracutdevs/dracut/commit/8391a993033e212a24635dd629c167354f0834f8))
* **connman:** introduce connman support module ([f30d0351](https://github.com/dracutdevs/dracut/commit/f30d03513f357a36d2ed48a522c7ef2a46bb0c5c))
* **dracut:**
* support parallel execution with --parallel ([6d923262](https://github.com/dracutdevs/dracut/commit/6d92326201014cde9ab04b90367017f875d3b991))
* add zfs detection ([9582f027](https://github.com/dracutdevs/dracut/commit/9582f02773c5115e14fe0992ec2db3935cb0e6eb))
* **dracut-install:** support ZSTD-compressed firmware with .zst suffix ([9d8387ed](https://github.com/dracutdevs/dracut/commit/ 9d8387ed803dfc3e8b97d2e415a15083774d7ac6))
* **dracut-systemd:** use Documentation= to point to man page ([42e8f17c](https://github.com/dracutdevs/dracut/commit/ 42e8f17c2481d33a3d6ba23f653c835e0cda6994))
* **gensplash:** remove module ([1befc641](https://github.com/dracutdevs/dracut/commit/1befc6416743a527824f0f2cc25471e86a6f8a79))
* **lvm:** add new module lvmthinpool-monitor ([d9812fc4](https://github.com/dracutdevs/dracut/commit/d9812fc4ae18a39c144140dd60cb03e16e0d2e06))
* **man:** add documentation for rd.luks.key.tout ([65e41b54](https://github.com/dracutdevs/dracut/commit/65e41b54600878e3e08bbe3b60f66524e1d166a8))
* **squash:**
* add shell completion for --squash-compressor option ([e2aee2d4](https://github.com/dracutdevs/dracut/commit/e2aee2d436cf68c4515a381d620a963ff18dcf05))
* update the manual page for --squash-compressor ([3693bfef](https://github.com/dracutdevs/dracut/commit/3693bfef2fc252f5a4b18278c87a1076896b7fb5))
* decouple the compressor for dracut and dracut-squash ([90d9ae8c](https://github.com/dracutdevs/dracut/commit/90d9ae8ca814c26045ecea63fa15bd8959076d0d))
* **url-lib.sh:** add --retry-connrefused to default curl arguments ([90032a46](https://github.com/dracutdevs/dracut/commit/ 90032a463190ab68f20f493894f667320466082d))
* **virtiofs:** virtiofs root filesystem support ([4632f799](https://github.com/dracutdevs/dracut/commit/4632f799954c18eb8f655efe05b1e6ce30246828))
#### Contributors
- Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
- Laszlo Gombos <laszlo.gombos@gmail.com>
- Pavel Valena <pvalena@redhat.com>
- David Tardon <dtardon@redhat.com>
- Tao Liu <ltao@redhat.com>
- наб <nabijaczleweli@nabijaczleweli.xyz>
- German Maglione <gmaglione@redhat.com>
- Jóhann B. Guðmundsson <johannbg@gmail.com>
- Nicolas Porcel <nicolasporcel06@gmail.com>
- Zoltán Böszörményi <zboszor@gmail.com>
- nkraetzschmar <nkraetzschmar@users.noreply.github.com>
- Benjamin Gilbert <bgilbert@redhat.com>
- Coiby Xu <coxu@redhat.com>
- Conrad Hoffmann <ch@bitfehler.net>
- David Teigland <teigland@redhat.com>
- James Morris <morisja@gmail.com>
- Lee Duncan <lduncan@suse.com>
- Martin Wilck <mwilck@suse.de>
- Masahiro Matsuya <mmatsuya@redhat.com>
- Michal Hecko <mhecko@redhat.com>
- Morten Linderud <morten@linderud.pw>
- Savyasachee Jha <genghizkhan91@hawkradius.com>
- Shreenidhi Shedi <sshedi@vmware.com>
- Wenchao Hao <haowenchao@huawei.com>
dracut-056
==========
#### Bug Fixes
* **base:**
* do not change the provided UUID ([4e858741](https://github.com/dracutdevs/dracut/commit/4e858741087a5cfea891bd2c1fd51ea9b830aeaf))
* add default device choice ([e8c18c9f](https://github.com/dracutdevs/dracut/commit/e8c18c9f7f5ed94898f70e9ff5a5f94a815a2b49))
* tr needs to be installed ([dfbfd33b](https://github.com/dracutdevs/dracut/commit/dfbfd33b24524c0c10ad3594be143192f5b7da84))
* do not quote $initargs for switch_root ([f649cd10](https://github.com/dracutdevs/dracut/commit/f649cd10b2e920e9d65c532db9b9f89a7370ad99))
* repair installing dracut-util ([d7acf107](https://github.com/dracutdevs/dracut/commit/d7acf107f2ac619f73dfa29588ea9adfaf79e296))
* **bluetooth:**
* make hostonly configuration files optional ([d03fb675](https://github.com/dracutdevs/dracut/commit/d03fb675d8e904c6c44de9b91814b33c45043f4f))
* dbus configuration path fixes ([34b1dd2e](https://github.com/dracutdevs/dracut/commit/34b1dd2e26c343e9000094db01a7985b6851adf1))
* **cms:** reload NetworkManager connections ([07977ee5](https://github.com/dracutdevs/dracut/commit/07977ee5c5294a5d30c1f33f292a0b31303750fb))
* **cpio:**
* correct dev_t -> rmajor/rminor mapping ([acc629ab](https://github.com/dracutdevs/dracut/commit/acc629abb0d7a26f692f99e5a9cf8c8401bc6a86))
* write zeros instead of seek for padding and alignment ([0af11c5e](https://github.com/dracutdevs/dracut/commit/0af11c5ea5018a3e1049a2207a9a671049651876))
* **crypt:** remove quotes from cryptsetupopts ([e0abf88a](https://github.com/dracutdevs/dracut/commit/e0abf88a15d23fbf793cf872397016ad86aeaaa8), closes [#1528](https://github.com/dracutdevs/dracut/issues/1528))
* **crypt-gpg:**
* tr needs to be installed ([a93fbc4a](https://github.com/dracutdevs/dracut/commit/a93fbc4ae00d8c6ecda67319a6425f7966609bbe))
* execute --card-status on each try ([66100936](https://github.com/dracutdevs/dracut/commit/6610093698db25fda1d584b9771da1e2c2330095))
* **dasd_rules:**
* correct udev dasd rules parsing ([5de6e4d5](https://github.com/dracutdevs/dracut/commit/5de6e4d56e5206cb47f645ad1cb6d39794048c68))
* remove collect based udev rule creators ([ebafbd82](https://github.com/dracutdevs/dracut/commit/ebafbd824175e201ae9476576588a896c6b7d7eb))
* **dmsquash-live:**
* option to use overlayfs on a block device root ([813577e2](https://github.com/dracutdevs/dracut/commit/813577e2ba034b448d2cf2d2857b2d20d56c0259))
* do not install systemd files when systemd is not enabled ([bf8738d3](https://github.com/dracutdevs/dracut/commit/bf8738d31ca53ad6410c46c1f9b2a4a12273b9a3))
* iso-scan requires rmdir ([e19e3890](https://github.com/dracutdevs/dracut/commit/e19e38904c054664473207d2d6ef3c53bd938867))
* correct regression introduced with shellcheck changes ([0c631efb](https://github.com/dracutdevs/dracut/commit/0c631efb10bf4ce18ec8640277bd94712950298a))
* **dmsquash-live-ntfs:** fuse3 no longer requires ulockmgr_server ([75ad2699](https://github.com/dracutdevs/dracut/commit/75ad269931eccd266a5d60ba4000d93655143e00))
* **dracut:** be more robust when using 'set -u' ([22a80629](https://github.com/dracutdevs/dracut/commit/22a80629b4bbcef02eb8fe3611ea44e253ef4c61))
* **dracut-functions.sh:**
* ip route parsing ([d754e1c6](https://github.com/dracutdevs/dracut/commit/d754e1c6f081a6501cb7fdcb5caaa6c4977235af))
* get block device driver if in a virtual subsystem ([dc3b976f](https://github.com/dracutdevs/dracut/commit/dc3b976f3393d7a3fb75b349418fc8ee2c9142bd))
* **dracut-init:** unbreak a comment ([bc4f196f](https://github.com/dracutdevs/dracut/commit/bc4f196f9825029eaef7ccf525ec57f5229b2793))
* **dracut-initramfs-restore.sh:**
* add missing compression options ([e86397de](https://github.com/dracutdevs/dracut/commit/e86397de24f4efa6d36e2bb5ae84b7d9ec69b72d))
* add missing default paths ([3d8e1ad2](https://github.com/dracutdevs/dracut/commit/3d8e1ad2ae1e34244ddf700beea6358c1452e05c), closes [#1628](https://github.com/dracutdevs/dracut/issues/1628))
* **dracut-install:** tweaks to get_real_file() ([1beeaf3b](https://github.com/dracutdevs/dracut/commit/1beeaf3b71aed763d5fc7a9ee044d675f8906e8c))
* **dracut-shutdown:** add cleanup handler on failure ([7ab1d002](https://github.com/dracutdevs/dracut/commit/7ab1d00227cad6f1b86ba01fdc766769faebb031))
* **dracut-systemd:** do not use Requires for vconsole-setup.service ([a7f5429c](https://github.com/dracutdevs/dracut/commit/a7f5429cb81f7ffdf9bd5684af8d36725170b756))
* **dracut.sh:**
* do not ignore invalid config file or dir path ([7de9ffc0](https://github.com/dracutdevs/dracut/commit/7de9ffc0574790ecbad74b5a000ecd022d7736d4))
* check kernel zstd support early ([475497b1](https://github.com/dracutdevs/dracut/commit/475497b1bd12c006c782541124b6427cb7ef4cb7))
* check availability of configured compression ([bdac657b](https://github.com/dracutdevs/dracut/commit/bdac657bf65615438942a872491a818750735014))
* inform user about auto-selected compression method ([06d47ded](https://github.com/dracutdevs/dracut/commit/06d47ded679231e1370cc655c1df408fc865baac))
* drop pointless check for module compression method ([586d3e76](https://github.com/dracutdevs/dracut/commit/586d3e7664c00bf144becfa69dde2dbab8711d51))
* change misspelled variable name ([acfd97a9](https://github.com/dracutdevs/dracut/commit/acfd97a94385c33cd6cef4e5a37f233ea4081288))
* remove wrong $ in loop sequence ([f1245b5b](https://github.com/dracutdevs/dracut/commit/f1245b5bc13a98ef0dcc679dcef6148214e09503))
* handle symlinks appropriately while using '-i' option ([c7fbc0c8](https://github.com/dracutdevs/dracut/commit/c7fbc0c8901917baf0d1f0822568e65c6ec00d18))
* handle '-i' option to include files beginning with '.' ([f1138012](https://github.com/dracutdevs/dracut/commit/f1138012c9dc44e6614466c0a8e929fc55e4a5dd))
* **drm:** add privacy screen modules to the initrd ([14d97a6a](https://github.com/dracutdevs/dracut/commit/14d97a6a28c6172340c47c89374358aaf4e2629d))
* **fedora.conf.example:** rename misspelled variable ([9371dcab](https://github.com/dracutdevs/dracut/commit/9371dcaba3c58377428eee44bd702fae7b2ab20e))
* **fido2:** add a missing library ([4753738b](https://github.com/dracutdevs/dracut/commit/4753738b62d958955f50fb077ea21c56a8d23dc3))
* **fips:**
* missing sourcing of dracut-lib ([857b17f0](https://github.com/dracutdevs/dracut/commit/857b17f090bdf575292f0bd6f5e8e3d753f6b426))
* add and remove local variables ([e8121bfd](https://github.com/dracutdevs/dracut/commit/e8121bfddda34e20db889a74d4ac6259ed182aea))
* wrong error message ([7f10c483](https://github.com/dracutdevs/dracut/commit/7f10c483b6abcc8be42cf246bbdade264be68228))
* handle s390x OSTree systems ([78557f05](https://github.com/dracutdevs/dracut/commit/78557f05a69fe718a97df85d2ed741ce10d3f806))
* **fips.sh:** repsect rd.fips.skipkernel ([5789abcb](https://github.com/dracutdevs/dracut/commit/5789abcbe05f30d556086590b786c4857d025d9d))
* **img-lib:** install rmdir ([51ce8893](https://github.com/dracutdevs/dracut/commit/51ce8893d981e90640123a7dcc3e4f3621e7d819))
* **install:**
* segfault on popen error ([5c2f72f1](https://github.com/dracutdevs/dracut/commit/5c2f72f152ec319a8001d1ff0bfd1f81a9130b04))
* extend hwcaps library handling to libraries under glibc-hwcaps/ ([10ed204f](https://github.com/dracutdevs/dracut/commit/10ed204f873f454dcd15ffcc82dc3a1c781c1514))
* use size_t to avoid -Wsign-compare warning ([55468a2d](https://github.com/dracutdevs/dracut/commit/55468a2d40182de4cce5ba4ecd5dcd96be03bd4d))
* improve gettid definition ([ef0f848a](https://github.com/dracutdevs/dracut/commit/ef0f848a67fdd0a0dab135acbd1cd7fa0179a95c))
* validate return values log.c ([19537f89](https://github.com/dracutdevs/dracut/commit/19537f8943ac4106c6d4ab0e00a48a8c0a9a0519))
* rectify unused function args in log.c ([b5cf7ec7](https://github.com/dracutdevs/dracut/commit/b5cf7ec784335ec561e379f8e78f48019a344ac0))
* use wrapper for asprintf ([e2a61595](https://github.com/dracutdevs/dracut/commit/e2a61595d2c91202ff4ea69937064cd2c0d1f336))
* use unsigned int instead of unsigned ([74a41799](https://github.com/dracutdevs/dracut/commit/74a417994840f7a6119e2dee57f9a3bb4d84998b))
* reduce cppcheck warnings ([b0bf8187](https://github.com/dracutdevs/dracut/commit/b0bf8187d5cc51d5576d8d70a81677d7c9741b37))
* add a missing ret value assignment ([6a444261](https://github.com/dracutdevs/dracut/commit/6a44426162d5b1b7084b17f921799863d353f847))
* **integrity:** add support for loading multiple EVM x509 certs ([9da76af8](https://github.com/dracutdevs/dracut/commit/9da76af8e7f0f7a939b2ee44f0b4a5ce0bdd3b0b))
* **iscsi:** add support for the new iscsiadm "no-wait" (-W) command ([7374943a](https://github.com/dracutdevs/dracut/commit/7374943ae3d063f0142c969b132c4156030fda8b))
* **kernel-modules:**
* add mailbox drivers for arm ([0e80ff72](https://github.com/dracutdevs/dracut/commit/0e80ff72e01d28e7e92d3adbf98ec40bdbdc37fe))
* detect block device's hardware driver ([c86f4d28](https://github.com/dracutdevs/dracut/commit/c86f4d286000d1e76fd405560b4114537e2cbbff))
* add blk_mq_alloc_disk and blk_cleanup_disk to blockfuncs ([b292ce72](https://github.com/dracutdevs/dracut/commit/b292ce7295f18192124e64e5ec31161d09492160))
* add more modules on RISC-V ([3cc9f1c1](https://github.com/dracutdevs/dracut/commit/3cc9f1c10c67dcdb5254e0eb69f19e9ab22abf20))
* add isp1760 USB controller ([15398458](https://github.com/dracutdevs/dracut/commit/15398458685d376fef56b1bf6fe09ae7c68324c1))
* add Type-C USB drivers for generic initrd ([a1287c62](https://github.com/dracutdevs/dracut/commit/a1287c627f28b16b1b066b7c256549b832bd98de))
* **kernel-modules-extra:** handle zstd module extension ([b3d2dcb7](https://github.com/dracutdevs/dracut/commit/b3d2dcb71e7af8f605f5f66041ed3c801333e5f1))
* **lvm:**
* restore setting LVM_MD_PV_ACTIVATED ([164e5ebb](https://github.com/dracutdevs/dracut/commit/164e5ebb1199ea3e3d641ce402d8257f0055a529))
* replace --partial option ([97543cca](https://github.com/dracutdevs/dracut/commit/97543cca48dfde849396f11c83f9c320e1b91c46))
* **man:** default value of rd.retry was increased to 180 seconds ([4855242c](https://github.com/dracutdevs/dracut/commit/4855242ce5cb586afd2eebd91df57ce1d28ae6b5))
* **mdraid:** allow UUID comparison for more than one UUID ([d364ce83](https://github.com/dracutdevs/dracut/commit/d364ce8334fef96f48492bd0fb3b7deac37bbb66))
* **memstrack:** drop bash runtime requirement ([35822f39](https://github.com/dracutdevs/dracut/commit/35822f39970b369301e0ff54436d5714dd996896))
* **mksh:** requires printf ([f806a628](https://github.com/dracutdevs/dracut/commit/f806a628aa9aec548e425e81b6ea4ab6f5db26f6))
* **multipath:**
* check if mpathconf is available ([4318533e](https://github.com/dracutdevs/dracut/commit/4318533e1493bfab622b64efc1b799426c812c26))
* drop ExecStop= setting from service unit ([9491e599](https://github.com/dracutdevs/dracut/commit/9491e599282d0d6bb12063eddbd192c0d2ce8acf))
* get config. dir from configuration ([2e3c5444](https://github.com/dracutdevs/dracut/commit/2e3c5444d271cb8f05955858b8fdc367c4ea5c48))
* **multipathd.service:**
* drop dependencies on iscsi and iscsid ([6246da40](https://github.com/dracutdevs/dracut/commit/6246da400fa7f527a1ff1c620bf85ac9f6644508))
* adapt to upstream multipath-tools unit file ([a247d2bc](https://github.com/dracutdevs/dracut/commit/a247d2bc0d4c6d37a2ea4f3da98dd7902bb37385))
* remove dependency on systemd-udev-settle ([371b338a](https://github.com/dracutdevs/dracut/commit/371b338a5f19d40ff4c3216dc0f27f9a00cf4e22))
* **network:**
* consistent use of "$gw" for gateway ([3f2c76bb](https://github.com/dracutdevs/dracut/commit/3f2c76bb1456941a28d3333569d2bf18f8624617))
* wrong test of wicked unit ([22e68307](https://github.com/dracutdevs/dracut/commit/22e683077a686b592da55e1d247b31f65c95d481))
* add errors and warnings when network interface does not exist ([79389352](https://github.com/dracutdevs/dracut/commit/7938935267dd8824f074adf84c219340ad4c8db6))
* **network-manager:**
* skip non-directories in /sys/class/net ([d9c3c774](https://github.com/dracutdevs/dracut/commit/d9c3c77437d91d7d66369a3ef701ffc5e501346d))
* disable tty output if the console is not usable ([f6e6be24](https://github.com/dracutdevs/dracut/commit/f6e6be245d0cda14d90a0442b688c8dca1410a2e))
* show output on console only with rd.debug enabled ([e07b7ad0](https://github.com/dracutdevs/dracut/commit/e07b7ad0e7f5dbb8024336f3075610b3b74ffb2e))
* write DHCP filename option to dhcpopts file ([38320fce](https://github.com/dracutdevs/dracut/commit/38320fce56a8d83b79d6c970c491a454ba9de213))
* check for nm-initrd-generator in both /usr/{libexec,lib} ([5ee7e249](https://github.com/dracutdevs/dracut/commit/5ee7e249b8cc74461122ccd7efe954b3402c23da))
* ensure safe content of /tmp/dhclient."$ifname".dhcpopts ([e509c638](https://github.com/dracutdevs/dracut/commit/e509c638e68a8e3cae446d1a4f9f86e3aa6e7a99))
* include nm-daemon-helper binary ([0e590531](https://github.com/dracutdevs/dracut/commit/0e5905315e92dfc095f543fd73db6190db533217))
* don't pull in systemd-udev-settle ([a0f12fb6](https://github.com/dracutdevs/dracut/commit/a0f12fb6a09b09f35ab28753d7c4461c10a8b562))
* support teaming under NM+systemd ([a97d2ced](https://github.com/dracutdevs/dracut/commit/a97d2cedcf65a9a2fbff2591171f0163c7d3cb46))
* pull in network.target in nm-initrd.service ([a97d6e2b](https://github.com/dracutdevs/dracut/commit/a97d6e2b13146783831b166ec5e8b33b29c514b0))
* **network-wicked:** multiple path corrections ([d3b5bc17](https://github.com/dracutdevs/dracut/commit/d3b5bc17ebadfe8922d1144b3dfd5435d0ecc71a))
* **nvmf:** validate_ip_conn ([655c65e6](https://github.com/dracutdevs/dracut/commit/655c65e6ced00e7a80c41e96c5f6fe108da07839))
* **qeth_rules:** check the existence of /sys/devices/qeth/*/online beforehand ([6c71ba41](https://github.com/dracutdevs/dracut/commit/6c71ba4121ae64ccd13fefba68ca327ac623810f))
* **resume:**
* resume using /usr/lib64/suspend ([c4593734](https://github.com/dracutdevs/dracut/commit/c459373448d24760d15e22fde7c6f811c7891376))
* check for presence of /sys/power/resume ([0b977906](https://github.com/dracutdevs/dracut/commit/0b97790626bff3579755b38f78a9c524a075cfcc))
* **rootfs-block:** make the base module dependency explicit ([3326e4c9](https://github.com/dracutdevs/dracut/commit/3326e4c957d0499495d9e91182fc574b960ace86))
* **s390_rules:** drop collect installation ([f905c3a7](https://github.com/dracutdevs/dracut/commit/f905c3a72c975cf6006f266755cc91229132c739))
* **shutdown:** be robust against forced shutdown ([b9ba3c8b](https://github.com/dracutdevs/dracut/commit/b9ba3c8bb8f0f1328cd1ffaa8dbf64585b28c474))
* **skipcpio:**
* calculate and use CPIO_MAGIC_LEN ([3fb8723c](https://github.com/dracutdevs/dracut/commit/3fb8723ce0066b4ba92f6dbfc4373a66d1f551c4))
* improve error checking ([f6d16b6b](https://github.com/dracutdevs/dracut/commit/f6d16b6bbd5b8b7ac238c3d2148bebf4e91140a2))
* **squash:**
* apply FIPS and libpthread workaround ([5ab18dee](https://github.com/dracutdevs/dracut/commit/5ab18dee996f0eeb2b0bfe354570e1b1af46d025))
* remove tailing '/' when installing ld.so.conf.d ([cbd85597](https://github.com/dracutdevs/dracut/commit/cbd85597e3ed6abf64ac17f431da5477eb5aefa0))
* keep ld cache under initdir ([dc21638c](https://github.com/dracutdevs/dracut/commit/dc21638c3f0acbb54417f3bfb6294ad5514bf2db))
* create relative symlinks ([a2b6be44](https://github.com/dracutdevs/dracut/commit/a2b6be44792b68218e3378a7d844b0f8527a4805))
* **systemd-sysusers:**
* use split systemd sysuser configs ([fec93bb2](https://github.com/dracutdevs/dracut/commit/fec93bb22181f80056b40231fca36c422248ade0))
* override systemd-sysusers.service ([dcbe23c1](https://github.com/dracutdevs/dracut/commit/dcbe23c14d13ca335ad327b7bb985071ca442f12))
* **tpm2-tss:**
* add a missing library ([c656b612](https://github.com/dracutdevs/dracut/commit/c656b612b101e4834e01f9841162e2629a7272f7))
* typo in depends() ([8b17105b](https://github.com/dracutdevs/dracut/commit/8b17105bed69ed90582a13d97d95ee19e6581365))
* **url-lib:**
* SC2086: Double quote to prevent globbing and word splitting ([acb18869](https://github.com/dracutdevs/dracut/commit/acb18869e98687a3f8c172d7e7befaa5326cf67a))
* SC2046: Quote this to prevent word splitting ([ec50cec3](https://github.com/dracutdevs/dracut/commit/ec50cec3bd9169410df409e077d0487c63c2a627))
* improve ca-bundle detection ([e3bb1815](https://github.com/dracutdevs/dracut/commit/e3bb1815bbbff1a7e21b857d2ae32bc0410754d5))
* make pre-pivot hook separetely per nfs mount ([2f091b17](https://github.com/dracutdevs/dracut/commit/2f091b17075f81ff490b05d3d566d736fc32f0be))
* **usrmount:** do not empty _dev variable ([4afdcba2](https://github.com/dracutdevs/dracut/commit/4afdcba212793f136aea012b30dd7bdb5b641a5a))
* **zfcp_rules:**
* correct udev zfcp rules parsing ([59252668](https://github.com/dracutdevs/dracut/commit/5925266832042f9d17a3fb7a219b83118c5b16d6))
* remove collect based udev rule creators ([d40c49a8](https://github.com/dracutdevs/dracut/commit/d40c49a8dfe203be33af8ace5f0efd07a88856f4))
#### Features
* **Makefile:** cargo wrapper for dracut-cpio build ([51d21c6b](https://github.com/dracutdevs/dracut/commit/51d21c6b37b0eb8566d18d665d0197ca4d68101c))
* **cpio:**
* add newc archive creation utility ([a9c67046](https://github.com/dracutdevs/dracut/commit/a9c67046431ccf5fd4f4c16c890695df388f0d38))
* add rust argument parsing library from crosvm ([94fc5026](https://github.com/dracutdevs/dracut/commit/94fc50262f5e6c28d92782dc231fbb6c61855954))
* **crypt:**
* check if pkcs11 module is needed in hostonly mode ([56f4fb6c](https://github.com/dracutdevs/dracut/commit/56f4fb6cb755327c77c32f8c414a4a0e64fc933c))
* check if fido2 module is needed in hostonly mode ([d5fd030c](https://github.com/dracutdevs/dracut/commit/d5fd030cc285730e1a1b9e0e78a1e1dc4daabfe0))
* check if tpm2-tss module is needed in hostonly mode ([5d990a00](https://github.com/dracutdevs/dracut/commit/5d990a004b5ae6863f2c9a633b184c07dd73563d))
* **dracut.sh:**
* add --aggresive-strip option ([67fc670a](https://github.com/dracutdevs/dracut/commit/67fc670a88ab6c97d22c6718082619c0cf850fc3))
* add "--enhanced-cpio" option for calling dracut-cpio ([afe4a6db](https://github.com/dracutdevs/dracut/commit/afe4a6dbb7df62982baab8212bba5d90010dfbac))
* check if target kernel has zstd support compiled in ([591118c5](https://github.com/dracutdevs/dracut/commit/591118c56da2bfcea060e3b7671bc87b23c0e44a))
* **fido2:** introducing the fido2 module ([049973b7](https://github.com/dracutdevs/dracut/commit/049973b708298ea0ce1ac9c869b404f4c718eff3))
* **lvm:**
* only run lvchange for LV that is seen on devices ([1af46743](https://github.com/dracutdevs/dracut/commit/1af46743195422aaebcde5c508a5dd479eff51ea))
* use generated filter when none is set ([7ffc5e38](https://github.com/dracutdevs/dracut/commit/7ffc5e388bcce20785803825bdd260c3c854b34f))
* update lvm command options ([c0a54f29](https://github.com/dracutdevs/dracut/commit/c0a54f2993b1d3c2101202c274a41f925445d54b))
* **pcsc:** introducing the pcsc module ([dcaff88a](https://github.com/dracutdevs/dracut/commit/dcaff88ac942042e3db0a2bbfc1c995ec0735f38))
* **pkcs11:**
* include the module in the spec file ([c5907f82](https://github.com/dracutdevs/dracut/commit/c5907f82d835d72e4dd7c473a86e872fce37d61e))
* introducing the pkcs11 module ([83ea8cf0](https://github.com/dracutdevs/dracut/commit/83ea8cf001a49356cf7814b3c08bdd1c4b4f2763))
* **spec:** add systemd-integritysetup module ([fe8df024](https://github.com/dracutdevs/dracut/commit/fe8df0240a24b9d2d60a5b0b998f82b251ede849))
* **squash:** install umount util ([563f5434](https://github.com/dracutdevs/dracut/commit/563f543424c66bf38e6cbd3f489655d45ad9b5c5))
* **systemd:** enable support for systemd compiled with ASAN ([d502d2a8](https://github.com/dracutdevs/dracut/commit/d502d2a816ba8f8329b3d8616bd2a7e82a0ad21f))
* **systemd-integritysetup:** introducing the systemd-integritysetup module ([33cf47a6](https://github.com/dracutdevs/dracut/commit/33cf47a60870cc290bd5b59c9cf87c54ad37051f))
#### Contributors
- Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
- David Disseldorp <ddiss@suse.de>
- Martin Wilck <mwilck@suse.de>
- Jóhann B. Guðmundsson <johannbg@gmail.com>
- Shreenidhi Shedi <sshedi@vmware.com>
- David Teigland <teigland@redhat.com>
- Beniamino Galvani <bgalvani@redhat.com>
- Thomas Blume <thomas.blume@suse.com>
- Kairui Song <kasong@redhat.com>
- Laszlo Gombos <laszlo.gombos@gmail.com>
- Renaud Métrich <rmetrich@redhat.com>
- Dusty Mabe <dusty@dustymabe.com>
- Masahiro Matsuya <mmatsuya@redhat.com>
- Alexander Wenzel <alexander.wenzel@qbeyond.de>
- Andre Russ <andre.russ@sap.com>
- Cornelius Hoffmann <coding@hoffmn.de>
- David Tardon <dtardon@redhat.com>
- Frantisek Sumsal <frantisek@sumsal.cz>
- Harald Hoyer <harald@profian.com>
- José María Fernández <josemariafg@gmail.com>
- Kairui Song <kasong@tencent.com>
- Peter Robinson <pbrobinson@fedoraproject.org>
- Pingfan Liu <piliu@redhat.com>
- Tony Asleson <tasleson@redhat.com>
- Zoltán Böszörményi <zboszor@gmail.com>
- Adrien Thierry <athierry@redhat.com>
- Alexander Tsoy <alexander@tsoy.me>
- Andreas Schwab <schwab@suse.de>
- Andrey Sokolov <keremet@altlinux.org>
- Brandon Sloane <btsloane@verizon.net>
- Charles Rose <charles.rose@dell.com>
- Coiby Xu <coxu@redhat.com>
- Dan Horák <dhorak@redhat.com>
- Dirk Müller <dirk@dmllr.de>
- Glenn Morris <rgm@stanford.edu>
- Hans de Goede <hdegoede@redhat.com>
- Hari Bathini <hbathini@linux.ibm.com>
- Henrik Gombos <henrik99999@gmail.com>
- Jonathan Lebon <jonathan@jlebon.com>
- LinkTed <link.ted@mailbox.org>
- Lubomir Rintel <lkundrak@v3.sk>
- Luca BRUNO <luca.bruno@coreos.com>
- Lukas Nykryn <lnykryn@redhat.com>
- Matthias Berndt <matthias_berndt@gmx.de>
- Mike Gilbert <floppym@gentoo.org>
- Pavel Valena <pvalena@redhat.com>
- Stefan Berger <stefanb@linux.ibm.com>
- Thomas Haller <thaller@redhat.com>
- Tomasz Paweł Gajc <tpgxyz@gmail.com>
- Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
- joshuacov1 <joshuacov@gmail.com>
- lapseofreason <lapseofreason0@gmail.com>
dracut-055
==========
#### Bug Fixes
* **base:**
* add missing `str_replace` to `dracut-dev-lib.sh` ([148e420b](https://github.com/dracutdevs/dracut/commit/148e420be5b5809aa8d5033f47477573bbbf3e60))
* split out `dracut-dev-lib.sh` ([c08bc810](https://github.com/dracutdevs/dracut/commit/c08bc8109d4c43beacfa4bcdc20a356102da6d02))
* **bash:** minor cleanups ([9355cb8e](https://github.com/dracutdevs/dracut/commit/9355cb8ea5024533210067373657dc337d63ecb9))
* **dash:** minor cleanups ([f4ea5f87](https://github.com/dracutdevs/dracut/commit/f4ea5f8734c4636f7d6db78da76e9525beb9a0ac))
* **dracut:** pipe hardlink output to `dinfo` ([0a6007bf](https://github.com/dracutdevs/dracut/commit/0a6007bf4f472565d2c0c205a56edea7ba3e3bc3))
* **dracut-functions:** get_maj_min without get_maj_min_cache_file set ([a277a5fc](https://github.com/dracutdevs/dracut/commit/a277a5fc7acc0a9e8d853f09671495f9d27645c1))
* **dracut-util:** print error message with trailing newline ([b9b6f0ee](https://github.com/dracutdevs/dracut/commit/b9b6f0ee5b859a562e46a8c4e0dee0261fabf74d))
* **fs-lib:** install fsck utilities ([12beeac7](https://github.com/dracutdevs/dracut/commit/12beeac741e4429146a674ef4ea9aa0bac10364b))
* **install:**
* configure logging earlier ([5eb24aa2](https://github.com/dracutdevs/dracut/commit/5eb24aa21d3ee639f869c2e363b3fb0b98be552b))
* sane default --kerneldir ([c1ab3613](https://github.com/dracutdevs/dracut/commit/c1ab36139d416e580e768c29f2addf7ccbc2c612), closes [#1505](https://github.com/dracutdevs/dracut/issues/1505))
* **integrity:** require ALLOW_METADATA_WRITES to come from EVM config file ([b12d91c4](https://github.com/dracutdevs/dracut/commit/b12d91c431220488fecf7b4be82427e3560560cb))
* **mksh:** minor cleanups ([6c673298](https://github.com/dracutdevs/dracut/commit/6c673298f36990665467564e6114c9ca2530f584))
* **squash:** don't mount the mount points if already mounted ([636d6df3](https://github.com/dracutdevs/dracut/commit/636d6df3134dde1dac72241937724bc59deb9303))
* **warpclock:** minor cleanups ([7d205598](https://github.com/dracutdevs/dracut/commit/7d205598c6a500b58b4d328e824d0446276f7ced))
#### Features
* **dracut.sh:** detect running in a container ([7275c6f6](https://github.com/dracutdevs/dracut/commit/7275c6f6a0f6808cd939ea5bdf1244c7bd13ba44))
* **install:** add default value for --firmwaredirs ([4cb086fa](https://github.com/dracutdevs/dracut/commit/4cb086fa2995799b95c0b25bc9a0cf72ba3868ea))
#### Contributors
- Harald Hoyer <harald@redhat.com>
- Jóhann B. Guðmundsson <johannbg@gmail.com>
- Marcos Mello <marcosfrm@gmail.com>
- Kairui Song <kasong@redhat.com>
- Lars Wendler <polynomial-c@gentoo.org>
- Stefan Berger <stefanb@linux.ibm.com>
- Tomasz Paweł Gajc <tpgxyz@gmail.com>
dracut-054
==========
With this release dracut has undergone a major overhaul.
A lot of systemd related modules have been added.
The integration test suite has finally ironed out the flaky behaviour due to the parallel device probing of the kernel,
which bit sometimes in the non-kvm github CI. So, if you see any `/dev/sda` in a setup script with more than two hard drives,
chances are, that the script works on the wrong disk. Same goes for network interfaces.
This release is also fully `shellcheck`'ed with `ShellCheck-0.7.2` and indented with `shfmt` and `astyle`.
The dracut project builds test containers every day for:
* `opensuse/tumbleweed-dnf:latest`
* `archlinux:latest`
* `fedora:rawhide`
* `fedora:latest`
* `fedora:33`
These containers can easily be used to run the integration tests locally without root permissions via `podman`.
We hope this serves as a blueprint for your distribution's CI process.
More information can be found in [docs/HACKING.md](https://github.com/dracutdevs/dracut/blob/master/HACKING.md).
#### Bug Fixes
* make testsuite pass on OpenSuse and Arch ([8b2afb08](https://github.com/dracutdevs/dracut/commit/8b2afb08baea7fc6e15ece94e287dcc4a008bcc4))
* cope with distributions with `/usr/etc` files ([3ad3b3a4](https://github.com/dracutdevs/dracut/commit/3ad3b3a40d419c4386b2924f6ac25ab0c355d131))
* deprecate gummiboot ([5c94cf41](https://github.com/dracutdevs/dracut/commit/5c94cf41e8937b6fbb72c96bc54c84fdf224c711))
* set vimrc and emacs indention according to .editorconfig ([9012f399](https://github.com/dracutdevs/dracut/commit/9012f3996b1e5f0788f8e80dfdd5c9ab0636c355))
* correctly handle kernel parameters ([501d82f7](https://github.com/dracutdevs/dracut/commit/501d82f79675a6bf9b37e8250152515863a80236))
* remove dracut.pc on `make clean` ([d643156d](https://github.com/dracutdevs/dracut/commit/d643156d561d3aca816d75e403149db073617292))
* honor KVERSION environment in the Makefile ([d8a454a5](https://github.com/dracutdevs/dracut/commit/d8a454a537c6de95033dec7d83c622fdc46c2a4f))
* always use mkdir -p ([9cf7b1c5](https://github.com/dracutdevs/dracut/commit/9cf7b1c529442d5abd6eaec4399d4ee77b95145e))
* **dracut.sh:**
* prevent symbolic links containing `//` ([de0c0872](https://github.com/dracutdevs/dracut/commit/de0c0872fc858fa9ca952f79ea9f00be17c37a4c))
* adding missing globalvars for udev ([f35d479d](https://github.com/dracutdevs/dracut/commit/f35d479d2b718da54886a66d3b7af2132215f80a))
* sysctl global variables ([3ca9aa1d](https://github.com/dracutdevs/dracut/commit/3ca9aa1d7b24b82e01d16613b86ec3be97c8a1bb))
* add global vars for modules-load ([ec4539c6](https://github.com/dracutdevs/dracut/commit/ec4539c6066edf25e52ed8e2d35c4be7ef39f729))
* omission is an addition to other omissions in conf files ([96c31333](https://github.com/dracutdevs/dracut/commit/96c313333d1a4f5e2c524a3a11c5b3aab24afc20))
* harden dracut against GZIP environment variable ([d8e47e20](https://github.com/dracutdevs/dracut/commit/d8e47e201af4646e2a82e11220ea9c993bd2ed48))
* add a missing tmpfilesconfdir global variable ([8849dd8d](https://github.com/dracutdevs/dracut/commit/8849dd8d1a74a46cb761c4d8041e4582d4686724))
* include `modules.builtin.alias` in the initramfs ([7f633747](https://github.com/dracutdevs/dracut/commit/7f6337471312486934f9592c1c7c05ed68694454))
* install all depmod relevant configuration files ([50a01dd4](https://github.com/dracutdevs/dracut/commit/50a01dd4b28471c0dfa810a705e219963bd5ec3c))
* add `modules.builtin.modinfo` to the initramfs ([87c4c178](https://github.com/dracutdevs/dracut/commit/87c4c17850e8bb982f6c07a6d3f58124bb2875de))
* search for btrfs devices from actual mount poiont ([3fdc734a](https://github.com/dracutdevs/dracut/commit/3fdc734a5cc8c0b94c1da49439181d540c8a5c43))
* **dracut-functions.sh:**
* implement a cache for get_maj_min ([c3bb9d18](https://github.com/dracutdevs/dracut/commit/c3bb9d18dceed7db6d16f9c2a7f682c5934099d7))
* word splitting issue for sed in get_ucode_file ([122657b2](https://github.com/dracutdevs/dracut/commit/122657b2fedf13991597830cca4d4ddbc8038233))
* **dracut-logger.sh:** double dash trigger unknown logger warnings during run ([4fbccde5](https://github.com/dracutdevs/dracut/commit/4fbccde50456f513d388cdfd858018cd889890dc))
* **dracut-install:**
* handle $LIB in ldd output parsing ([d1a36d3d](https://github.com/dracutdevs/dracut/commit/d1a36d3d80b0ed71ee814659e18a020c53cee05e))
* handle builtin modules ([2536a9ea](https://github.com/dracutdevs/dracut/commit/2536a9eaffbc9cc14c85579a2f537d3f3a1d5659))
* **base:**
* suppress calls to getarg in build phase ([6feaaabc](https://github.com/dracutdevs/dracut/commit/6feaaabc221ffbf79f652cbee3eea58f02449c50))
* source hooks without exec ([8059bcb2](https://github.com/dracutdevs/dracut/commit/8059bcb2c8df4d60cc2f548d3c53db25d815a7be))
* wait_for_dev quote shell variables ([b800edd6](https://github.com/dracutdevs/dracut/commit/b800edd69817b5e46d5f240b96d3b3648267ea21))
* adding crc32c for ext3 ([61f45643](https://github.com/dracutdevs/dracut/commit/61f456435879f084a1bf2c8885eaf37070035abf))
* **crypt:**
* install all crypto modules in the generic initrd ([10f9e569](https://github.com/dracutdevs/dracut/commit/10f9e569c52654ff54678a626a0f5dd14233716d))
* include cryptsetups tmpfile ([a4cc1964](https://github.com/dracutdevs/dracut/commit/a4cc196467e45f093fab7876c1c6b40798058920))
* **crypt-gpg:**
* cope with different scdaemon location ([44fd1c13](https://github.com/dracutdevs/dracut/commit/44fd1c13555f2e12bb566c246948629ada27d14d))
* **dbus-broker:**
* enable the service ([df1e5f06](https://github.com/dracutdevs/dracut/commit/df1e5f06a5449dcec6749baf742eac6eb1f0aa53))
* **dbus-daemon:**
* only error out in install() ([ae4fbb3d](https://github.com/dracutdevs/dracut/commit/ae4fbb3db4136e6e03a1c74d05ecc2a73b916401))
* **dracut-systemd:**
* don't refuse root=tmpfs when systemd is used ([a96900a8](https://github.com/dracutdevs/dracut/commit/a96900a82c3a8ec1ed2c6b2cc8862f912093fa0c))
* **examples:** remove the examples directory and reference to it ([b37c90c8](https://github.com/dracutdevs/dracut/commit/b37c90c8e00155a1f31237ae6cf91a81677c4df5))
* **fips:**
* add dh and ecdh ciphers ([543b8014](https://github.com/dracutdevs/dracut/commit/543b8014fc10fc6a92ba83db0dfc994fc1d2129b))
* remove old udev version requirements ([be30d987](https://github.com/dracutdevs/dracut/commit/be30d98751cff4ace660215305e2468943a45754))
* **i18n:**
* skip if data is missing ([651fe01e](https://github.com/dracutdevs/dracut/commit/651fe01e7937d86bbd471d9621581bed44f23dfa))
* **img-lib:**
* ignored null byte in input ([85eb9680](https://github.com/dracutdevs/dracut/commit/85eb96802cb82ec179bd3bc429b0dad2518946c5))
* **integrity:**
* properly set up EVM when using an x509 cert ([4bdd7eb2](https://github.com/dracutdevs/dracut/commit/4bdd7eb23a8187c3f19797e47eee8c672cea33ae))
* **iscsi:**
* replace sed call with bash internals ([66b920c6](https://github.com/dracutdevs/dracut/commit/66b920c65143f4cac80385a51704ae9483305569))
* add iscsid.service requirements ([bb6770f1](https://github.com/dracutdevs/dracut/commit/bb6770f1a413bdc7fd570b260ee28ace1255a195))
* only rely on socket activiation ([0eb87d78](https://github.com/dracutdevs/dracut/commit/0eb87d78108aae9aa4692f1edfb33ded50e26409))
* **kernel-modules:**
* optionally add /usr/lib/modules.d to initramfs ([92e6a8f8](https://github.com/dracutdevs/dracut/commit/92e6a8f87914322994387e559cf2a00b1760b301))
* add watchdog drivers for generic initrd ([3a60c036](https://github.com/dracutdevs/dracut/commit/3a60c036db7caccda95475d33c8d4ce1f615d2c8))
* **mdraid:**
* remove dependency statements ([86b75634](https://github.com/dracutdevs/dracut/commit/86b756346a6b7c5cb5f6fda4d12e2a58b6144e40))
* **memstrack:**
* correct dependencies ([c2ecc4d1](https://github.com/dracutdevs/dracut/commit/c2ecc4d131876383b47820a2e8d1a6f8a11716d9))
* **multipath:**
* stop multipath before udev db cleanup ([3c244c7c](https://github.com/dracutdevs/dracut/commit/3c244c7ca3555b526883dc20104c469b39085cbe))
* revise multipathd-stop ([7b8c78ff](https://github.com/dracutdevs/dracut/commit/7b8c78ff43a1f8e3690969e980d3d9d1dcb00c87))
* **nbd:**
* assume nbd version >= 3.8 ([6209edeb](https://github.com/dracutdevs/dracut/commit/6209edeb5c7783d94867829bf052aa53c78a1efe))
* remove old udev version requirements ([fd15dbad](https://github.com/dracutdevs/dracut/commit/fd15dbad6ebad86a3753a03f98706010f3e36cf7))
* make nbd work again with systemd ([77906443](https://github.com/dracutdevs/dracut/commit/7790644362622097aa69107920fd26b688c855d3))
* **network:**
* use wicked unit instead of find_binary ([57eefcf7](https://github.com/dracutdevs/dracut/commit/57eefcf70587f06b8874a3b3cf31e9ab70c03227))
* user variable for sdnetworkd instead of path ([4982e16d](https://github.com/dracutdevs/dracut/commit/4982e16dd53dcbbcfbd3a6b59013a0d6f893f840))
* correct regression in iface_has_carrier ([36af0518](https://github.com/dracutdevs/dracut/commit/36af0518b3fe59442de206c24bbe03be6fc17095))
* **network-legacy:**
* add missing options to dhclient.conf ([abfd547a](https://github.com/dracutdevs/dracut/commit/abfd547a85230a4520df65280aaf195f319df464))
* silence getargs ([60a34d8b](https://github.com/dracutdevs/dracut/commit/60a34d8b11dd50b2cd4e0e2208bd7c5e0fc48b71))
* **network-manager:**
* cope with distributions not using `libexec` ([22d6863e](https://github.com/dracutdevs/dracut/commit/22d6863ef1b2eb2a22264f2bfdb2b9329ab5dfdb))
* set timeout via command line option ([8a51ee1f](https://github.com/dracutdevs/dracut/commit/8a51ee1fa61bd3da342be53e35730837afd2caad))
* run after dracut-cmdline ([4d03404f](https://github.com/dracutdevs/dracut/commit/4d03404f499064b354a58223895cc47dbb461da5))
* create /run directories ([49b61496](https://github.com/dracutdevs/dracut/commit/49b614961dc8684f8512febbf80da489909e4b7f))
* use /run/NetworkManager/initrd/neednet in initqueue ([6a37c6f6](https://github.com/dracutdevs/dracut/commit/6a37c6f6302f950df608db3fd45acf9342ee3de2))
* only run NetworkManager if rd.neednet=1 ([ac0e8f7d](https://github.com/dracutdevs/dracut/commit/ac0e8f7dcc81432311906c3fca0d4211f6a2f68c))
* nm-run.service: don't kill forked processes ([1f21fac6](https://github.com/dracutdevs/dracut/commit/1f21fac646daa46cbe184ef8ff7705842f06ba15))
* no default deps for nm-run.service ([ba4bcf5f](https://github.com/dracutdevs/dracut/commit/ba4bcf5f4f11ad624c647ddf4f566997186135e7))
* nm-lib.sh does not require bash ([3402142e](https://github.com/dracutdevs/dracut/commit/3402142e344298c8f20fc52a2b064344788f1668))
* **squash:**
* post install should be the last step before stripping ([8c8aecdc](https://github.com/dracutdevs/dracut/commit/8c8aecdc63c9389038e78ee712d4809e49add5e1))
* **systemd:**
* include all nss libraries ([b3bbf5fb](https://github.com/dracutdevs/dracut/commit/b3bbf5fb6a95cfb69272da0711b5c5e0c6621de9))
* include hosts and nsswitch.conf in hostonly mode ([5912f4fb](https://github.com/dracutdevs/dracut/commit/5912f4fbc036cc36b9507c16dddef1ded1556572))
* remove old systemd version requirements ([fc53987b](https://github.com/dracutdevs/dracut/commit/fc53987bec1bc71b054d99072f62c1770a44bcca))
* **systemd-hostnamed:** extra quote ([2aa65234](https://github.com/dracutdevs/dracut/commit/2aa652349ca83198581cccb516a241a8d0e1b4d9))
* **systemd-modules:** remove dependency on systemd meta module ([afef4557](https://github.com/dracutdevs/dracut/commit/afef455718db69cff3797ca1a6d8bfebd2e86ab3))
* **systemd-modules-load:**
* misc repairs ([782ac8f1](https://github.com/dracutdevs/dracut/commit/782ac8f1f6b68edfe59630e9e4ac1673636f3a5e))
* **systemd-networkd:**
* make systemd-networkd a proper network provider ([ea779750](https://github.com/dracutdevs/dracut/commit/ea779750c371102c04252b48f1b7d9c7ece7cf93), closes [#737](https://github.com/dracutdevs/dracut/issues/737))
* **systemd-resolved:** remove nss libraries ([12bef83c](https://github.com/dracutdevs/dracut/commit/12bef83cdaf329e3ee2cc1f282bd9c128ec0fc56))
* **systemd-sysctl:**
* sysctl global variables ([02acedd0](https://github.com/dracutdevs/dracut/commit/02acedd09eb7222eaaf0f5256f3ddec26d658360))
* **systemd-sysusers:**
* misc fixes and cleanup ([7359ba8a](https://github.com/dracutdevs/dracut/commit/7359ba8acab2652cfff6b845f84a936cdec30f9d))
* **systemd-udev:** use global vars instead of fixed path ([fd883a58](https://github.com/dracutdevs/dracut/commit/fd883a58d1360f0c6c32f64462fafdd7a54af1ee))
* **systemd-udevd:** add udev id program files ([562cb77b](https://github.com/dracutdevs/dracut/commit/562cb77b5a28e3f31bc6d327c7712fba661e9a27))
* **systemd-verity:**
* incorrect reference to cryptsetup target ([ba92d1fc](https://github.com/dracutdevs/dracut/commit/ba92d1fcad68758004d7b1102fe1905c0f25e63e))
* re-naming module to veritysetup ([0267f3c3](https://github.com/dracutdevs/dracut/commit/0267f3c3554efd8f027afaf462347167402f5d6c))
* **tpm2-tss:** add tpm2 requirement ([8f99fada](https://github.com/dracutdevs/dracut/commit/8f99fadabea8f279a9fe28473dba424eb38f8d60))
* **udev-rules:**
* remove sourcing of network link files ([69f4e7cd](https://github.com/dracutdevs/dracut/commit/69f4e7cdc3f7da24e40496b0b2f0f5022cc3376d))
* add btrfs udev rules by default ([567c4557](https://github.com/dracutdevs/dracut/commit/567c4557537fe7f477f0f54237df00ebc79e56be))
* **url-lib:**
* fix passing args ([5f6be515](https://github.com/dracutdevs/dracut/commit/5f6be51595eab878314d031d9bfebe844b639302))
* **zipl:**
* don't depend on grub2 ([6b499ec1](https://github.com/dracutdevs/dracut/commit/6b499ec14b3ff35d5298617b436b64563a2d8c2f))
#### Performance
* disable initrd compression when squash module is enabled ([7c0bc0b2](https://github.com/dracutdevs/dracut/commit/7c0bc0b2fd167da42035020dae49af94844f053c))
#### Features
* support ZSTD-compressed kernel modules ([ce9af251](https://github.com/dracutdevs/dracut/commit/ce9af251af5fca08ea206ef980005853a4dac36e))
* also restore the initramfs from /lib/modules ([33e27fab](https://github.com/dracutdevs/dracut/commit/33e27fab59db60b1ca05a0c5b8a51fccb98578e5))
* extend Makefile indent target ([e0a0fa61](https://github.com/dracutdevs/dracut/commit/e0a0fa61749152fd5bc837770a02cf22d7e02d40))
* customize .editorconfig according to shfmt ([1f621aba](https://github.com/dracutdevs/dracut/commit/1f621aba3728a621b83b3b697eae6caadae9d287))
* squash module follow --compress option ([5d05ffbd](https://github.com/dracutdevs/dracut/commit/5d05ffbd87bc27e27f517ebc3454d50729c687e6))
* **bluetooth:** implement bluetooth support in initrd ([64ee2a53](https://github.com/dracutdevs/dracut/commit/64ee2a53864576fbedabe6b18fb9aae01b999199))
* **btrfs:** add 64-btrfs-dm.rules rules ([d4caa86a](https://github.com/dracutdevs/dracut/commit/d4caa86aba35b51dc1adda3ee3a5bae677420082))
* **mkinitrd:** remove mkinitrd ([43df4ee2](https://github.com/dracutdevs/dracut/commit/43df4ee274e7135aff87868bf3bf2fbab47aa8b4))
* **nbd:** support ipv6 link local nbds ([b12f8188](https://github.com/dracutdevs/dracut/commit/b12f8188a4ffac312694ebd48a5c99ba885e6467))
* **network-manager:** run as daemon with D-Bus ([112f03f9](https://github.com/dracutdevs/dracut/commit/112f03f9e225a790cbc6378c70773c6af5e7ee34))
* **qemu:** include the virtio_mem kernel module ([f3dcb606](https://github.com/dracutdevs/dracut/commit/f3dcb60619671f2d353caaa42d38207172c8b3ba))
* **skipcpio:** speed up and harden skipcpio ([63033495](https://github.com/dracutdevs/dracut/commit/630334950c9a7a714fdf31b6ff545d804b5df2f2))
* **squash:**
* use busybox for early setup if available ([90f269f6](https://github.com/dracutdevs/dracut/commit/90f269f6afe409925bad86f0bd7e9322ad9b4fb0))
* install and depmod modules seperately ([5a18b24a](https://github.com/dracutdevs/dracut/commit/5a18b24a8b9c20c98f711963ce5407ceb2f3d57b))
* **systemd-ac-power:** introducing the systemd-ac-power module ([e7407230](https://github.com/dracutdevs/dracut/commit/e74072306958262f22a9ecf10b928647ebdacf8f))
* **systemd-hostnamed:** introducing the systemd-hostnamed module ([bf273e3e](https://github.com/dracutdevs/dracut/commit/bf273e3e8632faff68fe19f9d7d7cc42e5a7c480))
* **systemd-initrd:** add initrd-usr-fs.target ([5eb73610](https://github.com/dracutdevs/dracut/commit/5eb736103d06197f37283bc27815c050adec81ea))
* **systemd-journald:** introducing the systemd-journald module ([3697891b](https://github.com/dracutdevs/dracut/commit/3697891b754493ecd6b19dbf279701bad3460fcd))
* **systemd-ldconfig:** introducing the systemd-ldconfig module ([563c434e](https://github.com/dracutdevs/dracut/commit/563c434ecba68c628344c1a684f656cdd8f9f214))
* **systemd-network-management:** introducing systemd-network-management module ([e942d86c](https://github.com/dracutdevs/dracut/commit/e942d86c9ddad19f9307d58cb2d99169f6e94edb))
* **systemd-resolved:** introducing the systemd-resolved module ([b7d3caef](https://github.com/dracutdevs/dracut/commit/b7d3caef6780305c553851169ca30b0b05b6ff31))
* **systemd-rfkill:** introducing the systemd-rfkill module ([21536544](https://github.com/dracutdevs/dracut/commit/215365441e1042793d62c4c9e146be5916ed5aeb))
* **systemd-sysext:** introducing the systemd-sysext module ([fc88af54](https://github.com/dracutdevs/dracut/commit/fc88af54134ec021be58465b52d1271453c30c55))
* **systemd-timedated:** introducing the systemd-timedated module ([1c41cc90](https://github.com/dracutdevs/dracut/commit/1c41cc90c52636e03abdf6d0c4fa0f557b7eb449))
* **systemd-timesyncd:** introducing the systemd-timesyncd module ([2257d545](https://github.com/dracutdevs/dracut/commit/2257d54583d24ca69d10b5e600b986d412a21714))
* **systemd-tmpfiles:** introducing the systemd-tmpfiles module ([2b61be32](https://github.com/dracutdevs/dracut/commit/2b61be32b890e70b1fce45d984327c27302da9bc))
* **systemd-udevd:** introducing the systemd-udevd module ([3534789c](https://github.com/dracutdevs/dracut/commit/3534789cc42331bc22cf44d26a1d04db4e010ad9))
* **systemd-verity:** introducing the systemd-verity module ([3d4dea58](https://github.com/dracutdevs/dracut/commit/3d4dea58f9821e58841d5c738b9935193c680181))
* **tpm2-tss:** introducing the tpm2-tss module ([8743b073](https://github.com/dracutdevs/dracut/commit/8743b0735692ab3f333815ba311cecdc29d45ecd))
#### Contributors
- Harald Hoyer <harald@redhat.com>
- Jóhann B. Guðmundsson <johannbg@gmail.com>
- Kairui Song <kasong@redhat.com>
- Dusty Mabe <dusty@dustymabe.com>
- Beniamino Galvani <bgalvani@redhat.com>
- Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
- Renaud Métrich <rmetrich@redhat.com>
- Adam Alves <adamoa@gmail.com>
- Daniel Molkentin <daniel.molkentin@suse.com>
- David Hildenbrand <david@redhat.com>
- David Tardon <dtardon@redhat.com>
- Jaroslav Jindrak <dzejrou@gmail.com>
- Jonas Jelten <jj@sft.lol>
- Lennart Poettering <lennart@poettering.net>
- Lev Veyde <lveyde@redhat.com>
- Peter Robinson <pbrobinson@fedoraproject.org>
- Stefan Berger <stefanb@linux.ibm.com>
- Đoàn Trần Công Danh <congdanhqx@gmail.com>
dracut-053
==========

View File

@@ -1,38 +0,0 @@
pkgname=dracut-git
pkgver=1
pkgrel=1
pkgdesc="Initramfs generation utility"
arch=('i686' 'x86_64')
url="https://dracut.wiki.kernel.org/"
license=('GPL')
conflicts=('dracut' 'mkinitcpio')
provides=('dracut=9999' 'mkinitcpio=9999')
depends=('bash')
optdepends=('cryptsetup' 'lvm2')
makedepends=('libxslt')
backup=(etc/dracut.conf)
source=()
md5sums=()
# out of tree builds disallowed for this PKGFILE
BUILDDIR="${PWD}"
PKGDEST="${PWD}"
SRCDEST=""
SRCPKGDEST=""
LOGDEST=""
pkgver() {
cd ..
desc="$(git describe)"
printf "%s.%s.%s" ${desc//-/ }
}
build() {
cd ..
make sysconfdir=/etc || return 1
}
package() {
cd ..
make DESTDIR="${pkgdir}" sysconfdir=/etc install || return 1
}

View File

@@ -3,10 +3,7 @@ dracut
dracut is an event driven initramfs infrastructure.
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](.github/CODE_OF_CONDUCT.md)
[![Fedora-32](https://github.com/dracutdevs/dracut/workflows/Fedora-32/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-32)
[![Fedora-33](https://github.com/dracutdevs/dracut/workflows/Fedora-33/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-33)
[![Fedora-latest](https://github.com/dracutdevs/dracut/workflows/Fedora-latest/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-latest)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](docs/CODE_OF_CONDUCT.md)
dracut (the tool) is used to create an initramfs image by copying tools
and files from an installed system and combining it with the
@@ -29,23 +26,21 @@ specific functionality into the initramfs. They live in the modules.d
subdirectory, and use functionality provided by dracut-functions to do their
work.
Currently dracut lives on github.com and kernel.org.
Documentation:
- [Introduction](man/dracut.asc)
- [User Manual](man/dracut.usage.asc)
The tarballs can be found here:
http://www.kernel.org/pub/linux/utils/boot/dracut/
ftp://ftp.kernel.org/pub/linux/utils/boot/dracut/
Currently dracut is developed on [github.com](https://github.com/dracutdevs/dracut).
Git:
https://github.com/dracutdevs/dracut.git
http://git.kernel.org/?p=boot/dracut/dracut.git
The release tarballs are [here](https://github.com/dracutdevs/dracut/releases).
Project Documentation:
http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
Gitter (chat):
- https://gitter.im/dracutdevs/Lobby
Project Wiki:
http://dracut.wiki.kernel.org
See [News](NEWS.md) for information about changes in the releases and
the [Wiki](https://github.com/dracutdevs/dracut/wiki) to share information.
See the github issue tracker for things which still need to be done and HACKING.md
See the github issue tracker for things which still need to be done and [Hacking](docs/HACKING.md)
for some instructions on how to get started. There is also a mailing list
that is being used for the discussion -- initramfs@vger.kernel.org.
It is a typical vger list, send mail to majordomo@vger.kernel.org with body

108
configure vendored
View File

@@ -1,11 +1,12 @@
#!/bin/bash
# We don't support srcdir != builddir
echo \#buildapi-variable-no-builddir >/dev/null
echo \#buildapi-variable-no-builddir > /dev/null
prefix=/usr
enable_documentation=yes
enable_dracut_cpio=no
CC="${CC:-cc}"
PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
@@ -31,24 +32,25 @@ read_arg() {
while (($# > 0)); do
case "${1%%=*}" in
--prefix) read_arg prefix "$@" || shift;;
--libdir) read_arg libdir "$@" || shift;;
--datadir) read_arg datadir "$@" || shift;;
--sysconfdir) read_arg sysconfdir "$@" || shift;;
--sbindir) read_arg sbindir "$@" || shift;;
--mandir) read_arg mandir "$@" || shift;;
--disable-documentation) enable_documentation=no;;
--program-prefix) read_arg programprefix "$@" || shift;;
--exec-prefix) read_arg execprefix "$@" || shift;;
--bindir) read_arg bindir "$@" || shift;;
--includedir) read_arg includedir "$@" || shift;;
--libexecdir) read_arg libexecdir "$@" || shift;;
--localstatedir) read_arg localstatedir "$@" || shift;;
--sharedstatedir) read_arg sharedstatedir "$@" || shift;;
--infodir) read_arg infodir "$@" || shift;;
--systemdsystemunitdir) read_arg systemdsystemunitdir "$@" || shift;;
--bashcompletiondir) read_arg bashcompletiondir "$@" || shift;;
*) echo "Ignoring unknown option '$1'";;
--prefix) read_arg prefix "$@" || shift ;;
--libdir) read_arg libdir "$@" || shift ;;
--datadir) read_arg datadir "$@" || shift ;;
--sysconfdir) read_arg sysconfdir "$@" || shift ;;
--sbindir) read_arg sbindir "$@" || shift ;;
--mandir) read_arg mandir "$@" || shift ;;
--disable-documentation) enable_documentation=no ;;
--program-prefix) read_arg programprefix "$@" || shift ;;
--exec-prefix) read_arg execprefix "$@" || shift ;;
--bindir) read_arg bindir "$@" || shift ;;
--includedir) read_arg includedir "$@" || shift ;;
--libexecdir) read_arg libexecdir "$@" || shift ;;
--localstatedir) read_arg localstatedir "$@" || shift ;;
--sharedstatedir) read_arg sharedstatedir "$@" || shift ;;
--infodir) read_arg infodir "$@" || shift ;;
--systemdsystemunitdir) read_arg systemdsystemunitdir "$@" || shift ;;
--bashcompletiondir) read_arg bashcompletiondir "$@" || shift ;;
--enable-dracut-cpio) enable_dracut_cpio=yes ;;
*) echo "Ignoring unknown option '$1'" ;;
esac
shift
done
@@ -58,7 +60,7 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
exit 1
fi
cat <<EOF >conftest.c
cat << EOF > conftest.c
#include <fts.h>
int main() {
return 0;
@@ -66,17 +68,17 @@ int main() {
EOF
# shellcheck disable=SC2086
${CC} $CFLAGS $LDFLAGS conftest.c >/dev/null 2>&1
${CC} $CFLAGS $LDFLAGS conftest.c > /dev/null 2>&1
ret=$?
rm -f conftest.c a.out
# musl doesn't have fts.h included
if test $ret -ne 0; then
echo "dracut needs fts development files." >&2
exit 1
echo "dracut needs fts development files." >&2
exit 1
fi
cat <<EOF >conftest.c
cat << EOF > conftest.c
#include <fts.h>
int main(void) {
fts_open(0, 0, 0);
@@ -86,23 +88,58 @@ EOF
found=no
for lib in "-lc" "-lfts"; do
# shellcheck disable=SC2086
${CC} $CFLAGS $LDFLAGS conftest.c -Wl,$lib >/dev/null 2>&1
ret=$?
if test $ret -eq 0; then
FTS_LIBS="$lib"
found=yes
break;
fi
# shellcheck disable=SC2086
${CC} $CFLAGS $LDFLAGS conftest.c -Wl,$lib > /dev/null 2>&1
ret=$?
if test $ret -eq 0; then
FTS_LIBS="$lib"
found=yes
break
fi
done
rm -f conftest.c a.out
if test $found = no; then
echo "dracut couldn't find usable fts library" >&2
exit 1
echo "dracut couldn't find usable fts library" >&2
exit 1
fi
cat > Makefile.inc.$$ <<EOF
cat << EOF > conftest.c
#include <stdio.h>
#include <unistd.h>
#include <sys/syscall.h>
#ifndef SYS_gettid
#error "SYS_gettid unavailable on this system"
#endif
#define gettid() ((pid_t) syscall(SYS_gettid))
int main(void) {
return getpid() == gettid() ? 0 : -1;
}
EOF
# shellcheck disable=SC2086
${CC} $CFLAGS $LDFLAGS conftest.c > /dev/null 2>&1
ret=$?
rm -f conftest.c a.out
if test $ret -ne 0; then
echo "dracut needs SYS_gettid support." >&2
exit 1
fi
if test "$enable_dracut_cpio" = "yes"; then
cargo --version > /dev/null
ret=$?
if test $ret -ne 0; then
echo "dracut couldn't find cargo for dracut-cpio build"
exit 1
fi
fi
cat > Makefile.inc.$$ << EOF
prefix ?= ${prefix}
libdir ?= ${libdir:-${prefix}/lib}
datadir ?= ${datadir:-${prefix}/share}
@@ -110,6 +147,7 @@ sysconfdir ?= ${sysconfdir:-${prefix}/etc}
sbindir ?= ${sbindir:-${prefix}/sbin}
mandir ?= ${mandir:-${prefix}/share/man}
enable_documentation ?= ${enable_documentation:-yes}
enable_dracut_cpio ?= ${enable_dracut_cpio}
bindir ?= ${bindir:-${prefix}/bin}
KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ")
KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ")

213
docs/BASH.md Normal file
View File

@@ -0,0 +1,213 @@
# BASH Notes
## basename
Don't use `basename`, use:
```shell
file=${path##*/}
```
## dirname
Don't use `dirname`, use:
```shell
dir=${path%/*}
```
## shopt
If you set `shopt` in a function, reset to its default state with `trap`:
```shell
func() {
trap "$(shopt -p globstar)" RETURN
shopt -q -s globstar
}
```
## find, grep, print0, -0, -z
Don't use `find` in `for` loops, because filenames can contain spaces.
Try to use `globstar` and `nullglob` or null byte terminated strings.
Instead of:
```shell
func() {
for file in $(find /usr/lib* -type f -name 'lib*.a' -print0 ); do
echo $file
done
}
```
use:
```shell
func() {
trap "$(shopt -p nullglob globstar)" RETURN
shopt -q -s nullglob globstar
for file in /usr/lib*/**/lib*.a; do
[[ -f $file ]] || continue
echo "$file"
done
}
```
Or collect the filenames in an array, if you need them more than once:
```shell
func() {
trap "$(shopt -p globstar)" RETURN
shopt -q -s globstar
filenames=( /usr/lib*/**/lib*.a )
for file in "${filenames[@]}"; do
[[ -f $file ]] || continue
echo "$file"
done
}
```
Or, if you really want to use `find`, use `-print0` and an array:
```shell
func() {
mapfile -t -d '' filenames < <(find /usr/lib* -type f -name 'lib*.a' -print0)
for file in "${filenames[@]}"; do
echo "$file"
done
}
```
Note: `-d ''` is the same as `-d $'\0'` and sets the null byte as the delimiter.
or:
```shell
func() {
find /usr/lib* -type f -name 'lib*.a' -print0 | while read -r -d '' file; do
echo "$file"
done
}
```
or
```shell
func() {
while read -r -d '' file; do
echo "$file"
done < <(find /usr/lib* -type f -name 'lib*.a' -print0)
}
```
Use the tool options for null terminated strings, like `-print0`, `-0`, `-z`, etc.
## prefix or suffix array elements
Instead of:
```shell
func() {
other-cmd $(for k in "$@"; do echo "prefix-$k"; done)
}
```
do
```shell
func() {
other-cmd "${@/#/prefix-}"
}
```
or suffix:
```shell
func() {
other-cmd "${@/%/-suffix}"
}
```
## Join array elements with a separator char
Here we have an associate array `_drivers`, where we want to print the keys separated by ',':
```shell
if [[ ${!_drivers[*]} ]]; then
echo "rd.driver.pre=$(IFS=, ;echo "${!_drivers[*]}")" > "${initdir}"/etc/cmdline.d/00-watchdog.conf
fi
```
## Optional parameters to commands
If you want to call a command `cmd` with an option, if a variable is set, rather than doing:
```shell
func() {
local param="$1"
if [[ $param ]]; then
param="--this-special-option $param"
fi
cmd $param
}
```
do it like this:
```shell
func() {
local param="$1"
cmd ${param:+--this-special-option "$param"}
}
# cmd --this-special-option 'abc'
func 'abc'
# cmd
func ''
# cmd
func
```
If you want to specify the option even with an empty string do this:
```shell
func() {
local -a special_params
if [[ ${1+_} ]]; then
# only declare `param` if $1 is set (even as null string)
local param="$1"
fi
# check if `param` is set (even as null string)
if [[ ${param+_} ]]; then
special_params=( --this-special-option "${param}" )
fi
cmd ${param+"${special_params[@]}"}
}
# cmd --this-special-option 'abc'
func 'abc'
# cmd --this-special-option ''
func ''
# cmd
func
```
Or more simple, if you only have to set an option:
```shell
func() {
if [[ ${1+_} ]]; then
# only declare `param` if $1 is set (even as null string)
local param="$1"
fi
cmd ${param+--this-special-option}
}
# cmd --this-special-option
func 'abc'
# cmd --this-special-option
func ''
# cmd
func
```

View File

@@ -40,7 +40,7 @@ This Code of Conduct applies within all community spaces, and also applies when
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer responsible for enforcement Harald Hoyer <harald@redhat.com>.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer responsible for enforcement Harald Hoyer <harald@profian.com>.
All complaints will be reviewed and investigated promptly and fairly and will result in a response that is deemed necessary and appropriate to the circumstances.
Project maintainers are obligated to respect the privacy and security of the reporter of any incident.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

View File

@@ -1,14 +1,49 @@
# Dracut Developer Guidelines
Please make sure to follow our [Contribution Guidelines](../CONTRIBUTING.md).
## git
Currently dracut lives on github.com and kernel.org.
Currently dracut lives on github.com.
* https://github.com/dracutdevs/dracut.git
* https://git.kernel.org/pub/scm/boot/dracut/dracut.git
Pull requests should be filed preferably on github nowadays.
### Code Format
It is recommended, that you install a plugin for your editor, which reads in `.editorconfig`.
Additionally `emacs` and `vim` config files are provided for convenience.
To reformat C files use `astyle`:
```console
$ astyle --options=.astylerc <FILE>
```
For convenience there is also a Makefile `indent-c` target `make indent-c`.
To reformat shell files use `shfmt`:
```console
$ shfmt_version=3.2.4
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w -s .
```
or
```console
$ GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
$ $GOPATH/bin/shfmt -w -s .
```
or if `shfmt` is already in your `PATH`, use `make indent`.
Some IDEs already have support for shfmt.
For convenience the `make indent` Makefile target also calls shfmt, if it is in `$PATH`.
### Commit Messages
Commit messages should answer these questions:
@@ -107,7 +142,7 @@ dracut_install_dir/modules.d/
This function of module-setup.sh is called to install all
non-kernel files. dracut supplies several install functions that are
specialized for different file types. Browse through dracut-functions
fore more details. dracut also provides a $moddir variable if you
for more details. dracut also provides a $moddir variable if you
need to install a file from the module directory, such as an initrd
hook, a udev rule, or a specialized executable.
@@ -191,35 +226,31 @@ init has the following hook points to inject scripts:
## Testsuite
For the testsuite to work, you will have to install at least the following software packages:
```
dash \
asciidoc \
mdadm \
lvm2 \
dmraid \
cryptsetup \
nfs-utils \
nbd \
dhcp-server \
scsi-target-utils \
iscsi-initiator-utils \
strace \
syslinux \
python-imgcreate \
genisoimage \
btrfs-progs \
kmod-devel \
gcc \
bzip2 \
xz \
tar \
wget \
rpm-build \
${NULL}
### Rootless in a container with podman
```console
$ cd <DRACUT_SOURCE>
$ podman pull [CONTAINER]
$ podman run --rm -it \
--cap-add=SYS_PTRACE --user 0 \
-v /dev:/dev -v ./:/dracut:z \
[CONTAINER] \
bash -l
# cd /dracut
# ./configure
# make -j $(getconf _NPROCESSORS_ONLN)
# cd test
# make V=1 SKIP="16 60 61" clean check
```
How to run the testsuite:
with `[CONTAINER]` being one of the
[github `dracutdevs` containers](https://github.com/orgs/dracutdevs/packages),
e.g. `ghcr.io/dracutdevs/fedora:latest`.
### On bare metal
For the testsuite to pass, you will have to install at least the software packages
mentioned in the `test/container` Dockerfiles.
```
$ sudo make clean check
@@ -241,8 +272,8 @@ debug a specific test case:
$ cd TEST-01-BASIC
$ sudo make clean setup run
```
... change some kernel parameters ...
... change some kernel parameters in `test.sh` ...
```
$ sudo make run
```
to run the test without doing the setup
to run the test without doing the setup.

View File

@@ -46,25 +46,3 @@ documented in the dracut(8) man page.
For the Plymouth boot splash to be added to the initramfs image,
this gitlab PR is needed for Plymouth:
https://gitlab.freedesktop.org/plymouth/plymouth/merge_requests/72
Extensions to be used with Yocto
================================
examples/yocto/classes/dracut.bbclass:
Bitbake class for running dracut during the "do_rootfs" stage of
creating a distribution image and from the postinstall script of
a package. A kernel recipe needs this line to activate it:
inherit dracut
examples/yocto/postinst-intercepts/execute_dracut
The "intercept" script used during "do_rootfs" mentioned above.
examples/yocto/recipes/cross-compiler-ldd_git.bb
Package recipe for the cross-compiler-ldd script from the above link.
All the above three need to be added to a Yocto layer to their
proper locations.
They were tested on Yocto 2.7 with MACHINE="intel-core2-32" and
MACHINE="genericx86-64".

View File

@@ -27,44 +27,22 @@ This documents contains the necessary steps to conduct a successful release.
4. Check in AUTHORS and NEWS.md
```console
$ git ci -m "docs: update NEWS.md and AUTHORS" NEWS.md AUTHORS
$ git commit -m "docs: update NEWS.md and AUTHORS" NEWS.md AUTHORS
$ git push origin master
```
5. Tag the release and push
5. Tag the release, validate the tag and push
```console
$ VERSION=052
$ git tag -s "$VERSION"
$ git tag -s 060
$ git tag -v 060
$ git push --tags
```
Add the section from `NEWS.md` to the git tag message.
Add the section from `NEWS.md` to the git tag message excluding the Rendered
view entry.
6. Push git to kernel.org
With:
```console
$ git remote add kernelorg ssh://gitolite@ra.kernel.org/pub/scm/boot/dracut/dracut.git
```
Push to kernel.org git:
```console
$ git push --atomic kernelorg master "$VERSION"
```
7. Sign and upload tarballs to kernel.org
```console
$ make upload
```
This requires `kup` and a kernel.org account.
Wait until the tarballs are synced to http://www.kernel.org/pub/linux/utils/boot/dracut/ .
8. Create a new release on github (https://github.com/dracutdevs/dracut/releases/new)
6. Create a new release on github (https://github.com/dracutdevs/dracut/releases/new)
- Add the section from `NEWS.md` to the release.
- Attach the tarballs and signature file from http://www.kernel.org/pub/linux/utils/boot/dracut/ to the github release.
9. Close the github milestone and open a new one (https://github.com/dracutdevs/dracut/milestones)
10. Ensure that announcement was sent and reached the linux-initramfs mailinglist (https://www.spinics.net/lists/linux-initramfs/)
7. Open a new milestone, move all unfinished issue from the previous milestone to the new one and close the released milestone (https://github.com/dracutdevs/dracut/milestones)

View File

@@ -1,3 +1,3 @@
Security is very important to us. If you discover any issue regarding security, we'd appreciate a non-public disclosure of
the information, so please disclose the information responsibly by sending an email to Harald Hoyer harald@redhat.com and not by creating a GitHub issue.
the information, so please disclose the information responsibly by sending an email to Harald Hoyer <harald@profian.com> and not by creating a GitHub issue.
We will respond swiftly to fix verifiable security issues with the disclosure being coordinated with distributions and relevant security teams.

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -1,97 +0,0 @@
#!/bin/bash
# Copyright 2013 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__contains_word () {
local word="$1"; shift
for w in "$@"; do [[ $w = "$word" ]] && return 0; done
return 1
}
_dracut() {
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
[STANDALONE]='-f -v -q -l -H -h -M -N
--ro-mnt --force --kernel-only --no-kernel --strip --nostrip
--hardlink --nohardlink --noprefix --mdadmconf --nomdadmconf
--lvmconf --nolvmconf --debug --profile --verbose --quiet
--local --hostonly --no-hostonly --fstab --help --bzip2 --lzma
--xz --zstd --no-compress --gzip --list-modules --show-modules --keep
--printsize --regenerate-all --noimageifnotneeded --early-microcode
--no-early-microcode --print-cmdline --reproducible --uefi'
[ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers
--omit-drivers --modules --omit --drivers --filesystems --install
--fwdir --libdirs --fscks --add-fstab --mount --device --nofscks
--kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix
--kernel-cmdline --sshkey --persistent-policy --install-optional
--loginstall --uefi-stub --kernel-image
'
)
# shellcheck disable=SC2086
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--kmoddir|-k|--fwdir|--confdir|--tmpdir)
comps=$(compgen -d -- "$cur")
compopt -o filenames
;;
-c|--conf|--sshkey|--add-fstab|--add-device|-I|--install|--install-optional)
comps=$(compgen -f -- "$cur")
compopt -o filenames
;;
-a|-m|-o|--add|--modules|--omit)
comps=$(dracut --list-modules 2>/dev/null)
;;
--persistent-policy)
comps=$(cd /dev/disk/ || return 0; printf -- "%s " *)
;;
--kver)
comps=$(cd /lib/modules || return 0; echo [0-9]*)
;;
*)
return 0
;;
esac
# shellcheck disable=SC2207
# shellcheck disable=SC2016
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
fi
if [[ $cur = -* ]]; then
# shellcheck disable=SC2207
# shellcheck disable=SC2016
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
fi
local args
_count_args
if [[ $args -eq 1 ]]; then
_filedir
return 0
elif [[ $args -eq 2 ]]; then
# shellcheck disable=SC2034
comps=$(cd /lib/modules || return 0; echo [0-9]*)
# shellcheck disable=SC2207
# shellcheck disable=SC2016
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
fi
}
complete -F _dracut dracut

View File

@@ -16,7 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
dwarning() {
echo "Warning: $*" >&2
}
@@ -30,7 +29,7 @@ derror() {
}
usage() {
# 80x25 linebreak here ^
# 80x25 linebreak here ^
cat << EOF
Usage: $0 [OPTION]... <initramfs> <base image> [<image>...]
Creates initial ramdisk image by concatenating several images from the command
@@ -49,27 +48,46 @@ line and /boot/dracut/
EOF
}
imagedir=/boot/dracut/
overlay=/var/lib/dracut/overlay
while (($# > 0)); do
case $1 in
-f|--force) force=yes;;
-i|--imagedir) imagedir=$2;shift;;
-o|--overlaydir) overlay=$2;shift;;
--nooverlay) no_overlay=yes;shift;;
--noimagedir) no_imagedir=yes;shift;;
-h|--help) usage; exit 1 ;;
--debug) export debug="yes";;
-v|--verbose) beverbose="yes";;
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
-f | --force) force=yes ;;
-i | --imagedir)
imagedir=$2
shift
;;
-o | --overlaydir)
overlay=$2
shift
;;
--nooverlay)
no_overlay=yes
shift
;;
--noimagedir)
no_imagedir=yes
shift
;;
-h | --help)
usage
exit 1
;;
--debug) export debug="yes" ;;
-v | --verbose) beverbose="yes" ;;
-*)
printf "\nUnknown option: %s\n\n" "$1" >&2
usage
exit 1
;;
*) break ;;
esac
shift
done
outfile=$1; shift
outfile=$1
shift
if [[ -z $outfile ]]; then
derror "No output file specified."
@@ -77,7 +95,8 @@ if [[ -z $outfile ]]; then
exit 1
fi
baseimage=$1; shift
baseimage=$1
shift
if [[ -z $baseimage ]]; then
derror "No base image specified."
@@ -103,8 +122,11 @@ fi
if [[ ! $no_overlay ]]; then
ofile="$imagedir/90-overlay.img"
dinfo "Creating image $ofile from directory $overlay"
type pigz &>/dev/null && gzip=pigz || gzip=gzip
( cd "$overlay" || return 1 ; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
type pigz &> /dev/null && gzip=pigz || gzip=gzip
(
cd "$overlay" || return 1
find . | cpio --quiet -H newc -o | $gzip -9 > "$ofile"
)
fi
if [[ ! $no_imagedir ]]; then
@@ -113,7 +135,7 @@ if [[ ! $no_imagedir ]]; then
done
fi
images+=( "$@" )
images+=("$@")
dinfo "Using base image $baseimage"
cat -- "$baseimage" > "$outfile"

File diff suppressed because it is too large Load Diff

396
dracut-init.sh Normal file → Executable file
View File

@@ -19,7 +19,7 @@
#
export LC_MESSAGES=C
if [[ "$EUID" = "0" ]] && ! [[ $DRACUT_NO_XATTR ]]; then
if [[ $EUID == "0" ]] && ! [[ $DRACUT_NO_XATTR ]]; then
export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr,links -dfr"
else
export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,links -dfr"
@@ -28,17 +28,17 @@ fi
# is_func <command>
# Check whether $1 is a function.
is_func() {
[[ "$(type -t "$1")" = "function" ]]
[[ "$(type -t "$1")" == "function" ]]
}
if ! [[ $dracutbasedir ]]; then
dracutbasedir=${BASH_SOURCE[0]%/*}
[[ $dracutbasedir = dracut-functions* ]] && dracutbasedir="."
[[ $dracutbasedir == dracut-functions* ]] && dracutbasedir="."
[[ $dracutbasedir ]] || dracutbasedir="."
dracutbasedir="$(readlink -f $dracutbasedir)"
fi
if ! is_func dinfo >/dev/null 2>&1; then
if ! is_func dinfo > /dev/null 2>&1; then
# shellcheck source=./dracut-logger.sh
. "$dracutbasedir/dracut-logger.sh"
dlog_init
@@ -64,7 +64,7 @@ srcmods="$dracutsysrootdir/lib/modules/$kernel/"
# shellcheck disable=SC2154
[[ $drivers_dir ]] && {
if ! command -v kmod &>/dev/null && vercmp "$(modprobe --version | cut -d' ' -f3)" lt 3.7; then
if ! command -v kmod &> /dev/null && vercmp "$(modprobe --version | cut -d' ' -f3)" lt 3.7; then
dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.'
exit 1
fi
@@ -72,8 +72,6 @@ srcmods="$dracutsysrootdir/lib/modules/$kernel/"
}
export srcmods
[[ $DRACUT_FIRMWARE_PATH ]] || export DRACUT_FIRMWARE_PATH="/lib/firmware/updates:/lib/firmware:/lib/firmware/$kernel"
# export standard hookdirs
[[ $hookdirs ]] || {
hookdirs="cmdline pre-udev pre-trigger netroot "
@@ -91,8 +89,8 @@ DRACUT_LDCONFIG=${DRACUT_LDCONFIG:-ldconfig}
. "$dracutbasedir"/dracut-functions.sh
# Detect lib paths
if ! [[ $libdirs ]] ; then
if [[ $("$DRACUT_LDD" "$dracutsysrootdir$DRACUT_TESTBIN") == */lib64/* ]] &>/dev/null \
if ! [[ $libdirs ]]; then
if [[ $("$DRACUT_LDD" "$dracutsysrootdir$DRACUT_TESTBIN") == */lib64/* ]] &> /dev/null \
&& [[ -d $dracutsysrootdir/lib64 ]]; then
libdirs+=" /lib64"
[[ -d $dracutsysrootdir/usr/lib64 ]] && libdirs+=" /usr/lib64"
@@ -114,14 +112,14 @@ require_binaries() {
local _module_name="${moddir##*/}"
local _ret=0
if [[ "$1" = "-m" ]]; then
if [[ $1 == "-m" ]]; then
_module_name="$2"
shift 2
fi
for cmd in "$@"; do
if ! find_binary "$cmd" &>/dev/null; then
dinfo "dracut module '${_module_name#[0-9][0-9]}' will not be installed, because command '$cmd' could not be found!"
if ! find_binary "$cmd" &> /dev/null; then
dinfo "Module '${_module_name#[0-9][0-9]}' will not be installed, because command '$cmd' could not be found!"
((_ret++))
fi
done
@@ -132,19 +130,19 @@ require_any_binary() {
local _module_name="${moddir##*/}"
local _ret=1
if [[ "$1" = "-m" ]]; then
if [[ $1 == "-m" ]]; then
_module_name="$2"
shift 2
fi
for cmd in "$@"; do
if find_binary "$cmd" &>/dev/null; then
if find_binary "$cmd" &> /dev/null; then
_ret=0
break
fi
done
if (( _ret != 0 )); then
if ((_ret != 0)); then
dinfo "$_module_name: Could not find any command of '$*'!"
return 1
fi
@@ -152,8 +150,33 @@ require_any_binary() {
return 0
}
# helper function for check() in module-setup.sh
# to check for required kernel modules
# issues a standardized warning message
require_kernel_modules() {
# shellcheck disable=SC2154
local _module_name="${moddir##*/}"
local _ret=0
# Ignore kernel module requirement for no-kernel build
[[ $no_kernel == yes ]] && return 0
if [[ $1 == "-m" ]]; then
_module_name="$2"
shift 2
fi
for mod in "$@"; do
if ! check_kernel_module "$mod" &> /dev/null; then
dinfo "Module '${_module_name#[0-9][0-9]}' will not be installed, because kernel module '$mod' is not available!"
((_ret++))
fi
done
return "$_ret"
}
dracut_need_initqueue() {
: >"$initdir/lib/dracut/need-initqueue"
: > "$initdir/lib/dracut/need-initqueue"
}
dracut_module_included() {
@@ -162,7 +185,7 @@ dracut_module_included() {
}
dracut_no_switch_root() {
: >"$initdir/lib/dracut/no-switch-root"
: > "$initdir/lib/dracut/no-switch-root"
}
dracut_module_path() {
@@ -182,8 +205,8 @@ fi
if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then
DRACUT_INSTALL=$dracutbasedir/dracut-install
elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/install/dracut-install ]]; then
DRACUT_INSTALL=$dracutbasedir/install/dracut-install
elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/src/install/dracut-install ]]; then
DRACUT_INSTALL=$dracutbasedir/src/install/dracut-install
fi
# Test if dracut-install is a standalone executable with no options.
@@ -193,76 +216,96 @@ fi
# DRACUT_INSTALL="dracut-install --debug"
# in which case the string cannot be tested for being executable.
DRINSTALLPARTS=0
for i in $DRACUT_INSTALL ; do
DRINSTALLPARTS=$((DRINSTALLPARTS+1))
for i in $DRACUT_INSTALL; do
DRINSTALLPARTS=$((DRINSTALLPARTS + 1))
done
if [[ $DRINSTALLPARTS = 1 ]] && ! command -v "$DRACUT_INSTALL" > /dev/null 2>&1 ; then
if [[ $DRINSTALLPARTS == 1 ]] && ! command -v "$DRACUT_INSTALL" > /dev/null 2>&1; then
dfatal "dracut-install not found!"
exit 10
fi
if [[ $hostonly == "-h" ]]; then
if ! [[ $DRACUT_KERNEL_MODALIASES ]] || ! [[ -f "$DRACUT_KERNEL_MODALIASES" ]]; then
if ! [[ $DRACUT_KERNEL_MODALIASES ]] || ! [[ -f $DRACUT_KERNEL_MODALIASES ]]; then
export DRACUT_KERNEL_MODALIASES="${DRACUT_TMPDIR}/modaliases"
"$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${srcmods:+--kerneldir "$srcmods"} --modalias > "$DRACUT_KERNEL_MODALIASES"
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${srcmods:+--kerneldir "$srcmods"} --modalias > "$DRACUT_KERNEL_MODALIASES"
fi
fi
[[ $DRACUT_RESOLVE_LAZY ]] || export DRACUT_RESOLVE_DEPS=1
inst_dir() {
[[ -e ${initdir}/"$1" ]] && return 0 # already there
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@"; then
local _ret
[[ -e ${initdir}/"$1" ]] && return 0 # already there
if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@"; then
return 0
else
_ret=$?
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@"
return $_ret
fi
}
inst() {
local _hostonly_install
if [[ "$1" == "-H" ]]; then
local _ret _hostonly_install
if [[ $1 == "-H" ]]; then
_hostonly_install="-H"
shift
fi
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
# shellcheck disable=SC2154
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
return 0
else
_ret=$?
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
return $_ret
fi
}
inst_simple() {
local _hostonly_install
if [[ "$1" == "-H" ]]; then
local _ret _hostonly_install
if [[ $1 == "-H" ]]; then
_hostonly_install="-H"
shift
fi
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
[[ -e $1 ]] || return 1 # no source
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"; then
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || :
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
[[ -e $1 ]] || return 1 # no source
if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"; then
return 0
else
_ret=$?
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"
return $_ret
fi
}
inst_symlink() {
local _hostonly_install
if [[ "$1" == "-H" ]]; then
local _ret _hostonly_install
if [[ $1 == "-H" ]]; then
_hostonly_install="-H"
shift
fi
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
[[ -L $1 ]] || return 1
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
return 0
else
_ret=$?
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
return $_ret
fi
}
inst_multiple() {
local _ret
if "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then
local _ret _hostonly_install
if [[ $1 == "-H" ]]; then
_hostonly_install="-H"
shift
fi
if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
return 0
else
_ret=$?
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
return $_ret
fi
}
@@ -272,63 +315,84 @@ dracut_install() {
}
dracut_instmods() {
local _silent=0;
local i;
local _ret _silent=0
local i
# shellcheck disable=SC2154
[[ $no_kernel = yes ]] && return
[[ $no_kernel == yes ]] && return
for i in "$@"; do
[[ $i == "--silent" ]] && _silent=1
done
# shellcheck disable=SC2154
if ! "$DRACUT_INSTALL" \
if $DRACUT_INSTALL \
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@"; then
return 0
else
_ret=$?
if ((_silent == 0)); then
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || :
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@"
fi
return $_ret
fi
}
inst_library() {
local _hostonly_install
if [[ "$1" == "-H" ]]; then
local _ret _hostonly_install
if [[ $1 == "-H" ]]; then
_hostonly_install="-H"
shift
fi
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
[[ -e $1 ]] || return 1 # no source
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
[[ -e $1 ]] || return 1 # no source
if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
return 0
else
_ret=$?
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
return $_ret
fi
}
inst_binary() {
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
local _ret
if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then
return 0
else
_ret=$?
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
return $_ret
fi
}
inst_script() {
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
local _ret
if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then
return 0
else
_ret=$?
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
return $_ret
fi
}
inst_fsck_help() {
local _helper="/run/dracut/fsck/fsck_help_$1.txt"
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" "$_helper"; then
derror "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" "$_helper" || :
local _ret _helper="/run/dracut/fsck/fsck_help_$1.txt"
if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" "$_helper"; then
return 0
else
_ret=$?
derror "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" "$_helper"
return $_ret
fi
}
# Use with form hostonly="$(optional_hostonly)" inst_xxxx <args>
# If hosotnly mode is set to "strict", hostonly restrictions will still
# If hostonly mode is set to "strict", hostonly restrictions will still
# be applied, else will ignore hostonly mode and try to install all
# given modules.
optional_hostonly() {
# shellcheck disable=SC2154
if [[ $hostonly_mode = "strict" ]]; then
if [[ $hostonly_mode == "strict" ]]; then
printf -- "%s" "$hostonly"
else
printf ""
@@ -366,7 +430,7 @@ rev_lib_symlinks() {
until [[ ${_fn##*.} == so ]]; do
_fn="${_fn%.*}"
[[ -L ${_fn} ]] && [[ $(readlink -f "${_fn}") == "${_orig}" ]] && _links+=( "${_fn}" )
[[ -L ${_fn} ]] && [[ $(readlink -f "${_fn}") == "${_orig}" ]] && _links+=("${_fn}")
done
echo "${_links[*]}}"
@@ -382,10 +446,10 @@ inst_rule_programs() {
# shellcheck disable=SC2154
if [[ -x ${udevdir}/$_prog ]]; then
_bin="${udevdir}"/$_prog
elif [[ "${_prog/\$env\{/}" == "$_prog" ]]; then
elif [[ ${_prog/\$env\{/} == "$_prog" ]]; then
_bin=$(find_binary "$_prog") || {
dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
continue;
continue
}
fi
@@ -397,10 +461,10 @@ inst_rule_programs() {
_bin=""
if [[ -x ${udevdir}/$_prog ]]; then
_bin=${udevdir}/$_prog
elif [[ "${_prog/\$env\{/}" == "$_prog" ]] && [[ "${_prog}" != "/sbin/initqueue" ]]; then
elif [[ ${_prog/\$env\{/} == "$_prog" ]] && [[ ${_prog} != "/sbin/initqueue" ]]; then
_bin=$(find_binary "$_prog") || {
dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
continue;
continue
}
fi
@@ -412,10 +476,10 @@ inst_rule_programs() {
_bin=""
if [[ -x ${udevdir}/$_prog ]]; then
_bin=${udevdir}/$_prog
elif [[ "${_prog/\$env\{/}" == "$_prog" ]]; then
elif [[ ${_prog/\$env\{/} == "$_prog" ]]; then
_bin=$(find_binary "$_prog") || {
dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
continue;
continue
}
fi
@@ -423,21 +487,21 @@ inst_rule_programs() {
done
}
# attempt to install any programs specified in a udev rule
# attempt to create any groups and users specified in a udev rule
inst_rule_group_owner() {
local i
# shellcheck disable=SC2013
for i in $(sed -nr 's/.*OWNER=?"([^ "]+).*/\1/p' "$1"); do
if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
grep -E "^$i:" "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2> /dev/null; then
grep -E "^$i:" "$dracutsysrootdir"/etc/passwd 2> /dev/null >> "$initdir/etc/passwd"
fi
done
# shellcheck disable=SC2013
for i in $(sed -nr 's/.*GROUP=?"([^ "]+).*/\1/p' "$1"); do
if ! grep -Eq "^$i:" "$initdir/etc/group" 2>/dev/null; then
grep -E "^$i:" "$dracutsysrootdir"/etc/group 2>/dev/null >> "$initdir/etc/group"
if ! grep -Eq "^$i:" "$initdir/etc/group" 2> /dev/null; then
grep -E "^$i:" "$dracutsysrootdir"/etc/group 2> /dev/null >> "$initdir/etc/group"
fi
done
}
@@ -476,7 +540,7 @@ inst_rules() {
inst_rule_initqueue "$_found"
inst_simple "$_found" "$_target/${_found##*/}"
done
[[ $_found ]] || dinfo "Skipping udev rule: $_rule"
[[ $_found ]] || ddebug "Skipping udev rule: $_rule"
done
}
@@ -485,7 +549,7 @@ inst_rules_wildcard() {
inst_dir "${udevdir}/rules.d"
inst_dir "$_target"
for _rule in ${udevdir}/rules.d/$1 ${dracutbasedir}/rules.d/$1 ; do
for _rule in ${udevdir}/rules.d/$1 ${dracutbasedir}/rules.d/$1; do
[[ -e $_rule ]] || continue
inst_rule_programs "$_rule"
inst_rule_group_owner "$_rule"
@@ -493,8 +557,8 @@ inst_rules_wildcard() {
inst_simple "$_rule"
_found=$_rule
done
if [[ -n ${hostonly} ]] ; then
for _rule in ${_target}/$1 ; do
if [[ -n ${hostonly} ]]; then
for _rule in ${_target}/$1; do
[[ -f $_rule ]] || continue
inst_rule_programs "$_rule"
inst_rule_group_owner "$_rule"
@@ -503,10 +567,26 @@ inst_rules_wildcard() {
_found=$_rule
done
fi
[[ $_found ]] || dinfo "Skipping udev rule: $_rule"
[[ $_found ]] || ddebug "Skipping udev rule: $_rule"
}
# make sure that library links are correct and up to date
build_ld_cache() {
for f in "$dracutsysrootdir"/etc/ld.so.conf "$dracutsysrootdir"/etc/ld.so.conf.d/*; do
[[ -f $f ]] && inst_simple "${f#"$dracutsysrootdir"}"
done
if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then
if [[ $EUID == 0 ]]; then
derror "ldconfig exited ungracefully"
else
derror "ldconfig might need uid=0 (root) for chroot()"
fi
fi
}
prepare_udev_rules() {
dwarn "prepare_udev_rules: deprecated and will be removed"
if [ -z "$UDEVVERSION" ]; then
UDEVVERSION=$(udevadm --version)
export UDEVVERSION
@@ -526,13 +606,13 @@ prepare_udev_rules() {
[ -e "$f" ] || continue
while read -r line || [ -n "$line" ]; do
if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then
if (( UDEVVERSION >= 174 )); then
if ((UDEVVERSION >= 174)); then
printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}"
else
printf '%sIMPORT{program}="path_id %%p"\n' "${line%%IMPORT PATH_ID}"
fi
elif [ "${line%%IMPORT BLKID}" != "$line" ]; then
if (( UDEVVERSION >= 176 )); then
if ((UDEVVERSION >= 176)); then
printf '%sIMPORT{builtin}="blkid"\n' "${line%%IMPORT BLKID}"
else
# shellcheck disable=SC2016
@@ -550,15 +630,18 @@ prepare_udev_rules() {
# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook
# All hooks should be POSIX/SuS compliant, they will be sourced by init.
inst_hook() {
local hook
if ! [[ -f $3 ]]; then
dfatal "Cannot install a hook ($3) that does not exist."
dfatal "Aborting initrd creation."
exit 1
elif ! [[ "$hookdirs" == *$1* ]]; then
elif ! [[ $hookdirs == *$1* ]]; then
dfatal "No such hook type $1. Aborting initrd creation."
exit 1
fi
inst_simple "$3" "/lib/dracut/hooks/${1}/${2}-${3##*/}"
hook="/lib/dracut/hooks/${1}/${2}-${3##*/}"
inst_simple "$3" "$hook"
chmod u+x "$initdir/$hook"
}
# install any of listed files
@@ -577,7 +660,7 @@ inst_hook() {
inst_any() {
local to f
[[ $1 = '-d' ]] && to="$2" && shift 2
[[ $1 == '-d' ]] && to="$2" && shift 2
for f in "$@"; do
[[ -e $f ]] || continue
@@ -588,20 +671,35 @@ inst_any() {
return 1
}
# inst_libdir_dir <dir> [<dir>...]
# Install a <dir> located on a lib directory to the initramfs image
inst_libdir_dir() {
local -a _dirs
for _dir in $libdirs; do
for _i in "$@"; do
for _d in "$dracutsysrootdir$_dir"/$_i; do
[[ -d $_d ]] && _dirs+=("${_d#"$dracutsysrootdir"}")
done
done
done
for _dir in "${_dirs[@]}"; do
inst_dir "$_dir"
done
}
# inst_libdir_file [-n <pattern>] <file> [<file>...]
# Install a <file> located on a lib directory to the initramfs image
# -n <pattern> install matching files
inst_libdir_file() {
local -a _files
if [[ "$1" == "-n" ]]; then
if [[ $1 == "-n" ]]; then
local _pattern=$2
shift 2
for _dir in $libdirs; do
for _i in "$@"; do
for _f in "$dracutsysrootdir$_dir"/$_i; do
[[ "${_f#$dracutsysrootdir}" =~ $_pattern ]] || continue
[[ -e "$_f" ]] && _files+=("${_f#$dracutsysrootdir}")
[[ ${_f#"$dracutsysrootdir"} =~ $_pattern ]] || continue
[[ -e $_f ]] && _files+=("${_f#"$dracutsysrootdir"}")
done
done
done
@@ -609,7 +707,7 @@ inst_libdir_file() {
for _dir in $libdirs; do
for _i in "$@"; do
for _f in "$dracutsysrootdir$_dir"/$_i; do
[[ -e "$_f" ]] && _files+=("${_f#$dracutsysrootdir}")
[[ -e $_f ]] && _files+=("${_f#"$dracutsysrootdir"}")
done
done
done
@@ -623,6 +721,7 @@ get_decompress_cmd() {
*.gz) echo 'gzip -f -d' ;;
*.bz2) echo 'bzip2 -d' ;;
*.xz) echo 'xz -f -d' ;;
*.zst) echo 'zstd -f -d ' ;;
esac
}
@@ -636,7 +735,7 @@ inst_decompress() {
for _src in "$@"; do
_cmd=$(get_decompress_cmd "${_src}")
[[ -z "${_cmd}" ]] && return 1
[[ -z ${_cmd} ]] && return 1
inst_simple "${_src}"
# Decompress with chosen tool. We assume that tool changes name e.g.
# from 'name.gz' to 'name'.
@@ -678,6 +777,7 @@ module_check() {
else
unset check depends cmdline install installkernel
check() { true; }
# shellcheck disable=SC1090
. "$_moddir"/module-setup.sh
is_func check || return 0
[[ $_forced != 0 ]] && unset hostonly
@@ -709,6 +809,7 @@ module_check_mount() {
else
unset check depends cmdline install installkernel
check() { false; }
# shellcheck disable=SC1090
. "$_moddir"/module-setup.sh
moddir=$_moddir check 0
_ret=$?
@@ -734,6 +835,7 @@ module_depends() {
else
unset check depends cmdline install installkernel
depends() { true; }
# shellcheck disable=SC1090
. "$_moddir"/module-setup.sh
moddir=$_moddir depends
_ret=$?
@@ -751,11 +853,13 @@ module_cmdline() {
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
[[ -d $_moddir ]] || return 1
if [[ ! -f $_moddir/module-setup.sh ]]; then
# shellcheck disable=SC1090
[[ -x $_moddir/cmdline ]] && . "$_moddir/cmdline"
return $?
else
unset check depends cmdline install installkernel
cmdline() { true; }
# shellcheck disable=SC1090
. "$_moddir"/module-setup.sh
moddir="$_moddir" cmdline
_ret=$?
@@ -773,11 +877,13 @@ module_install() {
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
[[ -d $_moddir ]] || return 1
if [[ ! -f $_moddir/module-setup.sh ]]; then
# shellcheck disable=SC1090
[[ -x $_moddir/install ]] && . "$_moddir/install"
return $?
else
unset check depends cmdline install installkernel
install() { true; }
# shellcheck disable=SC1090
. "$_moddir"/module-setup.sh
moddir="$_moddir" install
_ret=$?
@@ -795,11 +901,13 @@ module_installkernel() {
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
[[ -d $_moddir ]] || return 1
if [[ ! -f $_moddir/module-setup.sh ]]; then
# shellcheck disable=SC1090
[[ -x $_moddir/installkernel ]] && . "$_moddir/installkernel"
return $?
else
unset check depends cmdline install installkernel
installkernel() { true; }
# shellcheck disable=SC1090
. "$_moddir"/module-setup.sh
moddir="$_moddir" installkernel
_ret=$?
@@ -836,13 +944,14 @@ check_mount() {
fi
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
module_check_mount "$_mod" "$_moddir"; ret=$?
module_check_mount "$_mod" "$_moddir"
ret=$?
# explicit module, so also accept ret=255
[[ $ret = 0 || $ret = 255 ]] || return 1
[[ $ret == 0 || $ret == 255 ]] || return 1
else
# module not in our list
if [[ $dracutmodules = all ]]; then
if [[ $dracutmodules == all ]]; then
# check, if we can and should install this module
module_check_mount "$_mod" "$_moddir" || return 1
else
@@ -864,13 +973,13 @@ check_mount() {
&& force_add_dracutmodules+=" $_moddep "
# if a module we depend on fail, fail also
if ! check_module "$_moddep"; then
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
derror "Module '$_mod' depends on '$_moddep', which can't be installed"
return 1
fi
done
[[ " $mods_to_load " == *\ $_mod\ * ]] || \
mods_to_load+=" $_mod "
[[ " $mods_to_load " == *\ $_mod\ * ]] \
|| mods_to_load+=" $_mod "
return 0
}
@@ -896,23 +1005,26 @@ check_module() {
[[ $2 ]] || mods_checked_as_dep+=" $_mod "
if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then
ddebug "dracut module '$_mod' will not be installed, because it's in the list to be omitted!"
ddebug "Module '$_mod' will not be installed, because it's in the list to be omitted!"
return 1
fi
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
if [[ " $dracutmodules $force_add_dracutmodules " == *\ $_mod\ * ]]; then
module_check "$_mod" 1 "$_moddir"; ret=$?
module_check "$_mod" 1 "$_moddir"
ret=$?
else
module_check "$_mod" 0 "$_moddir"; ret=$?
module_check "$_mod" 0 "$_moddir"
ret=$?
fi
# explicit module, so also accept ret=255
[[ $ret = 0 || $ret = 255 ]] || return 1
[[ $ret == 0 || $ret == 255 ]] || return 1
else
# module not in our list
if [[ $dracutmodules = all ]]; then
if [[ $dracutmodules == all ]]; then
# check, if we can and should install this module
module_check "$_mod" 0 "$_moddir"; ret=$?
module_check "$_mod" 0 "$_moddir"
ret=$?
if [[ $ret != 0 ]]; then
[[ $2 ]] && return 1
[[ $ret != 255 ]] && return 1
@@ -936,13 +1048,13 @@ check_module() {
&& force_add_dracutmodules+=" $_moddep "
# if a module we depend on fail, fail also
if ! check_module "$_moddep"; then
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
derror "Module '$_mod' depends on '$_moddep', which can't be installed"
return 1
fi
done
[[ " $mods_to_load " == *\ $_mod\ * ]] || \
mods_to_load+=" $_mod "
[[ " $mods_to_load " == *\ $_mod\ * ]] \
|| mods_to_load+=" $_mod "
return 0
}
@@ -954,12 +1066,13 @@ for_each_module_dir() {
local _mod
local _moddir
local _func
local _reason
_func=$1
for _moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
[[ -d $_moddir ]] || continue;
[[ -e $_moddir/install || -e $_moddir/installkernel || \
-e $_moddir/module-setup.sh ]] || continue
_mod=${_moddir##*/}; _mod=${_mod#[0-9][0-9]}
[[ -d $_moddir ]] || continue
[[ -e $_moddir/install || -e $_moddir/installkernel || -e $_moddir/module-setup.sh ]] || continue
_mod=${_moddir##*/}
_mod=${_mod#[0-9][0-9]}
$_func "$_mod" 1 "$_moddir"
done
@@ -974,7 +1087,10 @@ for_each_module_dir() {
&& [[ " $omit_dracutmodules " == *\ $_mod\ * ]] \
&& continue
derror "dracut module '$_mod' cannot be found or installed."
[[ -d $(echo "$dracutbasedir/modules.d"/[0-9][0-9]"$_mod") ]] \
&& _reason="installed" \
|| _reason="found"
derror "Module '$_mod' cannot be $_reason."
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] && exit 1
[[ " $dracutmodules " == *\ $_mod\ * ]] && exit 1
[[ " $add_dracutmodules " == *\ $_mod\ * ]] && exit 1
@@ -982,13 +1098,13 @@ for_each_module_dir() {
}
dracut_kernel_post() {
for _f in modules.builtin.bin modules.builtin modules.order; do
for _f in modules.builtin modules.builtin.alias modules.builtin.modinfo modules.order; do
[[ -e $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
done
# generate module dependencies for the initrd
if [[ -d $initdir/lib/modules/$kernel ]] && \
! depmod -a -b "$initdir" "$kernel"; then
if [[ -d $initdir/lib/modules/$kernel ]] \
&& ! depmod -a -b "$initdir" "$kernel"; then
dfatal "\"depmod -a $kernel\" failed."
exit 1
fi
@@ -1006,13 +1122,13 @@ instmods() {
local _silent
local _ret
[[ $no_kernel = yes ]] && return
[[ $no_kernel == yes ]] && return
if [[ $1 = '-c' ]]; then
if [[ $1 == '-c' ]]; then
unset _optional
shift
fi
if [[ $1 = '-s' ]]; then
if [[ $1 == '-s' ]]; then
_silent=1
shift
fi
@@ -1026,7 +1142,7 @@ instmods() {
return 0
fi
"$DRACUT_INSTALL" \
$DRACUT_INSTALL \
${initdir:+-D "$initdir"} \
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
${loginstall:+-L "$loginstall"} \
@@ -1038,21 +1154,21 @@ instmods() {
-m "$@"
_ret=$?
if ((_ret != 0)) && [[ -z "$_silent" ]]; then
if ((_ret != 0)) && [[ -z $_silent ]]; then
derror "FAILED: " \
"$DRACUT_INSTALL" \
${initdir:+-D "$initdir"} \
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
${loginstall:+-L "$loginstall"} \
${hostonly:+-H} \
${omit_drivers:+-N "$omit_drivers"} \
${srcmods:+--kerneldir "$srcmods"} \
${_optional:+-o} \
${_silent:+--silent} \
-m "$@"
${initdir:+-D "$initdir"} \
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
${loginstall:+-L "$loginstall"} \
${hostonly:+-H} \
${omit_drivers:+-N "$omit_drivers"} \
${srcmods:+--kerneldir "$srcmods"} \
${_optional:+-o} \
${_silent:+--silent} \
-m "$@"
fi
[[ "$optional" ]] && return 0
[[ "$_optional" ]] && return 0
return $_ret
}
@@ -1064,7 +1180,7 @@ else
ln_r() {
local _source=$1
local _dest=$2
[[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
[[ -d ${_dest%/*} ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}"
}
fi
@@ -1073,21 +1189,21 @@ is_qemu_virtualized() {
# 0 if a virt environment was detected
# 1 if a virt environment could not be detected
# 255 if any error was encountered
if type -P systemd-detect-virt >/dev/null 2>&1; then
if ! vm=$(systemd-detect-virt --vm >/dev/null 2>&1); then
if type -P systemd-detect-virt > /dev/null 2>&1; then
if ! vm=$(systemd-detect-virt --vm 2> /dev/null); then
return 255
fi
[[ $vm = "qemu" ]] && return 0
[[ $vm = "kvm" ]] && return 0
[[ $vm = "bochs" ]] && return 0
[[ $vm == "qemu" ]] && return 0
[[ $vm == "kvm" ]] && return 0
[[ $vm == "bochs" ]] && return 0
fi
for i in /sys/class/dmi/id/*_vendor; do
[[ -f $i ]] || continue
read -r vendor < "$i"
[[ "$vendor" == "QEMU" ]] && return 0
[[ "$vendor" == "Red Hat" ]] && return 0
[[ "$vendor" == "Bochs" ]] && return 0
[[ $vendor == "QEMU" ]] && return 0
[[ $vendor == "Red Hat" ]] && return 0
[[ $vendor == "Bochs" ]] && return 0
done
return 1
}

63
dracut-initramfs-restore.sh Normal file → Executable file
View File

@@ -6,39 +6,59 @@ set -e
[ -e /run/initramfs/bin/sh ] && exit 0
[ -e /run/initramfs/.need_shutdown ] || exit 0
# SIGTERM signal is received upon forced shutdown: ignore the signal
# We want to remain alive to be able to trap unpacking errors to avoid
# switching root to an incompletely unpacked initramfs
trap 'echo "Received SIGTERM signal, ignoring!" >&2' TERM
KERNEL_VERSION="$(uname -r)"
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
SKIP="$dracutbasedir/skipcpio"
[[ -x $SKIP ]] || SKIP=cat
[[ -x $SKIP ]] || SKIP="cat"
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
if [[ -d /efi/Default ]] || [[ -d /boot/Default ]] || [[ -d /boot/efi/Default ]]; then
MACHINE_ID="Default"
elif [[ -s /etc/machine-id ]]; then
read -r MACHINE_ID < /etc/machine-id
[[ $MACHINE_ID == "uninitialized" ]] && MACHINE_ID="Default"
else
MACHINE_ID="Default"
fi
mount -o ro /boot &>/dev/null || true
mount -o ro /boot &> /dev/null || true
if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /efi/${MACHINE_ID} || -L /efi/${MACHINE_ID} ]] ; then
&& [[ -d /efi/$MACHINE_ID || -L /efi/$MACHINE_ID ]]; then
IMG="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
&& [[ -d /boot/$MACHINE_ID || -L /boot/$MACHINE_ID ]]; then
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
else
elif [[ -d /boot/efi/loader/entries || -L /boot/efi/loader/entries ]] \
&& [[ -d /boot/efi/$MACHINE_ID || -L /boot/efi/$MACHINE_ID ]]; then
IMG="/boot/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
elif [[ -f /lib/modules/${KERNEL_VERSION}/initrd ]]; then
IMG="/lib/modules/${KERNEL_VERSION}/initrd"
elif [[ -f /boot/initramfs-${KERNEL_VERSION}.img ]]; then
IMG="/boot/initramfs-${KERNEL_VERSION}.img"
elif mountpoint -q /efi; then
IMG="/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
elif mountpoint -q /boot/efi; then
IMG="/boot/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
else
echo "No initramfs image found to restore!"
exit 1
fi
cd /run/initramfs
[ -f .need_shutdown -a -f "$IMG" ] || exit 1
if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
rm -f -- .need_shutdown
elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
rm -f -- .need_shutdown
elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
rm -f -- .need_shutdown
elif $SKIP "$IMG" | zstd -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
if (command -v zcat > /dev/null && $SKIP "$IMG" 2> /dev/null | zcat 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| (command -v bzcat > /dev/null && $SKIP "$IMG" 2> /dev/null | bzcat 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| (command -v xzcat > /dev/null && $SKIP "$IMG" 2> /dev/null | xzcat 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| (command -v lz4 > /dev/null && $SKIP "$IMG" 2> /dev/null | lz4 -d -c 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| (command -v lzop > /dev/null && $SKIP "$IMG" 2> /dev/null | lzop -d -c 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| (command -v zstd > /dev/null && $SKIP "$IMG" 2> /dev/null | zstd -d -c 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| ($SKIP "$IMG" 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1); then
rm -f -- .need_shutdown
else
# something failed, so we clean up
@@ -48,17 +68,16 @@ else
fi
if [[ -d squash ]]; then
unsquashfs -no-xattrs -f -d . squash/root.img >/dev/null
if [ $? -ne 0 ]; then
echo "Squash module is enabled for this initramfs but failed to unpack squash/root.img" >&2
if ! unsquashfs -no-xattrs -f -d . squash-root.img > /dev/null; then
echo "Squash module is enabled for this initramfs but failed to unpack squash-root.img" >&2
rm -f -- /run/initramfs/shutdown
exit 1
fi
fi
if [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ] ; then
if [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ]; then
. /etc/selinux/config
/usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts /run/initramfs > /dev/null
[ -n "${SELINUXTYPE}" ] && /usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/"${SELINUXTYPE}"/contexts/files/file_contexts /run/initramfs > /dev/null
fi
exit 0

View File

@@ -17,10 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
export __DRACUT_LOGGER__=1
## @brief Logging facility module for dracut both at build- and boot-time.
#
# @section intro Introduction
@@ -86,7 +84,6 @@ export __DRACUT_LOGGER__=1
#
# @see dlog_init()
## @brief Initializes dracut Logger.
#
# @retval 1 if something has gone wrong
@@ -105,7 +102,8 @@ export __DRACUT_LOGGER__=1
# See file doc comment for details.
dlog_init() {
local __oldumask
local ret=0; local errmsg
local ret=0
local errmsg
[ -z "$stdloglvl" ] && stdloglvl=4
[ -z "$sysloglvl" ] && sysloglvl=0
[ -z "$kmsgloglvl" ] && kmsgloglvl=0
@@ -114,23 +112,23 @@ dlog_init() {
if [ -z "$fileloglvl" ]; then
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
elif (( fileloglvl > 0 )); then
elif ((fileloglvl > 0)); then
if [[ $logfile ]]; then
__oldumask=$(umask)
umask 0377
! [ -e "$logfile" ] && : >"$logfile"
! [ -e "$logfile" ] && : > "$logfile"
umask "$__oldumask"
if [[ -w $logfile ]] && [[ -f $logfile ]]; then
# Mark new run in the log file
echo >>"$logfile"
if command -v date >/dev/null; then
echo "=== $(date) ===" >>"$logfile"
# Mark new run in the log file
echo >> "$logfile"
if command -v date > /dev/null; then
echo "=== $(date) ===" >> "$logfile"
else
echo "===============================================" >>"$logfile"
echo "===============================================" >> "$logfile"
fi
echo >>"$logfile"
echo >> "$logfile"
else
# We cannot log to file, so turn this facility off.
# We cannot log to file, so turn this facility off.
fileloglvl=0
ret=1
errmsg="'$logfile' is not a writable file"
@@ -138,22 +136,22 @@ dlog_init() {
fi
fi
if (( UID != 0 )); then
if ((UID != 0)); then
kmsgloglvl=0
sysloglvl=0
fi
if (( sysloglvl > 0 )); then
if ((sysloglvl > 0)); then
if [[ -d /run/systemd/journal ]] \
&& type -P systemd-cat &>/dev/null \
&& systemctl --quiet is-active systemd-journald.socket &>/dev/null \
&& { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &>/dev/null; } ; then
&& type -P systemd-cat &> /dev/null \
&& systemctl --quiet is-active systemd-journald.socket &> /dev/null \
&& { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &> /dev/null; }; then
readonly _systemdcatfile="$DRACUT_TMPDIR/systemd-cat"
mkfifo "$_systemdcatfile"
readonly _dlogfd=15
systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" &
exec 15>"$_systemdcatfile"
elif ! [[ -S /dev/log ]] && [[ -w /dev/log ]] || ! command -v logger >/dev/null; then
systemd-cat -t 'dracut' --level-prefix=true < "$_systemdcatfile" &
exec 15> "$_systemdcatfile"
elif ! ([[ -S /dev/log ]] && [[ -w /dev/log ]] && command -v logger > /dev/null); then
# We cannot log to syslog, so turn this facility off.
kmsgloglvl=$sysloglvl
sysloglvl=0
@@ -162,7 +160,7 @@ dlog_init() {
fi
fi
if (( sysloglvl > 0 )) || (( kmsgloglvl > 0 )); then
if ((sysloglvl > 0)) || ((kmsgloglvl > 0)); then
if [ -n "$dracutbasedir" ]; then
readonly syslogfacility=user
else
@@ -171,44 +169,44 @@ dlog_init() {
export syslogfacility
fi
local lvl; local maxloglvl_l=0
local lvl
local maxloglvl_l=0
for lvl in $stdloglvl $sysloglvl $fileloglvl $kmsgloglvl; do
(( lvl > maxloglvl_l )) && maxloglvl_l=$lvl
((lvl > maxloglvl_l)) && maxloglvl_l=$lvl
done
readonly maxloglvl=$maxloglvl_l
export maxloglvl
if (( stdloglvl < 6 )) && ((kmsgloglvl < 6)) && ((fileloglvl < 6)) && ((sysloglvl < 6)); then
if ((stdloglvl < 6)) && ((kmsgloglvl < 6)) && ((fileloglvl < 6)) && ((sysloglvl < 6)); then
unset dtrace
dtrace() { :; };
dtrace() { :; }
fi
if ((stdloglvl < 5)) && ((kmsgloglvl < 5)) && ((fileloglvl < 5)) && ((sysloglvl < 5)); then
unset ddebug
ddebug() { :; };
ddebug() { :; }
fi
if ((stdloglvl < 4)) && ((kmsgloglvl < 4)) && ((fileloglvl < 4)) && ((sysloglvl < 4)); then
unset dinfo
dinfo() { :; };
dinfo() { :; }
fi
if ((stdloglvl < 3)) && ((kmsgloglvl < 3)) && ((fileloglvl < 3)) && ((sysloglvl < 3)); then
unset dwarn
dwarn() { :; };
dwarn() { :; }
unset dwarning
dwarning() { :; };
dwarning() { :; }
fi
if ((stdloglvl < 2)) && ((kmsgloglvl < 2)) && ((fileloglvl < 2)) && ((sysloglvl < 2)); then
unset derror
derror() { :; };
derror() { :; }
fi
if ((stdloglvl < 1)) && ((kmsgloglvl < 1)) && ((fileloglvl < 1)) && ((sysloglvl < 1)); then
unset dfatal
dfatal() { :; };
dfatal() { :; }
fi
[ -n "$errmsg" ] && derror "$errmsg"
@@ -224,13 +222,13 @@ dlog_init() {
# @result Echoes first letter of level name.
_lvl2char() {
case "$1" in
1) echo F;;
2) echo E;;
3) echo W;;
4) echo I;;
5) echo D;;
6) echo T;;
*) return 1;;
1) echo F ;;
2) echo E ;;
3) echo W ;;
4) echo I ;;
5) echo D ;;
6) echo T ;;
*) return 1 ;;
esac
}
@@ -241,15 +239,15 @@ _lvl2char() {
# @retval 0 if @a lvl is correct.
# @result Echoes logger priority.
_lvl2syspri() {
printf "%s" -- "$syslogfacility."
printf -- "%s" "$syslogfacility."
case "$1" in
1) echo crit;;
2) echo error;;
3) echo warning;;
4) echo info;;
5) echo debug;;
6) echo debug;;
*) return 1;;
1) echo crit ;;
2) echo error ;;
3) echo warning ;;
4) echo info ;;
5) echo debug ;;
6) echo debug ;;
*) return 1 ;;
esac
}
@@ -279,16 +277,16 @@ _dlvl2syslvl() {
local lvl
case "$1" in
1) lvl=2;;
2) lvl=3;;
3) lvl=4;;
4) lvl=6;;
5) lvl=7;;
6) lvl=7;;
*) return 1;;
1) lvl=2 ;;
2) lvl=3 ;;
3) lvl=4 ;;
4) lvl=6 ;;
5) lvl=7 ;;
6) lvl=7 ;;
*) return 1 ;;
esac
[ "$syslogfacility" = user ] && echo $(( 8 + lvl )) || echo $(( 24 + lvl ))
[ "$syslogfacility" = user ] && echo $((8 + lvl)) || echo $((24 + lvl))
}
## @brief Prints to stderr and/or writes to file, to syslog and/or /dev/kmsg
@@ -318,14 +316,16 @@ _dlvl2syslvl() {
# - @c INFO to @c info
# - @c DEBUG and @c TRACE both to @c debug
_do_dlog() {
local lvl="$1"; shift
local lvlc=$(_lvl2char "$lvl") || return 0
local lvlc
local lvl="$1"
shift
lvlc=$(_lvl2char "$lvl") || return 0
local msg="$*"
local lmsg="$lvlc: $*"
(( lvl <= stdloglvl )) && printf -- 'dracut: %s\n' "$msg" >&2
((lvl <= stdloglvl)) && printf -- 'dracut[%s]: %s\n' "$lvlc" "$msg" >&2
if (( lvl <= sysloglvl )); then
if ((lvl <= sysloglvl)); then
if [[ "$_dlogfd" ]]; then
printf -- "<%s>%s\n" "$(($(_dlvl2syslvl "$lvl") & 7))" "$msg" >&$_dlogfd
else
@@ -333,12 +333,12 @@ _do_dlog() {
fi
fi
if (( lvl <= fileloglvl )) && [[ -w "$logfile" ]] && [[ -f "$logfile" ]]; then
echo "$lmsg" >>"$logfile"
if ((lvl <= fileloglvl)) && [[ -w $logfile ]] && [[ -f $logfile ]]; then
echo "$lmsg" >> "$logfile"
fi
(( lvl <= kmsgloglvl )) && \
echo "<$(_dlvl2syslvl "$lvl")>dracut[$$] $msg" >/dev/kmsg
((lvl <= kmsgloglvl)) \
&& echo "<$(_dlvl2syslvl "$lvl")>dracut[$$] $msg" > /dev/kmsg
}
## @brief Internal helper function for _do_dlog()
@@ -359,9 +359,9 @@ _do_dlog() {
# echo "This is a warning" | dwarn
dlog() {
[ -z "$maxloglvl" ] && return 0
(( $1 <= maxloglvl )) || return 0
(($1 <= maxloglvl)) || return 0
if (( $# > 1 )); then
if (($# > 1)); then
_do_dlog "$@"
else
while read -r line || [ -n "$line" ]; do
@@ -377,7 +377,9 @@ dlog() {
dtrace() {
set +x
dlog 6 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}
## @brief Logs message at DEBUG level (5)
@@ -387,7 +389,9 @@ dtrace() {
ddebug() {
set +x
dlog 5 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}
## @brief Logs message at INFO level (4)
@@ -397,7 +401,9 @@ ddebug() {
dinfo() {
set +x
dlog 4 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}
## @brief Logs message at WARN level (3)
@@ -407,7 +413,9 @@ dinfo() {
dwarn() {
set +x
dlog 3 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}
## @brief It's an alias to dwarn() function.
@@ -417,7 +425,9 @@ dwarn() {
dwarning() {
set +x
dwarn "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}
## @brief Logs message at ERROR level (2)
@@ -427,7 +437,9 @@ dwarning() {
derror() {
set +x
dlog 2 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}
## @brief Logs message at FATAL level (1)
@@ -437,5 +449,7 @@ derror() {
dfatal() {
set +x
dlog 1 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}

View File

@@ -8,7 +8,7 @@ i18n_install_all="yes"
stdloglvl=3
sysloglvl=5
install_optional_items+=" vi /etc/virc ps grep cat rm "
install_optional_items+=" vi /usr/libexec/vi /etc/virc ps grep cat rm "
prefix="/"
environment=/usr/lib/environment.d
environmentconfdir=/etc/environment.d
@@ -22,10 +22,10 @@ dbusconfdir=/etc/dbus-1
dbusinterfacesconfdir=/etc/dbus-1/interfaces
dbusservicesconfdir=/etc/dbus-1/services
dbussessionconfdir=/etc/dbus-1/session.d
dbussystem=confdir/etc/dbus-1/system.d
dbussystemconfdir=/etc/dbus-1/system.d
dbussystemservicesconfdir=/etc/dbus-1/system-services
sysctld=/usr/lib/sysctl.d
sysctldconfdir=/etc/sysctl.d
sysctlconfdir=/etc/sysctl.d
systemdutildir=/usr/lib/systemd
systemdutilconfdir=/etc/systemd
systemdcatalog=/usr/lib/systemd/catalog

View File

@@ -1,5 +0,0 @@
# /etc/dracut.conf.d/gentoo-systemd.conf
# Paths of systemd dirs on Gentoo
systemdutildir=/usr/lib/systemd
systemdsystemunitdir=/usr/lib/systemd/system

View File

@@ -1,15 +0,0 @@
# /etc/dracut.conf.d/gentoo.conf
# dracut config file customized for Gentoo Base System release 2
udevdir=/lib/udev
ro_mnt=yes
#
# Modules
#
# i18n
i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE"
i18n_default_font="LatArCyrHeb-16"
omit_drivers+=" i2o_scsi "

View File

@@ -3,22 +3,12 @@
# SUSE by default always builds as small as possible initrd for performance
# and resource reasons.
# If you like to build a generic initrd which works on other platforms than
# on the one dracut/mkinitrd got called comment out below setting(s).
# on the one dracut got called comment out below setting(s).
hostonly="yes"
hostonly_cmdline="yes"
compress="xz -0 --check=crc32 --memlimit-compress=50%"
compress="zstd -3 -T0 -q"
i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
omit_drivers+=" i2o_scsi "
# Below adds additional tools to the initrd which are not urgently necessary to
# bring up the system, but help to debug problems.
# See /usr/lib/dracut/modules.d/95debug/module-setup.sh which additional tools
# are installed and add more if you need them. This specifically helps if you
# use:
# rd.break=[cmdline|pre-udev|pre-trigger|initqueue|pre-mount|
# mount|pre-pivot|cleanup]
# boot parameter or if you are forced to enter the dracut emergency shell.
# add_dracutmodules+=debug

2064
dracut.sh

File diff suppressed because it is too large Load Diff

View File

@@ -1,480 +0,0 @@
%define dracutlibdir %{_prefix}/lib/dracut
%bcond_without doc
# We ship a .pc file but don't want to have a dep on pkg-config. We
# strip the automatically generated dep here and instead co-own the
# directory.
%global __requires_exclude pkg-config
%define dist_free_release xxx
Name: dracut
Version: xxx
Release: %{dist_free_release}%{?dist}
Summary: Initramfs generator using udev
%if 0%{?fedora} || 0%{?rhel}
Group: System Environment/Base
%endif
%if 0%{?suse_version}
Group: System/Base
%endif
# The entire source code is GPLv2+
# except install/* which is LGPLv2+
License: GPLv2+ and LGPLv2+
URL: https://dracut.wiki.kernel.org/
# Source can be generated by
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%%{version};sf=tgz
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
BuildRequires: bash
BuildRequires: git-core
BuildRequires: pkgconfig(libkmod) >= 23
BuildRequires: gcc
%if 0%{?fedora} || 0%{?rhel}
BuildRequires: pkgconfig
BuildRequires: systemd
%endif
%if 0%{?fedora}
BuildRequires: bash-completion
%endif
%if %{with doc}
%if 0%{?fedora} || 0%{?rhel}
BuildRequires: docbook-style-xsl docbook-dtds libxslt
%endif
%if 0%{?suse_version}
BuildRequires: docbook-xsl-stylesheets libxslt
%endif
BuildRequires: asciidoc
%endif
%if 0%{?suse_version} > 9999
Obsoletes: mkinitrd < 2.6.1
Provides: mkinitrd = 2.6.1
%endif
Obsoletes: dracut-fips <= 047
Provides: dracut-fips = %{version}-%{release}
Obsoletes: dracut-fips-aesni <= 047
Provides: dracut-fips-aesni = %{version}-%{release}
Requires: bash >= 4
Requires: coreutils
Requires: cpio
Requires: filesystem >= 2.1.0
Requires: findutils
Requires: grep
Requires: kmod
Requires: sed
Requires: xz
Requires: gzip
%if 0%{?fedora} || 0%{?rhel}
Recommends: memstrack
Recommends: hardlink
Recommends: pigz
Recommends: kpartx
Requires: util-linux >= 2.21
Requires: systemd >= 219
Requires: systemd-udev >= 219
Requires: procps-ng
%else
Requires: hardlink
Requires: gzip
Requires: kpartx
Requires: udev > 166
Requires: util-linux-ng >= 2.21
%endif
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
Requires: libkcapi-hmaccalc
%endif
%description
dracut contains tools to create bootable initramfses for the Linux
kernel. Unlike other implementations, dracut hard-codes as little
as possible into the initramfs. dracut contains various modules which
are driven by the event-based udev. Having root on MD, DM, LVM2, LUKS
is supported as well as NFS, iSCSI, NBD, FCoE with the dracut-network
package.
%package network
Summary: dracut modules to build a dracut initramfs with network support
%if 0%{?_module_build}
# In the module-build-service, we have pieces of dracut provided by different
# modules ("base-runtime" provides most functionality, but we need
# dracut-network in "installer". Since these two modules build with separate
# dist-tags, we need to reduce this strict requirement to ignore the dist-tag.
Requires: %{name} >= %{version}-%{dist_free_release}
%else
Requires: %{name} = %{version}-%{release}
%endif
Requires: iputils
Requires: iproute
Requires: (NetworkManager >= 1.20 or dhclient)
Suggests: NetworkManager
Obsoletes: dracut-generic < 008
Provides: dracut-generic = %{version}-%{release}
%description network
This package requires everything which is needed to build a generic
all purpose initramfs with network support with dracut.
%package caps
Summary: dracut modules to build a dracut initramfs which drops capabilities
Requires: %{name} = %{version}-%{release}
Requires: libcap
%description caps
This package requires everything which is needed to build an
initramfs with dracut, which drops capabilities.
%package live
Summary: dracut modules to build a dracut initramfs with live image capabilities
%if 0%{?_module_build}
# See the network subpackage comment.
Requires: %{name} >= %{version}-%{dist_free_release}
%else
Requires: %{name} = %{version}-%{release}
%endif
Requires: %{name}-network = %{version}-%{release}
Requires: tar gzip coreutils bash device-mapper curl
%if 0%{?fedora}
Requires: fuse ntfs-3g
%endif
%description live
This package requires everything which is needed to build an
initramfs with dracut, with live image capabilities, like Live CDs.
%package config-generic
Summary: dracut configuration to turn off hostonly image generation
Requires: %{name} = %{version}-%{release}
Obsoletes: dracut-nohostonly < 030
Provides: dracut-nohostonly = %{version}-%{release}
%description config-generic
This package provides the configuration to turn off the host specific initramfs
generation with dracut and generates a generic image by default.
%package config-rescue
Summary: dracut configuration to turn on rescue image generation
Requires: %{name} = %{version}-%{release}
Obsoletes: dracut < 030
%description config-rescue
This package provides the configuration to turn on the rescue initramfs
generation with dracut.
%package tools
Summary: dracut tools to build the local initramfs
Requires: %{name} = %{version}-%{release}
%description tools
This package contains tools to assemble the local initrd and host configuration.
%package squash
Summary: dracut module to build an initramfs with most files in a squashfs image
Requires: %{name} = %{version}-%{release}
Requires: squashfs-tools
%description squash
This package provides a dracut module to build an initramfs, but store most files
in a squashfs image, result in a smaller initramfs size and reduce runtime memory
usage.
%prep
%autosetup -n %{name}-%{version} -S git_am
cp %{SOURCE1} .
%build
%configure --systemdsystemunitdir=%{_unitdir} \
--bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) \
--libdir=%{_prefix}/lib \
%if %{without doc}
--disable-documentation \
%endif
${NULL}
%make_build
%install
%make_install %{?_smp_mflags} \
libdir=%{_prefix}/lib
echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh
%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips
%endif
# we do not support dash in the initramfs
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
# we do not support mksh in the initramfs
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00mksh
# remove gentoo specific modules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
%if %{defined _unitdir}
# with systemd IMA and selinux modules do not make sense
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity
%endif
%ifnarch s390 s390x
# remove architecture specific modules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/80cms
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/81cio_ignore
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/91zipl
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_mod
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_rules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dcssblk
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95qeth_rules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp_rules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95znet
%else
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00warpclock
%endif
mkdir -p $RPM_BUILD_ROOT/boot/dracut
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs
%if 0%{?fedora} || 0%{?rhel}
install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
%endif
%if 0%{?suse_version}
install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
%else
rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse*
%endif
%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} <= 9999
rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd
rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd
rm -f -- $RPM_BUILD_ROOT%{_mandir}/man8/mkinitrd.8*
rm -f -- $RPM_BUILD_ROOT%{_mandir}/man1/lsinitrd.1*
%endif
echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
%files
%if %{with doc}
%doc README.md HACKING.md AUTHORS NEWS.md dracut.html dracut.png dracut.svg
%endif
%{!?_licensedir:%global license %%doc}
%license COPYING lgpl-2.1.txt
%{_bindir}/dracut
%{_datadir}/bash-completion/completions/dracut
%{_datadir}/bash-completion/completions/lsinitrd
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999
%{_bindir}/mkinitrd
%{_bindir}/lsinitrd
%endif
%dir %{dracutlibdir}
%dir %{dracutlibdir}/modules.d
%{dracutlibdir}/dracut-functions.sh
%{dracutlibdir}/dracut-init.sh
%{dracutlibdir}/dracut-functions
%{dracutlibdir}/dracut-version.sh
%{dracutlibdir}/dracut-logger.sh
%{dracutlibdir}/dracut-initramfs-restore
%{dracutlibdir}/dracut-install
%{dracutlibdir}/skipcpio
%config(noreplace) %{_sysconfdir}/dracut.conf
%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel}
%{dracutlibdir}/dracut.conf.d/01-dist.conf
%endif
%dir %{_sysconfdir}/dracut.conf.d
%dir %{dracutlibdir}/dracut.conf.d
%dir %{_datadir}/pkgconfig
%{_datadir}/pkgconfig/dracut.pc
%if %{with doc}
%{_mandir}/man8/dracut.8*
%{_mandir}/man8/*service.8*
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999
%{_mandir}/man8/mkinitrd.8*
%{_mandir}/man1/lsinitrd.1*
%endif
%if 0%{?suse_version}
%{_mandir}/man8/mkinitrd-suse.8*
%endif
%{_mandir}/man7/dracut.kernel.7*
%{_mandir}/man7/dracut.cmdline.7*
%{_mandir}/man7/dracut.modules.7*
%{_mandir}/man7/dracut.bootup.7*
%{_mandir}/man5/dracut.conf.5*
%endif
%if %{undefined _unitdir}
%endif
%{dracutlibdir}/modules.d/00bash
%{dracutlibdir}/modules.d/00systemd
%ifnarch s390 s390x
%{dracutlibdir}/modules.d/00warpclock
%endif
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
%{dracutlibdir}/modules.d/01fips
%endif
%{dracutlibdir}/modules.d/01systemd-ask-password
%{dracutlibdir}/modules.d/01systemd-coredump
%{dracutlibdir}/modules.d/01systemd-initrd
%{dracutlibdir}/modules.d/01systemd-modules-load
%{dracutlibdir}/modules.d/01systemd-repart
%{dracutlibdir}/modules.d/01systemd-sysctl
%{dracutlibdir}/modules.d/01systemd-sysusers
%{dracutlibdir}/modules.d/03modsign
%{dracutlibdir}/modules.d/03rescue
%{dracutlibdir}/modules.d/04watchdog
%{dracutlibdir}/modules.d/04watchdog-modules
%{dracutlibdir}/modules.d/05busybox
%{dracutlibdir}/modules.d/06dbus-broker
%{dracutlibdir}/modules.d/06dbus-daemon
%{dracutlibdir}/modules.d/06rngd
%{dracutlibdir}/modules.d/09dbus
%{dracutlibdir}/modules.d/10i18n
%{dracutlibdir}/modules.d/30convertfs
%{dracutlibdir}/modules.d/45url-lib
%{dracutlibdir}/modules.d/50drm
%{dracutlibdir}/modules.d/50plymouth
%{dracutlibdir}/modules.d/80lvmmerge
%{dracutlibdir}/modules.d/90btrfs
%{dracutlibdir}/modules.d/90crypt
%{dracutlibdir}/modules.d/90dm
%{dracutlibdir}/modules.d/90dmraid
%{dracutlibdir}/modules.d/90kernel-modules
%{dracutlibdir}/modules.d/90kernel-modules-extra
%{dracutlibdir}/modules.d/90lvm
%{dracutlibdir}/modules.d/90mdraid
%{dracutlibdir}/modules.d/90multipath
%{dracutlibdir}/modules.d/90nvdimm
%{dracutlibdir}/modules.d/90ppcmac
%{dracutlibdir}/modules.d/90qemu
%{dracutlibdir}/modules.d/91crypt-gpg
%{dracutlibdir}/modules.d/91crypt-loop
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95fstab-sys
%{dracutlibdir}/modules.d/95lunmask
%{dracutlibdir}/modules.d/95nvmf
%{dracutlibdir}/modules.d/95resume
%{dracutlibdir}/modules.d/95rootfs-block
%{dracutlibdir}/modules.d/95terminfo
%{dracutlibdir}/modules.d/95udev-rules
%{dracutlibdir}/modules.d/95virtfs
%ifarch s390 s390x
%{dracutlibdir}/modules.d/80cms
%{dracutlibdir}/modules.d/81cio_ignore
%{dracutlibdir}/modules.d/91zipl
%{dracutlibdir}/modules.d/95dasd
%{dracutlibdir}/modules.d/95dasd_mod
%{dracutlibdir}/modules.d/95dasd_rules
%{dracutlibdir}/modules.d/95dcssblk
%{dracutlibdir}/modules.d/95qeth_rules
%{dracutlibdir}/modules.d/95zfcp
%{dracutlibdir}/modules.d/95zfcp_rules
%endif
%if %{undefined _unitdir}
%{dracutlibdir}/modules.d/96securityfs
%{dracutlibdir}/modules.d/97masterkey
%{dracutlibdir}/modules.d/98integrity
%endif
%{dracutlibdir}/modules.d/97biosdevname
%{dracutlibdir}/modules.d/98dracut-systemd
%{dracutlibdir}/modules.d/98ecryptfs
%{dracutlibdir}/modules.d/98pollcdrom
%{dracutlibdir}/modules.d/98selinux
%{dracutlibdir}/modules.d/98syslog
%{dracutlibdir}/modules.d/98usrmount
%{dracutlibdir}/modules.d/99base
%{dracutlibdir}/modules.d/99memstrack
%{dracutlibdir}/modules.d/99fs-lib
%{dracutlibdir}/modules.d/99shutdown
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
%dir %{_sharedstatedir}/initramfs
%if %{defined _unitdir}
%{_unitdir}/dracut-shutdown.service
%{_unitdir}/sysinit.target.wants/dracut-shutdown.service
%{_unitdir}/dracut-cmdline.service
%{_unitdir}/dracut-initqueue.service
%{_unitdir}/dracut-mount.service
%{_unitdir}/dracut-pre-mount.service
%{_unitdir}/dracut-pre-pivot.service
%{_unitdir}/dracut-pre-trigger.service
%{_unitdir}/dracut-pre-udev.service
%{_unitdir}/initrd.target.wants/dracut-cmdline.service
%{_unitdir}/initrd.target.wants/dracut-initqueue.service
%{_unitdir}/initrd.target.wants/dracut-mount.service
%{_unitdir}/initrd.target.wants/dracut-pre-mount.service
%{_unitdir}/initrd.target.wants/dracut-pre-pivot.service
%{_unitdir}/initrd.target.wants/dracut-pre-trigger.service
%{_unitdir}/initrd.target.wants/dracut-pre-udev.service
%endif
%{_prefix}/lib/kernel/install.d/50-dracut.install
%files network
%{dracutlibdir}/modules.d/02systemd-networkd
%{dracutlibdir}/modules.d/35network-manager
%{dracutlibdir}/modules.d/35network-legacy
%{dracutlibdir}/modules.d/35network-wicked
%{dracutlibdir}/modules.d/40network
%{dracutlibdir}/modules.d/45ifcfg
%{dracutlibdir}/modules.d/90kernel-network-modules
%{dracutlibdir}/modules.d/90qemu-net
%{dracutlibdir}/modules.d/95cifs
%{dracutlibdir}/modules.d/95fcoe
%{dracutlibdir}/modules.d/95fcoe-uefi
%{dracutlibdir}/modules.d/95iscsi
%{dracutlibdir}/modules.d/95nbd
%{dracutlibdir}/modules.d/95nfs
%{dracutlibdir}/modules.d/95ssh-client
%ifarch s390 s390x
%{dracutlibdir}/modules.d/95znet
%endif
%{dracutlibdir}/modules.d/99uefi-lib
%files caps
%{dracutlibdir}/modules.d/02caps
%files live
%{dracutlibdir}/modules.d/99img-lib
%{dracutlibdir}/modules.d/90dmsquash-live
%{dracutlibdir}/modules.d/90dmsquash-live-ntfs
%{dracutlibdir}/modules.d/90livenet
%files tools
%if %{with doc}
%doc %{_mandir}/man8/dracut-catimages.8*
%endif
%{_bindir}/dracut-catimages
%dir /boot/dracut
%dir /var/lib/dracut
%dir /var/lib/dracut/overlay
%files squash
%{dracutlibdir}/modules.d/99squash
%files config-generic
%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
%files config-rescue
%{dracutlibdir}/dracut.conf.d/02-rescue.conf
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
%changelog

View File

@@ -1,116 +0,0 @@
DRACUT_PN ??= "${PN}"
def dracut_compression_type(d):
rdtype = d.getVar("INITRAMFS_FSTYPES", True).split('.')
if len(rdtype) != 2:
return ['','','']
if rdtype[0] != 'cpio':
return ['','','']
cmptypes = [['gz','--gzip','gzip'],['bz2', '--bzip2','bzip2'],['lzma','--lzma','xz'],['xz','--xz','xz'],['lzo','--lzo','lzo'],['lz4','--lz4','lz4'],['zstd','--zstd','zstd']]
for cmp in cmptypes:
if rdtype[1] == cmp[0]:
return cmp
return ['','','']
def dracut_compression_opt(d):
cmp = dracut_compression_type(d)
return cmp[1]
def dracut_compression_pkg(d):
cmp = dracut_compression_type(d)
return cmp[2]
def dracut_compression_pkg_native(d):
cmp = dracut_compression_type(d)
if cmp[2] == '':
return ''
return cmp[2] + '-native'
DRACUT_COMPRESS_OPT ??= "${@dracut_compression_opt(d)}"
DRACUT_COMPRESS_PKG ??= "${@dracut_compression_pkg(d)}"
DRACUT_COMPRESS_PKG_NATIVE ??= "${@dracut_compression_pkg_native(d)}"
DRACUT_OPTS ??= "--early-microcode ${DRACUT_COMPRESS_OPT}"
python __anonymous () {
pkg = d.getVar("DRACUT_PN", True)
if pkg != 'dracut':
d.appendVar("RDEPENDS_%s" % pkg, " dracut %s " % d.getVar("DRACUT_COMPRESS_PKG", True))
if not pkg.startswith('kernel'):
d.appendVarFlag("do_configure", "depends", "virtual/kernel:do_shared_workdir")
d.appendVarFlag("do_compile", "depends", "virtual/kernel:do_compile_kernelmodules")
}
export BUILD_TIME_KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}"
dracut_postinst () {
MY_KERNEL_VERSION=$(readlink $D/boot/bzimage | sed 's,^.*bzImage-,,')
if [[ -z "$MY_KERNEL_VERSION" ]]; then
MY_KERNEL_VERSION="${KERNEL_VERSION}"
fi
if [[ -z "$MY_KERNEL_VERSION" ]]; then
MY_KERNEL_VERSION="${BUILD_TIME_KERNEL_VERSION}"
fi
if [[ -z "$MY_KERNEL_VERSION" ]]; then
exit 1
fi
if [ -n "$D" ]; then
#DEBUGOPTS="--debug --keep"
DEBUGOPTS="--keep"
$INTERCEPT_DIR/postinst_intercept execute_dracut ${PKG} mlprefix=${MLPREFIX} \
prefix= \
MY_KERNEL_VERSION=$MY_KERNEL_VERSION \
DEBUGOPTS="\"$DEBUGOPTS\"" \
DRACUT_OPTS="\"${DRACUT_OPTS}\"" \
systemdutildir=${systemd_unitdir} \
systemdsystemunitdir=${systemd_system_unitdir} \
systemdsystemconfdir=${sysconfdir}/systemd/system \
udevdir=${libdir}/udev \
DRACUT_TMPDIR=${WORKDIR}/dracut-tmpdir \
DRACUT_ARCH="${TUNE_ARCH}" \
DRACUT_COMPRESS_GZIP=$NATIVE_ROOT${bindir}/gzip \
DRACUT_COMPRESS_BZIP2=$NATIVE_ROOT${bindir}/bzip2 \
DRACUT_COMPRESS_LZMA=$NATIVE_ROOT${bindir}/lzma \
DRACUT_LDD="\"PATH='$PATH' ${STAGING_BINDIR_CROSS}/ldd --root $D\"" \
DRACUT_LDCONFIG=$NATIVE_ROOT${bindir}/ldconfig \
DRACUT_INSTALL="\"$NATIVE_ROOT${libdir}/dracut/dracut-install\"" \
PLYMOUTH_LDD="\"${STAGING_BINDIR_CROSS}/ldd --root $D\"" \
PLYMOUTH_LDD_PATH="'$PATH'" \
PLYMOUTH_PLUGIN_PATH=${libdir}/plymouth \
PLYMOUTH_THEME_NAME=${PLYMOUTH_THEME_NAME:-spinner} \
PLYMOUTH_THEME=${PLYMOUTH_THEME_NAME:-spinner}
else
depmod -a $MY_KERNEL_VERSION
echo RUNNING: dracut -f ${DRACUT_OPTS} /boot/initramfs.img $MY_KERNEL_VERSION
echo "dracut: $(dracut --help | grep 'Version:')"
dracut -f ${DRACUT_OPTS} /boot/initramfs.img $MY_KERNEL_VERSION
fi
}
dracut_populate_packages[vardeps] += "dracut_postinst"
python dracut_populate_packages() {
localdata = d.createCopy()
pkg = d.getVar('DRACUT_PN', True)
postinst = d.getVar('pkg_postinst_%s' % pkg, True)
if not postinst:
postinst = '#!/bin/sh\n'
postinst += localdata.getVar('dracut_postinst', True)
d.setVar('pkg_postinst_%s' % pkg, postinst)
}
PACKAGESPLITFUNCS_prepend = "dracut_populate_packages "
DRACUT_DEPENDS = " \
binutils-cross-${TUNE_ARCH} gcc-cross-${TUNE_ARCH} \
ldconfig-native coreutils-native findutils-native \
cpio-native util-linux-native kmod-native ${DRACUT_COMPRESS_PKG_NATIVE} \
dracut-native pkgconfig-native cross-compiler-ldd \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
"
DEPENDS_append_class-target = " ${DRACUT_DEPENDS}"
PACKAGE_WRITE_DEPS_append = " ${DRACUT_DEPENDS}"

View File

@@ -1,44 +0,0 @@
#!/bin/sh
set -e
if [[ -z "$DRACUT_TMPDIR" ]]; then
echo "DRACUT_TMPDIR is unset, exiting"
exit 0
fi
# We have to unset "prefix" as dracut uses it to move files around.
# Yocto has it set as part of the build environment.
export prefix=
# DRACUT settings
export UDEVVERSION=241
export SYSTEMD_VERSION=241
export DRACUT_TESTBIN=/bin/bash.bash
export DRACUT_INSTALL_PATH="/usr/sbin:/usr/bin:/sbin:/bin"
# PLYMOUTH settings
export PLYMOUTH_SYSROOT=$D
export \
systemdutildir systemdsystemunitdir systemdsystemconfdir udevdir \
DRACUT_ARCH DRACUT_TESTBIN DRACUT_LDD DRACUT_LDCONFIG DRACUT_INSTALL \
DRACUT_COMPRESS_GZIP DRACUT_COMPRESS_BZIP2 DRACUT_COMPRESS_LZMA \
PLYMOUTH_LDD PLYMOUTH_LDD_PATH PLYMOUTH_PLUGIN_PATH \
PLYMOUTH_THEME_NAME PLYMOUTH_THEME
# List environment for debugging
echo ROOTFS-POSTINST-ENVIRONMENT
echo -----------
env
echo -----------
[[ -d $DRACUT_TMPDIR ]] || mkdir -p $DRACUT_TMPDIR
# Execute depmod and dracut
echo "$(date) - RUNNING: depmod -b $D -a $MY_KERNEL_VERSION"
depmod -b $D -a $MY_KERNEL_VERSION
echo "dracut: $(dracut --sysroot $D --help | grep 'Version:')"
echo "$(date) - RUNNING: dracut -f --sysroot $D --tmpdir $DRACUT_TMPDIR $DRACUT_OPTS $DEBUGOPTS -k $D/lib/modules/$MY_KERNEL_VERSION $D/boot/initramfs.img $MY_KERNEL_VERSION"
dracut -f --sysroot $D --tmpdir $DRACUT_TMPDIR $DRACUT_OPTS $DEBUGOPTS -k $D/lib/modules/$MY_KERNEL_VERSION $D/boot/initramfs.img $MY_KERNEL_VERSION
echo "$(date) - DONE: dracut"

View File

@@ -1,19 +0,0 @@
diff --git a/cross-compile-ldd b/cross-compile-ldd
index ef2ca20..332d57f 100644
--- a/cross-compile-ldd
+++ b/cross-compile-ldd
@@ -337,13 +337,13 @@ do_scan_etc_ldsoconf() {
# Build up the full list of search directories
declare -a needed_search_path
do_trace "Adding basic lib dirs\n"
-ld_library_path="${ld_library_path}:"
while [ -n "${ld_library_path}" ]; do
d="${ld_library_path%%:*}"
if [ -n "${d}" ]; then
do_trace "-> adding search dir '%s'\n" "${d}"
needed_search_path+=( "${d}" )
fi
+ [[ "$ld_library_path" == "${ld_library_path#*:}" ]] && break
ld_library_path="${ld_library_path#*:}"
done
do_trace "Done adding basic lib dirs\n"

View File

@@ -1,33 +0,0 @@
SUMMARY = "Cross-compiler LDD"
HOMEPAGE = "https://gist.github.com/c403786c1394f53f44a3b61214489e6f"
BUGTRACKER = ""
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://cross-compile-ldd;beginline=53;endline=57;md5=2b29d19d18a430b931dda3750e865c84"
SRCBRANCH = "master"
SRCREV = "eb44581caf7dd60b149a6691abef46264c46e866"
SRC_URI = " \
git://gist.github.com/c403786c1394f53f44a3b61214489e6f.git;protocol=https;branch=${SRCBRANCH} \
file://cross-compile-ldd-fix-infinite-loop.patch \
"
S = "${WORKDIR}/git"
inherit siteinfo
SYSROOT_PREPROCESS_FUNCS += " cross_ldd_populate_sysroot "
cross_ldd_populate_sysroot() {
mkdir -p ${SYSROOT_DESTDIR}${bindir_crossscripts}
cat ${S}/cross-compile-ldd | \
sed \
-e "s,^prefix=.*$,prefix=${TARGET_SYS}," \
-e "s,^bits=.*$,bits=${SITEINFO_BITS}," \
-e "s,^ld_library_path=.*$,ld_library_path=${LD_LIBRARY_PATH:-/lib:/usr/lib}," \
>${SYSROOT_DESTDIR}${bindir_crossscripts}/ldd
chmod +x ${SYSROOT_DESTDIR}${bindir_crossscripts}/ldd
}
DEPENDS = "coreutils-native sed-native binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH}"
PACKAGE_WRITE_DEPS = "coreutils-native sed-native binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH}"

View File

@@ -1,30 +0,0 @@
#!/bin/bash
set -ex
[[ -d ${0%/*} ]] && cd ${0%/*}
RUN_ID="$1"
TESTS=$2
./configure
NCPU=$(getconf _NPROCESSORS_ONLN)
if ! [[ $TESTS ]]; then
make -j$NCPU all syncheck rpm logtee
else
[[ $TESTS == "99" ]] && make_docs=yes || make_docs=no
make -j$NCPU enable_documentation=$make_docs all logtee
cd test
time sudo LOGTEE_TIMEOUT_MS=300000 make \
enable_documentation=$make_docs \
KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \
DRACUT_NO_XATTR=1 \
TEST_RUN_ID=$RUN_ID \
${TESTS:+TESTS="$TESTS"} \
-k V=2 \
check
fi

View File

@@ -1,64 +0,0 @@
#!/usr/bin/perl
sub create_patches {
my $tag=shift;
my $pdir=shift;
my $n=1;
my @lines;
my $fname;
my $f=0;
mkdir $pdir, 0755;
open( GIT, 'git log -p --pretty=email --stat -m --first-parent --reverse --binary '.$tag.'..HEAD |');
while (<GIT>) {
if (/^From [a-z0-9]{40} .*$/) {
$fname = sprintf("%04d", $n++).".patch";
open FH, ">".$pdir."/".$fname;
$f=1;
}
if (/^---$/ && $f == 1) {
push @lines, $fname;
$f=0;
}
print FH;
}
return @lines;
};
use POSIX qw(strftime);
my $datestr = strftime "%Y%m%d", gmtime;
my $tag=shift;
my $pdir=shift;
$tag=`git describe --abbrev=0 --tags` if not defined $tag;
chomp($tag);
my @patches=&create_patches($tag, $pdir);
my $num=$#patches + 2;
$tag=~s/[^0-9]+?([0-9]+)/$1/ if $tag !~ /\b[0-9a-f]{5,40}\b/;
my $release="$num.git$datestr";
$release="1" if $num == 1;
while(<>) {
if (/^Version:/) {
print "Version: $tag\n";
}
elsif (/^%define dist_free_release/) {
print "%define dist_free_release $release\n";
}
elsif ((/^Source0:/) || (/^Source:/)) {
print $_;
$num=1;
for(@patches) {
s/.*\///g;
print "Patch$num: $_\n";
$num++;
}
print "\n";
}
else {
print $_;
}
}

99
install.d/50-dracut.install Executable file
View File

@@ -0,0 +1,99 @@
#!/bin/bash
COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"
# If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory.
# So, let's skip to create initrd.
if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
exit 0
fi
# Mismatching the install layout and the --uefi/--no-uefi opts just creates a mess.
if [[ $KERNEL_INSTALL_LAYOUT == "uki" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
IMAGE="uki.efi"
UEFI_OPTS="--uefi"
elif [[ $KERNEL_INSTALL_LAYOUT == "bls" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
IMAGE="initrd"
UEFI_OPTS="--no-uefi"
else
# No layout information, use users --uefi/--no-uefi preference
UEFI_OPTS=""
if [[ -d $BOOT_DIR_ABS ]]; then
IMAGE="initrd"
else
BOOT_DIR_ABS="/boot"
IMAGE="initramfs-${KERNEL_VERSION}.img"
fi
fi
ret=0
case "$COMMAND" in
add)
if [[ $IMAGE == "uki.efi" ]]; then
IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/uki.efi
else
IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd
fi
if [[ -f ${IMAGE_PREGENERATED} ]]; then
# we found an initrd or uki.efi at the same place as the kernel
# use this and don't generate a new one
[[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo \
"There is an ${IMAGE} image at the same place as the kernel, skipping generating a new one"
cp --reflink=auto "$IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$IMAGE" \
&& chown root:root "$BOOT_DIR_ABS/$IMAGE" \
&& chmod 0600 "$BOOT_DIR_ABS/$IMAGE" \
&& exit 0
fi
if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then
if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then
read -r -d '' -a BOOT_OPTIONS < "$KERNEL_INSTALL_CONF_ROOT/cmdline"
fi
elif [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
else
declare -a BOOT_OPTIONS
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ ${i#initrd=*} != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi
unset noimageifnotneeded
for ((i = 0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
# shellcheck disable=SC1001
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
noimageifnotneeded="yes"
break
fi
done
# shellcheck disable=SC2046
dracut -f \
${noimageifnotneeded:+--noimageifnotneeded} \
$([[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo --verbose) \
$([[ -n $KERNEL_IMAGE ]] && echo --kernel-image "$KERNEL_IMAGE") \
"$UEFI_OPTS" \
--kver "$KERNEL_VERSION" \
"$BOOT_DIR_ABS/$IMAGE"
ret=$?
;;
remove)
rm -f -- "$BOOT_DIR_ABS/$IMAGE"
ret=$?
;;
esac
exit $ret

View File

@@ -7,13 +7,12 @@ KERNEL_VERSION="$2"
BOOT_DIR_ABS="${3%/*}/0-rescue"
KERNEL_IMAGE="$4"
dropindirs_sort()
{
suffix=$1; shift
dropindirs_sort() {
suffix=$1
shift
args=("$@")
files=$(
while (( $# > 0 )); do
while (($# > 0)); do
for i in "${1}"/*"${suffix}"; do
[[ -f $i ]] && echo "${i##*/}"
done
@@ -31,11 +30,17 @@ dropindirs_sort()
done
}
[[ -f /etc/os-release ]] && . /etc/os-release
if [[ -f /etc/os-release ]]; then
. /etc/os-release
elif [[ -f /usr/lib/os-release ]]; then
. /usr/lib/os-release
fi
[[ -n $PRETTY_NAME ]] || PRETTY_NAME="Linux $KERNEL_VERSION"
if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
elif [[ -f /etc/machine-id ]] ; then
elif [[ -f /etc/machine-id ]]; then
read -r MACHINE_ID < /etc/machine-id
fi
@@ -43,7 +48,11 @@ if ! [[ $MACHINE_ID ]]; then
exit 0
fi
if [[ -f /etc/kernel/cmdline ]]; then
if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then
if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then
read -r -d '' -a BOOT_OPTIONS < "$KERNEL_INSTALL_CONF_ROOT/cmdline"
fi
elif [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
@@ -52,14 +61,14 @@ else
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" ]] && continue
[[ ${i#initrd=*} != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi
if [[ -d "${BOOT_DIR_ABS%/*}" ]]; then
if [[ -d ${BOOT_DIR_ABS%/*} ]]; then
BOOT_DIR="/${MACHINE_ID}/0-rescue"
BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR}
BOOT_ROOT=${BOOT_DIR_ABS%"$BOOT_DIR"}
LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf"
KERNEL="linux"
INITRD="initrd"
@@ -75,8 +84,12 @@ ret=0
case "$COMMAND" in
add)
[[ -f "$LOADER_ENTRY" ]] && [[ -f "$BOOT_DIR_ABS/$KERNEL" ]] \
&& [[ -f "$BOOT_DIR_ABS/$INITRD" ]] && exit 0
if [[ -f $LOADER_ENTRY ]] && [[ -f "$BOOT_DIR_ABS/$KERNEL" ]] \
&& [[ -f "$BOOT_DIR_ABS/$INITRD" ]]; then
[[ $KERNEL_INSTALL_VERBOSE == 1 ]] \
&& echo "Skipping, there is already a rescue image generated with the same input parameters"
exit 0
fi
# source our config dir
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
@@ -87,20 +100,30 @@ case "$COMMAND" in
done
# shellcheck disable=SC2154
[[ $dracut_rescue_image != "yes" ]] && exit 0
if [[ $dracut_rescue_image != "yes" ]]; then
[[ $KERNEL_INSTALL_VERBOSE == 1 ]] \
&& echo "Skipping, 'dracut_rescue_image' not set to 'yes' in any dracut configuration file"
exit 0
fi
[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
[[ -d $BOOT_DIR_ABS ]] || mkdir -p "$BOOT_DIR_ABS"
if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS/$KERNEL"; then
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/$KERNEL'!" >&2
fi
if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then
dracut -f --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
((ret+=$?))
# shellcheck disable=SC2046
dracut -f --no-hostonly --no-uefi \
-a "rescue" \
$([[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo --verbose) \
--kver "$KERNEL_VERSION" \
"$BOOT_DIR_ABS/$INITRD"
((ret += $?))
fi
if [[ "${BOOT_DIR_ABS}" != "/boot" ]]; then
[[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo "Creating $LOADER_ENTRY"
if [[ ${BOOT_DIR_ABS} != "/boot" ]]; then
{
echo "title $PRETTY_NAME - Rescue Image"
echo "version $KERNEL_VERSION"
@@ -118,16 +141,13 @@ case "$COMMAND" in
sed -i "s/${KERNEL_VERSION}/0-rescue-${MACHINE_ID}/" "$LOADER_ENTRY"
fi
((ret+=$?))
((ret += $?))
;;
remove)
exit 0
;;
*)
usage
ret=1;;
esac
exit $ret

View File

@@ -1 +0,0 @@
kate: space-indent on; tab-width 8; indent-width 8; replace-tabs on; eol unix;

View File

@@ -1,12 +0,0 @@
# src/shared/hashmap.lo - a libtool object file
# Generated by libtool (GNU libtool) 2.4.2
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# Name of the PIC object.
pic_object='.libs/hashmap.o'
# Name of the non-PIC object
non_pic_object='hashmap.o'

View File

@@ -1,73 +0,0 @@
#define _GNU_SOURCE
#include <fcntl.h>
#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#define BUFLEN 4096
int
main(int argc, char *argv[])
{
int fd;
int len, slen;
int ret;
int timeout;
char *timeout_env;
struct pollfd fds[] = {{
.fd = STDIN_FILENO,
.events = POLLIN | POLLERR,
}};
timeout_env = getenv("LOGTEE_TIMEOUT_MS");
if (timeout_env)
timeout = atoi(timeout_env);
else
timeout = -1;
if (argc != 2) {
fprintf(stderr, "Usage: %s <file>\n", argv[0]);
exit(EXIT_FAILURE);
}
fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, 0644);
if (fd == -1) {
perror("open");
exit(EXIT_FAILURE);
}
fprintf(stderr, "Logging to %s: ", argv[1]);
slen = 0;
do {
ret = poll (fds, sizeof(fds) / sizeof(fds[0]), timeout);
if (ret == 0) {
fprintf (stderr, "Timed out after %d milliseconds of no output.\n", timeout);
exit(EXIT_FAILURE);
}
len = splice(STDIN_FILENO, NULL, fd, NULL,
BUFLEN, SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
if (len < 0) {
if (errno == EAGAIN)
continue;
perror("tee");
exit(EXIT_FAILURE);
} else
if (len == 0)
break;
slen += len;
if ((slen/BUFLEN) > 0) {
fprintf(stderr, ".");
}
slen = slen % BUFLEN;
} while (1);
close(fd);
fprintf(stderr, "\n");
exit(EXIT_SUCCESS);
}

View File

@@ -1,68 +0,0 @@
#!/bin/bash
# Copyright 2013 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__contains_word () {
local word="$1"; shift
for w in "$@"; do [[ $w = "$word" ]] && return 0; done
return 1
}
_lsinitrd() {
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
[STANDALONE]='-s --size -h --help'
[ARG]='-f --file -k --kver'
)
# shellcheck disable=SC2086
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--file|-f)
comps=$(compgen -f -- "$cur")
compopt -o filenames
;;
--kver|-k)
comps=$(cd /lib/modules || return 1; echo [0-9]*)
;;
*)
return 0
;;
esac
# shellcheck disable=SC2207
# shellcheck disable=SC2016
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
fi
if [[ $cur = -* ]]; then
# shellcheck disable=SC2207
# shellcheck disable=SC2016
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
fi
# shellcheck disable=SC2034
comps=$(compgen -f -- "$cur")
compopt -o filenames
# shellcheck disable=SC2207
# shellcheck disable=SC2016
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
}
complete -F _lsinitrd lsinitrd

View File

@@ -17,8 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
usage()
{
usage() {
{
echo "Usage: ${0##*/} [options] [<initramfs file> [<filename> [<filename> [...] ]]]"
echo "Usage: ${0##*/} [options] -k <kernel version>"
@@ -38,7 +37,6 @@ usage()
} >&2
}
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
sorted=0
@@ -59,7 +57,8 @@ TEMP=$(getopt \
--long verbose \
-- "$@")
if (( $? != 0 )); then
# shellcheck disable=SC2181
if (($? != 0)); then
usage
exit 1
fi
@@ -68,16 +67,31 @@ eval set -- "$TEMP"
while (($# > 0)); do
case $1 in
-k|--kver) KERNEL_VERSION="$2"; shift;;
-f|--file) filenames[${2#/}]=1; shift;;
-s|--size) sorted=1;;
-h|--help) usage; exit 0;;
-m|--mod) modules=1;;
-v|--verbose) verbose="--verbose";;
--unpack) unpack=1;;
--unpackearly) unpackearly=1;;
--) shift;break;;
*) usage; exit 1;;
-k | --kver)
KERNEL_VERSION="$2"
shift
;;
-f | --file)
filenames[${2#/}]=1
shift
;;
-s | --size) sorted=1 ;;
-h | --help)
usage
exit 0
;;
-m | --mod) modules=1 ;;
-v | --verbose) verbose="--verbose" ;;
--unpack) unpack=1 ;;
--unpackearly) unpackearly=1 ;;
--)
shift
break
;;
*)
usage
exit 1
;;
esac
shift
done
@@ -86,7 +100,7 @@ done
if [[ $1 ]]; then
image="$1"
if ! [[ -f "$image" ]]; then
if ! [[ -f $image ]]; then
{
echo "$image does not exist"
echo
@@ -95,28 +109,51 @@ if [[ $1 ]]; then
exit 1
fi
else
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
if [[ -d /efi/Default ]] || [[ -d /boot/Default ]] || [[ -d /boot/efi/Default ]]; then
MACHINE_ID="Default"
elif [[ -s /etc/machine-id ]]; then
read -r MACHINE_ID < /etc/machine-id
[[ $MACHINE_ID == "uninitialized" ]] && MACHINE_ID="Default"
else
MACHINE_ID="Default"
fi
if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /efi/${MACHINE_ID} || -L /efi/${MACHINE_ID} ]] ; then
&& [[ -d /efi/${MACHINE_ID} || -L /efi/${MACHINE_ID} ]]; then
image="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
&& [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]]; then
image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
else
elif [[ -d /boot/efi/loader/entries || -L /boot/efi/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /boot/efi/${MACHINE_ID} || -L /boot/efi/${MACHINE_ID} ]]; then
image="/boot/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -f /lib/modules/${KERNEL_VERSION}/initrd ]]; then
image="/lib/modules/${KERNEL_VERSION}/initrd"
elif [[ -f /lib/modules/${KERNEL_VERSION}/initramfs.img ]]; then
image="/lib/modules/${KERNEL_VERSION}/initramfs.img"
elif [[ -f /boot/initramfs-${KERNEL_VERSION}.img ]]; then
image="/boot/initramfs-${KERNEL_VERSION}.img"
elif [[ $MACHINE_ID ]] \
&& mountpoint -q /efi; then
image="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ $MACHINE_ID ]] \
&& mountpoint -q /boot/efi; then
image="/boot/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
else
image=""
fi
fi
shift
while (($# > 0)); do
filenames[${1#/}]=1;
filenames[${1#/}]=1
shift
done
if ! [[ -f "$image" ]]; then
if ! [[ -f $image ]]; then
{
echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"
echo
@@ -126,6 +163,7 @@ if ! [[ -f "$image" ]]; then
fi
TMPDIR="$(mktemp -d -t lsinitrd.XXXXXX)"
# shellcheck disable=SC2064
trap "rm -rf '$TMPDIR'" EXIT
dracutlibdirs() {
@@ -134,46 +172,45 @@ dracutlibdirs() {
done
}
extract_files()
{
(( ${#filenames[@]} == 1 )) && nofileinfo=1
extract_files() {
((${#filenames[@]} == 1)) && nofileinfo=1
for f in "${!filenames[@]}"; do
[[ $nofileinfo ]] || echo "initramfs:/$f"
[[ $nofileinfo ]] || echo "========================================================================"
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout "$f" 2>/dev/null
((ret+=$?))
# shellcheck disable=SC2001
[[ $f == *"\\x"* ]] && f=$(echo "$f" | sed 's/\\x.\{2\}/????/g')
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout "$f" 2> /dev/null
((ret += $?))
[[ $nofileinfo ]] || echo "========================================================================"
[[ $nofileinfo ]] || echo
done
}
list_modules()
{
list_modules() {
echo "dracut modules:"
# shellcheck disable=SC2046
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs modules.txt) 2>/dev/null
((ret+=$?))
$(dracutlibdirs modules.txt) 2> /dev/null
((ret += $?))
}
list_files()
{
list_files() {
echo "========================================================================"
if [ "$sorted" -eq 1 ]; then
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --list | sort -n -k5
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --list | sort -n -k5
else
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --list | sort -k9
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --list | sort -k9
fi
((ret+=$?))
((ret += $?))
echo "========================================================================"
}
list_squash_content()
{
SQUASH_IMG="squash/root.img"
list_squash_content() {
SQUASH_IMG="squash-root.img"
SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh"
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- \
$SQUASH_IMG > "$SQUASH_TMPFILE" 2>/dev/null
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout -- \
$SQUASH_IMG > "$SQUASH_TMPFILE" 2> /dev/null
if [[ -s $SQUASH_TMPFILE ]]; then
echo "Squashed content ($SQUASH_IMG):"
echo "========================================================================"
@@ -182,22 +219,26 @@ list_squash_content()
fi
}
unpack_files()
{
if (( ${#filenames[@]} > 0 )); then
unpack_files() {
if ((${#filenames[@]} > 0)); then
for f in "${!filenames[@]}"; do
$CAT "$image" 2>/dev/null | cpio -id --quiet $verbose $f
((ret+=$?))
# shellcheck disable=SC2001
[[ $f == *"\\x"* ]] && f=$(echo "$f" | sed 's/\\x.\{2\}/????/g')
$CAT "$image" 2> /dev/null | cpio -id --quiet $verbose "$f"
((ret += $?))
done
else
$CAT "$image" 2>/dev/null | cpio -id --quiet $verbose
((ret+=$?))
$CAT "$image" 2> /dev/null | cpio -id --quiet $verbose
((ret += $?))
fi
}
read -N 2 bin < "$image"
read -r -N 2 bin < "$image"
if [ "$bin" = "MZ" ]; then
command -v objcopy > /dev/null || { echo "Need 'objcopy' to unpack an UEFI executable."; exit 1; }
command -v objcopy > /dev/null || {
echo "Need 'objcopy' to unpack an UEFI executable."
exit 1
}
objcopy \
--dump-section .linux="$TMPDIR/vmlinuz" \
--dump-section .initrd="$TMPDIR/initrd.img" \
@@ -209,10 +250,10 @@ if [ "$bin" = "MZ" ]; then
[ -f "$image" ] || exit 1
fi
if (( ${#filenames[@]} <= 0 )) && [[ -z "$unpack" ]] && [[ -z "$unpackearly" ]]; then
if ((${#filenames[@]} <= 0)) && [[ -z $unpack ]] && [[ -z $unpackearly ]]; then
if [ -n "$uefi" ]; then
echo -n "initrd in UEFI: $uefi: "
du -h $image | while read a b || [ -n "$a" ]; do echo $a;done
du -h "$image" | while read -r a _ || [ -n "$a" ]; do echo "$a"; done
if [ -f "$TMPDIR/osrel.txt" ]; then
name=$(sed -En '/^PRETTY_NAME/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
id=$(sed -En '/^ID/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
@@ -229,33 +270,33 @@ if (( ${#filenames[@]} <= 0 )) && [[ -z "$unpack" ]] && [[ -z "$unpackearly" ]];
fi
else
echo -n "Image: $image: "
du -h $image | while read a b || [ -n "$a" ]; do echo $a;done
du -h "$image" | while read -r a _ || [ -n "$a" ]; do echo "$a"; done
fi
echo "========================================================================"
fi
read -N 6 bin < "$image"
read -r -N 6 bin < "$image"
case $bin in
$'\x71\xc7'*|070701)
$'\x71\xc7'* | 070701)
CAT="cat --"
is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2>/dev/null)
is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2> /dev/null)
# Debian mkinitramfs does not create the file 'early_cpio', so let's check if firmware files exist
[[ "$is_early" ]] || is_early=$(cpio --list --verbose --quiet --to-stdout -- 'kernel/*/microcode/*.bin' < "$image" 2>/dev/null)
[[ "$is_early" ]] || is_early=$(cpio --list --verbose --quiet --to-stdout -- 'kernel/*/microcode/*.bin' < "$image" 2> /dev/null)
if [[ "$is_early" ]]; then
if [[ -n "$unpack" ]]; then
if [[ -n $unpack ]]; then
# should use --unpackearly for early CPIO
:
elif [[ -n "$unpackearly" ]]; then
elif [[ -n $unpackearly ]]; then
unpack_files
elif (( ${#filenames[@]} > 0 )); then
elif ((${#filenames[@]} > 0)); then
extract_files
else
echo "Early CPIO image"
list_files
fi
if [[ -d "$dracutbasedir/skipcpio" ]]; then
SKIP="$dracutbasedir/skipcpio/skipcpio"
if [[ -d "$dracutbasedir/src/skipcpio" ]]; then
SKIP="$dracutbasedir/src/skipcpio/skipcpio"
else
SKIP="$dracutbasedir/skipcpio"
fi
@@ -269,10 +310,10 @@ case $bin in
;;
esac
if [[ $SKIP ]] ; then
bin="$($SKIP "$image" | { read -N 6 bin && echo "$bin" ; })"
if [[ $SKIP ]]; then
bin="$($SKIP "$image" | { read -r -N 6 bin && echo "$bin"; })"
else
read -N 6 bin < "$image"
read -r -N 6 bin < "$image"
fi
case $bin in
$'\x1f\x8b'*)
@@ -281,7 +322,7 @@ case $bin in
BZh*)
CAT="bzcat --"
;;
$'\x71\xc7'*|070701)
$'\x71\xc7'* | 070701)
CAT="cat --"
;;
$'\x02\x21'*)
@@ -294,7 +335,7 @@ case $bin in
CAT="zstd -d -c"
;;
*)
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
if echo "test" | xz | xzcat --single-stream > /dev/null 2>&1; then
CAT="xzcat --single-stream --"
else
CAT="xzcat --"
@@ -302,8 +343,12 @@ case $bin in
;;
esac
skipcpio()
{
type "${CAT%% *}" > /dev/null 2>&1 || {
echo "Need '${CAT%% *}' to unpack the initramfs."
exit 1
}
skipcpio() {
$SKIP "$@" | $ORIG_CAT
}
@@ -312,26 +357,26 @@ if [[ $SKIP ]]; then
CAT=skipcpio
fi
if (( ${#filenames[@]} > 1 )); then
if ((${#filenames[@]} > 1)); then
TMPFILE="$TMPDIR/initrd.cpio"
$CAT "$image" 2>/dev/null > $TMPFILE
pre_decompress()
{
cat $TMPFILE
$CAT "$image" 2> /dev/null > "$TMPFILE"
pre_decompress() {
cat "$TMPFILE"
}
CAT=pre_decompress
fi
ret=0
if [[ -n "$unpack" ]]; then
if [[ -n $unpack ]]; then
unpack_files
elif (( ${#filenames[@]} > 0 )); then
elif ((${#filenames[@]} > 0)); then
extract_files
else
# shellcheck disable=SC2046
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs 'dracut-*') 2>/dev/null)
((ret+=$?))
$(dracutlibdirs 'dracut-*') 2> /dev/null)
((ret += $?))
echo "Version: $version"
echo
if [ "$modules" -eq 1 ]; then
@@ -339,8 +384,9 @@ else
echo "========================================================================"
else
echo -n "Arguments: "
# shellcheck disable=SC2046
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs build-parameter.txt) 2>/dev/null
$(dracutlibdirs build-parameter.txt) 2> /dev/null
echo
list_modules
list_files
@@ -348,4 +394,4 @@ else
fi
fi
exit $ret
exit "$ret"

View File

@@ -51,7 +51,7 @@ Harald Hoyer
AVAILABILITY
------------
The dracut-catimages command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
link:$$https://github.com/dracutdevs/dracut$$[https://github.com/dracutdevs/dracut]
SEE ALSO
--------

View File

@@ -18,8 +18,13 @@ DESCRIPTION
Create an initramfs <image> for the kernel with the version <kernel version>.
If <kernel version> is omitted, then the version of the actual running
kernel is used. If <image> is omitted or empty, then the default location
/boot/initramfs-<kernel version>.img is used.
kernel is used. If <image> is omitted or empty, depending on bootloader
specification, the default location can be
_/efi/<machine-id>/<kernel-version>/initrd_,
_/boot/<machine-id>/<kernel-version>/initrd_,
_/boot/efi/<machine-id>/<kernel-version>/initrd_,
_/lib/modules/<kernel-version>/initrd_ or
_/boot/initramfs-<kernel-version>.img_.
dracut creates an initial image used by the kernel for preloading the block
device modules (such as IDE, SCSI or RAID) which are needed to access the root
@@ -48,22 +53,28 @@ include::dracut.usage.asc[]
OPTIONS
-------
**--kver** _<kernel version>_::
set the kernel version. This enables to specify the kernel version, without
Set the kernel version. This enables to specify the kernel version, without
specifying the location of the initramfs image. For example:
----
# dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
----
**-f, --force**::
overwrite existing initramfs file.
Overwrite existing initramfs file.
_<output file>_ **--rebuild**::
Append the current arguments to those with which the input initramfs image
was built. This option helps in incrementally building the initramfs for
testing. If optional _<output file>_ is not provided, the input initramfs
provided to rebuild will be used as output file.
**-a, --add** _<list of dracut modules>_::
add a space-separated list of dracut modules to the default set of modules.
Add a space-separated list of dracut modules to the default set of modules.
This parameter can be specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --add "module1 module2" ...
@@ -71,13 +82,13 @@ example:
===============================
**--force-add** _<list of dracut modules>_::
force to add a space-separated list of dracut modules to the default set of
Force to add a space-separated list of dracut modules to the default set of
modules, when -H is specified. This parameter can be specified multiple
times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --force-add "module1 module2" ...
@@ -85,12 +96,12 @@ example:
===============================
**-o, --omit** _<list of dracut modules>_::
omit a space-separated list of dracut modules. This parameter can be
Omit a space-separated list of dracut modules. This parameter can be
specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --omit "module1 module2" ...
@@ -98,7 +109,7 @@ example:
===============================
**-m, --modules** _<list of dracut modules>_::
specify a space-separated list of dracut modules to call when building the
Specify a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
parameter can be specified multiple times.
This option forces dracut to only include the specified dracut modules.
@@ -106,7 +117,7 @@ example:
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --modules "module1 module2" ...
@@ -114,13 +125,13 @@ example:
===============================
**-d, --drivers** _<list of kernel modules>_::
specify a space-separated list of kernel modules to exclusively include
Specify a space-separated list of kernel modules to exclusively include
in the initramfs. The kernel modules have to be specified without the ".ko"
suffix. This parameter can be specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --drivers "kmodule1 kmodule2" ...
@@ -128,13 +139,13 @@ example:
===============================
**--add-drivers** _<list of kernel modules>_::
specify a space-separated list of kernel modules to add to the initramfs.
Specify a space-separated list of kernel modules to add to the initramfs.
The kernel modules have to be specified without the ".ko" suffix. This
parameter can be specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --add-drivers "kmodule1 kmodule2" ...
@@ -147,7 +158,7 @@ example:
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --force-drivers "kmodule1 kmodule2" ...
@@ -155,14 +166,14 @@ example:
===============================
**--omit-drivers** _<list of kernel modules>_::
specify a space-separated list of kernel modules not to add to the
Specify a space-separated list of kernel modules not to add to the
initramfs.
The kernel modules have to be specified without the ".ko" suffix. This
parameter can be specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --omit-drivers "kmodule1 kmodule2" ...
@@ -170,13 +181,13 @@ example:
===============================
**--filesystems** _<list of filesystems>_::
specify a space-separated list of kernel filesystem modules to exclusively
Specify a space-separated list of kernel filesystem modules to exclusively
include in the generic initramfs. This parameter can be specified multiple
times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --filesystems "filesystem1 filesystem2" ...
@@ -184,51 +195,64 @@ example:
===============================
**-k, --kmoddir** _<kernel directory>_::
specify the directory, where to look for kernel modules
Specify the directory, where to look for kernel modules.
**--fwdir** _<dir>[:<dir>...]++_::
specify additional directories, where to look for firmwares. This parameter
Specify additional directories, where to look for firmwares. This parameter
can be specified multiple times.
**--kernel-cmdline <parameters>**::
specify default kernel command line parameters
**--kernel-only**::
only install kernel drivers and firmware files
**--no-kernel**::
do not install kernel drivers and firmware files
**--early-microcode**::
Combine early microcode with ramdisk
**--no-early-microcode**::
Do not combine early microcode with ramdisk
**--print-cmdline**::
print the kernel command line for the current disk layout
**--mdadmconf**::
include local _/etc/mdadm.conf_
**--nomdadmconf**::
do not include local _/etc/mdadm.conf_
**--lvmconf**::
include local _/etc/lvm/lvm.conf_
**--nolvmconf**::
do not include local _/etc/lvm/lvm.conf_
**--fscks** [LIST]::
add a space-separated list of fsck tools, in addition to _dracut.conf_'s
specification; the installation is opportunistic (non-existing tools are
ignored)
**--libdirs** _<list of directories>_::
Specify a space-separated list of directories to look for libraries to
include in the generic initramfs. This parameter can be specified multiple
times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --libdirs "dir1 dir2" ...
----
===============================
**--kernel-cmdline <parameters>**::
Specify default kernel command line parameters.
**--kernel-only**::
Only install kernel drivers and firmware files.
**--no-kernel**::
Do not install kernel drivers and firmware files.
**--early-microcode**::
Combine early microcode with ramdisk.
**--no-early-microcode**::
Do not combine early microcode with ramdisk.
**--print-cmdline**::
Print the kernel command line for the current disk layout.
**--mdadmconf**::
Include local _/etc/mdadm.conf_ file.
**--nomdadmconf**::
Do not include local _/etc/mdadm.conf_ file.
**--lvmconf**::
Include local _/etc/lvm/lvm.conf_ file.
**--nolvmconf**::
Do not include local _/etc/lvm/lvm.conf_ file.
**--fscks** _<list of fsck tools>_::
Add a space-separated list of fsck tools, in addition to _dracut.conf_'s
specification; the installation is opportunistic (non-existing tools are
ignored).
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --fscks "fsck.foo barfsck" ...
@@ -236,60 +260,65 @@ example:
===============================
**--nofscks**::
inhibit installation of any fsck tools
Inhibit installation of any fsck tools.
**--strip**::
strip binaries in the initramfs (default)
Strip binaries in the initramfs (default).
**--aggressive-strip**::
Strip more than just debug symbol and sections, for a smaller initramfs
build. The --strip option must also be specified.
**--nostrip**::
do not strip binaries in the initramfs
Do not strip binaries in the initramfs.
**--hardlink**::
hardlink files in the initramfs (default)
Hardlink files in the initramfs (default).
**--nohardlink**::
do not hardlink files in the initramfs
Do not hardlink files in the initramfs.
**--prefix** _<dir>_::
prefix initramfs files with the specified directory
Prefix initramfs files with the specified directory.
**--noprefix**::
do not prefix initramfs files (default)
Do not prefix initramfs files (default).
**-h, --help**::
display help text and exit.
Display help text and exit.
**--debug**::
output debug information of the build process
Output debug information of the build process.
**-v, --verbose**::
increase verbosity level (default is info(4))
Increase verbosity level (default is info(4)).
**--version**::
display version and exit
Display version and exit.
**-q, --quiet**:: decrease verbosity level (default is info(4))
**-q, --quiet**::
Decrease verbosity level (default is info(4)).
**-c, --conf** _<dracut configuration file>_::
specify configuration file to use.
Specify configuration file to use.
+
Default:
_/etc/dracut.conf_
**--confdir** _<configuration directory>_::
specify configuration directory to use.
Specify configuration directory to use.
+
Default:
_/etc/dracut.conf.d_
**--tmpdir** _<temporary directory>_::
specify temporary directory to use.
Specify temporary directory to use.
+
Default:
_/var/tmp_
**-r, --sysroot** _<sysroot directory>_::
specify the sysroot directory to collect files from.
Specify the sysroot directory to collect files from.
This is useful to create the initramfs image from
a cross-compiled sysroot directory. For the extra helper
variables, see *ENVIRONMENT* below.
@@ -297,22 +326,23 @@ Default:
Default:
_empty_
**--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
**--sshkey** _<sshkey file>_::
SSH key file used with ssh-client module.
**--logfile** _<logfile>_:: logfile to use; overrides any setting from
the configuration files.
**--logfile** _<logfile>_::
Logfile to use; overrides any setting from the configuration files.
+
Default:
_/var/log/dracut.log_
**-l, --local**::
activates the local mode. dracut will use modules from the current working
Activates the local mode. dracut will use modules from the current working
directory instead of the system-wide installed modules in
_/usr/lib/dracut/modules.d_.
This is useful when running dracut from a git checkout.
**-H, --hostonly**::
Host-Only mode: Install only what is needed for booting the local host
Host-only mode: Install only what is needed for booting the local host
instead of a generic host and generate host-specific configuration.
+
[WARNING]
@@ -322,28 +352,47 @@ provide a valid _/etc/fstab_.
====
**-N, --no-hostonly**::
Disable Host-Only mode
Disable host-only mode.
**--hostonly-cmdline**:
Store kernel command line arguments needed in the initramfs
**--hostonly-mode _<mode>_**::
Specify the host-only mode to use. _<mode>_ could be one of "sloppy" or
"strict".
In "sloppy" host-only mode, extra drivers and modules will be installed, so
minor hardware change won't make the image unbootable (e.g. changed
keyboard), and the image is still portable among similar hosts.
With "strict" mode enabled, anything not necessary for booting the local
host in its current state will not be included, and modules may do some
extra job to save more space. Minor change of hardware or environment could
make the image unbootable.
+
Default:
_sloppy_
**--no-hostonly-cmdline**:
Do not store kernel command line arguments needed in the initramfs
**--hostonly-cmdline**::
Store kernel command line arguments needed in the initramfs.
**--no-hostonly-default-device**:
**--no-hostonly-cmdline**::
Do not store kernel command line arguments needed in the initramfs.
**--no-hostonly-default-device**::
Do not generate implicit host devices like root, swap, fstab, etc.
Use "--mount" or "--add-device" to explicitly add devices as needed.
**--hostonly-i18n**:
Install only needed keyboard and font files according to the host configuration (default).
**--hostonly-i18n**::
Install only needed keyboard and font files according to the host
configuration (default).
**--no-hostonly-i18n**:
**--no-hostonly-i18n**::
Install all keyboard and font files available.
**--hostonly-nics** _<list of nics>_::
Only enable listed NICs in the initramfs. The list can be empty, so other
modules can install only the necessary network drivers.
**--persistent-policy** _<policy>_::
Use _<policy>_ to address disks and partitions.
_<policy>_ can be any directory name found in /dev/disk.
E.g. "by-uuid", "by-label"
_<policy>_ can be any directory name found in /dev/disk (e.g. "by-uuid",
"by-label"), or "mapper" to use /dev/mapper device names (default).
**--fstab**::
Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
@@ -357,7 +406,7 @@ provide a valid _/etc/fstab_.
be specified, see fstab manpage for the details.
The default _<filesystem options>_ is "defaults".
The default _<dump frequency>_ is "0".
the default _<fsck order>_ is "2".
The default _<fsck order>_ is "2".
**--mount** "_<mountpoint>_"::
Like above, but _<device>_, _<filesystem type>_ and _<filesystem options>_
@@ -365,22 +414,22 @@ provide a valid _/etc/fstab_.
**--add-device** _<device>_ ::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
This can be useful in hostonly mode for resume support when your swap is on
This can be useful in host-only mode for resume support when your swap is on
LVM or an encrypted partition.
[NB --device can be used for compatibility with earlier releases]
**-i, --include** _<SOURCE>_ _<TARGET>_::
include the files in the SOURCE directory into the
Include the files in the SOURCE directory into the
TARGET directory in the final initramfs. If SOURCE is a file, it will be
installed to TARGET in the final initramfs. This parameter can be specified
multiple times.
**-I, --install** _<file list>_::
install the space separated list of files into the initramfs.
Install the space separated list of files into the initramfs.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --install "/bin/foo /sbin/bar" ...
@@ -388,12 +437,12 @@ example:
===============================
**--install-optional** _<file list>_::
install the space separated list of files into the initramfs, if they exist.
Install the space separated list of files into the initramfs, if they exist.
**--gzip**::
Compress the generated initramfs using gzip. This will be done by default,
unless another compression option or --no-compress is passed. Equivalent to
"--compress=gzip -9"
"--compress=gzip -9".
**--bzip2**::
Compress the generated initramfs using bzip2.
@@ -401,7 +450,7 @@ example:
[WARNING]
====
Make sure your kernel has bzip2 decompression support compiled in, otherwise you
will not be able to boot. Equivalent to "--compress=bzip2"
will not be able to boot. Equivalent to "--compress=bzip2 -9".
====
**--lzma**::
@@ -410,7 +459,7 @@ will not be able to boot. Equivalent to "--compress=bzip2"
[WARNING]
====
Make sure your kernel has lzma decompression support compiled in, otherwise you
will not be able to boot. Equivalent to "lzma --compress=lzma -9"
will not be able to boot. Equivalent to "--compress=lzma -9 -T0".
====
**--xz**::
@@ -420,31 +469,34 @@ will not be able to boot. Equivalent to "lzma --compress=lzma -9"
====
Make sure your kernel has xz decompression support compiled in, otherwise you
will not be able to boot. Equivalent to
"lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"
"--compress=xz --check=crc32 --lzma2=dict=1MiB -T0".
====
**--lzo**::
Compress the generated initramfs using lzop.
+
[WARNING]
====
Make sure your kernel has lzo decompression support compiled in, otherwise you
will not be able to boot.
will not be able to boot. Equivalent to "--compress=lzop -9".
====
**--lz4**::
Compress the generated initramfs using lz4.
+
[WARNING]
====
Make sure your kernel has lz4 decompression support compiled in, otherwise you
will not be able to boot.
will not be able to boot. Equivalent to "--compress=lz4 -l -9".
====
**--zstd**::
Compress the generated initramfs using Zstandard.
+
[WARNING]
====
Make sure your kernel has zstd decompression support compiled in, otherwise you
will not be able to boot.
will not be able to boot. Equivalent to "--compress=zstd -15 -q -T0".
====
**--compress** _<compressor>_::
@@ -453,7 +505,14 @@ will not be able to boot.
program with known-working arguments. If you pass a quoted string with
arguments, it will be called with exactly those arguments. Depending on what
you pass, this may result in an initramfs that the kernel cannot decompress.
The default value can also be set via the _INITRD_COMPRESS_ environment variable.
The default value can also be set via the _INITRD_COMPRESS_ environment
variable.
**--squash-compressor** _<compressor>_::
Compress the squashfs image using the passed compressor and compressor
specific options for mksquashfs. You can refer to mksquashfs manual for
supported compressors and compressor specific options. If squash module is
not called when building the initramfs, this option will not take effect.
**--no-compress**::
Do not compress the generated initramfs. This will override any other
@@ -475,16 +534,16 @@ will not be able to boot.
Keep the initramfs temporary directory for debugging purposes.
**--printsize**::
Print out the module install size
Print out the module install size.
**--profile**:
Output profile information of the build process
**--profile**::
Output profile information of the build process.
**--ro-mnt**:
**--ro-mnt**::
Mount / and /usr read-only by default.
**-L, --stdlog** _<level>_::
[0-6] Specify logging level (to standard error)
[0-6] Specify logging level (to standard error).
----
0 - suppress any messages
1 - only fatal errors
@@ -499,37 +558,57 @@ will not be able to boot.
Regenerate all initramfs images at the default location with the kernel
versions found on the system. Additional parameters are passed through.
**--loginstall _<DIR>_**::
Log all files installed from the host to _<DIR>_.
**-p, --parallel**::
Try to execute tasks in parallel. Currently only supported with
**--regenerate-all** (build initramfs images for all kernel
versions simultaneously).
**--noimageifnotneeded**::
Do not create an image in host-only mode, if no kernel driver is needed
and no /etc/cmdline/*.conf will be generated into the initramfs.
**--loginstall _<directory>_**::
Log all files installed from the host to _<directory>_.
**--uefi**::
Instead of creating an initramfs image, dracut will create an UEFI executable,
which can be executed by an UEFI BIOS. The default output filename is
_<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_. <EFI> might be
_/efi_, _/boot_ or _/boot/efi_ depending on where the ESP partition is mounted.
The <BUILD_ID> is taken from BUILD_ID in _/usr/lib/os-release_ or if it exists
_/etc/os-release_ and is left out, if BUILD_ID is non-existant or empty.
Instead of creating an initramfs image, dracut will create an UEFI
executable, which can be executed by an UEFI BIOS. The default output
filename is _<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_.
<EFI> might be _/efi_, _/boot_ or _/boot/efi_ depending on where the ESP
partition is mounted. The <BUILD_ID> is taken from BUILD_ID in
_/usr/lib/os-release_ or if it exists _/etc/os-release_ and is left out,
if BUILD_ID is non-existant or empty.
**--no-uefi**::
Disables UEFI mode.
**--no-machineid**::
affects the default output filename of **--uefi** and will discard the <MACHINE_ID>
part.
Affects the default output filename of **--uefi** and will discard the
<MACHINE_ID> part.
**--uefi-stub _<FILE>_**::
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
kernel command line and boots the kernel. The default is
_$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
or _$prefix/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
**--uefi-stub _<file>_**::
Specifies the UEFI stub loader, which will load the attached kernel,
initramfs and kernel command line and boots the kernel. The default is
_$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_.
**--uefi-splash-image _<FILE>_**::
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image
format.
**--uefi-splash-image _<file>_**::
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**)
image format.
**--kernel-image _<FILE>_**::
Specifies the kernel image, which to include in the UEFI executable. The default is
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
**--kernel-image _<file>_**::
Specifies the kernel image, which to include in the UEFI executable. The
default is _/lib/modules/<KERNEL-VERSION>/vmlinuz_ or
_/boot/vmlinuz-<KERNEL-VERSION>_.
**--enhanced-cpio**::
Attempt to use the dracut-cpio binary, which optimizes archive creation for
copy-on-write filesystems by using the copy_file_range(2) syscall via Rust's
io::copy(). When specified, initramfs archives are also padded to ensure
optimal data alignment for extent sharing. To retain reflink data
deduplication benefits, this should be used alongside the **--no-compress**
and **--nostrip** parameters, with initramfs source files, **--tmpdir**
staging area and destination all on the same copy-on-write capable
filesystem.
ENVIRONMENT
-----------
@@ -663,7 +742,7 @@ _/etc/cmdline.d/*.conf_::
AVAILABILITY
------------
The dracut command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
link:$$https://github.com/dracutdevs/dracut$$[https://github.com/dracutdevs/dracut]
AUTHORS
-------

View File

@@ -1,7 +1,7 @@
dracut {mainversion}
====================
:author: Harald Hoyer
:email: harald@redhat.com
:email: harald@profian.com
:revnumber: {version}
:language: bash
@@ -50,7 +50,7 @@ computer. This can be:
* The root file system itself
* A boot image on an optical disc
* A small ext2/ext3 or FAT-formatted partition on a local disk
* A small ext2/ext3/ext4 or FAT-formatted partition on a local disk
(a _boot partition_)
* A TFTP server (on systems that can boot from Ethernet)
@@ -162,9 +162,6 @@ include::dracut.cmdline.7.asc[]
[[lsinitrd1]]
include::lsinitrd.1.asc[]
[[mkinitrd8]]
include::mkinitrd.8.asc[]
= Developer Manual
:leveloffset: 1

View File

@@ -56,7 +56,7 @@ root=PARTUUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
[listing]
.Example
--
rootfstype=ext3
rootfstype=ext4
--
**rootflags=**__<mount options>__::
@@ -134,7 +134,7 @@ menuentry 'Live Fedora 20' --class fedora --class gnu-linux --class gnu --class
Misc
~~~~
**rd.emergency=**__[reboot|poweroff|halt]__::
specify, what action to execute in case of a critical failure. rd.shell=0 also
specify, what action to execute in case of a critical failure. rd.shell=0 must also
be specified.
**rd.driver.blacklist=**__<drivername>__[,__<drivername>__,...]::
@@ -151,7 +151,7 @@ Misc
**rd.retry=**__<seconds>__::
specify how long dracut should retry the initqueue to configure devices.
The default is 30 seconds. After 2/3 of the time, degraded raids are force
The default is 180 seconds. After 2/3 of the time, degraded raids are force
started. If you have hardware, which takes a very long time to announce its
drives, you might want to extend this value.
@@ -221,7 +221,7 @@ It should be attached to any report about dracut problems.
drop to a shell at the end
**rd.break=**__{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|cleanup}__::
drop to a shell on defined breakpoint
drop to a shell before the defined breakpoint starts
**rd.udev.info**::
set udev to loglevel info
@@ -453,6 +453,11 @@ it, e.g. `rd.luks.name=cccc=mykeys`, otherwise it gets closed
when not needed anymore.
===============================
**rd.luks.key.tout=0**::
specify how many times dracut will try to read the keys specified in in
rd.luk.key. This gives a chance to the removable device containing the key
to initialise.
MD RAID
~~~~~~~
**rd.md=0**::
@@ -575,8 +580,13 @@ USB Android phone::
* enp0s29u1u2
=====================
**ip=**__{dhcp|on|any|dhcp6|auto6|either6|single-dhcp}__::
dhcp|on|any::: get ip from dhcp server from all interfaces. If root=dhcp,
The following options are supported by the 'network-legacy' dracut
module. Other network modules might support a slightly different set of
options; refer to the documentation of the specific network module in use. For
NetworkManager, see *nm-initrd-generator*(8).
**ip=**__{dhcp|on|any|dhcp6|auto6|either6|link6|single-dhcp}__::
dhcp|on|any::: get ip from dhcp server from all interfaces. If netroot=dhcp,
loop sequentially through all interfaces (eth0, eth1, ...) and use the first
with a valid DHCP root-path.
@@ -584,7 +594,7 @@ USB Android phone::
opposed to one after another. After the first DHCP response is received,
stop DHCP on all other interfaces. This gives the fastest boot time by
using the IP on interface for which DHCP succeeded first during early boot.
Caveat: Does not apply to Network Manager and to SUSE using wicked.
Caveat: Does not apply to Network Manager.
auto6::: IPv6 autoconfiguration
@@ -592,12 +602,15 @@ USB Android phone::
either6::: if auto6 fails, then dhcp6
**ip=**__<interface>__:__{dhcp|on|any|dhcp6|auto6}__[:[__<mtu>__][:__<macaddr>__]]::
link6::: bring up interface for IPv6 link-local addressing
**ip=**__<interface>__:__{dhcp|on|any|dhcp6|auto6|link6}__[:[__<mtu>__][:__<macaddr>__]]::
This parameter can be specified multiple times.
+
=====================
dhcp|on|any|dhcp6::: get ip from dhcp server on a specific interface
auto6::: do IPv6 autoconfiguration
link6::: bring up interface for IPv6 link local address
<macaddr>::: optionally **set** <macaddr> on the <interface>. This
cannot be used in conjunction with the **ifname** argument for the
same <interface>.
@@ -704,7 +717,7 @@ NFS
":" or "," and are separated by ",".
**root=**nfs:\[_<server-ip>_:]__<root-dir>__[:__<nfs-options>__], **root=**nfs4:\[_<server-ip>_:]__<root-dir>__[:__<nfs-options>__], **root=**__{dhcp|dhcp6}__::
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
netroot=dhcp alone directs initrd to look at the DHCP root-path where NFS
options can be specified.
+
[listing]
@@ -727,7 +740,7 @@ NFS
Default is 1.
**rd.net.timeout.dhcp=**__<arg>__::
If this option is set, dhclient is called with "-timeout <arg>".
If this option is set, dhclient is called with "--timeout <arg>".
**rd.net.timeout.iflink=**__<seconds>__::
Wait <seconds> until link shows up. Default is 60 seconds.
@@ -882,6 +895,18 @@ NOTE: letters in the MAC-address must be lowercase!
NVMf
~~~~
**rd.nonvmf**::
Disable NVMf
**rd.nvmf.nonbft**::
Disable connecting to targets from the NVMe Boot Firmware Table. Without
this parameter, NBFT connections will take precedence over _rd.nvmf.discover_.
**rd.nvmf.nostatic**::
Disable connecting to targets that have been statically configured when
the initramfs was built. Targets specified with rd.nvmf.discover on the
kernel command line will still be tried.
**rd.nvmf.hostnqn=**__<hostNQN>__::
NVMe host NQN to use
@@ -893,9 +918,19 @@ NVMf
_<traddr>_ and the optionally _<host_traddr>_ or _<trsvcid>_.
The first argument specifies the transport to use; currently only
'rdma', 'fc', or 'tcp' are supported.
The _<traddr>_ parameter can be set to 'auto' to select
autodiscovery; in that case all other parameters are ignored.
This parameter can be specified multiple times.
+
[listing]
.Examples
--
rd.nvmf.discover=tcp,192.168.10.10,,4420
rd.nvmf.discover=fc,nn-0x201700a05634f5bf:pn-0x201900a05634f5bf,nn-0x200000109b579ef3:pn-0x100000109b579ef3
--
**rd.nvmf.discover=fc,auto**::
This special syntax determines that Fibre Channel autodiscovery
is to be used rather than regular NVMe discovery. It takes precedence
over all other _rd.nvmf.discover=_ arguments.
NBD
~~~
@@ -906,8 +941,8 @@ NOTE:
If "exportname" instead of "port" is given the standard port is used.
Newer versions of nbd are only supported with "exportname".
**root=dhcp** with **dhcp** **root-path=**nbd:__<server>__:__<port/exportname>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
**root=/dev/root netroot=dhcp** with **dhcp** **root-path=**nbd:__<server>__:__<port/exportname>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
netroot=dhcp alone directs initrd to look at the DHCP root-path where NBD
options can be specified. This syntax is only usable in cases where you are
directly mounting the volume as the rootfs.
+
@@ -915,6 +950,25 @@ NOTE:
If "exportname" instead of "port" is given the standard port is used.
Newer versions of nbd are only supported with "exportname".
VIRTIOFS
~~~~~~~~
**root=**virtiofs:__<mount-tag>__::
mount virtiofs share using the tag <mount-tag>.
The tag name is arbitrary and must match the tag given in the qemu '-device' command.
**rootfstype=**virtiofs **root=**__<mount-tag>__::
mount virtiofs share using the tag <mount-tag>.
The tag name is arbitrary and must match the tag given in the qemu '-device' command.
Both formats are supported by the 'virtiofs' dracut module.
See https://gitlab.com/virtio-fs/virtiofsd for more information.
[listing]
.Example
--
root=virtiofs:host rw
--
DASD
~~~~
**rd.dasd=**....::
@@ -1072,6 +1126,13 @@ NOTE: There must be enough free RAM available to hold the complete image.
+
This method is very suitable for diskless boots.
**rd.minmem=**__<megabyte>__::
Specify minimum free RAM in MB after copying a live disk image into memory.
The default is 1024.
+
This parameter only applies together with the parameters rd.writable.fsimg
or rd.live.ram.
**root=**live:__<url>__::
Boots a live image retrieved from __<url>__. Requires the dracut 'livenet'
module. Valid handlers: __http, https, ftp, torrent, tftp__.
@@ -1126,6 +1187,10 @@ rd.live.overlay=/dev/sdb1:persistent-overlay.img
rd.live.overlay=UUID=99440c1f-8daa-41bf-b965-b7240a8996f4
--
**rd.live.overlay.cowfs=**__[btrfs|ext4|xfs]__::
Specifies the filesystem to use when formatting the overlay partition.
The default is ext4.
**rd.live.overlay.size=**__<size_MiB>__::
Specifies a non-persistent Device-mapper overlay size in MiB. The default is
_32768_.
@@ -1232,8 +1297,8 @@ masterkey=/etc/keys/kmk-trusted.blob
masterkeytype=trusted
--
**evmkey=**__<EVM key path name>__::
Set the path name of the EVM key.
**evmkey=**__<EVM HMAC key path name>__::
Set the path name of the EVM HMAC key.
+
[listing]
.Example
@@ -1241,6 +1306,15 @@ masterkeytype=trusted
evmkey=/etc/keys/evm-trusted.blob
--
**evmx509=**__<EVM X.509 cert path name>__::
Set the path name of the EVM X.509 certificate.
+
[listing]
.Example
--
evmx509=/etc/keys/x509_evm.der
--
**ecryptfskey=**__<eCryptfs key path name>__::
Set the path name of the eCryptfs key.
+
@@ -1312,10 +1386,6 @@ rd_LVM_LV:: rd.lvm.lv
rd_NO_LVM:: rd.lvm=0
rd_LVM_SNAPSHOT:: rd.lvm.snapshot
rd_LVM_SNAPSIZE:: rd.lvm.snapsize
rd_LVM_VG:: rd.lvm.vg
rd_NO_MDADMCONF:: rd.md.conf=0

View File

@@ -36,20 +36,20 @@ Configuration files must have the extension .conf; other extensions are ignored.
Add a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
*dracutmodules+=*" __<dracut modules>__ "::
Specify a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
This option forces dracut to only include the specified dracut modules.
In most cases the "add_dracutmodules" option is what you want to use.
*force_add_dracutmodules+=*" __<dracut modules>__ "::
Force to add a space-separated list of dracut modules to the default set of
modules, when host-only mode is specified. This parameter can be specified
multiple times.
*omit_dracutmodules+=*" __<dracut modules>__ "::
Omit a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
*drivers+=*" __<kernel modules>__ "::
Specify a space-separated list of kernel modules to exclusively include in
the initramfs. The kernel modules have to be specified without the ".ko"
suffix.
*dracutmodules+=*" __<dracut modules>__ "::
Specify a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
This option forces dracut to only include the specified dracut modules.
In most cases the "add_dracutmodules" option is what you want to use.
*add_drivers+=*" __<kernel modules>__ "::
Specify a space-separated list of kernel modules to add to the initramfs.
@@ -63,15 +63,24 @@ Configuration files must have the extension .conf; other extensions are ignored.
Specify a space-separated list of kernel modules not to add to the
initramfs. The kernel modules have to be specified without the ".ko" suffix.
*drivers+=*" __<kernel modules>__ "::
Specify a space-separated list of kernel modules to exclusively include in
the initramfs. The kernel modules have to be specified without the ".ko"
suffix.
*filesystems+=*" __<filesystem names>__ "::
Specify a space-separated list of kernel filesystem modules to exclusively
include in the generic initramfs.
*drivers_dir=*"__<kernel modules directory>__"::
Specify the directory, where to look for kernel modules
Specify the directory where to look for kernel modules.
*fw_dir+=*" :__<dir>__[:__<dir>__ ...] "::
Specify additional directories, where to look for firmwares, separated by :
Specify additional colon-separated list of directories where to look for
firmware files.
*libdirs+=*" __<dir>__[ __<dir>__ ...] "::
Specify a space-separated list of directories where to look for libraries.
*install_items+=*" __<file>__[ __<file>__ ...] "::
Specify additional files to include in the initramfs, separated by spaces.
@@ -80,28 +89,61 @@ Configuration files must have the extension .conf; other extensions are ignored.
Specify additional files to include in the initramfs, separated by spaces,
if they exist.
*compress=*"__{cat|bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args ...]>}__"::
*compress=*"__{cat|bzip2|lzma|xz|gzip|lzop|lz4|zstd|<compressor [args ...]>}__"::
Compress the generated initramfs using the passed compression program. If
you pass it just the name of a compression program, it will call that
program with known-working arguments. If you pass arguments, it will be called
with exactly those arguments. Depending on what you pass, this may result in
an initramfs that the kernel cannot decompress.
program with known-working arguments. If you pass arguments, it will be
called with exactly those arguments. Depending on what you pass, this may
result in an initramfs that the kernel cannot decompress.
To disable compression, use "cat".
*squash_compress=*"__{<compressor [args ...]>}__"::
Compress the squashfs image using the passed compressor and compressor
specific options for mksquashfs. You can refer to mksquashfs manual for
supported compressors and compressor specific options. If squash module is
not called when building the initramfs, this option will not take effect.
*do_strip=*"__{yes|no}__"::
Strip binaries in the initramfs (default=yes)
Strip binaries in the initramfs (default=yes).
*aggressive_strip=*"__{yes|no}__"::
Strip more than just debug symbol and sections, for a smaller initramfs
build. The "do_strip=yes" option must also be specified (default=no).
*do_hardlink=*"__{yes|no}__"::
Hardlink files in the initramfs (default=yes).
*prefix=*" __<directory>__ "::
Prefix initramfs files with __<directory>__.
*hostonly=*"__{yes|no}__"::
Host-Only mode: Install only what is needed for booting the local host
instead of a generic host and generate host-specific configuration.
Host-only mode: Install only what is needed for booting the local host
instead of a generic host and generate host-specific configuration
(default=no).
*hostonly_mode=*"__{sloppy|strict}__"::
Specify the host-only mode to use (default=sloppy).
In "sloppy" host-only mode, extra drivers and modules will be installed, so
minor hardware change won't make the image unbootable (e.g. changed
keyboard), and the image is still portable among similar hosts.
With "strict" mode enabled, anything not necessary for booting the local
host in its current state will not be included, and modules may do some
extra job to save more space. Minor change of hardware or environment could
make the image unbootable.
*hostonly_cmdline=*"__{yes|no}__"::
If set to "yes", store the kernel command line arguments needed in the initramfs
If set to "yes", store the kernel command line arguments needed in the
initramfs. If **hostonly="yes"** and this option is not configured, it's
automatically set to "yes".
*hostonly_nics+=*" [__<nic>__[ __<nic>__ ...]] "::
Only enable listed NICs in the initramfs. The list can be empty, so other
modules can install only the necessary network drivers.
*persistent_policy=*"__<policy>__"::
Use _<policy>_ to address disks and partitions.
_<policy>_ can be any directory name found in /dev/disk.
E.g. "by-uuid", "by-label"
_<policy>_ can be any directory name found in /dev/disk (e.g. "by-uuid",
"by-label"), or "mapper" to use /dev/mapper device names (default=mapper).
*tmpdir=*"__<temporary directory>__"::
Specify temporary directory to use.
@@ -113,21 +155,21 @@ provide a valid _/etc/fstab_.
====
*use_fstab=*"__{yes|no}__"::
Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
Use _/etc/fstab_ instead of _/proc/self/mountinfo_ (default=no).
*add_fstab+=*" __<filename>__ "::
Add entries of __<filename>__ to the initramfs /etc/fstab.
*add_device+=*" __<device>__ "::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
This can be useful in hostonly mode for resume support when your swap is on
This can be useful in host-only mode for resume support when your swap is on
LVM an encrypted partition.
*mdadmconf=*"__{yes|no}__"::
Include local _/etc/mdadm.conf_ (default=yes)
Include local _/etc/mdadm.conf_ (default=no).
*lvmconf=*"__{yes|no}__"::
Include local _/etc/lvm/lvm.conf_ (default=yes)
Include local _/etc/lvm/lvm.conf_ (default=no).
*fscks=*" __<fsck tools>__ "::
Add a space-separated list of fsck tools. If nothing is specified, the
@@ -136,19 +178,19 @@ provide a valid _/etc/fstab_.
(non-existing tools are ignored).
*nofscks=*"__{yes|no}__"::
If specified, inhibit installation of any fsck tools.
If specified, inhibit installation of any fsck tools (default=no).
*ro_mnt=*"__{yes|no}__"::
Mount _/_ and _/usr_ read-only by default.
Mount _/_ and _/usr_ read-only by default (default=no).
*kernel_cmdline=*"__parameters__"::
Specify default kernel command line parameters
Specify default kernel command line parameters.
*kernel_only=*"__{yes|no}__"::
Only install kernel drivers and firmware files. (default=no)
Only install kernel drivers and firmware files (default=no).
*no_kernel=*"__{yes|no}__"::
Do not install kernel drivers and firmware files (default=no)
Do not install kernel drivers and firmware files (default=no).
*acpi_override=*"__{yes|no}__"::
[WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! +
@@ -166,22 +208,40 @@ provide a valid _/etc/fstab_.
Directory to search for ACPI tables if acpi_override= is set to yes.
*early_microcode=*"{yes|no}"::
Combine early microcode with ramdisk (default=yes)
Combine early microcode with ramdisk (default=yes).
*stdloglvl*="__\{0-6\}__"::
Set logging to standard error level.
Specify logging level for standard error (default=4).
[NOTE]
===============================
Logging levels:
----
0 - suppress any messages
1 - only fatal errors
2 - all errors
3 - warnings
4 - info
5 - debug info (here starts lots of output)
6 - trace info (and even more)
----
===============================
*sysloglvl*="__\{0-6\}__"::
Set logging to syslog level.
Specify logging level for syslog (default=0).
*fileloglvl=*"__\{0-6\}__"::
Set logging to file level.
Specify logging level for logfile (default=4).
*logfile=*"__<file>__"::
Path to log file.
Path to logfile.
*sshkey=*"__<file>__"::
SSH key file used with ssh-client module.
*show_modules=*"__{yes|no}__"::
Print the name of the included modules to standard output during build.
Print the name of the included modules to standard output during build
(default=no).
*i18n_vars=*"__<variable mapping>__"::
Distribution specific variable mapping.
@@ -192,30 +252,68 @@ provide a valid _/etc/fstab_.
Default is "eurlatgr".
*i18n_install_all=*"__{yes|no}__"::
Install everything regardless of generic or hostonly mode.
Install everything regardless of generic or host-only mode (default=no).
*reproducible=*"__{yes|no}__"::
Create reproducible images.
Create reproducible images (default=no).
*loginstall=*"__<DIR>__"::
Log all files installed from the host to _<DIR>_.
*noimageifnotneeded=*"__{yes|no}__"::
Do not create an image in host-only mode, if no kernel driver is needed
and no /etc/cmdline/*.conf will be generated into the initramfs
(default=no).
*uefi_stub=*"_<FILE>_"::
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
kernel command line and boots the kernel. The default is
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
or _/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
*loginstall=*"__<directory>__"::
Log all files installed from the host to _<directory>_.
*uefi_splash_image=*"_<FILE>_"::
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image format.
*uefi=*"__{yes|no}__"::
Instead of creating an initramfs image, dracut will create an UEFI
executable, which can be executed by an UEFI BIOS (default=no).
The default output filename is
_<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_.
<EFI> might be _/efi_, _/boot_ or _/boot/efi_ depending on where the ESP
partition is mounted. The <BUILD_ID> is taken from BUILD_ID in
_/usr/lib/os-release_ or if it exists _/etc/os-release_ and is left out,
if BUILD_ID is non-existant or empty.
*uefi_secureboot_cert=*"_<FILE>_", *uefi_secureboot_key=*"_<FILE>_"::
Specifies a certificate and corresponding key, which are used to sign the created UEFI executable.
Requires both certificate and key need to be specified and _sbsign_ to be installed.
*machine_id=*"__{yes|no}__"::
Affects the default output filename of the UEFI executable, including the
<MACHINE_ID> part (default=yes).
*kernel_image=*"_<FILE>_"::
Specifies the kernel image, which to include in the UEFI executable. The default is
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
*uefi_stub=*"_<file>_"::
Specifies the UEFI stub loader, which will load the attached kernel,
initramfs and kernel command line and boots the kernel. The default is
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_.
*uefi_splash_image=*"_<file>_"::
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**)
image format.
*uefi_secureboot_cert=*"_<file>_", *uefi_secureboot_key=*"_<file>_"::
Specifies a certificate and corresponding key, which are used to sign the
created UEFI executable.
Requires both certificate and key need to be specified and _sbsign_ to be
installed.
*uefi_secureboot_engine=*"_parameter_"::
Specifies an engine to use when signing the created UEFI executable. E.g. "pkcs11"
*kernel_image=*"_<file>_"::
Specifies the kernel image, which to include in the UEFI executable. The
default is _/lib/modules/<KERNEL-VERSION>/vmlinuz_ or
_/boot/vmlinuz-<KERNEL-VERSION>_.
*enhanced_cpio=*"__{yes|no}__"::
Attempt to use the dracut-cpio binary, which optimizes archive creation for
copy-on-write filesystems (default=no).
When specified, initramfs archives are also padded to ensure optimal data
alignment for extent sharing. To retain reflink data deduplication benefits,
this should be used alongside the **compress="cat"** and **do_strip="no"**
parameters, with initramfs source files, **tmpdir** staging area and
destination all on the same copy-on-write capable filesystem.
*parallel=*"__{yes|no}__"::
If set to _yes_, try to execute tasks in parallel (currently only supported
for _--regenerate-all_).
Files
-----

View File

@@ -5,9 +5,13 @@ To create a initramfs image, the most simple command is:
This will generate a general purpose initramfs image, with all possible
functionality resulting of the combination of the installed dracut modules and
system tools. The image is /boot/initramfs-_++<kernel version>++_.img and
contains the kernel modules of the currently active kernel with version
_++<kernel version>++_.
system tools. The image, depending on bootloader specification, can be
_/efi/_++<machine-id>++_/_++<kernel-version>++_/initrd_,
_/boot/_++<machine-id>++_/_++<kernel-version>++_/initrd_,
_/boot/efi/_++<machine-id>++_/_++<kernel-version>++_/initrd_,
_/lib/modules/_++<kernel-version>++_/initrd_ or
_/boot/initramfs-_++<kernel-version>++_.img_ and contains the kernel modules of
the currently active kernel with version _++<kernel-version>++_.
If the initramfs image already exists, dracut will display an error message, and
to overwrite the existing image, you have to use the --force option.
@@ -103,7 +107,7 @@ The kernel command line can also be provided by the dhcp server with the
root-path option. See <<NetworkBoot>>.
For a full reference of all kernel command line parameters,
see *dracut.cmdline*(5).
see *dracut.cmdline*(7).
To get a quick start for the suitable kernel command line on your system,
use the __--print-cmdline__ option:
@@ -161,8 +165,8 @@ a modern init system, like systemd.
==== Blacklisting Kernel Modules
Sometimes it is required to prevent the automatic kernel module loading of a
specific kernel module. To do this, just add rd.blacklist=_++<kernel module
name>++_, with _++<kernel module name>++_ not containing the _.ko_
specific kernel module. To do this, just add rd.driver.blacklist=_++<kernel
module name>++_, with _++<kernel module name>++_ not containing the _.ko_
suffix, to the kernel command line. For example:
----
rd.driver.blacklist=mptsas rd.driver.blacklist=nouveau
@@ -228,10 +232,10 @@ creation time.
----
# dracut --install 'strace fsck.ext3 ssh' initramfs-dbg.img
# dracut --install 'strace fsck.ext4 ssh' initramfs-dbg.img
----
This will create an initramfs with the strace, fsck.ext3 and ssh executables,
This will create an initramfs with the strace, fsck.ext4 and ssh executables,
together with the libraries needed to start those. The --install option can be
specified multiple times.
@@ -279,10 +283,7 @@ This will reduce the size of the initramfs image significantly.
== Troubleshooting
If the boot process does not succeed, you have several options to debug the
situation. Some of the basic operations are covered here. For more information
you should also visit:
https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
situation.
[[identifying-your-problem-area]]
=== Identifying your problem area
@@ -467,7 +468,7 @@ any logical volumes.
/dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4"
/dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member"
/dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS"
/dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3"
/dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext4"
/dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap"
----
+

View File

@@ -13,12 +13,15 @@ SYNOPSIS
--------
*lsinitrd* ['OPTION...'] [<image> [<filename> [<filename> [...] ]]]
*lsinitrd* ['OPTION...'] -k <kernel-version>
*lsinitrd* ['OPTION...'] -k <kernel version>
DESCRIPTION
-----------
lsinitrd shows the contents of an initramfs image. if <image> is omitted, then
lsinitrd uses the default image _/boot/<machine-id>/<kernel-version>/initrd_ or
lsinitrd uses the default image _/efi/<machine-id>/<kernel-version>/initrd_,
_/boot/<machine-id>/<kernel-version>/initrd_,
_/boot/efi/<machine-id>/<kernel-version>/initrd_,
_/lib/modules/<kernel-version>/initrd_ or
_/boot/initramfs-<kernel-version>.img_.
OPTIONS
@@ -53,7 +56,7 @@ OPTIONS
AVAILABILITY
------------
The lsinitrd command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
link:$$https://github.com/dracutdevs/dracut$$[https://github.com/dracutdevs/dracut]
AUTHORS
-------

View File

@@ -1,225 +0,0 @@
#!/bin/bash --norc
kver=$(uname -r)
boot_dir="/boot"
quiet=0
host_only=0
force=0
error() { echo "$@" >&2; }
usage () {
[[ $1 = '-n' ]] && cmd=echo || cmd=error
$cmd "usage: ${0##*/} [--version] [--help] [-v] [-f] [--preload <module>]"
$cmd " [--image-version] [--with=<module>]"
$cmd " [--nocompress]"
$cmd " <initrd-image> <kernel-version>"
$cmd ""
$cmd " (ex: ${0##*/} /boot/initramfs-$kver.img $kver)"
[[ $1 = '-n' ]] && exit 0
exit 1
}
# Little helper function for reading args from the commandline.
# it automatically handles -a b and -a=b variants, and returns 1 if
# we need to shift $3.
read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
param="$1"
local rematch='^[^=]*=(.*)$' result
if [[ $2 =~ $rematch ]]; then
read "$param" <<< "${BASH_REMATCH[1]}"
else
for ((i=3; $i <= $#; i++)); do
# Only read next arg if it not an arg itself.
if [[ ${*:$i:1} = -* ]];then
break
fi
result="$result ${@:$i:1}"
# There is no way to shift our callers args, so
# return "no of args" to indicate they should do it instead.
done
read "$1" <<< "$result"
return $(($i - 3))
fi
}
# Taken over from SUSE mkinitrd
default_kernel_images() {
local regex kernel_image kernel_version version_version initrd_image
local qf='%{NAME}-%{VERSION}-%{RELEASE}\n'
case "${DRACUT_ARCH:-$(uname -m)}" in
s390|s390x)
regex='image'
;;
ppc*)
regex='vmlinux'
;;
i?86|x86_64)
regex='vmlinuz'
;;
arm*)
regex='[uz]Image'
;;
aarch64|riscv64)
regex='Image'
;;
*) regex='vmlinu.'
;;
esac
# user mode linux
if grep -q UML /proc/cpuinfo; then
regex='linux'
fi
kernel_images=""
initrd_images=""
for kernel_image in $(ls $boot_dir \
| sed -ne "\|^$regex\(-[0-9.]\+-[0-9]\+-[a-z0-9]\+$\)\?|p" \
| grep -v kdump$ ) ; do
# Note that we cannot check the RPM database here -- this
# script is itself called from within the binary kernel
# packages, and rpm does not allow recursive calls.
[ -L "$boot_dir/$kernel_image" ] && continue
[ "${kernel_image%%.gz}" != "$kernel_image" ] && continue
kernel_version=$(/usr/bin/get_kernel_version \
$boot_dir/$kernel_image 2> /dev/null)
initrd_image=$(echo $kernel_image | sed -e "s|${regex}|initrd|")
if [ "$kernel_image" != "$initrd_image" -a \
-n "$kernel_version" -a \
-d "/lib/modules/$kernel_version" ]; then
kernel_images="$kernel_images $boot_dir/$kernel_image"
initrd_images="$initrd_images $boot_dir/$initrd_image"
fi
done
for kernel_image in $kernel_images;do
kernels="$kernels ${kernel_image#*-}"
done
for initrd_image in $initrd_images;do
targets="$targets $initrd_image"
done
host_only=1
force=1
}
while (($# > 0)); do
case ${1%%=*} in
--with-usb) read_arg usbmodule "$@" || shift $?
basicmodules="$basicmodules ${usbmodule:-usb-storage}"
unset usbmodule;;
--with-avail) read_arg modname "$@" || shift $?
basicmodules="$basicmodules $modname";;
--with) read_arg modname "$@" || shift $?
basicmodules="$basicmodules $modname";;
--version)
echo "mkinitrd: dracut compatibility wrapper"
exit 0;;
-v|--verbose) dracut_args="${dracut_args} -v";;
-f|--force) force=1;;
--preload) read_arg modname "$@" || shift $?
basicmodules="$basicmodules $modname";;
--image-version) img_vers=yes;;
--rootfs|-d) read_arg rootfs "$@" || shift $?
dracut_args="${dracut_args} --filesystems $rootfs";;
--nocompress) dracut_args="$dracut_args --no-compress";;
--help) usage -n;;
--builtin) ;;
--without*) ;;
--without-usb) ;;
--fstab*) ;;
--ifneeded) ;;
--omit-scsi-modules) ;;
--omit-ide-modules) ;;
--omit-raid-modules) ;;
--omit-lvm-modules) ;;
--omit-dmraid) ;;
--allow-missing) ;;
--net-dev*) ;;
--noresume) ;;
--rootdev*) ;;
--thawdev*) ;;
--rootopts*) ;;
--root*) ;;
--loopdev*) ;;
--loopfs*) ;;
--loopopts*) ;;
--looppath*) ;;
--dsdt*) ;;
-s) ;;
--quiet|-q) quiet=1;;
-b) read_arg boot_dir "$@" || shift $?
if [ ! -d $boot_dir ];then
error "Boot directory $boot_dir does not exist"
exit 1
fi
;;
-k) # Would be nice to get a list of images here
read_arg kernel_images "$@" || shift $?
for kernel_image in $kernel_images;do
kernels="$kernels ${kernel_image#*-}"
done
host_only=1
force=1
;;
-i) read_arg initrd_images "$@" || shift $?
for initrd_image in $initrd_images;do
targets="$targets $boot_dir/$initrd_image"
done
;;
*) if [[ ! $targets ]]; then
targets=$1
elif [[ ! $kernels ]]; then
kernels=$1
else
usage
fi;;
esac
shift
done
[[ $targets && $kernels ]] || default_kernel_images
[[ $targets && $kernels ]] || (error "No kernel found in $boot_dir" && usage)
# We can have several targets/kernels, transform the list to an array
targets=( $targets )
[[ $kernels ]] && kernels=( $kernels )
[[ $host_only == 1 ]] && dracut_args="${dracut_args} -H"
[[ $force == 1 ]] && dracut_args="${dracut_args} -f"
echo "Creating: target|kernel|dracut args|basicmodules "
for ((i=0 ; $i<${#targets[@]} ; i++)); do
if [[ $img_vers ]];then
target="${targets[$i]}-${kernels[$i]}"
else
target="${targets[$i]}"
fi
kernel="${kernels[$i]}"
# Duplicate code: No way found how to redirect output based on $quiet
if [[ $quiet == 1 ]];then
echo "$target|$kernel|$dracut_args|$basicmodules"
if [[ $basicmodules ]]; then
dracut $dracut_args --add-drivers "$basicmodules" "$target" \
"$kernel" &>/dev/null
else
dracut $dracut_args "$target" "$kernel" &>/dev/null
fi
else
if [[ $basicmodules ]]; then
dracut $dracut_args --add-drivers "$basicmodules" "$target" \
"$kernel"
else
dracut $dracut_args "$target" "$kernel"
fi
fi
done

View File

@@ -1,106 +0,0 @@
MKINITRD(8)
===========
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
mkinitrd-suse - is a compat wrapper, which calls dracut to generate an initramfs
SYNOPSIS
--------
*mkinitrd* ['OPTION...']
DESCRIPTION
-----------
*mkinitrd* creates an initramfs image <initrd-image> for the kernel with
version <kernel-version> by calling *dracut*.
[IMPORTANT]
This version of mkinitrd is provided for compatibility with older
versions of mkinitrd. If a more fine grained control over the
resulting image is needed, *dracut* should be called directly.
OPTIONS
-------
**-R, --version**::
print info about the version
**-k** _<kernel_list>_::
List of kernel images for which initrd files are created (relative
to _boot_dir_), Image name should begin with the following string,
defaults to _vmlinux_ on ppc/ppc64, _image_ on s390/s390x and _vmlinuz_
for everything else.
**-i** _<initrd_list>_::
List of file names (relative to _boot_dir_) for the initrd; positions
have to match the _kernel_list_. Defaults to _initrd_.
**-m** _<module_list>_::
Modules to include in initrd, defaults to _INITRD_MODULES_ variable
in */etc/sysconfig/kernel*.
**-f** _<feature_list>_::
Features to be enabled for the initrd. In general mkinitrd
configures the initrd for the root device it is started from. With
this option additional feature can be enabled.
**-b** _<bootdir>_::
Boot directory, defaults to */boot*, where the initrd is created.
**-d** _<root_device>_::
Root device, defaults to the device from which the root_dir is
mounted; overwrites the rootdev environment variable if set
**-s** _<size>_::
Add splash animation and bootscreen to initrd.
**-D** _<interface>::
Run dhcp on the specified interface (for example "eth0").
**-I** _<interface>::
Configure the specified interface statically.
**-a** _<acpi_dsdt>::
Attach compiled ACPI DSDT (Differentiated System Description Table)
to initrd. This replaces the DSDT of the BIOS. Defaults to the
_ACPI_DSDT_ variable in */etc/sysconfig/kernel*.
**-M** _<map>::
System.map file to use.
**-B**::
Dont run the *update-bootloader(8)* script after the initrd(s) have
been created. This is useful if you call mkinitrd(8) for anything
else than the running system.
**-A**::
Create a so called "monster initrd" which includes all available
features and modules. This calls dracut with --no-hostonly and
--no-hostonly-cmdline parameters internally, instead of the default
--hostonly and --hostonly-cmdline.
**-v, --verbose**::
increase verbosity level
**-L**::
Disable logging to _/var/log/YaST2/mkinitrd.log_. This is useful for
testing if you dont want to clutter the system log.
**--help**::
print a help message and exit.
AVAILABILITY
------------
The mkinitrd command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
AUTHORS
-------
Harald Hoyer, Hannes Reinecke
SEE ALSO
--------
*dracut*(8)
*update-bootloader*(8)

View File

@@ -1,379 +0,0 @@
#!/bin/bash --norc
#
# mkinitrd compatibility wrapper for SUSE.
#
# Copyright (c) 2013 SUSE Linux Products GmbH. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
boot_dir="/boot"
quiet=0
logfile=/var/log/YaST2/mkinitrd.log
dracut_cmd=dracut
error() { echo "$@" >&2; }
usage () {
[[ $1 = '-n' ]] && cmd=echo || cmd=error
$cmd "usage: ${0##*/} [options]"
$cmd ""
$cmd " Create initial ramdisk images that contain all kernel modules needed"
$cmd " in the early boot process, before the root file system becomes"
$cmd " available."
$cmd " This usually includes SCSI and/or RAID modules, a file system module"
$cmd " for the root file system, or a network interface driver module for dhcp."
$cmd ""
$cmd " options:"
$cmd " -f \"feature list\" Features to be enabled when generating initrd."
$cmd " Available features are:"
$cmd " iscsi, md, multipath, lvm, lvm2,"
$cmd " ifup, fcoe, dcbd"
$cmd " -k \"kernel list\" List of kernel images for which initrd files are"
$cmd " created. Defaults to all kernels found in /boot."
$cmd " -i \"initrd list\" List of file names for the initrd; position have"
$cmd " match to \"kernel list\". Defaults to all kernels"
$cmd " found in /boot."
$cmd " -b boot_dir Boot directory. Defaults to /boot."
$cmd " -t tmp_dir Temporary directory. Defaults to /var/tmp."
$cmd " -M map System.map file to use."
$cmd " -A Create a so called \"monster initrd\" which"
$cmd " includes all features and modules possible."
$cmd " -B Do not update bootloader configuration."
$cmd " -v Verbose mode."
$cmd " -L Disable logging."
$cmd " -h This help screen."
$cmd " -m \"module list\" Modules to include in initrd. Defaults to the"
$cmd " INITRD_MODULES variable in /etc/sysconfig/kernel"
$cmd " -u \"DomU module list\" Modules to include in initrd. Defaults to the"
$cmd " DOMU_INITRD_MODULES variable in"
$cmd " /etc/sysconfig/kernel."
$cmd " -d root_device Root device. Defaults to the device from"
$cmd " which / is mounted. Overrides the rootdev"
$cmd " environment variable if set."
$cmd " -j device Journal device"
$cmd " -D interface Run dhcp on the specified interface."
$cmd " -I interface Configure the specified interface statically."
$cmd " -a acpi_dsdt Obsolete, do not use."
$cmd " -s size Add splash animation and bootscreen to initrd."
[[ $1 = '-n' ]] && exit 0
exit 1
}
# Little helper function for reading args from the commandline.
# it automatically handles -a b and -a=b variants, and returns 1 if
# we need to shift $3.
read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
param="$1"
local rematch='^[^=]*=(.*)$' result
if [[ $2 =~ $rematch ]]; then
read "$param" <<< "${BASH_REMATCH[1]}"
else
for ((i=3; $i <= $#; i++)); do
# Only read next arg if it not an arg itself.
if [[ ${*:$i:1} = -* ]];then
break
fi
result="$result ${@:$i:1}"
# There is no way to shift our callers args, so
# return "no of args" to indicate they should do it instead.
done
read "$1" <<< "$result"
return $(($i - 3))
fi
}
# Helper functions to calculate ipconfig command line
calc_netmask() {
local prefix=$1
[ -z "$prefix" ] && return
mask=$(( 0xffffffff << (32 - $prefix) ))
byte1=$(( mask >> 24 ))
byte2=$(( mask >> 16 ))
byte3=$(( mask >> 8 ))
byte4=$(( mask & 0xff ))
netmask=$(printf "%d.%d.%d.%d" $(( byte1 & 0xff )) $(( byte2 & 0xff )) $(( byte3 & 0xff )) $byte4);
echo $netmask
}
ipconfig() {
local interface=$1
local iplink macaddr broadcast gateway ipaddr prefix netmask
iplink=$(ip addr show dev $interface | sed -n 's/ *inet \(.*\) brd.*/\1/p')
macaddr=$(ip addr show dev $interface | sed -n 's/.*ether \(.*\) brd.*/\1/p')
broadcast=$(ip addr show dev $interface | sed -n 's/.*brd \(.*\) scope.*/\1/p')
gateway=$(ip route show dev $interface | sed -n 's/default via \([0-9\.]*\).*/\1/p')
ipaddr=${iplink%%/*}
prefix=${iplink##*/}
netmask=$(calc_netmask $prefix)
echo "${ipaddr}:${serveraddr}:${gateway}:${netmask}:${hostname}:${interface}:none::${macaddr}"
}
is_xen_kernel() {
local kversion=$1
local root_dir=$2
local cfg
for cfg in ${root_dir}/boot/config-$kversion $root_dir/lib/modules/$kversion/build/.config
do
test -r $cfg || continue
grep -q "^CONFIG_XEN=y\$" $cfg
return
done
test $kversion != "${kversion%-xen*}"
return
}
kernel_version_from_image() {
local dir="${1%/*}/"
[[ "$dir" != "$1" ]] || dir=""
local kernel_image="$1" kernel_image_gz="${dir}vmlinux-${1#*-}.gz"
echo kernel_image_gz="'$kernel_image_gz'" >&2
if get_kernel_version "$kernel_image" 2>/dev/null; then
return
fi
# As a last resort, try vmlinux-$version.gz, which might be around
get_kernel_version "$kernel_image_gz" 2>/dev/null
}
# Taken over from SUSE mkinitrd
default_kernel_images() {
local regex kernel_image kernel_version version_version initrd_image
local qf='%{NAME}-%{VERSION}-%{RELEASE}\n'
case "${DRACUT_ARCH:-$(uname -m)}" in
s390|s390x)
regex='image'
;;
ppc|ppc64)
regex='vmlinux'
;;
i?86|x86_64)
regex='vmlinuz'
;;
arm*)
regex='[uz]Image'
;;
aarch64|riscv64)
regex='Image'
;;
*) regex='vmlinu.'
;;
esac
kernel_images=""
initrd_images=""
for kernel_image in $(ls $boot_dir \
| sed -ne "\|^$regex\(-[0-9.]\+-[0-9]\+-[a-z0-9]\+$\)\?|p" \
| grep -v kdump$ ) ; do
# Note that we cannot check the RPM database here -- this
# script is itself called from within the binary kernel
# packages, and rpm does not allow recursive calls.
[ -L "$boot_dir/$kernel_image" ] && continue
[ "${kernel_image%%.gz}" != "$kernel_image" ] && continue
kernel_version=$(kernel_version_from_image \
$boot_dir/$kernel_image 2> /dev/null)
initrd_image=$(echo $kernel_image | sed -e "s|${regex}|initrd|")
if [ "$kernel_image" != "$initrd_image" -a \
-n "$kernel_version" -a \
-d "/lib/modules/$kernel_version" ]; then
kernel_images="$kernel_images $boot_dir/$kernel_image"
initrd_images="$initrd_images $boot_dir/$initrd_image"
fi
done
for kernel_image in $kernel_images;do
kernels="$kernels ${kernel_image#*-}"
done
for initrd_image in $initrd_images;do
targets="$targets $initrd_image"
done
}
while (($# > 0)); do
case ${1%%=*} in
-f) read_arg feature_list "$@" || shift $?
# Could be several features
;;
-k) # Would be nice to get a list of images here
read_arg kernel_images "$@" || shift $?
for kernel_image in $kernel_images;do
[ -L "/boot/$kernel_image" ] && kernel_image="$(readlink "/boot/$kernel_image")"
kernels="$kernels ${kernel_image#*-}"
done
;;
-i) read_arg initrd_images "$@" || shift $?
for initrd_image in $initrd_images;do
[ -L "/boot/$initrd_image" ] && initrd_image="$(readlink "/boot/$initrd_image")"
# Check if the initrd_image contains a path.
# if not, then add the default boot_dir
dname=`dirname $initrd_image`
if [ "$dname" == "." ]; then
targets="$targets $boot_dir/$initrd_image";
else
targets="$targets $initrd_image";
fi
done
;;
-b) read_arg boot_dir "$@" || shift $?
if [ ! -d $boot_dir ];then
error "Boot directory $boot_dir does not exist"
exit 1
fi
;;
-t) read_arg tmp_dir "$@" || shift $?
dracut_args="${dracut_args} --tmpdir $tmp_dir"
;;
-M) read_arg map_file "$@" || shift $?
;;
-A) dracut_args="${dracut_args} --no-host-only";;
-B) skip_update_bootloader=1;;
-v|--verbose) dracut_args="${dracut_args} -v";;
-L) logfile=;;
-h|--help) usage -n;;
-m) read_arg module_list "$@" || shift $? ;;
-u) read_arg domu_module_list "$@" || shift $?
echo "mkinitrd: DomU modules not yet supported" ;;
-d) read_arg rootfs "$@" || shift $?
dracut_args="${dracut_args} --filesystems $rootfs" ;;
-D) read_arg dhcp_if "$@" || shift $?
dracut_cmdline="${dracut_cmdline} ip=${dhcp_if}:dhcp"
;;
-I) read_arg static_if "$@" || shift $?
dracut_cmdline="${dracut_cmdline} ip=$(ipconfig $static_if)":
;;
-a) read_arg acpi_dsdt "$@" || shift $?
echo "Obsolete -a param, use acpi_table_dir= and acpi_override= variables in /etc/dracut.conf.d/"
exit 1
;;
-s) read_arg boot_splash "$@" || shift $?
echo "mkinitrd: boot splash not yet supported"
exit 1
;;
-V) echo "mkinitrd: vendor scipts are no longer supported"
exit 1;;
--dracut)
read_arg dracut_cmd "$@" || shift $? ;;
--version|-R)
echo "mkinitrd: dracut compatibility wrapper"
exit 0;;
--quiet|-q) quiet=1;;
*) if [[ ! $targets ]]; then
targets=$1
elif [[ ! $kernels ]]; then
kernels=$1
else
usage
fi;;
esac
shift
done
[[ $targets && $kernels ]] || default_kernel_images
if [[ ! $targets || ! $kernels ]];then
error "No kernel found in $boot_dir or bad modules dir in /lib/modules"
exit 1
fi
# We can have several targets/kernels, transform the list to an array
targets=( $targets )
[[ $kernels ]] && kernels=( $kernels )
[[ $logfile ]] && dracut_args="${dracut_args} --logfile $logfile"
dracut_args="${dracut_args} --force"
[[ $dracut_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}"
[ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1
# Update defaults from /etc/sysconfig/kernel
if [ -f /etc/sysconfig/kernel ] ; then
. /etc/sysconfig/kernel
fi
[[ $module_list ]] || module_list="${INITRD_MODULES}"
[[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}"
shopt -s extglob
failed=""
for ((i=0 ; $i<${#targets[@]} ; i++)); do
if [[ $img_vers ]];then
target="${targets[$i]}-${kernels[$i]}"
else
target="${targets[$i]}"
fi
kernel="${kernels[$i]}"
if is_xen_kernel $kernel $rootfs ; then
modules_all="${module_list} ${domu_module_list}"
else
modules_all="${module_list}"
fi
# Remove leading and trailing spaces needs (set above): shopt -s extglob
modules_all=${modules_all%%+([[:space:]])}
modules_all=${modules_all##+([[:space:]])}
echo "Creating initrd: $target"
# Duplicate code: No way found how to redirect output based on $quiet
if [[ $quiet == 1 ]];then
# Duplicate code: --force-drivers must not be called with empty string
# -> dracut bug workarounded ugly, because of complex whitespace
# expansion magics
if [ -n "${modules_all}" ];then
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" &>/dev/null
[ $? -ne 0 ] && failed="$failed $target"
else
$dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
[ $? -ne 0 ] && failed="$failed $target"
fi
else
if [ -n "${modules_all}" ];then
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel"
[ $? -ne 0 ] && failed="$failed $target"
else
$dracut_cmd $dracut_args "$target" "$kernel"
[ $? -ne 0 ] && failed="$failed $target"
fi
fi
done
if [ "$skip_update_bootloader" ] ; then
echo 2>&1 "Did not refresh the bootloader. You might need to refresh it manually."
else
update-bootloader --refresh
[ $? -ne 0 ] && echo "Updating bootloader failed" && exit 1
fi
if [ "$failed" != "" ]; then
echo "Generating $failed targets failed"
exit 1
fi
exit 0

View File

@@ -1,66 +0,0 @@
MKINITRD(8)
=========
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}
NAME
----
mkinitrd - is a compat wrapper, which calls dracut to generate an initramfs
SYNOPSIS
--------
*mkinitrd* ['OPTION...'] [<initrd-image>] <kernel-version>
DESCRIPTION
-----------
mkinitrd creates an initramfs image <initrd-image> for the kernel with
version <kernel-version> by calling "dracut".
[IMPORTANT]
If a more fine grained control over the resulting image is needed,
"dracut" should be called directly.
OPTIONS
-------
**--version**::
print info about the version
**-v, --verbose**::
increase verbosity level
**-f, --force**::
overwrite existing initramfs file.
**--image-version*::
append the kernel version to the target image
<initrd-image>-<kernel-version>.
**--with=<module>**::
add the kernel module <module> to the initramfs.
**--preload=<module>**::
preload the kernel module <module> in the initramfs before any other kernel
modules are loaded. This can be used to ensure a certain device naming,
which should in theory be avoided and the use of symbolic links in /dev is
encouraged.
**--nocompress**::
do not compress the resulting image.
**--help**::
print a help message and exit.
AVAILABILITY
------------
The mkinitrd command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
AUTHORS
-------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

View File

@@ -1,21 +1,32 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
# called by dracut
# Prerequisite check(s) for module.
check() {
require_binaries /bin/bash
# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries bash || return 1
# Return 255 to only include the module, if another module requires it.
return 255
}
# called by dracut
# Module dependency requirements.
depends() {
# Return 0 to include the dependent module(s) in the initramfs.
return 0
}
# called by dracut
# Install the required file(s) and directories for the module in the initramfs.
install() {
# If another shell is already installed, do not use bash
[[ -x $initdir/bin/sh ]] && return
# Prefer bash as /bin/sh if it is available.
inst /bin/bash && ln -sf bash "${initdir}/bin/sh"
inst /bin/bash
# Prefer bash as default shell if no other shell is preferred.
[[ -L $initdir/bin/sh ]] || ln -sf bash "${initdir}/bin/sh"
}

View File

@@ -1,21 +1,32 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
# called by dracut
# Prerequisite check(s) for module.
check() {
require_binaries /bin/dash
# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries dash || return 1
# Return 255 to only include the module, if another module requires it.
return 255
}
# called by dracut
# Module dependency requirements.
depends() {
# Return 0 to include the dependent module(s) in the initramfs.
return 0
}
# called by dracut
# Install the required file(s) and directories for the module in the initramfs.
install() {
# If another shell is already installed, do not use dash
[[ -x $initdir/bin/sh ]] && return
# Prefer dash as /bin/sh if it is available.
inst /bin/dash && ln -sf dash "${initdir}/bin/sh"
inst /bin/dash
# Prefer dash as default shell if no other shell is preferred.
[[ -L $initdir/bin/sh ]] || ln -sf dash "${initdir}/bin/sh"
}

View File

@@ -1,21 +1,34 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
# called by dracut
# Prerequisite check(s) for module.
check() {
require_binaries /bin/mksh
# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries mksh || return 1
require_binaries printf || return 1
# Return 255 to only include the module, if another module requires it.
return 255
}
# called by dracut
# Module dependency requirements.
depends() {
# Return 0 to include the dependent module(s) in the initramfs.
return 0
}
# called by dracut
# Install the required file(s) and directories for the module in the initramfs.
install() {
# If another shell is already installed, do not use mksh
[[ -x $initdir/bin/sh ]] && return
# Prefer mksh as /bin/sh if it is available.
inst /bin/mksh && ln -sf mksh "${initdir}/bin/sh"
inst /bin/mksh
inst printf
# Prefer mksh as default shell if no other shell is preferred.
[[ -L $initdir/bin/sh ]] || ln -sf mksh "${initdir}/bin/sh"
}

View File

@@ -0,0 +1,21 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
# Prerequisite check(s) for module.
check() {
# Return 255 to only include the module, if another module requires it.
return 255
}
# Module dependency requirements.
depends() {
# This module has external dependency on other module(s).
echo systemd systemd-hostnamed systemd-networkd systemd-resolved systemd-timedated systemd-timesyncd
# Return 0 to include the dependent module(s) in the initramfs.
return 0
}

View File

@@ -1,26 +1,14 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
getSystemdVersion() {
[ -z "$SYSTEMD_VERSION" ] && SYSTEMD_VERSION=$("$systemdutildir"/systemd --version | { read -r _ b _; echo "$b"; })
# Check if the systemd version is a valid number
if ! [[ $SYSTEMD_VERSION =~ ^[0-9]+$ ]]; then
dfatal "systemd version is not a number ($SYSTEMD_VERSION)"
exit 1
fi
echo "$SYSTEMD_VERSION"
}
# called by dracut
# Prerequisite check(s) for module.
check() {
[[ $mount_needs ]] && return 1
if require_binaries "$systemdutildir"/systemd; then
SYSTEMD_VERSION=$(getSystemdVersion)
(( SYSTEMD_VERSION >= 198 )) && return 0
return 255
fi
return 1
# If the binary(s) requirements are not fulfilled the module can't be installed
require_binaries "$systemdutildir"/systemd || return 1
# Return 255 to only include the module, if another module requires it.
return 255
}
# called by dracut
@@ -37,17 +25,11 @@ installkernel() {
install() {
local _mods
if [[ "$prefix" == /run/* ]]; then
dfatal "systemd does not work with a prefix, which contains \"/run\"!!"
if [[ $prefix == /run/* ]]; then
dfatal 'systemd does not work with a prefix, which contains "/run"!!'
exit 1
fi
if [[ $(getSystemdVersion) -ge 240 ]]; then
inst_multiple -o \
"$systemdutildir"/system-generators/systemd-debug-generator \
"$systemdsystemunitdir"/debug-shell.service
fi
inst_multiple -o \
"$systemdutildir"/systemd \
"$systemdutildir"/systemd-coredump \
@@ -61,9 +43,11 @@ install() {
"$systemdutildir"/systemd-modules-load \
"$systemdutildir"/systemd-vconsole-setup \
"$systemdutildir"/systemd-volatile-root \
"$systemdutildir"/systemd-sysroot-fstab-check \
"$systemdutildir"/system-generators/systemd-debug-generator \
"$systemdutildir"/system-generators/systemd-fstab-generator \
"$systemdutildir"/system-generators/systemd-gpt-auto-generator \
\
"$systemdsystemunitdir"/debug-shell.service \
"$systemdsystemunitdir"/cryptsetup.target \
"$systemdsystemunitdir"/cryptsetup-pre.target \
"$systemdsystemunitdir"/remote-cryptsetup.target \
@@ -94,9 +78,8 @@ install() {
"$systemdsystemunitdir"/timers.target \
"$systemdsystemunitdir"/paths.target \
"$systemdsystemunitdir"/umount.target \
\
"$systemdsystemunitdir"/sys-kernel-config.mount \
\
"$systemdsystemunitdir"/modprobe@.service \
"$systemdsystemunitdir"/kmod-static-nodes.service \
"$systemdsystemunitdir"/systemd-tmpfiles-setup.service \
"$systemdsystemunitdir"/systemd-tmpfiles-setup-dev.service \
@@ -120,10 +103,7 @@ install() {
"$systemdsystemunitdir"/systemd-journald.service \
"$systemdsystemunitdir"/systemd-vconsole-setup.service \
"$systemdsystemunitdir"/systemd-volatile-root.service \
"$systemdsystemunitdir"/systemd-random-seed-load.service \
"$systemdsystemunitdir"/systemd-random-seed.service \
"$systemdsystemunitdir"/systemd-sysctl.service \
\
"$systemdsystemunitdir"/sysinit.target.wants/systemd-modules-load.service \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-ask-password-console.path \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-journald.service \
@@ -138,18 +118,14 @@ install() {
"$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup.service \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup-dev.service \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-sysctl.service \
\
"$systemdsystemunitdir"/ctrl-alt-del.target \
"$systemdsystemunitdir"/reboot.target \
"$systemdsystemunitdir"/systemd-reboot.service \
"$systemdsystemunitdir"/syslog.socket \
\
"$systemdsystemunitdir"/slices.target \
"$systemdsystemunitdir"/system.slice \
"$systemdsystemunitdir"/-.slice \
\
"$tmpfilesdir"/systemd.conf \
\
journalctl systemctl \
echo swapoff \
kmod insmod rmmod modprobe modinfo depmod lsmod \
@@ -157,8 +133,7 @@ install() {
systemd-run systemd-escape \
systemd-cgls systemd-tmpfiles \
systemd-ask-password systemd-tty-ask-password-agent \
/etc/udev/udev.hwdb \
${NULL}
/etc/udev/udev.hwdb
inst_multiple -o \
/usr/lib/modules-load.d/*.conf \
@@ -170,18 +145,19 @@ install() {
[[ -f $i ]] || continue
while read -r _line || [ -n "$_line" ]; do
case $_line in
\#*)
;;
\;*)
;;
\#*) ;;
\;*) ;;
*)
echo "$_line"
;;
esac
done < "$i"
done
}
mapfile -t _mods <<< $(modules_load_get /usr/lib/modules-load.d)
mapfile -t _mods < <(modules_load_get /usr/lib/modules-load.d)
[[ ${#_mods[@]} -gt 0 ]] && hostonly='' instmods "${_mods[@]}"
if [[ $hostonly ]]; then
@@ -190,7 +166,11 @@ install() {
/etc/systemd/journald.conf.d/*.conf \
/etc/systemd/system.conf \
/etc/systemd/system.conf.d/*.conf \
"$systemdsystemconfdir"/modprobe@.service \
"$systemdsystemconfdir/modprobe@.service.d/*.conf" \
/etc/hosts \
/etc/hostname \
/etc/nsswitch.conf \
/etc/machine-id \
/etc/machine-info \
/etc/vconsole.conf \
@@ -198,33 +178,53 @@ install() {
/etc/modules-load.d/*.conf \
/etc/sysctl.d/*.conf \
/etc/sysctl.conf \
/etc/udev/udev.conf \
${NULL}
/etc/udev/udev.conf
mapfile -t _mods <<< $(modules_load_get /etc/modules-load.d)
mapfile -t _mods < <(modules_load_get /etc/modules-load.d)
[[ ${#_mods[@]} -gt 0 ]] && hostonly='' instmods "${_mods[@]}"
fi
if ! [[ -e "$initdir/etc/machine-id" ]]; then
: > "$initdir/etc/machine-id"
chmod 444 "$initdir/etc/machine-id"
fi
# install adm user/group for journald
inst_multiple nologin
grep '^systemd-journal:' "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^adm:' "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^systemd-journal:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
grep '^wheel:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
grep '^adm:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
grep '^utmp:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
grep '^root:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
{
grep '^systemd-journal:' "$dracutsysrootdir"/etc/passwd 2> /dev/null
grep '^adm:' "$dracutsysrootdir"/etc/passwd 2> /dev/null
# we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet
grep '^systemd-network:' "$dracutsysrootdir"/etc/passwd 2> /dev/null
} >> "$initdir/etc/passwd"
# we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet
grep '^systemd-network:' "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^systemd-network:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
{
grep '^systemd-journal:' "$dracutsysrootdir"/etc/group 2> /dev/null
grep '^wheel:' "$dracutsysrootdir"/etc/group 2> /dev/null
grep '^adm:' "$dracutsysrootdir"/etc/group 2> /dev/null
grep '^utmp:' "$dracutsysrootdir"/etc/group 2> /dev/null
grep '^root:' "$dracutsysrootdir"/etc/group 2> /dev/null
# we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet
grep '^systemd-network:' "$dracutsysrootdir"/etc/group 2> /dev/null
} >> "$initdir/etc/group"
ln_r "$systemdutildir"/systemd "/init"
ln_r "$systemdutildir"/systemd "/sbin/init"
local _systemdbinary="$systemdutildir"/systemd
if ldd "$_systemdbinary" | grep -qw libasan; then
local _wrapper="$systemdutildir"/systemd-asan-wrapper
cat > "$initdir"/"$_wrapper" << EOF
#!/bin/sh
mount -t proc -o nosuid,nodev,noexec proc /proc
exec $_systemdbinary
EOF
chmod 755 "$initdir"/"$_wrapper"
_systemdbinary="$_wrapper"
unset _wrapper
fi
ln_r "$_systemdbinary" "/init"
ln_r "$_systemdbinary" "/sbin/init"
unset _systemdbinary
inst_binary true
ln_r "$(find_binary true)" "/usr/bin/loginctl"
@@ -234,15 +234,13 @@ install() {
71-seat.rules \
73-seat-late.rules \
90-vconsole.rules \
99-systemd.rules \
${NULL}
99-systemd.rules
for i in \
emergency.target \
rescue.target \
systemd-ask-password-console.service \
systemd-ask-password-plymouth.service \
; do
systemd-ask-password-plymouth.service; do
[[ -f "$systemdsystemunitdir"/$i ]] || continue
$SYSTEMCTL -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service
done
@@ -257,4 +255,10 @@ install() {
} >> "$initdir/etc/systemd/journald.conf"
$SYSTEMCTL -q --root "$initdir" set-default multi-user.target
# Install library file(s)
_arch=${DRACUT_ARCH:-$(uname -m)}
inst_libdir_file \
{"tls/$_arch/",tls/,"$_arch/",}"libnss_*"
}

32
modules.d/00warpclock/module-setup.sh Normal file → Executable file
View File

@@ -1,29 +1,39 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
# called by dracut
# Prerequisite check(s) for module.
check() {
# hwclock does not exist on S390(x), bail out silently then
local _arch=${DRACUT_ARCH:-$(uname -m)}
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] && return 1
[ -e /etc/localtime -a -e /etc/adjtime ] || return 1
require_binaries /sbin/hwclock || return 1
# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries hwclock || return 1
# Return 255 to only include the module, if another module requires it.
return 255
}
# called by dracut
# Module dependency requirements.
depends() {
# Return 0 to include the dependent module(s) in the initramfs.
return 0
}
# called by dracut
# Install the required file(s) and directories for the module in the initramfs.
install() {
inst /usr/share/zoneinfo/UTC
inst /etc/localtime
inst /etc/adjtime
inst_hook pre-trigger 00 "$moddir/warpclock.sh"
inst /sbin/hwclock
inst_multiple -o \
/usr/share/zoneinfo/UTC \
/etc/localtime \
/etc/adjtime \
hwclock
}

15
modules.d/00warpclock/warpclock.sh Normal file → Executable file
View File

@@ -1,9 +1,14 @@
#!/bin/sh
# This file is part of dracut warpclock module.
# SPDX-License-Identifier: GPL-2.0-or-later
if test -e /etc/adjtime ; then
while read line ; do
if test "$line" = LOCAL ; then
hwclock --systz
fi
# Set the kernel's timezone and reset the system time
# if adjtime is set to LOCAL.
if test -e /etc/adjtime; then
while read -r line; do
if test "$line" = LOCAL; then
hwclock --systz
fi
done < /etc/adjtime
fi

View File

@@ -1,12 +1,16 @@
#!/bin/sh
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
rm -f -- /etc/modprobe.d/fips.conf > /dev/null 2>&1
elif [ -z "$fipsmode" ]; then
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
elif getarg boot= >/dev/null; then
elif getarg boot= > /dev/null; then
. /sbin/fips.sh
fips_info "fips-boot: start"
if mount_boot; then
do_fips || die "FIPS integrity test failed"
fi
fips_info "fips-boot: done!"
fi

10
modules.d/01fips/fips-load-crypto.sh Normal file → Executable file
View File

@@ -1,8 +1,14 @@
#!/bin/sh
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf > /dev/null 2>&1
elif [ -z "$fipsmode" ]; then
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
else
. /sbin/fips.sh
fips_info "fips-load-crypto: start"
fips_load_crypto || die "FIPS integrity test failed"
fips_info "fips-load-crypto: done!"
fi

View File

@@ -1,11 +1,15 @@
#!/bin/sh
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
rm -f -- /etc/modprobe.d/fips.conf > /dev/null 2>&1
elif [ -z "$fipsmode" ]; then
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
elif ! [ -f /tmp/fipsdone ]; then
. /sbin/fips.sh
fips_info "fips-noboot: start"
mount_boot
do_fips || die "FIPS integrity test failed"
fips_info "fips-noboot: done!"
fi

View File

@@ -1,5 +1,7 @@
#!/bin/sh
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
# systemd lets stdout go to journal only, but the system
# has to halt when the integrity check fails to satisfy FIPS.
if [ -z "$DRACUT_SYSTEMD" ]; then
@@ -12,67 +14,65 @@ else
}
fi
mount_boot()
{
mount_boot() {
boot=$(getarg boot=)
if [ -n "$boot" ]; then
if [ -d /boot ] && ismounted /boot; then
boot_dev=
if command -v findmnt > /dev/null; then
boot_dev=$(findmnt -n -o SOURCE /boot)
fi
fips_info "Ignoring 'boot=$boot' as /boot is already mounted ${boot_dev:+"from '$boot_dev'"}"
return 0
fi
case "$boot" in
LABEL=*)
boot="$(echo $boot | sed 's,/,\\x2f,g')"
boot="/dev/disk/by-label/${boot#LABEL=}"
;;
UUID=*)
boot="/dev/disk/by-uuid/${boot#UUID=}"
;;
PARTUUID=*)
boot="/dev/disk/by-partuuid/${boot#PARTUUID=}"
;;
PARTLABEL=*)
boot="/dev/disk/by-partlabel/${boot#PARTLABEL=}"
;;
/dev/*)
;;
*)
die "You have to specify boot=<boot device> as a boot option for fips=1" ;;
LABEL=* | UUID=* | PARTUUID=* | PARTLABEL=*)
boot="$(label_uuid_to_dev "$boot")"
;;
/dev/*) ;;
*)
die "You have to specify boot=<boot device> as a boot option for fips=1"
;;
esac
if ! [ -e "$boot" ]; then
udevadm trigger --action=add >/dev/null 2>&1
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
udevadm trigger --action=add > /dev/null 2>&1
i=0
while ! [ -e $boot ]; do
if [ $UDEVVERSION -ge 143 ]; then
udevadm settle --exit-if-exists=$boot
else
udevadm settle --timeout=30
fi
[ -e $boot ] && break
while ! [ -e "$boot" ]; do
udevadm settle --exit-if-exists="$boot"
[ -e "$boot" ] && break
sleep 0.5
i=$(($i+1))
i=$((i + 1))
[ $i -gt 40 ] && break
done
fi
[ -e "$boot" ] || return 1
mkdir /boot
mkdir -p /boot
fips_info "Mounting $boot as /boot"
mount -oro "$boot" /boot || return 1
elif [ -d "$NEWROOT/boot" ]; then
FIPS_MOUNTED_BOOT=1
elif ! ismounted /boot && [ -d "$NEWROOT/boot" ]; then
# shellcheck disable=SC2114
rm -fr -- /boot
ln -sf "$NEWROOT/boot" /boot
else
die "You have to specify boot=<boot device> as a boot option for fips=1"
fi
}
do_rhevh_check()
{
do_rhevh_check() {
KERNEL=$(uname -r)
kpath=${1}
# If we're on RHEV-H, the kernel is in /run/initramfs/live/vmlinuz0
HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b || [ -n "$a" ]; do printf "%s\n" $a; done)
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b || [ -n "$a" ]; do printf "%s\n" $a; done || return 1)
HMAC_SUM_ORIG=$(while read -r a _ || [ -n "$a" ]; do printf "%s\n" "$a"; done < "$NEWROOT/boot/.vmlinuz-${KERNEL}.hmac")
HMAC_SUM_CALC=$(sha512hmac "$kpath" | while read -r a _ || [ -n "$a" ]; do printf "%s\n" "$a"; done || return 1)
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
warn "HMAC sum mismatch"
return 1
@@ -81,31 +81,34 @@ do_rhevh_check()
return 0
}
nonfatal_modprobe()
{
modprobe $1 2>&1 > /dev/stdout |
while read -r line || [ -n "$line" ]; do
nonfatal_modprobe() {
modprobe "$1" 2>&1 > /dev/stdout \
| while read -r line || [ -n "$line" ]; do
echo "${line#modprobe: FATAL: }" >&2
done
}
fips_load_crypto()
{
FIPSMODULES=$(cat /etc/fipsmodules)
fips_load_crypto() {
local _k
local _v
local _module
local _found
read -d '' -r FIPSMODULES < /etc/fipsmodules
fips_info "Loading and integrity checking all crypto modules"
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
for _module in $FIPSMODULES; do
if [ "$_module" != "tcrypt" ]; then
if ! nonfatal_modprobe "${_module}" 2>/tmp/fips.modprobe_err; then
if ! nonfatal_modprobe "${_module}" 2> /tmp/fips.modprobe_err; then
# check if kernel provides generic algo
_found=0
while read _k _s _v || [ -n "$_k" ]; do
while read -r _k _ _v || [ -n "$_k" ]; do
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
[ "$_v" != "$_module" ] && continue
_found=1
break
done </proc/crypto
done < /proc/crypto
[ "$_found" = "0" ] && cat /tmp/fips.modprobe_err >&2 && return 1
fi
fi
@@ -117,59 +120,76 @@ fips_load_crypto()
rmmod tcrypt
}
do_fips()
{
local _v
local _s
local _v
local _module
do_fips() {
KERNEL=$(uname -r)
fips_info "Checking integrity of kernel"
if [ -e "/run/initramfs/live/vmlinuz0" ]; then
do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
elif [ -e "/run/install/repo/images/pxeboot/vmlinuz" ]; then
# This is a boot.iso with the .hmac inside the install.img
do_rhevh_check /run/install/repo/images/pxeboot/vmlinuz || return 1
else
BOOT_IMAGE="$(getarg BOOT_IMAGE)"
if ! getarg rd.fips.skipkernel > /dev/null; then
# Trim off any leading GRUB boot device (e.g. ($root) )
BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')"
fips_info "Checking integrity of kernel"
if [ -e "/run/initramfs/live/vmlinuz0" ]; then
do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
elif [ -e "/run/install/repo/images/pxeboot/vmlinuz" ]; then
# This is a boot.iso with the .hmac inside the install.img
do_rhevh_check /run/install/repo/images/pxeboot/vmlinuz || return 1
else
BOOT_IMAGE="$(getarg BOOT_IMAGE)"
BOOT_IMAGE_NAME="${BOOT_IMAGE##*/}"
BOOT_IMAGE_PATH="${BOOT_IMAGE%${BOOT_IMAGE_NAME}}"
if [ -z "$BOOT_IMAGE_NAME" ]; then
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
#if /boot is not a separate partition BOOT_IMAGE might start with /boot
BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"}
#on some achitectures BOOT_IMAGE does not contain path to kernel
#so if we can't find anything, let's treat it in the same way as if it was empty
if ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
BOOT_IMAGE_PATH=""
# On s390x, BOOT_IMAGE isn't a path but an integer representing the
# entry number selected. Let's try the root of /boot first, and
# otherwise fallback to trying to parse the BLS entries if it's a
# BLS-based system.
if [ "$(uname -m)" = s390x ]; then
if [ -e "/boot/vmlinuz-${KERNEL}" ]; then
BOOT_IMAGE="vmlinuz-${KERNEL}"
elif [ -d /boot/loader/entries ]; then
bls=$(find /boot/loader/entries -name '*.conf' | sort -rV | sed -n "$((BOOT_IMAGE + 1))p")
if [ -e "${bls}" ]; then
BOOT_IMAGE=$(grep ^linux "${bls}" | cut -d' ' -f2)
fi
fi
fi
fi
BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}/.${BOOT_IMAGE_NAME}.hmac"
if ! [ -e "${BOOT_IMAGE_HMAC}" ]; then
warn "${BOOT_IMAGE_HMAC} does not exist"
return 1
fi
# Trim off any leading GRUB boot device (e.g. ($root) )
BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')"
(cd "${BOOT_IMAGE_HMAC%/*}" && sha512hmac -c "${BOOT_IMAGE_HMAC}") || return 1
BOOT_IMAGE_NAME="${BOOT_IMAGE##*/}"
BOOT_IMAGE_PATH="${BOOT_IMAGE%"${BOOT_IMAGE_NAME}"}"
if [ -z "$BOOT_IMAGE_NAME" ]; then
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
#if /boot is not a separate partition BOOT_IMAGE might start with /boot
BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"}
#on some achitectures BOOT_IMAGE does not contain path to kernel
#so if we can't find anything, let's treat it in the same way as if it was empty
if ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
BOOT_IMAGE_PATH=""
fi
fi
BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}/.${BOOT_IMAGE_NAME}.hmac"
if ! [ -e "${BOOT_IMAGE_HMAC}" ]; then
warn "${BOOT_IMAGE_HMAC} does not exist"
return 1
fi
(cd "${BOOT_IMAGE_HMAC%/*}" && sha512hmac -c "${BOOT_IMAGE_HMAC}") || return 1
fi
fi
fips_info "All initrd crypto checks done"
> /tmp/fipsdone
: > /tmp/fipsdone
umount /boot >/dev/null 2>&1
if [ "$FIPS_MOUNTED_BOOT" = 1 ]; then
fips_info "Unmounting /boot"
umount /boot > /dev/null 2>&1
else
fips_info "Not unmounting /boot"
fi
return 0
}

View File

@@ -14,7 +14,7 @@ depends() {
installkernel() {
local _fipsmodules _mod _bootfstype
if [[ -f "${srcmods}/modules.fips" ]]; then
_fipsmodules="$(cat "${srcmods}/modules.fips")"
read -d '' -r _fipsmodules < "${srcmods}/modules.fips"
else
_fipsmodules=""
@@ -24,7 +24,7 @@ installkernel() {
_fipsmodules+="crc32c crct10dif ghash "
# Ciphers:
_fipsmodules+="cipher_null des3_ede aes cfb "
_fipsmodules+="cipher_null des3_ede aes cfb dh ecdh "
# Modes/templates:
_fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac ofb cts "
@@ -39,20 +39,21 @@ installkernel() {
_fipsmodules+="aead cryptomgr tcrypt crypto_user "
fi
# shellcheck disable=SC2174
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
for _mod in $_fipsmodules; do
if hostonly='' instmods -c -s $_mod; then
echo $_mod >> "${initdir}/etc/fipsmodules"
if hostonly='' instmods -c -s "$_mod"; then
echo "$_mod" >> "${initdir}/etc/fipsmodules"
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
fi
done
# with hostonly_default_device fs module for /boot is not installed by default
if [[ $hostonly ]] && [[ "$hostonly_default_device" == "no" ]]; then
if [[ $hostonly ]] && [[ $hostonly_default_device == "no" ]]; then
_bootfstype=$(find_mp_fstype /boot)
if [[ -n "$_bootfstype" ]]; then
hostonly='' instmods $_bootfstype
if [[ -n $_bootfstype ]]; then
hostonly='' instmods "$_bootfstype"
else
dwarning "Can't determine fs type for /boot, FIPS check may fail."
fi
@@ -61,24 +62,23 @@ installkernel() {
# called by dracut
install() {
local _dir
inst_hook pre-mount 01 "$moddir/fips-boot.sh"
inst_hook pre-pivot 00 "$moddir/fips-boot.sh"
inst_hook pre-pivot 01 "$moddir/fips-noboot.sh"
inst_hook pre-udev 01 "$moddir/fips-load-crypto.sh"
inst_script "$moddir/fips.sh" /sbin/fips.sh
inst_multiple sha512hmac rmmod insmod mount uname umount
inst_multiple sha512hmac rmmod insmod mount uname umount grep sed cut find sort
inst_simple /etc/system-fips
[ -c ${initdir}/dev/random ] || mknod ${initdir}/dev/random c 1 8 \
[ -c "${initdir}"/dev/random ] || mknod "${initdir}"/dev/random c 1 8 \
|| {
dfatal "Cannot create /dev/random"
dfatal "To create an initramfs with fips support, dracut has to run as root"
return 1
}
[ -c ${initdir}/dev/urandom ] || mknod ${initdir}/dev/urandom c 1 9 \
[ -c "${initdir}"/dev/urandom ] || mknod "${initdir}"/dev/urandom c 1 9 \
|| {
dfatal "Cannot create /dev/random"
dfatal "Cannot create /dev/urandom"
dfatal "To create an initramfs with fips support, dracut has to run as root"
return 1
}

View File

@@ -0,0 +1,3 @@
# This file is part of dracut systemd ac power module
SUBSYSTEM=="power_supply", KERNEL=="AC", ATTR{online}=="0", RUN+="/usr/sbin/systemctl start initrd-on-battery-power.target"
SUBSYSTEM=="power_supply", KERNEL=="AC", ATTR{online}=="1", RUN+="/usr/sbin/systemctl start initrd-on-ac-power.target"

View File

@@ -0,0 +1,8 @@
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
[Unit]
Description=Initial RAM Disk On AC Power
ConditionPathExists=/usr/lib/initrd-release
DefaultDependencies=no
StopWhenUnneeded=yes

View File

@@ -0,0 +1,8 @@
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
[Unit]
Description=Initial RAM Disk On Battery Power
ConditionPathExists=/usr/lib/initrd-release
DefaultDependencies=no
StopWhenUnneeded=yes

View File

@@ -0,0 +1,29 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
# Prerequisite check(s) for module.
check() {
# Return 255 to only include the module, if another module requires it.
return 255
}
# Module dependency requirements.
depends() {
# Return 0 to include the dependent module(s) in the initramfs.
return 0
}
# Install the required file(s) and directories for the module in the initramfs.
install() {
inst_rules "$moddir/99-initrd-power-targets.rules"
inst systemd-ac-power
inst_simple "$moddir/initrd-on-ac-power.target" "$systemdsystemunitdir/initrd-on-ac-power.target"
inst_simple "$moddir/initrd-on-battery-power.target" "$systemdsystemunitdir/initrd-on-battery-power.target"
}

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
@@ -6,8 +6,10 @@
check() {
# If the binary(s) requirements are not fulfilled the module can't be installed
require_binaries systemd-ask-password || return 1
require_binaries systemd-tty-ask-password-agent || return 1
require_binaries \
systemd-ask-password \
systemd-tty-ask-password-agent \
|| return 1
# Return 255 to only include the module, if another module requires it.
return 255
@@ -17,9 +19,7 @@ check() {
# Module dependency requirements.
depends() {
# This module has external dependency on the systemd module.
echo systemd
# Return 0 to include the dependent systemd module in the initramfs.
# Return 0 to include the dependent module(s) in the initramfs.
return 0
}
@@ -28,32 +28,33 @@ depends() {
install() {
inst_multiple -o \
$systemdsystemunitdir/systemd-ask-password-console.path \
$systemdsystemunitdir/systemd-ask-password-console.service \
$systemdsystemunitdir/multi-user.target.wants/systemd-ask-password-wall.path \
$systemdsystemunitdir/sysinit.target.wants/systemd-ask-password-console.path \
systemd-ask-password systemd-tty-ask-password-agent
"$systemdsystemunitdir"/systemd-ask-password-console.path \
"$systemdsystemunitdir"/systemd-ask-password-console.service \
"$systemdsystemunitdir"/multi-user.target.wants/systemd-ask-password-wall.path \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-ask-password-console.path \
systemd-ask-password \
systemd-tty-ask-password-agent
# Enable the systemd type service unit for systemd-ask-password.
$SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-console.service
# Enable the systemd type service unit for systemd-ask-password.
$SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-console.service
# Install systemd-ask-password plymouth units if plymouth is enabled.
if dracut_module_included "plymouth"; then
inst_multiple -o \
$systemdsystemunitdir/systemd-ask-password-plymouth.path \
$systemdsystemunitdir/systemd-ask-password-plymouth.service
# Install systemd-ask-password plymouth units if plymouth is enabled.
if dracut_module_included "plymouth"; then
inst_multiple -o \
"$systemdsystemunitdir"/systemd-ask-password-plymouth.path \
"$systemdsystemunitdir"/systemd-ask-password-plymouth.service
$SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-plymouth.service
fi
$SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-plymouth.service
fi
# Uncomment this section if the usecase for wall module in the initramfs arises.
# Install systemd-ask-password wall units if <wall module> is enabled.
#if dracut_module_included "<wall module>"; then
# inst_multiple -o \
# $systemdsystemunitdir/systemd-ask-password-wall.path \
# $systemdsystemunitdir/systemd-ask-password-wall.service \
# $systemdsystemunitdir/multi-user.target.wants/systemd-ask-password-wall.path
#
# $SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-wall.service
#fi
# Uncomment this section if the usecase for wall module in the initramfs arises.
# Install systemd-ask-password wall units if <wall module> is enabled.
#if dracut_module_included "<wall module>"; then
# inst_multiple -o \
# $systemdsystemunitdir/systemd-ask-password-wall.path \
# $systemdsystemunitdir/systemd-ask-password-wall.service \
# $systemdsystemunitdir/multi-user.target.wants/systemd-ask-password-wall.path \
#
# $SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-wall.service
#fi
}

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
@@ -6,8 +6,10 @@
check() {
# If the binary(s) requirements are not fulfilled the module can't be installed
require_binaries coredumpctl || return 1
require_binaries $systemdutildir/systemd-coredump || return 1
require_binaries \
coredumpctl \
"$systemdutildir"/systemd-coredump \
|| return 1
# Return 255 to only include the module, if another module requires it.
return 255
@@ -18,8 +20,8 @@ check() {
depends() {
# This module has external dependency on the systemd module.
echo systemd systemd-journald systemd-sysctl
# Return 0 to include the dependent systemd module in the initramfs.
echo systemd-journald systemd-sysctl systemd-sysusers
# Return 0 to include the dependent module(s) in the initramfs.
return 0
}
@@ -27,26 +29,27 @@ depends() {
# Install the required file(s) and directories for the module in the initramfs.
install() {
inst_dir /var/lib/systemd/coredump
inst_dir /var/lib/systemd/coredump
inst_multiple -o \
$sysctld/50-coredump.conf \
$systemdutildir/coredump.conf \
$systemdsystemunitdir/systemd-coredump \
$systemdsystemunitdir/systemd-coredump.socket \
$systemdsystemunitdir/systemd-coredump@.service\
$systemdsystemunitdir/sockets.target.wants/systemd-coredump.socket \
"$sysctld"/50-coredump.conf \
"$systemdutildir"/coredump.conf \
"$systemdutildir"/systemd-coredump \
"$systemdsystemunitdir"/systemd-coredump.socket \
"$systemdsystemunitdir"/systemd-coredump@.service \
"$systemdsystemunitdir"/sockets.target.wants/systemd-coredump.socket \
"$sysusers"/systemd-coredump.conf \
coredumpctl
# Install the hosts local user configurations if enabled.
if [[ $hostonly ]]; then
inst_multiple -H -o \
$systemdutilconfdir/coredump.conf \
$systemdsystemconfdir/coredump.conf.d/*.conf \
$systemdsystemconfdir/systemd-coredump.socket \
$systemdsystemconfdir/systemd-coredump.socket.d/*.conf \
$systemdsystemconfdir/systemd-coredump@.service \
$systemdsystemconfdir/systemd-coredump@.service.d/*.conf \
$systemdsystemconfdir/sockets.target.wants/systemd-coredump.socket \
${NULL}
"$systemdutilconfdir"/coredump.conf \
"$systemdsystemconfdir/coredump.conf.d/*.conf" \
"$systemdsystemconfdir"/systemd-coredump.socket \
"$systemdsystemconfdir/systemd-coredump.socket.d/*.conf" \
"$systemdsystemconfdir"/systemd-coredump@.service \
"$systemdsystemconfdir/systemd-coredump@.service.d/*.conf" \
"$systemdsystemconfdir"/sockets.target.wants/systemd-coredump.socket \
"$sysusersconfdir"/systemd-coredump.conf
fi
}

View File

@@ -0,0 +1,46 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
# Prerequisite check(s) for module.
check() {
# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries systemd-creds || return 1
# Return 255 to only include the module, if another module requires it.
return 255
}
# Module dependency requirements.
depends() {
local deps
# This module has external dependency on other module(s).
deps="systemd"
systemd-creds -q has-tpm2 && deps+=" tpm2-tss"
echo "$deps"
# Return 0 to include the dependent module(s) in the initramfs.
return 0
}
# Install the required file(s) and directories for the module in the initramfs.
install() {
inst_multiple -o \
"/usr/lib/credstore/*" \
"/usr/lib/credstore.encrypted/*" \
"$tmpfilesdir/credstore.conf" \
systemd-creds
# Install the hosts local user configurations if enabled.
if [[ $hostonly ]]; then
inst_multiple -H -o \
"/etc/credstore/*" \
"/etc/credstore.encrypted/*"
fi
}

View File

@@ -0,0 +1,6 @@
# This file is part of dracut systemd-hostnamed module.
[Service]
User=systemd-network
Group=systemd-hostname
AmbientCapabilities=CAP_SYS_ADMIN

View File

@@ -0,0 +1,52 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
# Prerequisite check(s) for module.
check() {
# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries \
hostnamectl \
"$systemdutildir"/systemd-hostnamed \
|| return 1
# Return 255 to only include the module, if another module requires it.
return 255
}
# Module dependency requirements.
depends() {
# This module has external dependency on other module(s).
echo dbus systemd-sysusers
# Return 0 to include the dependent module(s) in the initramfs.
return 0
}
# Install the required file(s) and directories for the module in the initramfs.
install() {
inst_simple "$moddir/systemd-hostname-dracut.conf" "$sysusers/systemd-hostname-dracut.conf"
inst_simple "$moddir/org.freedesktop.hostname1_dracut.conf" "$dbussystem/org.freedesktop.hostname1_dracut.conf"
inst_simple "$moddir/99-systemd-networkd-dracut.conf" "$systemdsystemunitdir/systemd-hostnamed.service.d/99-systemd-networkd-dracut.conf"
inst_multiple -o \
"$dbussystem"/org.freedesktop.hostname1.conf \
"$dbussystemservices"/org.freedesktop.hostname1.service \
"$systemdutildir"/systemd-hostnamed \
"$systemdsystemunitdir"/systemd-hostnamed.service \
"$systemdsystemunitdir/systemd-hostnamed.service.d/*.conf" \
"$systemdsystemunitdir"/dbus-org.freedesktop.hostname1.service \
hostnamectl
# Install the hosts local user configurations if enabled.
if [[ $hostonly ]]; then
inst_multiple -H -o \
/etc/hostname \
"$systemdsystemconfdir"/systemd-hostnamed.service \
"$systemdsystemconfdir/systemd-hostnamed.service.d/*.conf"
fi
}

Some files were not shown because too many files have changed in this diff Show More