]> git.ipfire.org Git - thirdparty/dracut.git/log
thirdparty/dracut.git
4 years agoiscsiroot: there's never more than one target per call
Martin Wilck [Thu, 4 Apr 2019 13:40:14 +0000 (15:40 +0200)] 
iscsiroot: there's never more than one target per call

iscsi_target_name is set by iscsi_root, and thus can't have
more than one member. This allows us to get rid of one bashism
in iscsiroot.sh.

4 years agoiscsiroot: parse_iscsi_root overwrites command line args
Martin Wilck [Thu, 4 Apr 2019 13:29:04 +0000 (15:29 +0200)] 
iscsiroot: parse_iscsi_root overwrites command line args

iscsi_target_name, iscsi_target_ip, iscsi_target_port are
unconditionally overwritten by parse_iscsi_root. Don't set
them here, for code clarity.

4 years agonetwork: stop waiting for interfaces if root device is present
Martin Wilck [Thu, 21 Mar 2019 20:31:15 +0000 (21:31 +0100)] 
network: stop waiting for interfaces if root device is present

4 years agoiscsi: don't continue waiting if the root device is present
Martin Wilck [Thu, 21 Mar 2019 15:27:04 +0000 (16:27 +0100)] 
iscsi: don't continue waiting if the root device is present

dracut waits for every iscsiroot connection to be established
before switching root. This is not necessary in multipath scenarios,
where a single path is usually sufficient to set up the root device,
and where users expect booting to succeed unless all paths are down.

Don't wait for the iscsi portal to start if the root device has
already been found.

4 years agoDracut: only login to one target at a time
Lee Duncan [Mon, 25 Mar 2019 23:49:19 +0000 (16:49 -0700)] 
Dracut: only login to one target at a time

For handling the configuration where there are two
paths to an iscsi root target, each using a different
NIC. In such a case, the initramfs was trying to configure
the first NIC, then call iscsiroot to login to both targets,
which would fail for the 2nd target, since the path to the
2nd target was not yet configured. This would eventually
work after a timeout. But it's better to login to just
one target at a time.
This change makes the initramfs handle multiple paths to an
iscsi target better by logging into only one target at a time,
rather than trying to login to all targets when only one of
several NICs is up.

This can be further optimized by using the initrd parameter
"rd.iscsi.testroute", which would skip iscsiadm login attempts
for targets to which no route exists.

If the script is called again via the timeout initqueue,
we try "iscsiadm -L onboot" again, hoping that some targets
may now have become reachable.

4 years agoDocumentation: add systemd warning for rd.luks.key, clean up related text
jbash aka John Bashinski [Wed, 23 Oct 2019 12:46:46 +0000 (14:46 +0200)] 
Documentation: add systemd warning for rd.luks.key, clean up related text

Harald Hoyer <harald@redhat.com>: Squashed commit of the following:

commit 4b5e5da6061983964a85d1671bd1c97c48ee76f1
Author: jbash aka John Bashinski <jbash@velvet.com>
Date:   Thu Aug 1 13:21:35 2019 -0400

    Documentation: add systemd warning for rd.luks.key, clean up related text

4 years ago99squash: Only start the cleaner on switch-root
Kairui Song [Tue, 6 Aug 2019 07:39:31 +0000 (15:39 +0800)] 
99squash: Only start the cleaner on switch-root

Currently it starts the cleaner early and do the clean up job if switch
root is called. It's better to just start the service only on switch
root to avoid any risk of service dependency failure and make is
simpler.

Signed-off-by: Kairui Song <kasong@redhat.com>
4 years agodracut: check_vol_slaves_all must return 1 when lvm vgs failed
gaoyi [Wed, 14 Aug 2019 12:55:56 +0000 (08:55 -0400)] 
dracut: check_vol_slaves_all must return 1 when lvm vgs failed

reason:when filter/global_filter is set in lvm.conf, lvm vgs may be
failed

Signed-off-by: gaoyi <ymuemc@163.com>
4 years agoOnly generate hostonly-kernel-modules list in strict mode
Kairui Song [Tue, 20 Aug 2019 16:52:29 +0000 (00:52 +0800)] 
Only generate hostonly-kernel-modules list in strict mode

Fixes #617.

4 years agonet-lib: check if addr exists before checking for dad state
Lukas Nykryn [Mon, 7 Oct 2019 14:48:09 +0000 (16:48 +0200)] 
net-lib: check if addr exists before checking for dad state

Before we check if dad is done we should first make sure,
that there is a link local address where we do the check.

Due to this issue, on ipv6 only setups sometimes dhclient started
asking for ip address, before the link local address was present
and failed immediately.

4 years agodracut-functions.sh: remove declared unused variables
Daniel Molkentin [Wed, 16 Oct 2019 23:07:37 +0000 (01:07 +0200)] 
dracut-functions.sh: remove declared unused variables

4 years agodracut-init.sh: remove obsolete for_each_kmod_dep()
Daniel Molkentin [Wed, 16 Oct 2019 23:01:47 +0000 (01:01 +0200)] 
dracut-init.sh: remove obsolete for_each_kmod_dep()

4 years ago99base: Rework `/etc/initrd-release` to derive from real os-release
Colin Walters [Fri, 18 Oct 2019 18:26:04 +0000 (18:26 +0000)] 
99base: Rework `/etc/initrd-release` to derive from real os-release

I'd like to rework CoreOS Ignition (which runs in the initramfs)
to include some values from the *real* `/etc/os-release` in
HTTP headers.

Looking at this, it turns out dracut eats almost all of the useful
information from it.  I don't think `dracut` should be the `ID`
here...dracut's not an OS itself, it's a way to *build* little
operating systems.  It'd be kind of like if Fedora's Koji
injected itself into `/etc/os-release`.

This code dates back a long time; not sure of all the rationale
behind it.

I changed it so that we keep extending the VERSION/PRETTY_NAME
with the dracut version, but otherwise "pass through" the
rest of the real `/etc/os-release` we were built from unchanged.

4 years ago99base: Do not hardcode ANSI_COLOR
Daniel Molkentin [Thu, 17 Oct 2019 14:08:26 +0000 (16:08 +0200)] 
99base: Do not hardcode ANSI_COLOR

Take it from /etc/os-release instead, as distributions
usually customize this setting, but keep it as default value.

4 years ago01systemd-initrd: remove redundant code from 99base
Daniel Molkentin [Thu, 17 Oct 2019 14:07:58 +0000 (16:07 +0200)] 
01systemd-initrd: remove redundant code from 99base

4 years agoMake TEST-16-DMSQUASH Python 3 compatible
Böszörményi Zoltán [Thu, 3 Oct 2019 05:25:06 +0000 (07:25 +0200)] 
Make TEST-16-DMSQUASH Python 3 compatible

This change still supports Python 2.6 and 2.7 but loses support
for Python 2.5.

The reason for this change was that Fedora 30 does not ship
python-imgcreate but ships python3-imgcreate.

Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
4 years agoMerge branch 'nolange-fix_ipv2_for_busybox'
Harald Hoyer [Mon, 21 Oct 2019 12:43:44 +0000 (14:43 +0200)] 
Merge branch 'nolange-fix_ipv2_for_busybox'

4 years agoMerge branch 'fix_ipv2_for_busybox' of https://github.com/nolange/dracut into nolange...
Harald Hoyer [Mon, 21 Oct 2019 12:41:12 +0000 (14:41 +0200)] 
Merge branch 'fix_ipv2_for_busybox' of https://github.com/nolange/dracut into nolange-fix_ipv2_for_busybox

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>