Commit Graph

2956 Commits (2b1b3bcdcb0ddaa18337f18da515adb6284df0ab)

Author SHA1 Message Date
Lubomir Rintel 35efada5ec network: parse root=dhcp also with network-manager module
Move the logic from network-legacy to common network code.
2019-07-19 16:21:13 +02:00
Lubomir Rintel 381ab6b7cd 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.
2019-07-19 16:21:13 +02:00
Lubomir Rintel 4be95b67a7 network-manager: also read out next-server from NM state 2019-07-19 16:21:13 +02:00
Lubomir Rintel 5e0f8c8a4c network-manager: remove useless use of basename 2019-07-19 16:21:13 +02:00
Kairui Song d9721f20d8 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>
2019-07-19 16:19:07 +02:00
Frank Deng 11e1f68065 35network-legacy: fix classless static route parsing 2019-07-19 16:16:26 +02:00
Lubomir Rintel 43c8c4ce04 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.
2019-07-19 16:13:22 +02:00
Kairui Song 7b76fa924d 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>
2019-07-19 16:12:47 +02:00
Max Resch 705eb4eeb2 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
2019-07-19 16:09:01 +02:00
Renaud Métrich adee5b97bc 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>
2019-07-19 16:05:45 +02:00
Michal Koutný 42e004feb9 debug: Add dd into debug module
When at it also deduplicate the list of installed utilities.
2019-07-19 16:02:47 +02:00
Lianbo Jiang 84c862d8f3 99base: enable the initqueue in both 'dracut --add-device' and 'dracut --mount' cases.
The commit 9f3c31cd8d ("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>
2019-07-19 15:51:21 +02:00
Kairui Song 90ac0a2d77 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.
2019-07-19 15:37:25 +02:00
Daniel Molkentin 4f19427641 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
2019-07-19 00:25:06 +02:00
Thomas Blume 8c6ab479ab call netroot on wicked dhcp setup 2019-07-19 00:24:15 +02:00
Thomas Blume 9cc1b76087 nfsroot follow ifcfg settings for boot protocol 2019-07-19 00:23:34 +02:00
Lukas Nykryn 9f96bb4c73 01fips: add cfb cipher
Required by FIPS standard
2019-07-16 14:31:32 +02:00
Kairui Song 8365177644 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>
2019-03-22 12:58:09 +01:00
Renaud Métrich 33cfad0b8f iscsi: always popd, even if there is no iscsi device 2019-03-04 10:43:21 +01:00
Böszörményi Zoltán 0d08f43d71 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>
2019-02-12 14:56:12 +01:00
Lukas Nykryn 94eccd15c5 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
2019-02-07 16:19:00 +01:00
Lukas Nykryn ad906d85ea 95iscsi: fix a typo in a name of iscsiuio 2019-02-07 11:52:07 +01:00
Thomas Abraham 38ccf7c8e5 91zipl: Don't use contents of commented lines
Comment lines should be ignored. They should not be used for determining
the /boot/zipl device
2019-02-07 11:48:34 +01:00
Frantisek Sumsal 53cb081b4c 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.
2019-01-31 13:52:41 +01:00
Jens Heise 44f2fe5170 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.
2019-01-26 16:12:14 +01:00
Patrick Talbert 7c6d2ad916 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>
2019-01-18 14:10:19 +01:00
Lukas Nykryn fca93eac19 95iscsi: decouple iscsi from sysinit.target 2019-01-15 14:14:27 +01:00
Lukas Nykryn 88820dc781 Revert "95iscsi: drop systemd dracut service dependencies for iscsid"
This reverts commit 765b20333d.
2019-01-15 14:14:27 +01:00
Daniel Molkentin 32f68c1f9a 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
2019-01-10 10:16:15 +01:00
Lukas Nykryn 61afc70454 95iscsi: rd.iscsi.initiator should have priority over stored configuration 2019-01-10 10:10:02 +01:00
Đoàn Trần Công Danh 09d2a1605b 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>
2019-01-07 12:01:55 +01:00
Norbert Lange f9c96cf56f remove superfluous quotes in parameter expansion
as this breaks busybox hush shell.
offending functions can be found with
grep -r '${[^}]*"[^}]*}'
2018-12-13 15:13:03 +01:00
Harald Hoyer ebe1821635
95iscsi/module-setup.sh: do not require 'hostname' anymore 2018-12-04 10:27:17 +01:00
Harald Hoyer f6e3b59e5e network: skip already enslaved interfaces 2018-12-04 08:50:42 +01:00
Thierry Vignaud a6bc200c28 kill bogus comment
should have been killed in commit 4a855e6beb
2018-11-30 16:06:14 +01:00
Lubomir Rintel 79a17b0112 network-manager: call the online hook for connected devices
Look for "connection-uuid" instead of "managed" to determine the devices
that are actually activated with a connection and call the online hook.

This fixes the anaconda-net root mount, which utilizes the online hook.
2018-11-30 15:26:18 +01:00
Renaud Métrich 01ffcf342a fips: removed false-positive 'FATAL: Module xxx not found' error message when kernel provides a generic algo for module
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2018-11-15 10:46:24 +01:00
masem 05dc158e3c Delay argument "-d" requires number
Arguments "-f -d -n" fails with "invalid number -n", because -d delay expects number of seconds.
2018-11-15 10:44:37 +01:00
Kairui Song a60af53413 squash: unsquash the root image instead of mounting it on shutdown
When building squash image, squash module forgot to install the new
shutdown.sh, and the shutdown hooks are always skipped on ordinary
shutdown if squash module is enabled.

The new shutdown.sh will remount the squash image and then everything
will just work, but currently re-mounting the squash image on shutdown
may have selinux problem and make the system hang, and there is no
easy way to fix it.

So skip fixing the shutdown.sh not being install problem, instead
just drop the new shutdown.sh, and unsquash the image on ordinary
shutdown, which is safer and should always work.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-11-12 09:04:14 +01:00
Pedro Monreal f18d069d46 Fixed some SUSE specific typos and outputs 2018-11-08 14:43:08 +01:00
Dusty Mabe 765b20333d 95iscsi: drop systemd dracut service dependencies for iscsid
These dependencies cause an odd issue where swap devices specified
by resume= on the kernel command line will cause systemd device
timeouts to occur on boot. According to @haraldh these lines aren't
needed because the socket activiation will take care of it for us.
Removing these lines now as it fixes the resume= device timeout issue.

Fixes #480
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1641268
2018-10-24 08:57:24 +02:00
Daniel Molkentin b38b7fef36 95dasd_rules: mark dasd rules host_only
Reference: bsc#1090884
2018-10-22 09:36:26 +02:00
Daniel Molkentin 7117bf6270 99base: Allow files with backslashes in hostonly files
Files with blackslashes are routinely by systemd.

Reference: bsc#1090884
2018-10-22 09:36:26 +02:00
Renaud Métrich e54ab383f7 fips: check fips integrity just before mounting local filesystems in /sysroot
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2018-10-19 15:08:53 +02:00
Kairui Song b9af0fcdfb 99squash: Don't clean up squahfs on isolate
The only time we need to cleanup squahfs manually is on switch root, to
release resource and memory. We've covered that by setting
"Conflicts=initrd-switch-root.target" for squash cleanup service.
On shutdown systemd will take care of squahfs mounts. But for other
isolate, files in initramfs are most likely still required, so don't
clean up squahfs. For example, kdump's emergency handler will isolate
into its own target, if squahfs is cleaned up it will fail.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-10-18 11:55:50 +02:00
Kairui Song 83cbc06ab9 40network: Don't include 40network by default
commit 7347391 ('network-legacy: split off from network module')
splitted network function to network-legacy and removed check() function
of 40network. This caused 40network to be included even if network is
not needed.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-10-12 13:17:58 +02:00
Eugene Syromiatnikov 290df2e1de modules.d: Add a module for handling additional depmod kernel module directories
It parses depmod configuration and scans modules.dep for kernel modules
present in directories supplied in "overrides", "external", and "search"
depmod configuration options.  The resulting list of (absolute) kernel
module paths is then supplied to instmods.

* modules.d/90kernel-modules-extra/module-setup.sh: New file.
* dracut.spec (%files): Add
%{dracutlibdir}/modules.d/90kernel-modules-extra.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2018-10-08 10:49:36 +02:00
Lubomir Rintel 08bdadbf31 network-manager: add module 2018-09-21 11:32:01 +02:00
Lubomir Rintel 734739187b network-legacy: split off from network module 2018-09-21 11:32:01 +02:00
Lubomir Rintel 1c4a51c39c network: fix an error message 2018-09-21 11:32:01 +02:00