Commit Graph

5099 Commits (01ffcf342ae65984c655f10a2fd35019a492ee5c)

Author SHA1 Message Date
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
Lukas Nykryn 48c283a296 dracut.install: call dracut with --force
The kernel-install is called even if you run make install.
Since we don't call dracut with -f a second make install will fail
because initrd with same version is already there.
This makes kernel developers feel miserable.

https://bugzilla.redhat.com/show_bug.cgi?id=1642402
2018-10-25 16:14:05 +02:00
Harald Hoyer 0eef73ea43 Makefile: add srpm target 2018-10-24 15:14:03 +02: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
Pedro Monreal db4d6bb42c Added space in Resolving executable dependencies done as in the rest of the messages 2018-10-09 13:41:55 +02:00
Kairui Song f51ab4a81f dracut.spec: Fix error introduced by 70291ed
70291e0 ('dracut.spec: Add dracut-squash package') introduced a new
dracut-squash package, but by accident it overrided some other package
spec and the dependency name is wrong. This patch will fix it.
2018-10-09 13:39:32 +02:00
Mike Gilbert 6d886bb74d dracut-install: simplify ldd parsing logic
The previous logic would not handle absolute paths on the left side of
the "=>" properly. For example, on Gentoo ARM64, ldd outputs this:

	/lib/ld-linux-aarch64.so.1 => /lib64/ld-linux-aarch64.so.1

At runtime, the kernel tries to load the file from /lib, and fails if we
only provide it in /lib64.

Instead of looking for the first slash after the "=>", just look for the
first slash, period. This would fail if we somehow had a relative path
on the left side (foo/libbar.so), but I'm not aware of any binaries that
would contain such an entry in DT_NEEDED.

Bug: https://bugs.gentoo.org/667752
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
2018-10-09 13:38:47 +02:00
Harald Hoyer 225e4b94cb Fix tests with network-legacy 2018-10-08 15:38:33 +02:00
Harald Hoyer 3e676eb12f AUTHORS: update 2018-10-08 15:31:49 +02:00
Harald Hoyer 2257b800ac NEWS: update 2018-10-08 15:31:08 +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
Harald Hoyer 4be697e5c1 dracut.spec: fixed invalid spec line 2018-09-21 12:41:00 +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 24f3463bff dracut.spec: Add dracut-squash package
As 99squash module requires extra dependency and it introduces new
files, add a new sub package for this module.
2018-09-21 10:32:04 +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 838f22259a install: avoid non-portable __WORDSIZE
Lets not unnecessarily rely on __WORDSIZE, which is not clearly specified
by any spec. Use explicit size comparisons if we're not interested in the
WORDSIZE, anyway.

Patch ported from systemd.
(commit 8507eb20b64010b26f23822cbf442bb0bf96511c)

Original-patch-by: Emil Renner Berthing <systemd@esmil.dk>
Bug: https://bugs.gentoo.org/602122
2018-09-10 09:45:22 +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
Tobias Klauser d09218823c Fix misspellings in man pages and usage
Also remove some trailing whitespaces from the same files.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-08-30 13:12:00 +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 e0e6d96d69 travis: re-enable test 14
https://bugzilla.redhat.com/show_bug.cgi?id=1615271
2018-08-20 10:05:41 +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 09132c732a test/test-functions: fixed V=1 logic 2018-08-17 15:38:03 +02:00
Harald Hoyer f19063ac71 travis: one last job reshuffle 2018-08-16 15:34:49 +02:00
Harald Hoyer a17440713a travis: reshuffle tests
long running tests first
2018-08-16 14:48:21 +02:00
Harald Hoyer bd03d374b7 travis: modprobe amd nested=1
GREAT!

$ modinfo kvm-intel kvm-amd| fgrep nested
parm:           nested:bool
parm:           nested:int
2018-08-16 14:28:54 +02:00
Harald Hoyer 06e12e4ba8 travis: rebalance tests 2018-08-16 14:25:23 +02:00