Commit Graph

2910 Commits (049)

Author SHA1 Message Date
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
Lubomir Rintel 0aa2e5f728 iscsi: start iscsid even w/o systemd 2018-09-21 11:32:01 +02:00
Lubomir Rintel 5e615f4eb4 iscsi: do not install all of /etc/iscsi unless hostonly
/etc/iscsi/initiatorname.iscsi would leak the host initiator name (that
is host configuration) to the initramfs. Perhaps other files too.
2018-09-21 11:32:01 +02:00
Lubomir Rintel 9e82732dd4 iscsi: do not replace the configuration in the host system
ln: failed to create symbolic link '/usr/lib/systemd/system/sockets.target.wants/iscsid.socket': Permission denied
  ln: failed to create symbolic link '/usr/lib/systemd/system/sockets.target.wants/iscsiuio.socket': Permission denied

No way. Just ensure the links are there in the initramfs image. In fact,
that is already the case for iscsiuio.socket. Add iscsid.socket too.
2018-09-21 11:32:01 +02:00
Lubomir Rintel 0454dc247a network: configure NetworkManager to use dhclient
If the network module obtained a lease using dhclient, NetworkManager
must be configured to use it too, otherwise it would obtain a different
lease (and could potentially break a connection to the network volume).
2018-09-21 10:40:55 +02:00
Kairui Song 095e1f37c4 Add support for building a squashed initramfs
With all files stored in ramfs, and most of them are not compressed,
the initramfs will take up a lot of memory. Besides, if the file number
is large, each file will waste some memory due to page fragmetation.
This is due to ramfs' design, at least one page will be allocated for
one file however small the file is. On machine with large page size,
this will become worse and waste too many memory.

One approach to reducing the memory usage is to reduce the number of
files that got directly loaded into the root ramfs, and compress files
by put most files will into a read-only squash image and keep a minimum
set of executable and libraries outside as the loader for the squash
image. After the squash image is mounted, the real 'init' will be
executed and then everything behaves as usual.

This patch will introduce a '99squash' module which will never be
included by default. User can force add it, and if it is included,
dracut will perform some extra steps before creating the final image:

For now, "/etc" and "/usr" will be moved into the squashfs image.
"/init" will be renamed to "/init.stock" and replaced by "/init.squash".
Files and folders need to be accessible before mounting the image will
be still avaliable at their original place. And due to squashfs is
readonly, an overlayfs layer will be created on top of squashfs mount
point, as many dracut module require readwrite access to "/etc" and
"/usr", "init.squash" will ultimately call "/init.stock".

An extra systemd service will be installed. This service will umount all
squashfs related mount points right before switch-root to release
resources properly. This service will not actually do anything if
switch-root is not used.

This is very helpful when mem resource is very limited, like Kdump.
According to my tests, this squash module can help save about 35MB of
memory with 64K page size, or about 15MB with 4K page size on an
ordinary kdump capture routine. This module could also help reduce
memory usage for normal boot up process.

Won't change any behavior if squash module is not enabled.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-09-21 10:32:04 +02:00
Alexander Tsoy f4334e9bdf base/dracut-lib.sh: use "command -v" in pidof()
"type -P" doesn't work in dash
2018-09-10 09:45:50 +02:00
Alexander Tsoy b3480d31b0 Prevent environment leaking into initrd-release
On my system the following initrd-release is generated:
...
VERSION="4 dracut-048 dracut-048"
...

VERSION is not defined in /etc/os-release, so the variable is
concatenated with its previous value:

* "4" comes from the kernel build system since dracut is called from the
  kernel install hook ("4" is a major kernel version);
* first "dracut-048" comes from the "systemd-initrd" module;
* second "dracut-048" comes from the "base" module.
2018-09-10 09:42:36 +02:00
Frederick Grose 8dd7bb48fc dmsquash-live/apply-live-updates: Test proper file link.
Update flag link to /dev/root as required by commit
789668deb3.
2018-09-06 11:46:24 +02:00
Frederick Grose 44d1688164 dmsquash-live-root: Manage absent overlayfs module better.
die when required; systemctl reload otherwise.
2018-09-06 11:46:24 +02:00
Frederick Grose a7d8fc280c dmsquash-live: Avoid grep and sed in this module.
strstr and variable string manipulations suffice.
2018-09-06 11:46:24 +02:00
Daniel Molkentin e9a84e0a21 98dracut-systemd: Start systemd-vconsole-setup before dracut-cmdline-ask
This is what happened before this patch (edited for brevity):

  dracut-cmdline-ask.service in modules.d/98dracut-systemd, which invokes
  dracut-cmdline-ask.sh. This script and systemd-vconsole-setup are
  started in parallel for the same console (tty1).

  Then dracut-cmdline-ask quits immediately without doing anything (unless
  rd.cmdline=ask is given). As this is a bash script and it gets tty as
  stdin as specified in its *.service, this triggers the hangup of tty1 at
  its exit.

  Meanwhile systemd-vconsole-setup continues and tries some ioctls after
  that, but they fail because of the hung up tty1.

The usual culprit for starting systemd-vconsole-setup early on is
plymouth-start.service, even if plymouth.enable=0 is set.

A popular (and annoying) symptom of this as reported by users was
the inability use their configured keyboard layout in plymouth when
unlocking their crypted block devices.

Reference: boo#1055834
2018-09-05 13:20:36 +02:00
Tony Asleson ae9bc0d72f stratis: Add additional binaries
Include all binaries that could be called by the daemon.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2018-08-24 08:46:13 +02:00
Kairui Song 09ba1b289f kernel-modules: add nfit
To support pmem devices, nfit module is required
2018-08-21 13:03:36 +02:00
Kairui Song 9f3c31cd8d 99base: enable initqueue if extra devices are added
When extra devices are added, initqueue should be enabled to make sure
those devices are present, so following services and routines could
use those devices.

See PR #442 for more detail.
2018-08-21 13:03:20 +02:00
Frederick Grose eb18a1fe29 dmsquash-live, livenet: Simplify OverlayFS read-only overlay setup.
Use multiple lower layer directories in a single OverlayFS mount with
  a transient overlay directory.
Tolerate a command line with rd.live.overlay.readonly and NO persistent
  overlay by reconfiguring the OverlayFS mount options.
Use more compatible shell syntax for testing symlinks, and use printf
  instead of echo -e.
2018-08-21 10:52:34 +02:00
Frederick Grose 789668deb3 dmsquash-live: Support a flattened squashfs.img
A simplified root filesystem structure may be provided for OverlayFS
overlays by squashing the root filesystem directly instead of squashing
an embedded image file at /LiveOS/rootfs.img.  Detect and configure
such a squashed root filesystem for live booting.

For OverlayFS boots, avoid the read-only Device-mapper linear device
  at /dev/mapper/live-base.
Create a consistent device link at /dev/live-base for the read-only
  base loop device for all overlayed live root filesystems.
Consistently provide a link at /dev/root for wait_for_dev.

Update documentation.
2018-08-21 10:52:34 +02:00
Frederick Grose e791d753be livenet: Enable OverlayFS overlay in sysroot.mount generator.
Adjust sysroot.mount configuration for rd.live.overlay.overlayfs option.
Use link at /dev/root as a consistent flag for wait_for_dev.
Adjust documentation.
2018-08-20 10:08:43 +02:00
Harald Hoyer ee18dd2b88 ifcfg/write-ifcfg.sh: aggregate resolv.conf
The old code used /tmp/net.$netif.resolv.conf with $netif being randomly
chosen.

As it is not known which nameserver have which priority, just sort them
and deduplicate.
2018-08-17 15:52:36 +02:00
Harald Hoyer bb75d16521 kernel-network-modules: add vlan kernel modules 2018-08-14 14:07:12 +02:00
Harald Hoyer ab94a204e0 load modules earlier for iscsi via dhcp root-path 2018-08-14 11:03:11 +02:00
Harald Hoyer 26aea0299a multipath-shutdown: fix shell syntax
seems like a misplaced $()
2018-08-13 16:30:25 +02:00
Harald Hoyer 6f0500ed4a iscsi: remove $() where it does not fit
also simplify iscsiadm command to one call
2018-08-13 16:30:25 +02:00
Harald Hoyer 746135dd1e mdraid: better handling of various UUID formats 2018-08-13 16:30:25 +02:00
Nicolas Chauvet a0c915b1e4 Add gpio and pinctrl drivers for arm*/aarch64
This is needed since few gpio/pinctrl can be built as modules and are
useful on early boot.

One example is jetson-tx1 where sata and external mmc can work only
after loading pinctrl-max77620 and gpio-max77620 modules.

Having theses kind of drivers bundled into the initramfs will also
avoid some deferred probes.

V2: add pinctrl for all arches

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2018-08-06 09:46:08 +02:00
Harald Hoyer 99df3d22be mdraid/parse-md.sh: also accept rd.md.uuid with ":"
convert rd.md.uuid=32ef2172:f056:6fa7:66a8:2f7fc8b1798
to udev rules in the correct UUID format 32ef2172-f056-6fa7-66a8-2f7fcf8b1798
2018-08-02 16:32:41 +02:00
Hannes Reinecke a0eadcdc64 00warpclock: Set correct timezone
Add module for setting correct timezone.

References: bnc#830060

For now, this module will not be included automatically due to different
expectations (see e.g.  https://bugzilla.redhat.com/show_bug.cgi?id=981617)

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Molkentin <daniel.molkentin@suse.com>
2018-07-24 07:08:11 +02:00
Harald Hoyer 1caaeaae1e modules.d/95fcoe/cleanup-fcoe.sh: chmod +x 2018-07-12 15:19:17 +02:00
Harald Hoyer f265cb67dc mdraid: fix case if rd.md.uuid is in ID_FS_UUID format
if rd.md.uuid is in ID_FS_UUID format with dashes
e40a0234-7e52-5f10-f267-658d8ec463fa
convert it for the /dev/disk/by-id/md-uuid-${uuid} format
e40a0234:7e525f10:f267658d:8ec463fa
2018-07-06 09:25:03 +02:00
Harald Hoyer f98d3066d9 rdsosreport.sh: best effort to strip out passwords
Modified version of:
https://github.com/dracutdevs/dracut/pull/96

Thanks to Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
2018-07-05 14:49:23 +02:00
Kairui Song 35e86ac117 Merge 90-multipath-hostonly and 90-multipath
This commit basically reverts 5ce7cc73

90-multipath-hostonly module was added in 5ce7cc73, because if hostonly
mode is enabled, multipath module will always hardcode wwids which
causes problems when the initramfs is cloned to another system with same
hardware.

Now with tri-state hostonly mode, the two modules could be merged and only
hardcode wwids when "strict" hostonly mode is enabled.
2018-07-05 13:17:19 +02:00
Harald Hoyer efecf0a95e network: iface_has_carrier(): fixed logic 2018-07-05 09:37:10 +02:00
Hiroaki Mizuguchi c574c3f565 ifup.sh: don't wait linkup when set static ip explicitly
iface_has_carrier is skipped when set $dev. Fail curl fetch for root=live:<url>.
2018-07-05 09:37:01 +02:00
Daniel Molkentin 61ac90fefa 95qeth_rules: Add new module to copy qeth rules
Only pick rules for interfaces which have a carrier in the running
system. Those interfaces will be assembled by udev to allow booting
from those devices (i.e. iSCSI).

Reference: FATE#323440
2018-07-05 09:15:08 +02:00
Kairui Song 432647c278 90kernel-modules: Don't install extra modules when hostonly mode is set to strict 2018-07-05 09:14:02 +02:00
Harald Hoyer 6ccb58a5b6 iscsi: s/rd.iscsilogin.retries/rd.iscsi.login_retry_max 2018-07-05 09:02:55 +02:00
Harald Hoyer 7d0848957c iscsi: do discovery for every network change 2018-07-04 13:05:56 +02:00
Daniel Molkentin 6b7ffedf0d Fix syncheck complaints 2018-07-04 13:05:56 +02:00
Daniel Molkentin b31f3fe0d1 95iscsi: Replace iscsistart with iscsid
This allows to setup multiple paths to targets, which is
required for iscsi multipath.
2018-07-04 13:05:56 +02:00
Nicolas Porcel c1688560ad Add timeout option to crypt module 2018-07-04 09:16:50 +02:00
Sullivan (CTR), Austin e0ec6f10d4 Fixed issue #420 2018-07-02 12:42:32 +02:00
Adam Williamson ba26c59523 Include virtio DRM drivers in hostonly initramfs
The code in 50drm which tries to include all DRM drivers for
hardware attached to the system did not look for virtio devices.
So if the system is a VM using the 'virtio' graphics adapter,
the 'virtio-gpu' module which should be included is not. This
extends the code to also look for virtio devices.

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

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2018-07-02 11:56:15 +02:00
Ondrej Mosnacek cec0d04112 fips: only install FIPS-compliant crypto modules
Since the kernel doesn't allow using any non-FIPS-compliant crypto
algorithms, it doesn't make sense to install them. Even if they are
installed, tcrypt will not test them anyway.

Tested on Fedora 28 x86_64 by booting with fips=1 (with hand-patched
module-setup.sh).
2018-07-02 11:42:04 +02:00
Ondrej Mosnacek f4d34357c0 fips: cleanup FIPS crypto module list
This patch cleans up the default list of kernel modules in the 01fips
dracut module. All the algorithms that are tested in tcrypt are listed
by their algorithm name so that all the generic implementations and
drivers are picked up automatically based on the module alias.

This drops several unneeded modules and even a bogus one (rot13 -- this
one was obviously copy-pasted from tcrypt.c where it was listed as an
easter egg :).

The patch adds also some algorithms that weren't included in the
original set. It turns out in FIPS mode we only need those algorithms
that are marked as FIPS-allowed in testmgr.c (failure to find a non-FIPS
algorithm is ignored). The non-FIPS algorithms are further removed in a
subsequent patch.
2018-07-02 11:42:04 +02:00
Ondrej Mosnacek eed91294f8 fips: add crypto_user module for new hmaccalc
In Fedora 28+, hmaccalc (sha512hmac) is provided by libkcapi-hmaccalc,
which needs the crypto_user module for its functionality.
2018-07-02 11:42:04 +02:00
Hui Wang a73ba9a8ef dracut: scan and install external kernel modules
since kmod-25 keyword "external" was implemented in order to avoid
additional actions(like weak-modules) when kernel was updated, which
makes it more simple while kernels' kabi were compatible.

but if move some special modules such as megaraid_sas, mpt3sas and
so on, to a external path like /opt/modules, these modules will not
be install to initramfs by default, which make the initramfs can't
be used to boot for disk detection failure.

according to kmod's document, you must specify a absolute path with
"external" keyword, so scan the lines in modules.dep that begin with
"/" and install them, to make sure necessary modules in external path
can be installed to initramfs too.

Signed-off-by: Hui Wang <john.wanghui@huawei.com>
2018-07-02 11:40:42 +02:00
Ondrej Mosnacek bca1967c90 fips: Drop obsolete dependencies
Explicitly require libkcapi-hmaccalc and stop installing NSS/prelink
dependencies that are no longer needed.
2018-06-14 13:07:07 +02:00