]> git.ipfire.org Git - thirdparty/dracut.git/log
thirdparty/dracut.git
4 years agoUse eurlatgr as default console font
Marko Myllynen [Tue, 30 Oct 2018 10:30:11 +0000 (12:30 +0200)] 
Use eurlatgr as default console font

Fedora and others have used eurlatgr as the default console font
for some time now, or suggested using it:

https://fedoraproject.org/wiki/Changes/NewDefaultConsoleFont
https://wiki.archlinux.org/index.php/Linux_console#Fonts

The Fedora Change page lists some of the benefits and this file
lists all the characters (glyphs) supported by the font:

http://git.altlinux.org/people/legion/packages/kbd.git?p=kbd.git;a=blob;f=data/consolefonts/README.eurlatgr

The notable downside is that the font does not support Arabic,
Cyrillic or Hebrew as LatArCyrHeb-16 (partially) does, so in cases
where support for languages using them is needed a non-default
console font should be used. Fedora, for instance, uses langtable
to decide the console font to use based on installation language:

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

4 years agoDo not sort the resulting /run/initramfs/state/etc/resolv.conf
Harald Hoyer [Mon, 21 Oct 2019 09:49:10 +0000 (11:49 +0200)] 
Do not sort the resulting /run/initramfs/state/etc/resolv.conf

nameserver priorities should be preserved

Resolves: https://github.com/dracutdevs/dracut/issues/652

4 years agoMove README to README.md
Colin Walters [Fri, 18 Oct 2019 18:27:17 +0000 (18:27 +0000)] 
Move README to README.md

The `README.md` was nearly empty.  Move the travis bits into
`README`, then rename `README` to `README.md`.

This matches the Github standard.  A major compelling feature
of Github is how prominently it displays a project's `README.md`,
so let's ensure ours has content.

4 years agotravis: switch to Bionic
Frantisek Sumsal [Mon, 23 Sep 2019 09:10:53 +0000 (11:10 +0200)] 
travis: switch to Bionic

4 years agotest: fix preserving server.log with V=1
Lubomir Rintel [Fri, 30 Aug 2019 13:44:48 +0000 (15:44 +0200)] 
test: fix preserving server.log with V=1

This is essentially equivalent to what commit 712f471ebfae
('test/test-functions: correctly move server.log') does for V=2.

4 years agoadded additional useful filesystem tools
logan [Fri, 6 Sep 2019 14:59:38 +0000 (08:59 -0600)] 
added additional useful filesystem tools

4 years agomodules.d: fix udev rules detection of multipath devices
Benjamin Marzinski [Tue, 3 Sep 2019 15:44:36 +0000 (10:44 -0500)] 
modules.d: fix udev rules detection of multipath devices

Starting with the 0.7.7 release of the multipath tools, the multipath
udev rules always set a value in ENV{DM_MULTIPATH_DEVICE_PATH} for any
device that multipath scans. A value of 0 means that the device is not
claimed by multipath, and a value of 1 means that it is. Because of
this, udev rules that check ENV{DM_MULTIPATH_DEVICE_PATH}=="?*" will
always return True, and act as if every scanned device is claimed by
multipath. Checking ENV{DM_MULTIPATH_DEVICE_PATH}=="1" will work
correctly for both the old and new versions of the multipath tools.

4 years agorootfs-block: suppress spurious printing of rootflags
Jonas Witschel [Sat, 31 Aug 2019 15:48:05 +0000 (17:48 +0200)] 
rootfs-block: suppress spurious printing of rootflags

getarg prints the value so it inadvertently shows up in the dracut
output.

4 years agocrypt: create locking directory /run/cryptsetup
Jonas Witschel [Sat, 31 Aug 2019 15:45:11 +0000 (17:45 +0200)] 
crypt: create locking directory /run/cryptsetup

For LUKS2 partitions cryptsetup needs a locking directory. If it does
not exist, cryptsetup will create it, but produce a warning

WARNING: Locking directory /run/cryptsetup is missing!

in the process that we do not want to see in the dracut output.

4 years agodracut.sh: suppress "ignored null byte in input" warning
Jonas Witschel [Fri, 30 Aug 2019 12:45:15 +0000 (14:45 +0200)] 
dracut.sh: suppress "ignored null byte in input" warning

Since Bash 4.4, command substitutions containing null bytes produce a
warning of the form

/usr/sbin/dracut: line 1958: warning: command substitution: ignored null byte in input

Remove the trailing null byte from the UEFI kernel command line file
before printing it to suppress this warning.

4 years agoadded debug-shell to initrd in systemd version >= 240
Ondrej Dubaj [Thu, 29 Aug 2019 12:31:06 +0000 (14:31 +0200)] 
added debug-shell to initrd in systemd version >= 240

4 years agoPrint an error if included item ('-i' option) doesn't exist or is neither a directory...
Renaud Métrich [Fri, 1 Mar 2019 10:37:59 +0000 (11:37 +0100)] 
Print an error if included item ('-i' option) doesn't exist or is neither a directory nor a regular file

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
4 years agoCheck /usr/sbin for fsck programs
Tomasz Paweł Gajc [Thu, 13 Dec 2018 22:45:34 +0000 (23:45 +0100)] 
Check /usr/sbin for fsck programs

4 years agodracut.spec: fix build on openSUSE
Lubomir Rintel [Tue, 28 May 2019 07:36:49 +0000 (09:36 +0200)] 
dracut.spec: fix build on openSUSE

When testing the previous commit on openSUSE it turned out that it
didn't really work in the first place, without a few tweaks.

4 years agodracut.spec: fix build with %fedora, %rhel and %suse_version undefined
Lubomir Rintel [Tue, 28 May 2019 06:31:58 +0000 (08:31 +0200)] 
dracut.spec: fix build with %fedora, %rhel and %suse_version undefined

The RPM build failed on due to missing and unpackaged files on my Fedora
machine that happened to have %fedora set to %nil for reasons long
forgotten.

This is probably not a likely scenario, but some of the conditions in the
SPEC file are still wrong and perhaps worth fixing.

4 years agonet-lib: fix typo $li -> $_li
Lukas Nykryn [Tue, 6 Aug 2019 08:54:09 +0000 (10:54 +0200)] 
net-lib: fix typo $li -> $_li

4 years agodoc: Fix integrity key name
Petr Vorel [Tue, 26 Mar 2019 15:13:14 +0000 (16:13 +0100)] 
doc: Fix integrity key name

Default value of EVMKEYDESC (in evm-enable.sh) is "evm-key" and it's
also specified previously in this README file.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
4 years agoman: fix several typos
Frantisek Sumsal [Tue, 20 Aug 2019 09:14:29 +0000 (11:14 +0200)] 
man: fix several typos

4 years ago50-dracut: synchronize option reading code with 51-dracut.install
Zbigniew Jędrzejewski-Szmek [Fri, 23 Aug 2019 09:32:57 +0000 (11:32 +0200)] 
50-dracut: synchronize option reading code with 51-dracut.install

initrd= option should also be dropped here. There is not reason
for the code to be different in the two places.

4 years agoDo not require non-empty kernel cmdline
Zbigniew Jędrzejewski-Szmek [Fri, 12 Apr 2019 14:26:59 +0000 (16:26 +0200)] 
Do not require non-empty kernel cmdline

When booting with Fedora-Server-dvd-x86_64-30-20190411.n.0.iso,
/proc/cmdline is empty (libvirt, qemu host with bios, not sure if that
matters), after installation to disk, anaconda would "crash" in kernel-core
%posttrans, after calling kernel-install, because dracut would fail
with
> Could not determine the kernel command line parameters.
> Please specify the kernel command line in /etc/kernel/cmdline!

I guess it's legitimate, even if unusual, to have no cmdline parameters.
Two changes are done in this patch:
1. do not fail if the cmdline is empty.
2. if /usr/lib/kernel/cmdline or /etc/kernel/cmdline are present, but
   empty, ignore /proc/cmdline. If there's explicit configuration to
   have empty cmdline, don't ignore it.

4 years agodracut-init.sh: Nuke unused install_kmod_with_fw function
Takashi Iwai [Thu, 22 Aug 2019 10:50:23 +0000 (12:50 +0200)] 
dracut-init.sh: Nuke unused install_kmod_with_fw function

Kill the no longer used function, so that anyone won't be confused and
try to modify this function in future.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1146769
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agodracut-install: Support the compressed firmware files correctly
Takashi Iwai [Thu, 22 Aug 2019 10:37:56 +0000 (12:37 +0200)] 
dracut-install: Support the compressed firmware files correctly

The compressed firmware support was supposed to be already
implemented, but it didn't work as expected in the end, because dracut
moved to use dracut-install binary.  This patch adds the support of
XZ-compressed firmware installation to dracut-install for fixing the
missing piece.

At best the firmware files should be uncompressed in initrd, but this
patch simply copies the compressed file as-is, as a quick workaround.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1146769
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoshutdown: fix shutdown with console=null
Zbigniew Jędrzejewski-Szmek [Tue, 20 Aug 2019 19:11:59 +0000 (21:11 +0200)] 
shutdown: fix shutdown with console=null

C.f. https://github.com/systemd/systemd/issues/13332.

4 years agotravis: fetch only tags
Frantisek Sumsal [Wed, 21 Aug 2019 12:06:29 +0000 (14:06 +0200)] 
travis: fetch only tags

The original `git pull` would try to pull & merge changes from the
master branch, which breaks CI runs on PRs based on non-master branches

4 years agogit2spec: avoid malforming of SHA-1 hashes
Frantisek Sumsal [Wed, 21 Aug 2019 09:16:07 +0000 (11:16 +0200)] 
git2spec: avoid malforming of SHA-1 hashes

When a SHA-1 hash of a specific commit is used as a tag, the regex
shenanigans later in the script can (and will) corrupt it in certain
cases.

e.g.:
$ perl -e '
$tag="6e8cd92261577230daa1098f7e05ec198c3c4281";
$tag=~s/[^0-9]+?([0-9]+)/$1/;
print("$tag\n");
'
68cd92261577230daa1098f7e05ec198c3c4281

(Notice the missing 'e')

Let's fix this by limiting the regex's scope to a non-SHA-1 tags only.

4 years agodracut.sh: Adjust squash and strip order
Kairui Song [Wed, 17 Jul 2019 09:10:36 +0000 (17:10 +0800)] 
dracut.sh: Adjust squash and strip order

Previously with squash module, some binaries will be reinstalled, but
stripping happens before that so new installed binaries is not stripped.
So adjust the squash and strip order, ensure new installed binaries are
stripped just the same way with the old binaries.

Also split squash into two stage to make the split easier, move the
squash temp dir into initdir so stripping will cover that too,
and print more usefule message.

Signed-off-by: Kairui Song <kasong@redhat.com>
4 years ago90kernel-modules-extra: don't resolve symlinks before instmod
Lukas Nykryn [Fri, 2 Aug 2019 12:26:23 +0000 (14:26 +0200)] 
90kernel-modules-extra: don't resolve symlinks before instmod

When you install a third-party driver, you will probably end in a
situation, where the module will be in a different directory and
in $depmod_module_dir you will only have symlink. If we resolve the
symlink before we pass the module path to instmod, the dracut-install
will only include the module with its original path, but not the
symlink. Hence the module can't be automatically loaded.

Dracut-install is clever enough to handle symlinks and will include both
the symlink and the module to the initrd.

4 years agoREADME.md: comment out travis CI
Harald Hoyer [Mon, 22 Jul 2019 12:39:42 +0000 (14:39 +0200)] 
README.md: comment out travis CI

4 years agoMakefile: fix VERSION
Harald Hoyer [Mon, 22 Jul 2019 12:27:51 +0000 (14:27 +0200)] 
Makefile: fix VERSION

4 years agodracut.spec: add 06rngd
Harald Hoyer [Mon, 22 Jul 2019 12:07:26 +0000 (14:07 +0200)] 
dracut.spec: add 06rngd

4 years agoInclude systemd volatile root service and binary
Paul Robins [Sun, 12 May 2019 17:00:37 +0000 (18:00 +0100)] 
Include systemd volatile root service and binary

4 years agoConsollidate the qemu virtualization detection
Daniel Molkentin [Tue, 14 May 2019 12:17:14 +0000 (14:17 +0200)] 
Consollidate the qemu virtualization detection

Eventually, we could add a full virt detection routine.
This would be useful e.g. to determine inclusion of
ucode for hostonly setups.

4 years agofips: split loading the crypto modules and checking the kernel
Lukas Nykryn [Tue, 14 May 2019 07:23:55 +0000 (09:23 +0200)] 
fips: split loading the crypto modules and checking the kernel

In e54ab383 we moved the fips script to a later pahse of boot, since
the /boot might not be available early on.

The problem is that systemd-cryptsetup* services could be run now
started before the do_fips is executed and need the crypto modules
to decrypted the devices.

So let's split the do_fips and load the module before udev does the
trigger.

4 years agonet-lib: strstr is not for globs
Lukas Nykryn [Tue, 21 May 2019 15:58:38 +0000 (17:58 +0200)] 
net-lib: strstr is not for globs

4 years agoReplace $(arch) by $(uname -m)
Jonas Witschel [Wed, 22 May 2019 12:39:46 +0000 (14:39 +0200)] 
Replace $(arch) by $(uname -m)

4 years ago99base: Don't let vinfo return 1
Arnaud Rebillout [Tue, 28 May 2019 03:46:03 +0000 (10:46 +0700)] 
99base: Don't let vinfo return 1

When DRACUT_SYSTEMD is set and DRACUT_QUIET=yes, vinfo returns 1. This
is a problem for hooks which end with vinfo, as then the hook returns 1.
Especially problematic if this is a shutdown hook, as it will be
restarted again and again.

This commit fixes that.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
4 years agomove setting the "systemdutildir" variable before it's used
Дамјан Георгиевски [Mon, 27 May 2019 16:22:14 +0000 (18:22 +0200)] 
move setting the "systemdutildir" variable before it's used

on line 1086 it's used to check for the uefi_stub:
"${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"

so it needs to be defined before that

4 years agodracut.sh: fix EFI directory if ESP is mounted to /efi
Jonas Witschel [Wed, 22 May 2019 13:09:28 +0000 (15:09 +0200)] 
dracut.sh: fix EFI directory if ESP is mounted to /efi

The EFI executables produced by dracut --uefi must be placed in the
subdirectory /EFI/Linux of the EFI system partition (ESP) according to
the Boot Loader Specification, see
https://systemd.io/BOOT_LOADER_SPECIFICATION#logic

This is done correctly for the mount points /boot and /boot/efi, but for
the mount point /efi, the files are placed in /efi/Linux instead of the
correct /efi/EFI/Linux. This commit fixes the directory so that the EFI
executables are picked up correctly by conforming boot loaders.

Apart from complying to the specification, the change is also in line
with the commit message of 5c57209ba5ef36f8856b4ea1694de8e1da508b71
("dracut.sh: add default path for --uefi") which introduced this feature
as well as the documentation in dracut.8.asc.

4 years agotest/MULTINIC: correctly note activated devices when using network-manager
Lubomir Rintel [Mon, 10 Jun 2019 14:05:49 +0000 (16:05 +0200)] 
test/MULTINIC: correctly note activated devices when using network-manager

The .did-setup files are not there. What is there is the NetworkManager
connection files.

4 years agotest/BONDBRIDGETEAMVLAN: don't assert against ifcfg files
Lubomir Rintel [Mon, 10 Jun 2019 14:05:23 +0000 (16:05 +0200)] 
test/BONDBRIDGETEAMVLAN: don't assert against ifcfg files

The network-manager module writes keyfiles instead of ifcfg files. Just
check whether the configuration got actually applied correctly.

4 years agotest/IFCFG: make sure the network-legacy plugin is being used
Lubomir Rintel [Mon, 10 Jun 2019 14:04:33 +0000 (16:04 +0200)] 
test/IFCFG: make sure the network-legacy plugin is being used

If the network-manager plugin is used instead, it wouldn't write out
ifcfg files and we wouldn't have anything to check.

While at that, also enable the test.

4 years agotest: copy BONDBRIDGETEAMVLAN to IFCFG
Lubomir Rintel [Mon, 10 Jun 2019 14:04:18 +0000 (16:04 +0200)] 
test: copy BONDBRIDGETEAMVLAN to IFCFG

The IFCFG test will make sure the network-legacy plugin keeps writing
out correct ifcfg files.

This is a separate commit so that actual changes are visible in the
following one.

4 years agonetwork: parse root=dhcp also with network-manager module
Lubomir Rintel [Mon, 27 May 2019 09:12:22 +0000 (11:12 +0200)] 
network: parse root=dhcp also with network-manager module

Move the logic from network-legacy to common network code.

4 years agonetwork-manager: generate configuration with netroot=
Lubomir Rintel [Mon, 27 May 2019 10:43:59 +0000 (12:43 +0200)] 
network-manager: generate configuration with netroot=

If the root is on network, let nm-initrd-generator create configuration
even if none was explicitly specified on the command line.

Also do the same if /tmp/net.ifaces exists, because the anaconda plugin
creates an empty file in that location in hopes that will make us
configure the network.

4 years agonetwork-manager: also read out next-server from NM state
Lubomir Rintel [Mon, 27 May 2019 10:44:17 +0000 (12:44 +0200)] 
network-manager: also read out next-server from NM state

4 years agonetwork-manager: remove useless use of basename
Lubomir Rintel [Mon, 17 Jun 2019 08:07:38 +0000 (10:07 +0200)] 
network-manager: remove useless use of basename

4 years agotest/{10,12,13,14,17,30,31}: increase the disk sizes
Lubomir Rintel [Tue, 11 Jun 2019 07:56:13 +0000 (09:56 +0200)] 
test/{10,12,13,14,17,30,31}: increase the disk sizes

On Fedora 30 the paritition sizes turn out to be too small again:

  + mkdir -p /sysroot
  + mount /dev/dracut/root /sysroot
  + cp -a -t /sysroot /source/bin /source/dev /source/etc /source/lib /source/lib64 /source/proc /source/root /source/sbin /source/sys /source/tmp /source/usr /source/var
  cp: error writing '/sysroot/usr/lib64/libkrb5.so.3.3': No space left on device
  cp: error writing '/sysroot/usr/lib64/libkrb5support.so.0.1': No space left on device

It turns out that there has been quite some size increase in some libraries,
notably glibc, though not all -- some even shrunk, ruling out a toolchain
problem. Here's are files over 1M we install on Fedora 30:

   f29    f30
  2.7M => 6.4M /usr/lib64/{libc-2.28.so => libc-2.29.so}
  3.1M => 6.0M /usr/lib64/libcrypto.so.1.1.1c
  2.0M => 3.5M /usr/lib64/{libm-2.28.so => libm-2.29.so}
  2.9M => 2.8M /usr/lib/systemd/{libsystemd-shared-239.so => libsystemd-shared-241.so}
  1.7M => 2.5M /usr/lib64/libunistring.so.2.1.0
  2.3M => 2.4M /usr/lib64/bind9-export/libdns-export.so.1105.0.0
  1.2M => 2.1M /usr/bin/bash
  1.1M => 1.4M /usr/lib64/libkrb5.so.3.3
  1.2M => 1.4M /usr/lib64/libgcrypt.so.20.2.4
  612K => 1.1M /usr/lib64/libssl.so.1.1.1c

This increases the image sizes to accomodate for this. There's probably
little else we can do.

4 years ago95fcoe: load 'libfcoe' module as a fallback
Kairui Song [Wed, 12 Jun 2019 06:27:44 +0000 (14:27 +0800)] 
95fcoe: load 'libfcoe' module as a fallback

The kernel may only enable 'libfcoe' module. Some modules like bnx2fc
provides FCoE but only depend on 'libfcoe'. Loading 'fcoe' module may
fail but the kernel do support FCoE.

'libfcoe' will be installed as a dependency when installing block device
drivers if it's required. So no need to install it in installkernel.

Signed-off-by: Kairui Song <kasong@redhat.com>
4 years agodracut-install: Add support for compressed kernel modules
Takashi Iwai [Wed, 22 May 2019 12:47:14 +0000 (14:47 +0200)] 
dracut-install: Add support for compressed kernel modules

When a module is compressed, uncompress it before packing into initrd.
Since initrd is already compressed, it makes no sense to put the
compressed module files.

The patch contains a slight refactoring and adds a helper function to
get the command for uncompressing a file per extension.

4 years ago35network-legacy: fix classless static route parsing
Frank Deng [Sat, 15 Jun 2019 20:35:42 +0000 (13:35 -0700)] 
35network-legacy: fix classless static route parsing

4 years agoTEST-70-BONDBRIDGETEAMVLAN: get rid of duplicate makefile
Lubomir Rintel [Fri, 21 Jun 2019 11:41:51 +0000 (13:41 +0200)] 
TEST-70-BONDBRIDGETEAMVLAN: get rid of duplicate makefile

4 years agofs-lib: drop a bashism
Lubomir Rintel [Fri, 21 Jun 2019 16:39:48 +0000 (18:39 +0200)] 
fs-lib: drop a bashism

Bash 5 apparently longer propagates variable assignments to local variables
in front of function calls when in POSIX mode:

  [lkundrak@demiurge ~]$ cat feh.sh
  print_VAR () {
          echo "$VAR";
  }

  testfunc () {
          local VAR="OLD"
          VAR=NEW print_VAR
  }

  testfunc
  [lkundrak@demiurge ~]$ bash4 --posix feh.sh
  NEW
  [lkundrak@demiurge ~]$ bash5 --posix feh.sh
  OLD
  [lkundrak@demiurge ~]$ bash5 feh.sh
  NEW
  [lkundrak@demiurge ~]$

It works the way it did in Bash 4 in non-POSIX mode, for external programs,
or for non-local variables. Don't ask me why -- it's probably some
compatibility thing for some sad old people.

However, this precisely happens when fsck_single() is calling into the
fsck_drv_com(), assigned to _drv by fsck_able(). That ruins the
TEST-70-BONDBRIDGETEAMVLAN test's server and probably more.

Let's pass the fsck driver binary via the function argument instead. It's
less messy anyway.

4 years ago95iscsi: Fix network setup code for iscsi
Kairui Song [Sun, 23 Jun 2019 12:22:34 +0000 (20:22 +0800)] 
95iscsi: Fix network setup code for iscsi

- The network script and config could be in
  "/etc/sysconfig/network-scripts", so try look for network config in
  all possible path.

- The regex used for sed is not working, so fix it too.

- Make bootproto a local variable

Signed-off-by: Kairui Song <kasong@redhat.com>
4 years agotest: tell systemd to reboot on fatal errors
Lubomir Rintel [Wed, 26 Jun 2019 09:47:21 +0000 (11:47 +0200)] 
test: tell systemd to reboot on fatal errors

Otherwise systemd would freeze execution, causing the test to time out
instead of failing fast.

4 years agotest/TEST-14-IMSM: detect failure to compose the test setup root
Lubomir Rintel [Tue, 25 Jun 2019 15:39:57 +0000 (17:39 +0200)] 
test/TEST-14-IMSM: detect failure to compose the test setup root

The dracut-root-block-created line should not be created if we fail to copy
in the required files to sysroot. Let's turn on -e to trap failures and
poweroff on them, like some other tests do.

Also remove the &&. Not only it is unnecessary with -e, but defeats it.
From bash(1):

  The shell does not exit if the command that fails is [...] part of any
  command executed in a && or || list except the command following the
  final && or || [...]

4 years agoadd support for creating secureboot signed UEFI images
Max Resch [Sun, 30 Jun 2019 10:16:22 +0000 (12:16 +0200)] 
add support for creating secureboot signed UEFI images

4 years agoask for a password on readkey failure
Max Resch [Tue, 2 Jul 2019 23:22:24 +0000 (01:22 +0200)] 
ask for a password on readkey failure

continue asking for a password if readkey for cryptsetup input failed,
e.g. wrong password in the password file

4 years agolsinitrd handle UEFI created with dracut --uefi
Max Resch [Wed, 3 Jul 2019 18:53:41 +0000 (20:53 +0200)] 
lsinitrd handle UEFI created with dracut --uefi

4 years agorngd: new module running early during boot to help generating entropy
Renaud Métrich [Thu, 11 Jul 2019 08:50:40 +0000 (10:50 +0200)] 
rngd: new module running early during boot to help generating entropy
when system's default entropy sources are poor (e.g. use of SSD disks or
UEFI RNG not available)

On systems with low entropy at boot, the boot can take up to several
hours, specially when NBDE is used (e.g. clevis) which makes use of
the random number generator.

Enabling rngd service at boot early, because dracut-initqueue runs,
enables to initialize the random number generator in a couple of seconds
instead of minutes or hours.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
4 years agodebug: Add dd into debug module
Michal Koutný [Fri, 12 Jul 2019 13:46:15 +0000 (15:46 +0200)] 
debug: Add dd into debug module

When at it also deduplicate the list of installed utilities.

4 years agotest/TEST-17-LVM-THIN: fail setup if we run out of space in the thin pool
Lubomir Rintel [Wed, 26 Jun 2019 14:42:04 +0000 (16:42 +0200)] 
test/TEST-17-LVM-THIN: fail setup if we run out of space in the thin pool

This condition is rather difficult to detect -- the writes will just remain
queued and get lost on shutdown, resulting in a corrupt filesystem.

4 years agomkinitrd-suse.sh: remove trailing "|"
Harald Hoyer [Fri, 19 Jul 2019 13:56:42 +0000 (15:56 +0200)] 
mkinitrd-suse.sh: remove trailing "|"

caused by commit d10f6f836

4 years ago99base: enable the initqueue in both 'dracut --add-device' and 'dracut --mount' cases.
Lianbo Jiang [Mon, 13 May 2019 08:09:25 +0000 (16:09 +0800)] 
99base: enable the initqueue in both 'dracut --add-device' and 'dracut --mount' cases.

The commit 9f3c31cd8d68 ("99base: enable initqueue if extra devices are added")
only covers 'dracut --add-device' case, but it did not cover 'dracut --mount'
case, which causes the kdump failure in the Amazon virtual machine.

Lets make sure that the initqueue is enabled in both cases in order to wake up
the device in time.

Reported-by: Xiao Liang <xiliang@redhat.com>
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
4 years agoMerge branch 'ryncsn-optimization'
Harald Hoyer [Fri, 19 Jul 2019 13:48:37 +0000 (15:48 +0200)] 
Merge branch 'ryncsn-optimization'

4 years agoMerge branch 'optimization' of https://github.com/ryncsn/dracut into ryncsn-optimization
Harald Hoyer [Fri, 19 Jul 2019 13:48:22 +0000 (15:48 +0200)] 
Merge branch 'optimization' of https://github.com/ryncsn/dracut into ryncsn-optimization

4 years agosquash: also squash systemctl if switch-root is not needed
Kairui Song [Wed, 13 Mar 2019 09:36:53 +0000 (17:36 +0800)] 
squash: also squash systemctl if switch-root is not needed

systemctl need to be accessible on switch-root, but we unmount the
squash image on switch-root, so it will fail. systemctl depends on a lot
of libraries, squash them can save more RAM. So allow modules
(eg. kdump) to tell dracut that switch-root will be intercepted,
then we don't need to take care of that.

Signed-off-by: Kairui Song <kasong@redhat.com>
4 years agosquash: fix and simplify required_in_root
Kairui Song [Mon, 11 Mar 2019 11:46:19 +0000 (19:46 +0800)] 
squash: fix and simplify required_in_root

If required target is a symbol link, create the link then following the
link. If it's a directory, create new directory, else just move it.

Signed-off-by: Kairui Song <kasong@redhat.com>
4 years agosquash: squash systemd binary and udevadm
Kairui Song [Mon, 11 Mar 2019 10:44:02 +0000 (18:44 +0800)] 
squash: squash systemd binary and udevadm

systemd binary and udevadm are not needed to be outside the squash
image. Some binaries are kept outside because they are required before
mounting the image, or after umounting the image (when switching root),
or they may block umounting the image. But we are using lazy umounting,
so actually nothing will block the umount.

Keep more binaries outside the squash image won't hurt but cost extra
memories, the idea of squash image is to save memory usage.

So, there is no reason to keep udevadm outside, that should be a debug
left over. For systemd binary, it's running when switch root happens,
But we have lazy umounted the image and overlay, once systemd process
exec the new systemd in new root, everything will be cleared by kernel.

Also tidy up the comment make it less confussing.

Signed-off-by: Kairui Song <kasong@redhat.com>
4 years agodracut.sh: record the actual hostonly modules for hostonly mode
Kairui Song [Tue, 7 May 2019 11:15:42 +0000 (19:15 +0800)] 
dracut.sh: record the actual hostonly modules for hostonly mode

Previous in commit 7047294, dracut will include the loaded kernel module
list in initramfs, so other tools could check if the loaded kernel
module is changed and rebuild the host only initramfs in case some
module required to boot the machine is missing due to host only install.

It's better to use modalias list generated by dracut-install, that
list includes the device modalias list combined with current loaded
kernel module list. In this way, if any kernel module is yet to be
loaded when the initramfs is built, or got unloaded by accident the
module list will not change. This make the list more stable over
initramfs builds.

Signed-off-by: Kairui Song <kasong@redhat.com>
4 years ago99squash: fail early if can't install require modules in initramfs
Kairui Song [Tue, 25 Dec 2018 09:53:24 +0000 (17:53 +0800)] 
99squash: fail early if can't install require modules in initramfs

insmods will consider all arguments as optional modules by default, but
for squash module, all listed modules are required, if any of them is
missing the initramfs won't boot. So pass the '-c' argument to let instmos
know all those modules are mandatory, it will fail and give an error if
it failed to install any of those modules.

4 years agodracut.sh: Fix udevdir detection
Hongxu Jia [Wed, 3 Apr 2019 07:24:47 +0000 (15:24 +0800)] 
dracut.sh: Fix udevdir detection

In commit [9d1b81c dracut.sh: improve udevdir and systemdutildir
fallback logic] , it checked a common binary `collect' to location
udevdir.

But upstream systemd drop binary `collect' since systemd v240
[https://github.com/systemd/systemd/commit/a168792c2d95695fd30c0371d4b3890a9df1eafb]

So check binary `ata_id' to instead.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
4 years agomkinitrd-suse.sh: simplify get_kernel_version
Daniel Molkentin [Thu, 18 Jul 2019 08:14:37 +0000 (10:14 +0200)] 
mkinitrd-suse.sh: simplify get_kernel_version

This generalizes the naming and provides a workaround for compressed
kernels on s390.

Reference: bsc#1139939

4 years agotests: Ignore .testdir
Daniel Molkentin [Thu, 18 Jul 2019 09:16:18 +0000 (11:16 +0200)] 
tests: Ignore .testdir

4 years ago95fcoe: Fix startup when fcoe module is included
Daniel Molkentin [Thu, 18 Jul 2019 09:29:29 +0000 (11:29 +0200)] 
95fcoe: Fix startup when fcoe module is included

The parse-fcoe.sh hook is sourced, and hence must not contain
exit 0 calls. Otherwise, the cmdline sequence will be interupted,
and no error will be reported to systemd. Use return instead.

Reference: boo#1136977

4 years agocall netroot on wicked dhcp setup
Thomas Blume [Thu, 4 Jul 2019 07:10:30 +0000 (09:10 +0200)] 
call netroot on wicked dhcp setup

4 years agonfsroot follow ifcfg settings for boot protocol
Thomas Blume [Wed, 19 Jun 2019 13:15:57 +0000 (15:15 +0200)] 
nfsroot follow ifcfg settings for boot protocol

4 years agodracut-install: Add support for compressed firmware files
Takashi Iwai [Wed, 8 May 2019 05:12:06 +0000 (07:12 +0200)] 
dracut-install: Add support for compressed firmware files

The upcoming kernel will have a support for loading compressed
firmware files, and this patch corresponds to that kernel change.
When a firmware file with the extra .xz extension is found, dracut
copies to initrd as fallback.  Since initrd itself is compressed, the
file is uncompressed in initrd beforehand.

4 years ago01fips: add cfb cipher
Lukas Nykryn [Tue, 16 Jul 2019 07:27:01 +0000 (08:27 +0100)] 
01fips: add cfb cipher

Required by FIPS standard

4 years agoAdd support for riscv64
Andreas Schwab [Mon, 8 Jul 2019 08:24:58 +0000 (10:24 +0200)] 
Add support for riscv64

4 years agotravis: run TEST-13-ENC-RAID-LVM on Fedora 29
Lubomir Rintel [Thu, 27 Jun 2019 14:22:04 +0000 (16:22 +0200)] 
travis: run TEST-13-ENC-RAID-LVM on Fedora 29

Systemd in Fedora 30 is broken at the moment.
Fix: https://github.com/systemd/systemd/pull/12897

4 years agotravis: run TEST-14-IMSM on Fedora 29
Lubomir Rintel [Thu, 27 Jun 2019 14:20:32 +0000 (16:20 +0200)] 
travis: run TEST-14-IMSM on Fedora 29

Systemd in Fedora 30 is broken at the moment.
Fix: https://github.com/systemd/systemd/pull/12872/

5 years agofips: ensure fs module for /boot is installed
Kairui Song [Thu, 14 Mar 2019 10:54:10 +0000 (18:54 +0800)] 
fips: ensure fs module for /boot is installed

When using dracut with  --hostonly and --no-hostonly-default-device,
/boot will be inaccessible as dracut will most fs modules unless
specified. But FIPS require /boot to be accessible, and it will try
to mount it on boot. It will fail if corresponding fs module is missing.

For most case /boot will be a simple partition, include the fs module
will be enough for FIPS to mount it. For other cases users have to pass
extra parameters by themselves.

Suggested-by: Kenneth Dsouza <kdsouza@redhat.com>
Signed-off-by: Kairui Song <kasong@redhat.com>
5 years agoiscsi: always popd, even if there is no iscsi device
Renaud Métrich [Fri, 1 Mar 2019 10:46:43 +0000 (11:46 +0100)] 
iscsi: always popd, even if there is no iscsi device

5 years agodracut: let module handling function accept optional path option 545/head
Kairui Song [Thu, 21 Feb 2019 05:18:37 +0000 (13:18 +0800)] 
dracut: let module handling function accept optional path option

Let the caller pass in the module path instead of try to find the module
path everytime. This helps optimize the overall runtime.

Test results (3 rounds) on Fedora 30 in KVM VM with 8 CPUs, 2G memory, HDD:

    $ time ./dracut.sh --local --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode 'strict' -o 'plymouth dash resume ifcfg' --mount '/dev/mapper/fedora-root /sysroot xfs defaults' --no-hostonly-default-device -f initramfs.img
    Before the commit:
    real    0m11.782s  |  real    0m11.505s  |  real    0m11.958s
    user    0m9.169s   |  user    0m9.218s   |  user    0m9.327s
    sys     0m10.839s  |  sys     0m10.829s  |  sys     0m10.925s

    After this commit:
    real    0m9.866s  |  real    0m9.580s  |  real    0m9.638s
    user    0m9.048s  |  user    0m9.142s  |  user    0m9.120s
    sys     0m7.411s  |  sys     0m7.775s  |  sys     0m7.745s

Test result of building a ordinary image:

    $ time ./dracut.sh --local --quiet -f initramfs.img
    Before the commit:
    real    0m34.697s  |  real    0m34.371s  |  real    0m35.122s
    user    0m27.608s  |  user    0m27.524s  |  user    0m27.705s
    sys     0m22.341s  |  sys     0m22.032s  |  sys     0m22.246s

    After the commit:
    real    0m31.914s  |  real    0m31.006  |  real    0m31.289ss
    user    0m27.315s  |  user    0m27.324  |  user    0m27.290ss
    sys     0m19.051s  |  sys     0m18.916  |  sys     0m19.022ss

This will have an ~2s speed up.

Signed-off-by: Kairui Song <kasong@redhat.com>
5 years agoinstall: string_hash_func should not be fed with NULL
Lukas Nykryn [Thu, 14 Feb 2019 19:18:04 +0000 (20:18 +0100)] 
install: string_hash_func should not be fed with NULL

If kmod_module_get_path returns NULL, we should skip that entry,
the hash function does not like NULL pointers.

5 years agoFix 98dracut-systemd/dracut-emergency.sh
Böszörményi Zoltán [Tue, 12 Feb 2019 11:55:32 +0000 (12:55 +0100)] 
Fix 98dracut-systemd/dracut-emergency.sh

/dev/consoles does not exist. It's /proc/consoles.

Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
5 years ago95iscsi: /sys/devices/platform/*/flashnode_sess-*/is_boot_target sometimes does not...
Lukas Nykryn [Thu, 7 Feb 2019 15:09:43 +0000 (16:09 +0100)] 
95iscsi: /sys/devices/platform/*/flashnode_sess-*/is_boot_target sometimes does not exist

cat: '/sys/devices/platform/host2/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 90: [: -eq: unary operator expected

5 years ago95iscsi: fix a typo in a name of iscsiuio
Lukas Nykryn [Tue, 15 Jan 2019 15:42:38 +0000 (16:42 +0100)] 
95iscsi: fix a typo in a name of iscsiuio

5 years ago91zipl: Don't use contents of commented lines
Thomas Abraham [Wed, 19 Dec 2018 23:24:41 +0000 (18:24 -0500)] 
91zipl: Don't use contents of commented lines

Comment lines should be ignored. They should not be used for determining
the /boot/zipl device

5 years ago00systemd: check if systemd version is a number
Frantisek Sumsal [Fri, 4 Jan 2019 15:51:15 +0000 (16:51 +0100)] 
00systemd: check if systemd version is a number

The recent systemd upstream introduced a slightly modified version
string which included information about a git commit, which however
broke the version check in dracut. Unfortunately, the (( )) bash syntax
went along with it in certain cases and introduced a pretty nasty issue,
when the systemd would boot up but with slightly changed environment.

To prevent this from happening in the future, let's at least check if
the version parsed from the `systemd --version` output is a comparable
number.

5 years ago10i18n: Fix keymaps not getting included sometimes
Jens Heise [Mon, 7 Jan 2019 15:47:23 +0000 (16:47 +0100)] 
10i18n: Fix keymaps not getting included sometimes

Eliminate erroneous substring matches when looking up already processed keymaps to prevent necessary keymaps not getting added to the initramfs sometimes e.g. if there are the files 'compose.latin1' and 'compose.latin1.add' the unfixed version would skip processing 'compose.latin1' if find returned 'compose.latin1.add' first due to the directory listing not being in sorted order.

5 years agoFix a missing space in example configs
Daniel Molkentin [Sun, 20 Jan 2019 20:56:05 +0000 (21:56 +0100)] 
Fix a missing space in example configs

It has

omit_drivers+=" i2o_scsi"

which would break the next omit_drivers+="foo " if it's
missing a space at the beginning.

Reference: boo#1121251

5 years ago95fcoe: Add the rd.nofcoe option to disable the FCoE module from the command line
Patrick Talbert [Fri, 30 Nov 2018 08:28:09 +0000 (09:28 +0100)] 
95fcoe: Add the rd.nofcoe option to disable the FCoE module from the command line

Images built with the fcoe module will always run the lldpad
service as part of their pre-trigger scripts if the network
is active. This prevents network installations in
environments where, for security reasons, LLDPDU frames
cause a switchport shutdown.

Add a new rd.nofcoe option to cause dracut to skip the
lldpad.sh script and the entire 95-fcoe module.

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
5 years ago95iscsi: decouple iscsi from sysinit.target
Lukas Nykryn [Thu, 10 Jan 2019 17:08:32 +0000 (18:08 +0100)] 
95iscsi: decouple iscsi from sysinit.target

5 years agoRevert "95iscsi: drop systemd dracut service dependencies for iscsid"
Lukas Nykryn [Thu, 10 Jan 2019 16:44:54 +0000 (17:44 +0100)] 
Revert "95iscsi: drop systemd dracut service dependencies for iscsid"

This reverts commit 765b20333d9589e09b29dbe0d8304a56745623c6.

5 years agolsinitrd: list squash content as well
Kairui Song [Wed, 26 Dec 2018 09:38:02 +0000 (17:38 +0800)] 
lsinitrd: list squash content as well

When the initramfs is built with squash module enabled, the content
inside squash image will be invisible from the lsinitrd tool. This
commit make lsinitrd detect and list the content of the squash image as
well to avoid possible confusion.

Signed-off-by: Kairui Song <kasong@redhat.com>
5 years agoemergency mode: use sulogin
Daniel Molkentin [Wed, 5 Dec 2018 15:52:45 +0000 (16:52 +0100)] 
emergency mode: use sulogin

- allow emergency login on every console
  specified in the kernel cmdline
- require password for hostonly images
- emergency mode: Manually multiplex emergency infos

This will bring all vital information to all ttys specified
as console devices, regardless of wether they hold the C flag.

Reference: FATE#325386
Reference: #449

5 years ago95iscsi: rd.iscsi.initiator should have priority over stored configuration
Lukas Nykryn [Tue, 8 Jan 2019 16:16:07 +0000 (17:16 +0100)] 
95iscsi: rd.iscsi.initiator should have priority over stored configuration

5 years agoremove bashism in various boot scripts
Đoàn Trần Công Danh [Sun, 6 Jan 2019 04:48:02 +0000 (11:48 +0700)] 
remove bashism in various boot scripts

When using dash as initramfs shell, the boot process is broken.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
5 years agothe strip command should avoid changing the file modification time
Attila Bruncsak [Fri, 14 Dec 2018 14:57:33 +0000 (15:57 +0100)] 
the strip command should avoid changing the file modification time