Commit Graph

3270 Commits (c8ebb80590be2dbe0cb63c9696903889b51efc75)

Author SHA1 Message Date
Daniel Molkentin 1517f4c504 35network-wicked: install ip utility anyway 2020-11-25 18:21:39 +01:00
Daniel Molkentin 983aee0ef1 35network-wicked: Run wicked early enough to unlock block devices 2020-11-25 18:21:39 +01:00
Daniel Molkentin 7825c32bd6 06dbus: Do not install superfluous services 2020-11-25 18:21:39 +01:00
Daniel Molkentin 5fc7c05321 40network: introduce wicked option 2020-11-25 18:21:39 +01:00
Daniel Molkentin ed7ce0d64f 35network-wicked: introduce wicked support module 2020-11-25 18:21:39 +01:00
Daniel Molkentin e1845955ff 06dbus: introduce dbus support 2020-11-25 18:21:39 +01:00
Kairui Song 8c8af8a2cd 95fcoe: don't install if there is no FCoE hostonly devices
When in hostonly mode, 95fcoe module will still be installed even there
is no FCoE hostonly device. So use the new block_is_fcoe helper to check
for hostonly device in hostonly mode, avoid installing unneccessary module.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-11-23 17:23:38 +01:00
Kairui Song 4339d47cf8 95fcoe: ensure needed modules are installed
If fcoe module is loaded, the initramfs will always try load libfcoe
and bnx2fc, so also ensure they are installed if needed.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-11-18 14:18:01 +01:00
Petr Pavlu 6685d99448 Prevent creating unexpected files on the host when running dracut
Library file modules.d/99base/dracut-lib.sh contains initialization code
that makes sure certain directories and links are created when a system
runs from the produced initramfs. This file is normally sourced only
from initramfs scripts. However, modules.d/99base/module-setup.sh
includes it also when an initramfs image is being created to gain access
to some of the functions in this library. This can result in creating
unexpected directories and links on the current root file system when
the dracut command is executed.

For instance, during a system installation when dracut is invoked to
create an initial initramfs, the target sysroot might not contain
directory /run/initramfs but have /var/log. This situation results in
the code in modules.d/99base/dracut-lib.sh creating an unexpected link
/var/log/log that points to /run/initramfs/log. This link is then also
present on the installed system.

The patch fixes the problem by skipping the described logic in
modules.d/99base/dracut-lib.sh when the PREFIX variable is non-empty
which indicates that a target initramfs is being prepared. The variable
is set by modules.d/99base/module-setup.sh prior to including
dracut-lib.sh.
2020-11-15 00:47:39 +01:00
Daniel Molkentin 5840c466dc 95nfs: /var/lib/nfs/statd/sm is /var/lib/nfs/sm on SUSE
Reference: boo#1177462
2020-11-14 19:28:56 +01:00
Daniel Molkentin e0524af2bf Retrieve service, rpc and protcol entries via getent in hostonly mode
Sometimes, systems have more elaborate backends in nsswitch.conf,
the complexity of which we do not want in the initrd. SUSE systems
with atomic for instance, where those files may also reside in /usr/etc.

With this change, the unavaiable nsswitch.conf backends will be silently
ignored, and we still end up with all the information we need.

Reference: boo#1165366
2020-11-14 19:28:56 +01:00
Daniel Molkentin 1ec85e5232 Remove uses of bash (and bash specific syntax) in runtime scripts
dracutinstall picks up interpreters and includes bash despite
the users' wishes or expectations, as modules should not require
bashisms at runtime.

Fixes #951
2020-11-14 16:36:38 +01:00
Jonathan Lebon a23a4680e7 90crypt: pull in remote-cryptsetup.target enablement
This should've been part of #964. As mentioned there, the
`initrd-cryptsetup.target` approach was reverted in the end, and we went
back to relying in `remote-cryptsetup.target`:

https://github.com/systemd/systemd/pull/17467

So we do need to ship the enablement symlink for it.
2020-11-14 15:30:34 +01:00
David Tardon 0f89c0dff6 90multipath: install kpartx's 11-dm-parts.rules
This makes /dev/disk/by-uuid links point to the right device.
2020-11-14 15:15:13 +01:00
Jonathan Lebon 09804a4629 Revert "90crypt: ship initrd-cryptsetup.target"
This reverts commit 8f56daa8c3.

The addition of `initrd-cryptsetup.target` was reverted in systemd:
https://github.com/systemd/systemd/pull/17467
2020-11-05 14:22:52 +01:00
Kairui Song 831e310adf 90qemu-net: install less module for strict hostonly mode 2020-10-30 10:13:37 +01:00
Kairui Song 5698258d30 90qemu-net: in hostonly mode, only install if network is needed
Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song 3b45c7e1a0 95nfs: Install less module if hostonly mode is strict
For strict hostonly mode, only install currently loaded modules instead
of a bunch of driver that may not be needed.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song 5817934936 90kernel-modules: Install less modules for hostonly mode
Rearrange some module installation mode, install less modules for
hostonly mode.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song 6375d5d504 90kernel-modules: install block drivers more strictly
For strict hostonly mode, only install block drivers needed for hostonly
devices.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song 5a49fd3656 04watchdog-modules: Simplify install_kernel using new added helper
The new added get_dev_modules helper can help simplify the driver
detection code by a lot.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song c69961b403 90kernel-network-modules: Don't install iscsi related module
These modules are installed in 95iscsi, no need to repeat here.
2020-10-26 14:16:19 +01:00
Kairui Song 1e92f7285d Add a --hostonly-nics option
Currently when network is enabled, dracut will install all network
drivers that are currently loaded, but some time only one NIC is needed
for the initramfs.

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

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

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

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

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

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

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

So we have a dependency cycle:

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

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

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

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

Let's begin to treat them the same.

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

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

When the hwmon is bundled, no crash occurs

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

	root=/dev/block

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

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

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

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

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

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

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Nicolas Chauvet dee4f26adc 50drm: Check drm_encoder_init along drm_crtc_init
Some modules are involved in the display output without to rely on
drm_crtc_init.

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

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

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

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

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

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

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

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

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-09-17 14:52:48 +02:00
GuoChuang d76e9ad5d7 fix graphics startup failure with the rhgb paramter in CentOS8.2 2020-09-03 15:27:14 +02:00
Tomasz Paweł Gajc b7a7735c1d Do not start inside container
Host should take care of good entropy pool
#791
2020-08-28 17:34:22 +02:00
Daniel Molkentin e096d861ed 01fips: turn info calls into fips_info calls
systemd lets stdout go to journal only. Usually, this is desired
behavior to ensure that plymouth does not get disrupted.

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

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

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

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

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

It now reads "Module xyz not found in directory"

Reference: bsc#1169997
2020-08-21 15:56:53 +02:00
наб 31d0b55b86 95cifs: pass rootflags to mount 2020-08-21 15:24:58 +02:00
наб dae2759e61 95cifs: install new softdeps (sha512, gcm, ccm, aead2) 2020-08-21 15:24:58 +02:00
mulhern fe761330e5 Remove stratis module
It is obsolete. An approach which does not start the daemon is being worked
on.

Signed-off-by: mulhern <amulhern@redhat.com>
2020-08-20 18:39:44 +02:00
Frederick Grose f7e924c577 dmsquash-live-root: Remove obsolete osmin.img processing.
osmin.img is no longer used by anaconda or generated by
livemedia-creator.  livecd-creator will soon drop it as well.
Removing this code will allow OverlayFS boots to proceed  when
osmin.img is present in the .iso image.
2020-08-11 20:18:44 +02:00
Daniel Molkentin 74f83fb9f3 95nvmf: fix typo in the example documentation 2020-08-11 20:00:12 +02:00
Thomas Blume 376ce85105 net-lib.sh: support infiniband network mac addresses
Infiniband MAC addresses have 20 octets.

Reference: bsc#996146
2020-08-07 12:00:59 +02:00
Daniel Molkentin 01b7163a59 90lvm: do not add newline to cmdline
Fixes #862
2020-08-06 09:53:55 +02:00
Thomas Blume 3f5bf54fbf 35network-legacy: simplify fallback dhcp setup
suppress redundant calls to network setup

combine code for "no ip option directed at our interface" and
"No ip lines default to dhcp"
correct evaluation of return code for creating did-setup files
fix application of "load_ipv6" call to ipv6 setup only

Reference: bsc#1173402
2020-08-05 12:32:24 +02:00
Denis Volkov 09a691af3b Change the order of NFS servers during the boot
NFS server provided by DHCP in next-server option has higher priority than DHCP-server itself
2020-08-04 17:33:41 +02:00
David Tardon d9e27b0917 match simplified rd.zfcp format too
The simplified format was introduced by commit
c8aa1d949a .
2020-08-04 16:27:48 +02:00
David Tardon ae83919a7a match the whole string 2020-08-04 16:27:48 +02:00
Kairui Song cfd872392c 99squash: improve pre-requirements check
Check for systemd-initrd and squashfs-tools in check() to fail early if
it won't work.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-08-04 14:24:53 +02:00
Kairui Song 3a2beb037c 99squash: Don't hardcode the squash sub directories
Signed-off-by: Kairui Song <kasong@redhat.com>
2020-08-04 14:24:53 +02:00
Kairui Song dc9596155d dracut-initqueue: Print more useful info in case of timeout
Currently when initqueue timeout, it span the console with
"dracut-initqueue timeout - starting timeout scripts", which isn't very
helpful as we still don't know what actually happened. Try to improve
this by print what is actually being waited.

Besides, only print "starting timeout scripts" when there are
actual timeout scripts to use.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-08-04 14:00:06 +02:00
Norbert Lange acc782bad5 mount-root.sh: fix writing fstab file with missing fsck flag
if the kernel argument rootflags is set, then dracut will
not parse the rootfs fstab and rootfsck wil not be set.

if the filesystem can be fsck'ed then its unmounted,
and an entry to the local fstab is written, omitting the last
field.

mounting /sysroot using fstab will then fail.

This change makes sure that the filed is always written.

Signed-off-by: Norbert Lange <norbert.lange@andritz.com>
2020-08-04 13:26:33 +02:00
Kairui Song 5c025a7d2a 99memstrack: Only start tracking service when rd.memdebug=4|5
Currently systemd will always start the tracking service, it will
exit early if rd.memdebug<=3 so there is no issue here, but it
leave a message of: "Started Memstrack Anylazing Service.".
Better to avoid such message if it's not used.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-08-04 12:53:14 +02:00
Alexander Tsoy 07417b7fc5 lvm: fix removal of pvscan from udev rules
udev rules provided by lvm 2.02.128 and newer uses '+=' instead of '='.
2020-08-04 12:30:40 +02:00
Daniel Molkentin 480aa9695f 95resume: Do not resume on iSCSI, FCoE or NBD
The iSCSI configuration is started after dracut checks for resume,
so we run into a timeout here. Additionally it's questionable if
resume on iSCSI makes sense (or is even supported on the platform).

Same holds true for Network Block Devices and FcOE, cover those as well

References: bsc#999663

Original-patch-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Daniel Molkentin <daniel.molkentin@suse.com>
2020-08-04 10:37:57 +02:00
Alexander Tsoy fe02bc78ac lvm: remove unnecessary ${initdir} from lvm_scan.sh
lvm_scan.sh runs in the initramfs, so paths should not be prefixed with
${initdir}.
2020-08-04 09:53:51 +02:00
Martin Wilck 880d155967 95nfs: use ip_params_for_remote_addr()
Use the new helper function.
2020-08-04 08:43:32 +02:00
Martin Wilck 6dbae7e772 95iscsi: use ip_params_for_remote_addr()
Use the new helper function.
2020-08-04 08:43:32 +02:00
Enzo Matsumiya 019610af26 95nvmf: add NVMe over TCP support
Add support to boot from an NVMe over TCP device.

Example of supported command line formats:

nvme.discover=tcp:192.168.1.3::4420
nvme.discover=tcp:192.168.1.3 # will use 4420 as default svcid

- Create is_nvmf() function to handle all fabrics types
- Fix parse_nvmf_discover() to correctly use the default values
- Auxiliary function to validate an IP connection
- Fix inverted result for getargbool when reading "rd.nonvmf" command line parameter

Requires rd.neednet=1
Requires adding/replacing STARTMODE in /etc/sysconfig/network/ifcfg-ethX to "nfsroot"
to avoid shutdown hanging in initiator

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
2020-08-04 08:22:25 +02:00
q66 05ce5c41b6 90ppcmac: respect DRACUT_ARCH, don't exclude ppcle 2020-08-03 16:47:51 +02:00
Kairui Song f7ad1479f2 90kernel-modules: add pci_hyperv
Install pci_hyperv for SR-IOV devices on hyperv machines.
2020-08-03 15:57:04 +02:00
Jóhann B. Guðmundsson 0cf01f125a As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 8cb5ac1b30 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson d9149c6ca7 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson c437933cb0 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson e1130a8340 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 0c1bd016ec As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 317d841c78 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 5cb2a4004d As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 38ba90bf88 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 265f696b53 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Thomas Blume 3b869230a0 95iscsi: fix ipv6 target discovery
ipv6 addresses need square brackets, otherwise the iscsi discovery and log-in,
which adds the iscsi port after another colon will get confused and fail.
2020-07-09 21:19:43 +02:00
Martin Wilck 46f3156426 91zipl: parse-zipl.sh: honor SYSTEMD_READY
The zipl partition should not be mounted if SYSTEMD_READY=0 is set.
Otherwise booting issues with multipath will result.
2020-07-09 18:06:50 +02:00
Beniamino Galvani 5c3d0a9647 cms: regenerate NetworkManager connections
After changing the kernel command line, the cmsifup script calls ifup
to activate the interface. However, ifup is only available in the
network-legacy module; when using the network-manager module, we
should regenerate connections according to the command line; then
later NM will be run and will activate the device.
2020-06-25 10:58:34 +02:00
Beniamino Galvani 6e1e87cd25 network-manager: move connection generation to a lib file
Move the connection generation code to a library file so that it can
be reused from other places.
2020-06-25 10:58:34 +02:00
Daniel Molkentin 55b0d2edaf 95iscsi: fix missing space when compiling cmdline args
Reference: bsc#1172816
2020-06-17 21:01:03 +02:00
Hannes Reinecke 2f03d69f9d 95nvmf: add module for NVMe-oF
Add a module for booting from NVMe-oF devices.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-06-17 09:34:53 +02:00
Kairui Song 5f8063c6f2 95nfs: only install rpc services for NFS < 4 when hostonly is strict
Most rpc services are not needed for NFSv4, so skip these components
to save space. rpc.idmapd is still needed in case of
nfs4_disable_idmapping is set to 0.
2020-05-29 16:51:45 +02:00
Beniamino Galvani eb770a4a20 network-manager: set kernel hostname from the command line
Since commit ff70adf873ef ("initrd: save hostname to a file in /run"),
the initrd generator of NetworkManager parses the hostname from 'ip='
options of the kernel command line and writes it to
/run/NetworkManager/initrd/hostname.

When that file exists, set the kernel hostname.

In presence of multiple hostnames in the command line, the last one
wins. Hostnames from command line always have precedence over ones
received through DHCP. This is a bit different from the legacy network
module that gives higher precedence to the hostname (from DHCP or
command line) of the last interface that is brought up, which depends
on the udev order.
2020-05-29 14:42:42 +02:00
Alexander Tsoy 50cc23ba32 busybox: simplify listing of supported utilities
'--list' option is supported since busybox-1.20.0, which was released
in 2010.
2020-05-29 10:27:59 +02:00
Kairui Song 2a61132865 Remove cleanup_trace_mem calls
In commit 49c4172 all shell based memory tracing functions are removed,
there are some left over. Remove them as well.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-05-27 16:51:52 +02:00
Kairui Song 424f01e2a0 99memstrack: hook script should not call exit
With memstrack module, rd.break may not work because the hook scripts
are sourced, not executed, so the exit call will make pre-pivot queue
exit early. See 98dracut-systemd/dracut-pre-pivot.sh, everything after
"source_hook cleanup" will be ignored.

Replace with return instead.

Credits go to Lukas Nykryn <lnykryn@redhat.com> who helped discover and
debug this issue.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-05-27 16:51:52 +02:00
Tomasz Paweł Gajc 1ec7b694b5 install dependant libs too
By default rng-tools are compiled with pkcs11 support.
Make sure opensc-pkcs11.so library is installed inside initramfs to prevent error on boot
2020-05-20 15:45:38 +02:00
Derek Hageman cb9e6881dd 90crypt/module-setup.sh: fix force on multiple lines
The first line in crypttab with a "force" option causes all subsequent
lines to be included as if they also had it set because the variable
used to track it is not reset between loop iterations.  So fix that by
just setting it to empty before the check for the force option.
2020-05-01 11:43:47 +02:00
Harald Hoyer c6a2ebffe5 90kernel-modules/module-setup.sh: add sg kernel module
Fixes udevd messages about failure of `modprobe -bv sg`.
2020-04-30 21:51:58 +02:00
Harald Hoyer 5bfebf0f04 90crypt/module-setup.sh: try to catch kernel config changes
If a crypto kernel module changes from compiled in to module, the
encrypted disk might fail to open, because the kernel module was
not included in the initramfs.

This patch tries heuristically to catch such modules.

Fixes https://github.com/dracutdevs/dracut/issues/706
2020-04-24 12:29:05 +02:00
Harald Hoyer 586a56c287 Install crypto modules in 90kernel-modules
We don't want to play catch up with hash and encryption algorithms.
To be safe, just use the hammer and include all crypto.

Fixes https://github.com/dracutdevs/dracut/issues/802
2020-04-24 11:40:15 +02:00
Peter Georg faea4e4ddb Always pull in machinery to read ifcfg files
So far machinery is only pulled in if the user has not yet included any
ifcfg files.
2020-04-21 22:27:11 +02:00
Kairui Song 7dd8a2f4d3 Add 99memstrack module
memstrack is a new tool to track the overall memory usage and
allocation, which can help off load the improve the builtin module
memory tracing function in dracut.

With this change, the rd.memdebug=4 behavior is similiar with before,
but the report is defered to pre-pivot, so the memory usage info
during the whole initramfs run is traced. And the ourput format is
changed a bit:

  dracut-pre-pivot[519]: ======== Report format module_summary: ========
  dracut-pre-pivot[519]: Module squashfs using 10.4MB (2658 pages), peak allocation 10.4MB (2671 pages)
  dracut-pre-pivot[519]: Module qxl using 3.4MB (865 pages), peak allocation 3.4MB (880 pages)
  dracut-pre-pivot[519]: Module crc32c_intel using 2.0MB (519 pages), peak allocation 3.0MB (769 pages)
  dracut-pre-pivot[519]: Module serio_raw using 2.0MB (505 pages), peak allocation 3.6MB (918 pages)
  dracut-pre-pivot[519]: Module virtio_console using 1.6MB (416 pages), peak allocation 1.6MB (419 pages)
  ... snip ...
  dracut-pre-pivot[519]: ======== Report format module_summary END ========

It now contains more detail and also includes the peak usage which could
be more helpful.

And now it have a rd.memdebug=5, which will print more detail about
the stack trace of the top memory user, also printed on pri-pivot:

  dracut-pre-pivot[519]: ======== Report format module_top: ========
  dracut-pre-pivot[519]: Top stack usage of module squashfs:
  dracut-pre-pivot[519]:   (null) Pages: 2658 (peak: 2671)
  dracut-pre-pivot[519]:     (null) Pages: 2658 (peak: 2671)
  dracut-pre-pivot[519]:       async_page_fault (0xffffffff81a01149) Pages: 1448 (peak: 1461)
  dracut-pre-pivot[519]:         do_async_page_fault (0xffffffff8105c509) Pages: 1448 (peak: 1461)
  dracut-pre-pivot[519]:           do_page_fault (0xffffffff8106296a) Pages: 1448 (peak: 1461)
  dracut-pre-pivot[519]:             do_user_addr_fault (0xffffffff810626bd) Pages: 1448 (peak: 1461)
  dracut-pre-pivot[519]:               handle_mm_fault (0xffffffff812940c4) Pages: 1448 (peak: 1461)
  dracut-pre-pivot[519]:                 __handle_mm_fault (0xffffffff81293627) Pages: 1195 (peak: 1208)
  dracut-pre-pivot[519]:                   __do_fault (0xffffffff8128b07e) Pages: 1195 (peak: 1208)
  dracut-pre-pivot[519]:                     filemap_fault (0xffffffff8124c0b9) Pages: 1195 (peak: 1208)
  dracut-pre-pivot[519]:                       __do_page_cache_readahead (0xffffffff812585da) Pages: 1063 (peak: 1076)
  dracut-pre-pivot[519]:                         read_pages (0xffffffff812583c2) Pages: 1063 (peak: 1076)
  dracut-pre-pivot[519]:                           squashfs_readpage squashfs (0xffffffffc0022073) Pages: 1039 (peak: 1052)
  dracut-pre-pivot[519]:                             squashfs_readpage_block squashfs (0xffffffffc0024334) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                               squashfs_copy_cache squashfs (0xffffffffc0021a3f) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                                 pagecache_get_page (0xffffffff8124abf7) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                                   __page_cache_alloc (0xffffffff81247df6) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                                     alloc_pages_current (0xffffffff812cdca7) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                                       __alloc_pages_nodemask (0xffffffff812b3107) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                                         __alloc_pages_nodemask (0xffffffff812b3107) Pages: 1488 (peak: 1488)
  dracut-pre-pivot[519]: Top stack usage of module qxl:
  dracut-pre-pivot[519]:   (null) Pages: 865 (peak: 880)
  dracut-pre-pivot[519]:     entry_SYSCALL_64_after_hwframe (0xffffffff81a0008c) Pages: 855 (peak: 858)
  dracut-pre-pivot[519]:       do_syscall_64 (0xffffffff81002a5a) Pages: 855 (peak: 858)
  dracut-pre-pivot[519]:         __x64_sys_finit_module (0xffffffff8117ccea) Pages: 811 (peak: 811)
  dracut-pre-pivot[519]:           __do_sys_finit_module (0xffffffff8117cc6e) Pages: 811 (peak: 811)
  dracut-pre-pivot[519]:             load_module (0xffffffff8117c6be) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:               do_init_module (0xffffffff81179e72) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:                 do_one_initcall (0xffffffff81000d5a) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:                   serio_raw_poll serio_raw (0xffffffffc0200054) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:                     __pci_register_driver (0xffffffff81557804) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:                       driver_register (0xffffffff8167ed24) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:                         bus_add_driver (0xffffffff8167cbb2) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                           driver_attach (0xffffffff8167d28e) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                             bus_for_each_dev (0xffffffff8167b62c) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                               __driver_attach (0xffffffff8167e18f) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                 device_driver_attach (0xffffffff8167e0ed) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                   driver_probe_device (0xffffffff8167de6c) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                     really_probe (0xffffffff8167d9c9) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                       pci_device_probe (0xffffffff81559627) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                         local_pci_probe (0xffffffff81557f98) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                           qxl_pci_probe qxl (0xffffffffc01f0387) Pages: 773 (peak: 773)
  dracut-pre-pivot[519]:                                             drm_fbdev_generic_setup drm_kms_helper (0xffffffffc01b30c5) Pages: 773 (peak: 773)
  dracut-pre-pivot[519]:                                               drm_fbdev_client_hotplug drm_kms_helper (0xffffffffc01b2656) Pages: 773 (peak: 773)
  dracut-pre-pivot[519]:                                                 __drm_fb_helper_initial_config_and_unlock drm_kms_helper (0xffffffffc01b1a28) Pages: 770 (peak: 770)
  dracut-pre-pivot[519]:                                                   drm_fb_helper_generic_probe drm_kms_helper (0xffffffffc01b2fa5) Pages: 770 (peak: 770)
  dracut-pre-pivot[519]:                                                     vzalloc (0xffffffff812aa39c) Pages: 770 (peak: 770)
  dracut-pre-pivot[519]:                                                       __vmalloc_node_range (0xffffffff812aa200) Pages: 768 (peak: 768)
  ... snip ...
  ======== Report format module_top END ========

This could be very helpful for debuging memory usage issues.
2020-04-20 20:22:37 +02:00
Kairui Song 49c4172f4e Remove memtrace-ko and rd.memdebug=4 support in dracut
This feature could be off loaded to memstrack, which have better
accurecy, better performance, and have more detailed tracing features.

Also simplify make_trace_mem a bit.

And currently rd.memdebug=4 is unstable, fails from time to time.
2020-04-20 20:22:37 +02:00
Beniamino Galvani 87bffc36e7 network-manager: install libnss DNS and mDNS plugins
Install libnss_dns.so and libnss_mdns4_minimal.so plugins for the Name
Service Switch (NSS) functionality of glibc so that name resolution
through /etc/resolv.conf and mDNS works in the initrd.

Fixes: #772
2020-04-20 16:47:56 +02:00
Harald Hoyer 3a4a212649 systemd: skip dependency add for non-existent units
Fixes: https://github.com/dracutdevs/dracut/issues/795
2020-04-20 16:24:15 +02:00
Mikhail Novosyolov de34ba76e5 i18n: Always install /etc/vconsole.conf
/etc/vconsole.conf must be installed always, even in generic initrds, not only host-only ones.
systemd-vconsole-setup is run at initrd stage and expects either /etc/vconsole.conf or kernel cmdline options to exist.

I have also proposed a change in systemd-vconsole-setup that makes it behave better if /etc/vconsole.conf does not exist:
https://github.com/systemd/systemd/pull/15479
But it is just a fallback. If /etc/vconsole.conf does not exist in initrd and if that patch is applied on systemd,
then the default consoel font is set despite the one being set in /etc/vconsole.conf and this setting is inherited
when new TTYs are opened. This leads to full ignorance of settings in /etc/vconsole.conf.
It is incorrect, and that is why this file must be copied to initrds always, but not only on host-only initrds.

Fixes: https://github.com/dracutdevs/dracut/issues/796

Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
2020-04-20 15:37:28 +02:00
Jonas Witschel 8e1a4dc5f8 dracut-lib.sh: quote variables in parameter expansion patterns
According to POSIX.1-2017, 2.6.2 Parameter Expansion:

${parameter%[word]} [...] The word shall be expanded to produce a
pattern.

This means if word contains variables that itself contain special
characters like asterisks or backslashes, these are treated as pattern
characters unless the variable is quoted. Try e.g. the following example
in bash, dash or (busybox) ash:

i='a\c'; j='\'; echo "${i%$j*}"

This prints "a\c" because "$j*" is expanded to "\*", escaping the
asterisk. In contrast,

i='a\c'; j='\'; echo "${i%"$j"*}"

produces the expected result "a" because the backslash is not specially
treated any more after quoting.

The quotes that this commit adds have been previously removed in commit
f9c96cf56f, citing issues with busybox
hush without further specifying the actual error. I tested a recent
busybox build (upstream commit 9aa751b08ab03d6396f86c3df77937a19687981b)
and couldn't find any problems. Note that the above example always
produces "a\c" in hush regardless of quoting $j, making hush unsuitable
for use with dracut, but using quotes in parameter expansions generally
works.

The unquoted variables break the "rd.luks.uuid/name" kernel command line
options in dracut 050 because

str_replace "$luksname" '\' '\\'

in modules.d/90crypt/parse-crypt.sh is not able to escape the
backslashes any more, see GH-723, GH-727: backslashes in the
systemd-cryptsetup@.service unit name stay unescaped for use in udev
(cf. commit 0f6d93eb9d), leading to
failures in starting the unit.

This partially reverts commit f9c96cf56f.
2020-04-20 14:59:02 +02:00
Martin Wilck 25c7a13985 90nvdimm: include nvdimm keys in initrd
This is necessary to actually unlock NVDIMM keys during boot.
2020-04-17 18:22:36 +02:00
Kairui Song 872eb69936 95znet: Add a rd.znet_ifname= option
qeth device may have a different IP for each boot, so the rd.ifname=
option will no longer work. So for znet device, introduce a
rd.znet_ifname= options, to subchannel id instead of MAC address as the
identifier and rename the interface.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-04-14 12:56:13 +02:00
Ben Howard b8a92b7156 multipath: add automatic configuration for multipath
Add support for 'rd.multipath=default' for using the default
configuration on boot. The intended purpose for this is to help support
ostree-based image boots from multipathed devices (such as Fedora and
Red Hat CoreOS).
2020-04-03 23:48:32 +02:00
Alexander Sosedkin 3a043feea1 url-lib: drop NSS if it's not in curl --version 2020-04-02 22:09:39 +02:00
Patrick Talbert b68930ed3d dhclient-script: Fix typo in output of BOUND & BOUND6 cases
No bonding going on here.

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
2020-03-19 20:45:41 +01:00
Sebastian Mitterle defb1611c7 dasd: only install /etc/dasd.conf if present
`dasd.conf` needn't be present on system even if modules have been loaded.

Check if file exists to avoid error message during kernel update
```bash
dracut-install: ERROR: installing '/etc/dasd.conf'
dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.YvVRx5/initramfs -H /etc/dasd.conf
```
2020-03-19 18:05:30 +01:00
Đoàn Trần Công Danh 17d62d1206 cryptroot-ask: no warn if /run/cryptsetup exist
In either case:
- encrypted device is decrypted, udev will trigger device changes again,
- multiple encrypted device,

cryptroot-ask will run multiple time, then report:
> mkdir: cannot create directory '/run/cryptsetup': File exists

Pass `-p` into mkdir to ignore that warning.
2020-03-16 18:26:33 +01:00
Lukas Nykryn 7069132ec7 network: fix glob matching ipv6 addresses
In this case we want to cover three cases
1) ip_address:ip_address
2) number:macaddress
3) :macaddress

We consider something an IPv6 address if it starts with number and
contains ":", but IPv6 addresses are in hexa.
2020-03-12 13:46:46 +01:00
Beniamino Galvani 3dcaa97ca4 network-manager: ensure that nm-run.sh is executed when needed
The network-manager command line hook must install a
initqueue/finished hook to ensure that nm-run.sh is executed when
there are network connections to activate.

Fixes: #694
2020-03-12 11:42:37 +01:00
Harald Hoyer 0402b3777b btrfs: force preload btrfs module
fixes https://github.com/dracutdevs/dracut/issues/658

raid6_pq and xor takes time doing benchmarking

[    3.983009] request_module fs-btrfs succeeded, but still no fs?
2020-03-11 13:38:12 +01:00
Thomas Blume 8446c8f9de 95fcoe: default rd.nofcoe to false
rd.nofcoe should default to false, e.g. fcoe should be enabled unless
overwritten from the command line.
The same applies for lldapd.sh.
2020-03-11 12:29:03 +01:00
Radek Vykydal 7fb8f939a5 Fix pre-trigger stage by replacing exit with return in lldpad.sh
Using exit makes the pre-trigger stage finish after running 03-lldpad.sh
pre-trigger hook.
2020-03-10 12:47:55 +01:00
Daniel Molkentin 2293609dcb 95dcssblk: fix script permissions 2020-03-06 13:51:06 +01:00
Daniel Molkentin 7a04712ad0 95zfcp_rules/parse-zfcp.sh: remove rule existence check
Reference: bsc#1008352

Original-Patch-By: Michal Suchanek <msuchanek@suse.com>
2020-03-06 11:32:41 +01:00
Daniel Molkentin db9b5851f3 99base: Remove duplicate nfsroot_to_var from dracut-lib.sh
It already lives in nfs-lib.sh, which is the more correct library scope.

Fixes #17
2020-03-06 11:02:15 +01:00
Martin Wilck 18420d9ce5 90kernel-modules: remove nfit from static module list
The 90nvdimm module now resolves the nfit dependency when it's
necessary, so it's not necessary any more to pack it always.
2020-03-06 10:52:06 +01:00
Martin Wilck 7ef5ead6f4 Add module "90nvdimm" for NVDIMM support
Detection of persistent memory devices works mostly out of the box
already. Only the "provider" modules for ndbus devices, which are responsible
to extract information of available NVDIMM devices and their configuration
from system firmware, are only indirectly linked into the module stack.
Examples for such modules are nfit.ko, nd_e820.ko, and virtio-pmem.ko.

Add a module that resolves these dependencies.
2020-03-06 10:52:06 +01:00
Marek Marczykowski-Górecki ebeed55c07 Consider also drm_dev_register when looking for gpu driver
DRM drivers are filtered for drm_crtc_init symbol,
but not all drivers use it. Especially, cirrus driver
doesn't use it since Linux 5.2.

The practical result is text plymouth theme instead of graphical when in qemu.

Fix it by looking also for drm_dev_register symbol.
Suggested by @haraldh
Fixes #712
2020-03-04 10:41:04 +01:00
Daniel Molkentin f2d33a7f61 90kernel-modules: Add PCI host controller modules
Currently there is no usb support on RPi4 in the
initrd phase as the pcie-brcmstb module is missing.
If part of the boot is handled from a USB stick
(e.g. with Ignition), the stick cannot be accessed.

Reference: boo#1162669
2020-03-04 09:23:09 +01:00
Daniel Molkentin 7dc918cad1 90crypt: install crypt-run-generator in non-systemd environments 2020-03-04 09:22:09 +01:00
Daniel Molkentin 452cb40497 90crypt: Do not call cryptsetup in a systemd environment
systemd provides its own cryptsetup facilities, and the
cryptsetup binary might not even exist, failing
to execute the discard flag processing.

Fixes #602
2020-03-04 09:22:09 +01:00
nabijaczleweli 38c8fed48a Enable resume module if hibernation's enabled on the host
Ref: 34b56de12a
Fixes https://github.com/dracutdevs/dracut/issues/496
2020-03-03 19:51:08 +01:00
Alexander Miroshnichenko 3ea80545d6 stratis module: fix start order
Change start script order to pre-mount as stratis require fully initialized udev.
2020-02-28 20:43:01 +01:00
Frantisek Sumsal ef8915d7af fcoe/fcoe-genrules.sh: use $name instead of $env{INTERFACE}
Followup to a8ba1c4e25 and
11a5501d0f
2020-02-28 20:41:37 +01:00
Frantisek Sumsal 11a5501d0f cms/cmssetup.sh: use $name instead of $env{INTERFACE}
Followup to a8ba1c4e25
2020-02-28 16:32:11 +01:00
Harald Hoyer 63b67a48f9 nbd/parse-nbdroot.sh: don't create mount unit
let the generator do its thing
2020-02-27 15:27:30 +01:00
Harald Hoyer a8ba1c4e25 network-legacy/net-genrules.sh: use $name instead of $env{INTERFACE}
The original behavior of $env{INTERFACE} was undocumented and changed in
the recent udev versions, breaking the ability to bring up networking
reliably. Switching to $name directive should fix this issue.

Related links:
 - systemd/systemd#12700 (udev PR)
 - systemd/systemd#12291 (related udev issue)
 - systemd/systemd#14935 (this issue, udev side)
 - #732 (this issue, dracut side)

Fixes: #732
2020-02-27 13:49:21 +01:00
Jonathan Lebon 4985aa8c6e network-legacy/ifup: fix ip=dhcp,dhcp6 setup_net logic
Previously, we were doing `setup_net` from `ifup` for any setup that
wasn't DHCP, since those are already taken care of by `dhclient-script`.

The issue is that the case-statement we use to detect this doesn't catch
options like `ip=dhcp,dhcp6`.

Fix this by reworking the logic here to just check if a
`setup_net_$netif.sh` hook exists. If so, then we know that `setup_net`
will be called for this interface later.

This was causing issues in RHCOS which now ships with `ip=dhcp,dhcp6` to
support IPv6 environments[1]. The code here would make us do `setup_net`
pre-emptively which IIUC would then cause the initqueue to finish
earlier even if we had more udev netif events to process.

[1] https://github.com/coreos/coreos-assembler/pull/1067

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1803926
2020-02-25 14:34:58 +01:00
Jonathan Lebon 7795fde44c network-legacy/ifup: drop redundant if-statement
No need to check that `$ret` is 0, we're already running inside an
if-statement block which checks this.
2020-02-25 14:34:58 +01:00
Harald Hoyer 16abea2592
systemd: install systemd-tty-ask-password-agent systemd-ask-password
fixes https://github.com/dracutdevs/dracut/issues/726
2020-02-18 15:33:23 +01:00
Eugene S. Sobolev c7ee6b3dbb network/net-lib.sh: Configure all iBFT interfaces
Added boolean command line option rd.iscsi.mp
2020-02-14 10:42:34 +01:00
Lukas Nykryn 76f6566fd7 Revert "wait for IPv6 RA if using none/static IPv6 assignment"
This reverts commit c603419030.

wait_for_ipv6_dad_link is only called from dhclient script,
so the original intent "wait for IPv6 RA if using none/static IPv6 assignment"
does not seem to be correct.

Anyway, this brings an issue on isolated networks, where you don't
have any routes outside. dhclient-script hangs on this check
and after it times out, dhclient is able to set the address normally.
2020-02-11 14:23:27 +01:00
Lukas Nykryn 962310483f dhclient-script: ipv6 uses different variables for nameservers
new_domain_name_servers and new_domain_search is only provided vit IPv4

see: https://src.fedoraproject.org/rpms/dhcp/blob/HEAD/f/dhclient-script#_148
2020-02-11 14:23:03 +01:00
Lukas Nykryn 579fbb9fc4 40network: bump rd.net.timeout.carrier to 10 seconds
On some devices kernel currently takes 5.2 seconds to detect carrier,
so let's make the default in dracut bit more sensible.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1772010
2020-02-10 14:37:15 +01:00
Harald Hoyer 350ec5d9dd
uefi-lib/uefi-lib.sh: fixed script for bash version 5
bash 5 `read` behaves differently and returns != 0 for 0 bytes read

fix it with the best effort
2020-01-24 13:42:46 +01:00
Harald Hoyer 2ee69a40c8
add missing crypto modules for aarch64
Fixes https://github.com/dracutdevs/dracut/issues/711
2020-01-23 13:47:53 +01:00
Jonathan Lebon d0de58f232 network-legacy/ifup: nuke pid and lease files if dhclient failed
Otherwise we won't retry dhclient again on that interface. In
FCOS/RHCOS, we want to bake in `ip=dhcp,dhcp6` so we automatically try
getting a DHCPv6 lease if DHCPv4 failed.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1793591
2020-01-23 09:32:25 +01:00
Kairui Song f4ad2e5c89 90kernel-modules: don't install any block driver if not needed
If hostonly mode is in use, and there isn't any block device included
as hostonly device, then the initramfs won't need any block driver.

Eg. for kdump built image, there could be only one nfs mount point,
or the initramfs may only execute some network operation then reboot.

In such case, skip block driver installation to save space and time.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-01-17 07:26:24 +01:00
Jan Macku cb86c560b0 Write dns values passed by ip argument to ifcfg-* files 2020-01-14 09:33:38 +01:00
Jan Macku 70b19acf94 Replace ln with systemctl 2020-01-14 09:29:51 +01:00
Jacob Wen d5e818f349 35network-legacy: using 'replace' instead of 'add' to add route
This is a simple trick to honor RFC 3442:
If the DHCP server returns both a Classless Static Routes option and
a Router option, the DHCP client MUST ignore the Router option.

Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
2020-01-14 09:26:12 +01:00
Kairui Song 4598b5540e 95iscsi: Fix /etc/iscsi installation
Previous all files are installed with inst_dir, which will not install
the files under /etc/iscsi/, and it create folders with the same of the
files which is wrong.

Now only use inst_dir to install the config dir and ensure it
exists, and use inst_multiple to install the config files.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-01-14 09:25:29 +01:00
Lubomir Rintel 5965710e01 network-manager: don't run NetworkManager when there are no connections
NetworkManager would unnecessarily bring up the devices, colliding with
further attempts to rename the devices.

This is arguably a NetworkManager bug and should eventually be fixed there.
Running NetworkManager without the connection is unnecessary regardless.
2020-01-14 09:24:42 +01:00
Brian C. Lane 05b75703b0 Check .hmac of boot.iso in fips mode
Instead of carrying the kernel and hmac in the install.img (which takes
up more space) use the vmlinuz installed under /images/pxeboot/ and the
.hmac in the install.img /boot.

This check is triggered by the presence of /run/install/repo/images/pxeboot/vmlinuz

Related: rhbz#1782737
2020-01-14 09:23:21 +01:00