Commit Graph

5739 Commits (052)

Author SHA1 Message Date
Kairui Song 1e92f7285d Add a --hostonly-nics option
Currently when network is enabled, dracut will install all network
drivers that are currently loaded, but some time only one NIC is needed
for the initramfs.

So for strict hostonly mode, add a --hostonly-nics option, user can
provide a list of NICs to be enabled, and only needed drivers for
specifed NICs will be installed so save space.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-26 14:16:19 +01:00
Rumbaut Thomas e4483e5917 Configure the runner for team interfaces
https://bugzilla.redhat.com/show_bug.cgi?id=1881463
2020-10-26 12:52:24 +01:00
Kairui Song 83c65fd3db 99squash: Check require module earlier, and properly
Let 99squash fail earlier if required modules are not enabled or
missing, using the new added helper.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-21 17:04:00 +02:00
Kairui Song c050190f86 dracut-functions: add a helper to check if kernel module is available
It's like check_kernel_config, help to check if a kernel module is
enabled (cover built-in or compiled module case).

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-21 17:04:00 +02:00
Jonathan Lebon 8f56daa8c3 90crypt: ship initrd-cryptsetup.target
This was added in https://github.com/systemd/systemd/pull/17149 and is
the designated cryptsetup target for all encrypted volumes that need to
be opened in the initrd.

So it effectively replaces `cryptsetup.target` and
`remote-cryptsetup.target` there. I've removed the latter since it was
added recently (by me) in #930, but kept `cryptsetup.target` since we've
been shipping it for a long time now.
2020-10-21 16:43:53 +02:00
Jonathan Lebon 9fb2431a88 Revert "90crypt: pull in remote-cryptsetup.target enablement"
This reverts commit 7ea391b527.

We've moved away from this in
https://github.com/systemd/systemd/pull/17149.
2020-10-21 16:43:53 +02:00
Frederick Grose 12ab0dce66 dmsquash-live/iso-scan: Provide an easy reference to iso-scan device.
With commit 3c8c807, /run/initramfs/isoscan and /run/initramfs/live
mountpoints are unmounted upon rd.live.ram boots.  Save a link to
the iso-scan device in /run/initramfs/isoscandev to easily remount
the source, if desired.
2020-10-20 15:46:49 +02:00
Daniel Molkentin f51d013384 99memstrack: use /bin/bash
/usr/local/bin causes trouble for distros that do not use /usr/bin == /bin
/usr/bin/env likewise, plus the use of env is not needed here
2020-10-12 14:05:09 +02:00
Jonathan Lebon 512c51d267 98dracut-systemd: don't wait for root device if remote cryptsetup active
This is a plain and simple hack around dependency issues between dracut
and systemd.

When using Tang-pinned LUKS root devices, we want to rely on
`systemd-cryptsetup@.service` to unlock it. However, that service only
runs `After=remote-fs-pre.target`, while `dracut-initqueue.service` has
`Before=remote-fs-pre.target` (which makes sense because we don't want
to attempt networked root devices before networking is up).

However, the rootfs-generator here wants to make sure that the root
device exists *before* exiting the initqueue via an initqueue/finished
"devexists" hook. This will never work though because by design
`systemd-cryptsetup@.service`, which unlocks the root device, won't run
until after we exit.

So we have a dependency cycle:

    initqueue -> devexists hook -> root device ->
        systemd-cryptsetup@.service -> remote-fs-pre.target -> initqueue

There's no clean way to break this. The root issue is that there's no
way right now to split sequencing of systemd services across the
initqueue/online and initqueue/finished events because it's all bundled
in a single service. (The deeper root issue of course is that we have
two init systems. :) ).

Here we do a tactical fix: if there's a `systemd-cryptsetup@.service`
instance, let's assume it's for the root device and skip waiting for it
to show up if it depends on `remote-fs-pre.target`.
2020-10-12 11:07:41 +02:00
Đoàn Trần Công Danh 7990ab91f9 cryptroot-ask: unify /etc/crypttab and rd.luks.key
dracut feeds whatever it receives in password field of
crypttab(5) to `cryptsetup -d`, treating them as plain-text key file.

Meanwhile, dracut treats the key file from `rd.luks.key` differently,
by have some special rules to decrypt those key files that has extension of
`gpg` and `img`.

Let's begin to treat them the same.

This is a backward-incompatible change for those people
that uses plain-text key-file that has extension of `gpg` and `img`.
However, those setup is questionable to begin with.
2020-10-08 13:56:44 +02:00
Nicolas Chauvet a298f5f285 90kernel-modules: arm: add drivers/hwmon for arm/arm64
In the case of the s805x the drivers/hwmon directory contains the
scpi_hwmon kernel module.
On a running system, lsmod would output the following dependencies:
 arm_scpi               24576  2 clk_scpi,scpi_hwmon

It means that if the clock driver is bundled in the initramfs it will
bring arm_scpi. But if scpi_hwmon is missing the scpi will be incomplete
and it can lead to crashes.

When the hwmon is bundled, no crash occurs

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2020-10-07 16:04:08 +02:00
Đoàn Trần Công Danh 811c814677 rootfs-block: only write root argument for block device
Some filesystem (e.g. ZFS, and btrfs subvolumes) don't use block
devices. Should they be mounted as `/`, `find_root_block_device`
yields nothing, hence dracut will append this problematic argument
to kernel cmdline:

	root=/dev/block

On a machine that employ root ZFS on LUKS, which was setup with
an OpenPGP-encrypted key file, this argument renders that machine
unbootable. Remove that `root=/dev/block` manually could boot the
machine.

Let check if that device is a block device before write down `root`
argument. This is consistent with the check for block device in
`find_block_device`.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-10-05 17:17:40 +02:00
Jonathan Lebon 7ea391b527 90crypt: pull in remote-cryptsetup.target enablement
This is enabled upstream in
https://github.com/systemd/systemd/pull/17149.
2020-10-05 15:53:32 +02:00
Jonathan Lebon 7c923f1de8 00systemd: add missing cryptsetup-related targets
We want these in the initramfs. Things related to clevis and systemd's
`cryptsetup-generator` reference these targets.
2020-10-05 14:43:58 +02:00
Hannes Reinecke 251b424727 95nvmf: Implement 'fc,auto' commandline syntax
Add a 'fc,auto' commandline syntax for nvmf.discover to force
nvmf autodiscovery on FC-NVMe.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Hannes Reinecke 0e2ef80993 95nvmf: add nvmf-autoconnect script
Add a script to run FC autoconnect.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Hannes Reinecke f0ac6cb462 95nvmf: Fixup FC connections
D-Bus doesn't run in the initrd, so our usual trick of activating
custom systemd services from udev doesn't work.
So add a rule to create initqueue entries for each possible
connection.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Hannes Reinecke e9a614b50c 95nvmf: add documentation
Add documentation for 95nvmf module to dracut.cmdline

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Hannes Reinecke 4087fd4d1a 95nvmf: rework parameter handling
Always add the nvmf.discover parameters to /etc/nvme/discovery
when parsing the dracut commandline, and rely on NVMe autodiscovery
when no parameters are given.
And modify the syntax to use a comma ',' as a separator for nvmf.discover
as the semicolon ':' is already used for the FC-NVMe transport address format.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Daniel Molkentin ee9b9b1241 dracut-install: fix edge-case regression with weak modules
This was introduced with 6dafdda4a6, but
is actually caused by the fact that modules that have already been
installed cause dracut_install() to return without adding the module
to the hashmap. This can happen if an earlier-run dracut module chose
to install the same module. Now modprobe statements like:

softdep usb_storage post: uas
softdep uas pre: usb_storage

(which look weird, but are perfectly valid), cause
dracut_install() to enter an infinite recursion if and only if
at least one of the files has previously been installed by another
module.

Fix this by also adding already installed modules to the hashmap.
2020-10-02 15:49:09 +02:00
David Tardon 4916dfc2b9 dracut-install: ignore bogus preload libs
If there are any nonexistent libraries listed in /etc/ld.so.preload, ldd
prints error messages like:

ERROR: ld.so: object '/usr/lib64/libfoo.so.1' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.

This causes resolve_deps() to return error, which leads to symlinks
(like usr/bin/awk) not being copied into the initrd.
2020-10-02 15:34:40 +02:00
Harald Hoyer ee6ce31003 dracut.spec: Use make macros
https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
2020-10-02 14:05:51 +02:00
Harald Hoyer 9eb1d1ed5e dracut.spec: remove fedora pre 30 quirks 2020-10-02 13:48:48 +02:00
Nicolas Chauvet dee4f26adc 50drm: Check drm_encoder_init along drm_crtc_init
Some modules are involved in the display output without to rely on
drm_crtc_init.

This is the case for the meson_dw_hdmi. This module need to be included
into the initramfs in both hostonly and generic modes.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2020-09-28 21:08:12 +00:00
Nicolas Chauvet 5afd3cfc96 50drm: Include drm platform drivers in hostonly
On arm, many drm drivers are located in the plaform bus.

Adding the platform bus will allow drm drivers to be included in the
initramfs when using hostonly mode.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2020-09-28 21:08:12 +00:00
Nicolas Chauvet 89cd7a4629 50drm: fix ambiguous redirects
If i contains a space, there is a need to protect the variable usage in some cases.

This will occurs when a next patch will enable platform bus with such case:
'/sys/bus/platform/devices/Fixed MDIO bus.0'

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2020-09-28 21:08:12 +00:00
Peter Robinson 38ea7e821b Include devfreq drivers in initrd
Some SoCs now have drivers that user devfreq in early init and fail
if the drivers are missing so make sure we have them in the initrd.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2020-09-23 13:44:21 +02:00
Beniamino Galvani f3e328a7fd dracut.spec: include the 04watchdog-modules module
Include the 04watchdog-modules module that was added in 39d90012a6
("04watchdog: split the watchdog module install").
2020-09-21 13:25:14 +02:00
Antz 37502d4c89 90crypt: make `rd.luks.key` usable with encrypted keydev.
Introduce prefix `keysource:` for the values of `rd.luks.partuuid`,
`rd.luks.serial` and `rd.luks.uuid`.
If specified, ask for passphrase instead of waiting for keydevs to come
online.
2020-09-18 21:59:00 +02:00
Kairui Song 39d90012a6 04watchdog: split the watchdog module install
In some cases, user only want to include the watchdog module, not the
wdctl or any other userspace helper. For example, systemd have a
RebootWatchdogSec option that use watchdog to prevent reboot hangs. And
it can help prevent machines hangs when reboot directly within the
initramfs stage. So split the module installation to a standlone module.

Also when watchdog-module get included, install driver for all loaded
watchdog instaed of only install driver for active watchdog. Both
watchdog and watchdog-module return 255 in check(), so it's enabled only
when manually included, the watchdog may get configured/activated later.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-09-17 14:52:48 +02:00
GuoChuang d76e9ad5d7 fix graphics startup failure with the rhgb paramter in CentOS8.2 2020-09-03 15:27:14 +02:00
Beniamino Galvani f87605e3ab dracut.cmdline.7.asc: fix typo 2020-09-02 22:35:28 +02:00
Daniel Molkentin a5372b8ba8 Add --version to man page 2020-08-28 23:28:25 +02:00
Daniel Molkentin ff2d8bdfb3 dracut.sh: Add --version 2020-08-28 23:28:25 +02:00
Jóhann B. Guðmundsson d418e292e3 Fix CoC URL 2020-08-28 18:04:03 +00:00
Jóhann B. Guðmundsson ff78577d3f Fix Unicode and dracut install labeler 2020-08-28 17:41:41 +00:00
Jóhann B. Guðmundsson d2b3289aa5 Fix Unicode 2020-08-28 17:16:53 +00:00
Jóhann B. Guðmundsson de27127752 Adding security policy 2020-08-28 18:58:52 +02:00
Jóhann B. Guðmundsson 0132527b8f Adding documentation template 2020-08-28 18:58:52 +02:00
Jóhann B. Guðmundsson 455c5dbd35 Adding a feature request template 2020-08-28 18:58:52 +02:00
Jóhann B. Guðmundsson cd1a002512 Adding a bug report template 2020-08-28 18:58:52 +02:00
Tomasz Paweł Gajc b7a7735c1d Do not start inside container
Host should take care of good entropy pool
#791
2020-08-28 17:34:22 +02:00
Jóhann B. Guðmundsson fece5bfcac Adding a pull request template 2020-08-28 14:03:11 +00:00
Jóhann B. Guðmundsson d795211778 Adding code of conduct 2020-08-28 13:55:54 +00:00
Érico Rolim 497916e13b dracut.sh: fix some indentation.
Command level inside conditional and tab/space usage.
2020-08-24 11:29:34 +02:00
Érico Rolim 3b92d8bf84 dracut.sh: fix errors pointed out by shellcheck.
- use [ ] instead of calling test manually, as most of the script is
doing.

- use quotes in hostonly_cmdline blocks, specially when dealing with the
conf files, whose names are set by users/system administrators

- uefi_splash_image was being assigned set to `${dracutsysroot}...`, which
is a variable that doesn't exist.

- we don't want the conditional to run the output of fsfreeze as
commands. Instead, we just need to know if any of the fsfreeze commands
failed.
2020-08-24 10:27:29 +02:00
Daniel Molkentin 1855efb15a Document initqueue/online hook 2020-08-21 17:40:59 +02:00
Daniel Molkentin e096d861ed 01fips: turn info calls into fips_info calls
systemd lets stdout go to journal only. Usually, this is desired
behavior to ensure that plymouth does not get disrupted.

However in the 01fips case, the system has to halt when the integrity
check fails to satisfy FIPS requirements. So the user will not be able
to inspect the journal.

As this is special to the fips module, we introduce a fips_info() which
works like info(), but deviates the output to stderr when running with
systemd.

Reference: bsc#1164076
2020-08-21 15:56:53 +02:00
Daniel Molkentin da4c9a950f 01fips: modprobe failures during manual module loading is not fatal
Users might see

"modprobe: FATAL: Module xyz not found in directory"

The output from modprobe is semantically wrong in this case and
confuses users. Keep the warning for debugging purposes, but reduce
the severeness.

It now reads "Module xyz not found in directory"

Reference: bsc#1169997
2020-08-21 15:56:53 +02:00
наб 31d0b55b86 95cifs: pass rootflags to mount 2020-08-21 15:24:58 +02:00