Commit Graph

5665 Commits (836e2ffac6695201e334c8ef13488e2492b58db0)

Author SHA1 Message Date
Harald Hoyer 836e2ffac6 fix: shellcheck for modules.d/99squash/setup-squash.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 67bcc49304 docs: fix dracut.cmdline.7
```
asciidoc: WARNING: dracut.cmdline.7.asc: line 1115: nested inline passthrough
```
2021-02-15 09:31:57 +01:00
Harald Hoyer dbb8a98b29 ci: wait for udev before doing sfdisk
might be responsible for some flakiness
2021-02-15 09:31:01 +01:00
Harald Hoyer 0f807f49cf ci: more disk space for test 30 iscsi
```
mke2fs 1.45.6 (20-Mar-2020)

Filesystem too small for a journal
Discarding device blocks:          done
Creating filesystem with 1024 1k blocks and 128 inodes

Allocating group tables: 0/1   done
Writing inode tables: 0/1   done
Writing superblocks and filesystem accounting information: 0/1   done

cp: error writing '/sysroot/usr/bin/bash': No space left on device
cp: error writing '/sysroot/usr/bin/grep': No space left on device
cp: error writing '/sysroot/usr/bin/ping': No space left on device
[…]
```
2021-02-15 09:30:29 +01:00
Beniamino Galvani 79ed45e021 fix: update dbus module directory in spec file
The directory name was changed in 16efdfa25c.
2021-02-15 08:07:33 +00:00
Jóhann B. Guðmundsson 9edabfa600 fix: add sdaskpw and sdsyctl to spec file
Adding systemd-ask-password and systemd-sysctl to the spec file

Alphabeticaly order the newly introduced systemd based module
in the spec file.
2021-02-10 21:26:56 +01:00
Jóhann B. Guðmundsson 5cd1a9fb13 fix: cosmetic comment fixes
This rephrases a comment in the check() as requested on another PR
and generalizes the install() section comments on par with other recent
module changes.
2021-02-10 21:26:35 +01:00
Jóhann B. Guðmundsson dc00256e12 feat(systemd-ask-password): introducing systemd-ask-password module
Introducing systemd-ask-password module which is used to query a
system password or passphrase from the user.

This module can be used standalone ( systemd-ask-password )
( which is without plymouth & wall support )
With plymouth module ( systemd-ask-password + plymouth )
With wall module ( systemd-ask-password + wall ), which is currently
commented out since there is no forceable usecase for it or even exiting
wall module.

This is a standalone systemd module which means it depends on no other module than systemd.
2021-02-10 15:10:56 +01:00
Luiz Angelo Daros de Luca ba3f4cdadc Revert "nbd: use systemd-run to start nbd-client"
systemd-run runs nbd-client in parallel. This introduces a possible
race condition when /dev/nbd0 is not directly used by /sysroot mount
but used by another dracut module as in:

  netroot=nbd:ip:port:fstype root=live:/dev/nbd0

Before nbd0 usages are synchronized, it is better to keep it serial.

This reverts commit 9fd0461b7d.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2021-02-10 15:02:41 +01:00
Luiz Angelo Daros de Luca 51b36f56d8 dmsquash-live-root: squashfs in bare device
Check if dev in root=live:<dev> might be already the squashfs image.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2021-02-10 15:02:41 +01:00
Jóhann B. Guðmundsson dff9baf3b4 feat(systemd-sysctl): introducing systemd-sysctl module
Introducing systemd-sysctl module which is an early boot
service that configures sysctl.

The systemd-sysctl module has dependency's on systemd and
systemd-modules-load module.
2021-02-10 15:00:45 +01:00
Jóhann B. Guðmundsson ba2e760b91 fix: adding missing efi paths 2021-02-10 14:39:54 +01:00
Harald Hoyer b56448ba09 docs: fix CI badges in README 2021-02-10 14:39:11 +01:00
Harald Hoyer 1ebf454884 fix: correct the squash quirk
Previously with `no_kernel` the `for` loop errored on the modules
wildcard. By checking, if the file exists, this is mitigated.

"mv" asked interactively, if aliased in the user session, so a "--force"
was added.
2021-02-10 14:14:39 +01:00
Jóhann B. Guðmundsson fdbe7f9fbf feat(systemd-modules-load): introducing systemd-modules-load module
Introducing systemd-modules-load which is an early boot service
that loads kernel modules from a static list, which is required for
kernel modules that do for example not support automatic module loading
( like key type parsers ).
2021-02-10 13:13:18 +00:00
Petr Pavlu 38ef319390 fix(shutdown): add timeout to umount calls
When terminating a system, the shutdown module attempts to unmount all
file systems from under /oldroot. This reaps remaining file systems that
systemd cannot unmount and detaches /oldroot itself.

In case that running umount for some file system repeatedly fails, the
module reports this error and continues the processing in order to
shutdown the system. This handles a condition when the umount command
actually terminates but it can happen in some cases that it waits
indefinitely.

An example with NFS mounts:
# mount -t nfs 192.168.0.1:/srv/nfs/dir /mnt/nfs
# mkdir /mnt/nfs/dir2
# mount -t nfs 192.168.0.1:/srv/nfs/dir2 /mnt/nfs/dir2
# touch /mnt/nfs/dir2/file
# systemd-run -pKillMode=none -pSendSIGKILL=no tail -f /mnt/nfs/dir2/file
Running as unit: run-r367825c967ca4d88a793ae4793c02f8b.service
# systemctl poweroff

The invoked tail command escapes normal termination by systemd and
prevents stopping mnt-nfs.mount and mnt-nfs-dir2.mount as it makes the
mounts busy. Systemd then again attempts to unmount these file systems
in systemd-shutdown but this fails as well. The utility tries to unmount
/mnt/nfs/dir2 but the kernel waits indefinitely doing a path lookup for
/mnt/nfs because network is no longer available at that point. The
systemd-shutdown gives up after 90 seconds. Finally, the control is
transferred to dracut which tries to unmount the file systems in the
same way and ends up indefinitely waiting on umount to finish.

This situation causes that the system hangs during shutdown. The patch
improves the shutdown module to add a timeout of 90 seconds for the
umount operation and continue with the shutdown if it gets reached,
similarly to what systemd-shutdown does.
2021-02-10 14:06:37 +01:00
Harald Hoyer 45907c1d4d ci: disable tests with NFS kernel crashes
Tests 50, 51, 60, 61 all suffer from kernel crashes in the kernel nfsd.

Until this is resolved, disable these tests.
2021-02-10 13:56:40 +01:00
Harald Hoyer 35bd0b4ac1 ci: only bind /dev/kvm into the container
dracut is only interested to use `/dev/kvm` if available.
2021-02-10 13:56:40 +01:00
Harald Hoyer a6faf453a8 ci: reduce CI workload
Only run `fedora-latest` and `fedora-32` on actual merge.
2021-02-10 13:56:40 +01:00
Harald Hoyer 16efdfa25c fix: revise all module checks
1. no module checks for modules which are in depends()
2. no `derror` for optional (255) modules checking for dependencies
3. fix dbus meta module
2021-02-10 13:29:17 +01:00
Harald Hoyer 1914a2eba1 fix: add missing line continuation 2021-02-10 12:05:24 +01:00
Daniel Molkentin 786ca932e8 fix: BuildRequiring git-core is enough in dracut.spec 2021-02-10 11:12:02 +01:00
Nicolas Saenz Julienne b28e4b20f0 fix(kernel-modules): add reset controllers for arm
Reset controllers might be needed by some of the devices used in the
initrd. Particularly on the Raspberry Pi 4, 'xhci-pci' depends on a
platform specific reset controller.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
2021-02-09 20:35:11 +00:00
David Tardon c46ed697a2 35network-legacy: discard pointless RTNETLINK message
This command prints

    RTNETLINK answers: Network is unreachable

to stderr if IP is not assigned yet, but that's the thing we are
checking for, so there's no point in showing the message.
2021-02-09 21:04:23 +01:00
Zoltán Böszörményi fa06924239 fix(plymouth): install binaries with dependencies
If plymouth is used then its own installation script is preferred.
While plymouth's own variant of inst_binary resolves the library
dependencies properly, its inst_library shell function doesn't
actually install them in some cases properly.

Make sure to install both the required binaries and their
dependencies. In the worst case, it's a NOP.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 18:17:12 +01:00
Harald Hoyer d1c8083b3a fix: correct the line continuation
Comments will break bash line continuation.
Also added some missing line continuation here and there.
2021-02-09 15:33:34 +01:00
Zoltán Böszörményi 702e7e83ed fix(dbus-daemon): use uid/gid from sysroot is dracutsysrootdir is set
Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi 767fbf81b6 fix(network-manager): allow override network manager version
With dracutsysrootdir set and foreign binaries in sysroot,
running NetworkManager --version is not possible and it may be
different than the one installed on the host.
NM_VERSION can be used to override it.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi 18d36fabf5 feat(dracut.sh): allow overriding the systemctl command for sysroot
Allow overriding the systemctl command for sysroot with $SYSTEMCTL
Modified every modules' module-setup.sh to use the envvar instead
of the hardcoded command name.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi 433a9ec014 fix: use find_binary
Use find_binary instead of type -P because the former works if
dracutsysrootdir is set.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi bbe1434fca fix(dracut.sh): don't override path with foreign sysroot
Don't override PATH with foreign sysroot and
trim the sysroot prefix from NPATH elements.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi 03d132a76c fix: quote globbing in module-setup.sh for inst_multiple
Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi ddcdee9147 fix(dracut-install): allow globbing for multiple sources
Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
foopub c409108b04 Fix bad ls parsing
This used to cause some echo write/invalid argument errors. Simplest fix is to use readlink with -f for absolute path and -n to remove trailing newline. 
See previous discussion here:
https://github.com/void-linux/void-packages/issues/13024
2021-02-08 23:12:15 +01:00
Alexander Tsoy 6eff0ebcf8 fix: move ldconfig after library workaround
Commit de3cb0e321 moved libpthread workaround after the code that runs
ldconfig. As a result, if installed in a non-default path, libgcc_s.so.1
could not be found by dynamic linker.
2021-02-08 22:44:32 +01:00
Nicolas Chauvet 07c671cc51 feat(kernel-modules): add driver memory
External Memory Controller (EMC) drivers can be built as a module.

On Tegra, this allows tegra_drm to load faster and without deferred
probes, instead of waiting for the rootfs for the tegra*_emc dependencies.

Tested on jetson-tk1 and ac100.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2021-02-08 21:15:48 +00:00
Jóhann B. Guðmundsson c3446a7ce0 feat(systemd-repart): introducing systemd-repart module
This modules introduces systemd-repart which can be used
to generate partition(s), via a simple systemd-repart
drop-in(s), which can be useful in wide varity of usecase.

feat(systemd-repart): adding module to spec file

feat(systemd-repart): removing unessary requirement on type unit

fix: spelling error
2021-02-08 20:32:16 +00:00
Jóhann B. Guðmundsson 7135c81931 feat(dbus-daemon): introducing the dbus-daemon module
Introdusing dbus-daemon which is based on but superseeds
the previous 06dbus implementation with various enhancements and fixes.

fix: adding new modules to rpm spec file

fix: missed an echo
2021-02-08 20:18:25 +01:00
Jóhann B. Guðmundsson 38cd8125f6 feat(dbus-broker): introducing the dbus-broker module
Introducing the dbus-broker module.
2021-02-08 20:18:25 +01:00
Jóhann B. Guðmundsson 791f392ca6 feat(dbus): introducing a meta module for dbus
We require a meta module to handle multiple modules
2021-02-08 20:18:25 +01:00
Harald Hoyer 6032ade3cc fix(network-legacy): silent check for leaseinfo
Reroute negative checks for leaseinfo to /dev/null to suppress:
```
ls: cannot access '/tmp/leaseinfo.ens2*': No such file or directory
```
2021-02-08 17:18:02 +01:00
Harald Hoyer 0ce79d4c72 ci: mount host /dev into container
might pickup /dev/kvm if we are lucky?
2021-02-08 16:07:37 +01:00
Harald Hoyer 860b64b92d ci: remove `--privileged` option from docker containers
This option should not be needed anymore with "mount -o loop" removed.
2021-02-08 16:07:37 +01:00
Harald Hoyer 0f62da0405 ci: get rid of "mount -o loop"
This finally allows running the test suite completely in a rootless container:
```
❯ podman run \
         --user 0 \
         -v /dev:/dev \
         -v ./:/dracut \
         -it \
         quay.io/haraldh/dracut-fedora:33 \
         bash -c 'cd /dracut; make DRACUT_NO_XATTR=1 check'
```
2021-02-08 16:07:37 +01:00
Harald Hoyer 1211d6a3fb ci: disable TEST 99
1. people got annoyed by merge conflicts
2. spec file can be update per release
3. uses "mount" preventing container testing
2021-02-08 16:07:37 +01:00
Harald Hoyer 457e7b7a4a docs: remove TODO file
TODO file copied to https://github.com/dracutdevs/dracut/issues/1068
and also filed as individual issues on
https://github.com/dracutdevs/dracut/issues
2021-02-08 14:17:13 +01:00
Kairui Song e918f337b6 95nfs: fix rpc.statd installation
commit 5840c466d tried to make it create the right directory according
to the directory layout on current host, but added "$initdir" prefix
to the if statement by accident, so the installation code have no
effect now. Just fix it.
2021-02-08 12:20:48 +01:00
Matthew Thode 8a2edb1e4d fix: do not set cmdline for uefi images unless asked
The kernel does not allow the cmdline to be overridden if one is defined
in the uefi image.  This means that bootloaders like systemd-boot or
grub cannot manage boot options (editing at boot for debug being a use
case).  This patchset allows for no cmdline to be set (instead of force
setting one if none is provided).

Fixes: https://github.com/dracutdevs/dracut/issues/1012
Signed-off-by: Matthew Thode <mthode@mthode.org>
2021-02-08 10:37:22 +01:00
Anjali Kulkarni 4026cd3b01 feat(network-legacy): send dhcp in parallel on all devices
We can drastically improve boot times on some machines, or BM or VM
shapes, if we send DHCP requests in parallel on all interfaces
Add ip=single-dhcp as a kernel boot parameter, to send DHCP requests in
parallel on all interfaces. Thus, DHCP on each interface is overlapped
thereby reducing boot times for multiple interface machines.
This can help reduce the boot time by 1 minute per interface.
In addition, we may also save another 40 secs delay per interface, if
the link on which we try to send DHCP is in DOWN state. This can be
reduced by giving the following kernel command line parameter while
booting - rd.net.timeout.carrier=<timeout>.
Added manpage for ip=single-dhcp with the caveat that it does not
apply to Network Manager or SUSE wicked.

Signed-off-by: Anjali Kulkarni <anjali.k.kulkarni@oracle.com>
2021-02-05 11:11:22 +01:00
Mariusz Tkaczyk 30e49d5175 fix(mdraid): remove offroot
offroot is deprecated and can be safety removed.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
2021-02-05 10:59:50 +01:00