Martin Wilck [Thu, 9 Jun 2022 11:32:17 +0000 (13:32 +0200)]
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.
Tao Liu [Fri, 10 Jun 2022 08:39:31 +0000 (16:39 +0800)]
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.
Set common format to each option, correct default compression options and add
missing options:
--rebuild
--aggresive-strip
--hostonly-mode
--hostonly-nics
--noimageifnotneeded
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
German Maglione [Wed, 20 Apr 2022 16:15:23 +0000 (18:15 +0200)]
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>
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.
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.
Masahiro Matsuya [Tue, 15 Feb 2022 09:09:43 +0000 (18:09 +0900)]
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.
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.
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.
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().
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().
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.
Pavel Valena [Fri, 25 Mar 2022 16:26:19 +0000 (17:26 +0100)]
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.
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.
Pavel Valena [Fri, 25 Mar 2022 15:20:16 +0000 (16:20 +0100)]
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.
David Teigland [Mon, 28 Mar 2022 14:35:11 +0000 (09:35 -0500)]
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.
David Tardon [Fri, 11 Mar 2022 13:04:16 +0000 (14:04 +0100)]
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 7ab1d00227cad6f1b86ba01fdc766769faebb031, 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.
David Tardon [Mon, 14 Mar 2022 09:48:44 +0000 (10:48 +0100)]
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
Michal Hecko [Mon, 21 Feb 2022 09:59:27 +0000 (10:59 +0100)]
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.
Laszlo Gombos [Fri, 18 Feb 2022 01:49:31 +0000 (20:49 -0500)]
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.
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.
Savyasachee Jha [Thu, 17 Feb 2022 19:26:03 +0000 (00:56 +0530)]
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.
Commit 7374943ae3d06 ("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.
This systemd-timesyncd module depends on systemd-sysusers after the split of
systemd sysuser configs (https://github.com/dracutdevs/dracut/commit/fec93bb22181f80056b40231fca36c422248ade0).
The systemd-coredump module depends on systemd-sysusers after the split of
systemd sysuser configs (https://github.com/dracutdevs/dracut/commit/fec93bb22181f80056b40231fca36c422248ade0).
Tao Liu [Mon, 14 Feb 2022 07:11:35 +0000 (15:11 +0800)]
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".
David Disseldorp [Thu, 10 Feb 2022 19:08:11 +0000 (20:08 +0100)]
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>
David Disseldorp [Thu, 10 Feb 2022 17:05:21 +0000 (18:05 +0100)]
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.