Commit Graph

3429 Commits (fd15dbad6ebad86a3753a03f98706010f3e36cf7)

Author SHA1 Message Date
Jóhann B. Guðmundsson fd15dbad6e fix(nbd): remove old udev version requirements 2021-04-20 10:51:31 +02:00
Jóhann B. Guðmundsson be30d98751 fix(fips): remove old udev version requirements 2021-04-20 10:51:31 +02:00
Jóhann B. Guðmundsson fc53987bec fix(systemd): remove old systemd version requirements 2021-04-20 10:51:31 +02:00
Harald Hoyer 7790644362 fix(nbd): make nbd work again with systemd
* Correct the systemd generated sysroot.mount unit with the options
received by the DHCP request and do a `daemon-reload`.

* Inject the `nbd-client -check /dev/nbd0` in the finished initqueue.

* Reactivate the NBD tests and prepare them for NetworkManager tests.
2021-04-19 22:41:01 +02:00
Harald Hoyer 97b86d37f9 fix(bluetooth): shellcheck and hostonly corrections
Don't install files from `/var` in the non-hostonly case.

Use fileglobs, instead of `find`.
2021-04-17 14:07:41 +02:00
Harald Hoyer ae4fbb3db4 fix(dbus-daemon): only error out in install()
Don't hard exit in `check()`. The transaction logic only checks if it
should/can include the module. Just return `255` and the `dbus` meta
module will pick its dependency.
2021-04-17 13:22:58 +02:00
Adam Alves 64ee2a5386 feat(bluetooth): implement bluetooth support in initrd
- Included a bluetooth module that installs modules, firmware, udev rules and bluetoothd.
- systemd and dbus are required by bluetoothd
- Include bluetooth by default if BT keyboard or combo found
2021-04-16 18:43:31 +00:00
Beniamino Galvani 112f03f9e2 feat(network-manager): run as daemon with D-Bus
This commit changes how NM is started inside the initrd. Instead of running NM
in the special --configure-and-quit=initrd mode, which sets up network and
quits, start it as a daemon.

This has multiple advantages. First, we no longer need to run NM in a special
mode that requires additional code and maintenance. NetworkManager works
exactly as in the real root.

One problem of the current configure-and-quit approach is that once NM has
quit, dynamic addresses can expire if the initrd setup takes longer than the
DHCP lease interval or than the IPv6 address lifetime. Running NM as a service
solves this problem.

Now NM runs with D-Bus support and therefore its API can be used by other
modules. This open the possibility, for example, to integrate nm-cloud-setup to
automatically configure networking based on cloud metadata.

Use the NetworkManager-wait-online.service, ordered before
dracut-initqueue.service, to delay the initqueue until NM has terminated its
configuration.
2021-04-16 16:15:00 +02:00
Dusty Mabe 6a37c6f630 fix(network-manager): use /run/NetworkManager/initrd/neednet in initqueue
We don't want to start NetworkManager if networking is not needed.
Right now nm-config.sh lays down /usr/lib/dracut/hooks/initqueue/finished/nm.sh
which will cause the initqueue to run. If nothing exists in
/usr/lib/dracut/hooks/initqueue/finished/ then it will short circuit and
the initqueue won't run anything. But what if something else needed
something to run in the initqueue? nm-run.sh would still get started,
even though /usr/lib/dracut/hooks/initqueue/finished/nm.sh didn't exist.
In this case let's just trigger off of /run/NetworkManager/initrd/neednet
like we are doing in the systemd unit (nm-run.service).
2021-04-16 11:12:49 +02:00
Dusty Mabe ac0e8f7dcc fix(network-manager): only run NetworkManager if rd.neednet=1
Don't run the new systemd unit (nm-run.service) if rd.neednet=1
isn't set. nm-initrd-generator will generate configuration even
without rd.neednet=1 so determining if we should start based on
just if connection profiles exist isn't enough. We need some other
indicator. In this case we lay down a /run/NetworkManager/initrd/neednet
if rd.neednet=1, which is used by nm-run.service to determine the
need to run.
2021-04-16 11:12:49 +02:00
Dusty Mabe 1f21fac646 fix(network-manager): nm-run.service: don't kill forked processes
If teaming is set up via NetworkManager we don't want systemd to take
down the userspace teamd process when NetworkManager quits. `KillMode=process`
will allow it to leave those processes behind.

This is fallout from the change to run NetworkManager via systemd (c17c5b7).

With `KillMode=process` we get something like:

```
sh-5.1# journalctl -u nm-run -o cat | tail
<info>  [1618411262.7030] quitting now that startup is complete
<info>  [1618411262.7030] device (team0): carrier: link connected
<info>  [1618411262.7033] device (team0): team port ens2 was released
<info>  [1618411262.7033] device (team0): team port ens3 was released
<info>  [1618411262.7033] manager: NetworkManager state is now CONNECTED_SITE
<info>  [1618411262.7034] exiting (success)
nm-run.service: Deactivated successfully.
nm-run.service: Unit process 476 (teamd) remains running after unit stopped.
Finished nm-run.service.
```
2021-04-15 13:07:07 +02:00
Đoàn Trần Công Danh 651fe01e79 fix(i18n): skip if data is missing
On system that doesn't have either consolefonts, consoletrans, keymaps,
or unimaps, "kbddir" is empty, thus the followed installation will
broken with errors like:

	cp: cannot stat '/consolefonts/*': No such file or directory

Let's report the checks as failure if "kbddir" is empty.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2021-04-13 11:12:37 +02:00
Harald Hoyer 2d83bce21b fix(nbd): shellcheck regression
`$opts`, `$preopts` and `$nbdport` shouldn't have been quoted as they
can expand to multiple options.

Fixes: https://github.com/dracutdevs/dracut/issues/1270
2021-03-31 21:32:36 +02:00
Harald Hoyer 7fcc495588 fix(dracut-systemd): regression on root=block:
Commit 3532978de04c7 introduced a regression, where the `root` could be
`root=block:block:/dev/foo`.
2021-03-31 21:31:57 +02:00
Harald Hoyer 8059bcb2c8 fix(base): source hooks without exec
Patch 2fabaaa62d changed the behaviour for `dash`
under the assumption, that dash does not take parameters for `.` aka
`source`. Although this is true, the original positional parameters of
the `source_all` function are still in place, so everything is
fine with the old way of sourcing.
2021-03-31 21:31:00 +02:00
Harald Hoyer 36af0518b3 fix(network): correct regression in iface_has_carrier
Commit e25c536c70 introduced a regression in iface_has_carrier
due to unclear variable naming.
2021-03-31 21:29:52 +02:00
Harald Hoyer ba4bcf5f4f fix(network-manager): no default deps for nm-run.service
Otherwise nm-run.service will run only in basic.target, which is too
late in the initramfs.
2021-03-31 21:29:33 +02:00
Harald Hoyer 56606b0a1b fix(lunmask): shellcheck regression
`parse-lunmask.sh` is not a bash script
and dash doesn't understand `read -a`.

Revert to the initial code.

Fixes: https://github.com/dracutdevs/dracut/issues/1271
2021-03-31 12:13:31 +02:00
Harald Hoyer fd4b04da66 fix(lvmmerge): depend on bash 2021-03-31 11:32:48 +02:00
Harald Hoyer 5b965f6308 fix(livenet): fetch-liveupdate.sh does not require bash 2021-03-31 11:32:29 +02:00
Harald Hoyer fd3698aa42 fix(cms): require bash 2021-03-31 11:32:00 +02:00
Harald Hoyer 3402142e34 fix(network-manager): nm-lib.sh does not require bash 2021-03-31 11:31:47 +02:00
Harald Hoyer 6b499ec14b fix(zipl): don't depend on grub2
There is no grub2 dracut module.
2021-03-31 11:31:30 +02:00
Harald Hoyer 09356085b6 ci: enable shellcheck for everything 2021-03-31 11:31:17 +02:00
Harald Hoyer 1dc61299f7 fix(kernel-modules): shellcheck regression
`$_hostonly_drvs` contained multiple arguments and was quoted.

This patch converts `_hostonly_drvs` into an associative array, which
enables easy deduplication and proper quoting in bash.

Fixes: https://github.com/dracutdevs/dracut/issues/1276
2021-03-31 11:30:49 +02:00
Harald Hoyer 7b8c78ff43 fix(multipath): revise multipathd-stop
A shellcheck regression quoted `HARD` in
```shell
    kill "$HARD" "$pid" > /dev/null 2>&1
```

which would error on an empty "HARD".

Instead of fixing this, use `pkill` instead and also add it to the
non-optional list of binaries to install, which was revised also.

Fixes: https://github.com/dracutdevs/dracut/issues/1275
2021-03-31 11:30:10 +02:00
Harald Hoyer 85378f44af fix(multipath): shellcheck regression
`$_allow` should not have been quoted, because it can be multiple options.

Instead of unquoting it, convert it to an associative array with easy
deduplication and prefix every device with the `--allow` option.

Fixes: https://github.com/dracutdevs/dracut/issues/1274
2021-03-31 11:29:31 +02:00
Harald Hoyer af3cd22425 fix(nvdimm): shellcheck regression
`_provider_dirs` should not have been quoted, because it should expand
to multiple arguments.

Just remove the whole variable and add those arguments.

Fixes: https://github.com/dracutdevs/dracut/issues/1273
2021-03-31 11:29:07 +02:00
Harald Hoyer f450ebfdf2 fix(convertfs): require bash 2021-03-31 11:05:29 +02:00
Harald Hoyer f5046e56bc fix(caps): require bash 2021-03-31 11:04:52 +02:00
Harald Hoyer cd8db54a3d fix(dasd_rules): add bash dependency 2021-03-30 21:10:44 +00:00
Harald Hoyer 23d303f8a0 fix(fcoe-uefi): add bash dependency 2021-03-30 21:04:48 +00:00
Harald Hoyer f9b9faf433 fix(fcoe): remove needless bash dependency 2021-03-30 20:04:52 +00:00
Harald Hoyer f0c606f91d fix(lunmask): remove needless bash dependency 2021-03-30 21:21:01 +02:00
Jóhann B. Guðmundsson a4cc196467 fix(crypt): include cryptsetups tmpfile 2021-03-30 19:14:38 +00:00
Harald Hoyer 7c77835cd6 fix(zfcp_rules): require bash 2021-03-30 17:55:15 +02:00
Harald Hoyer c2ecc4d131 fix(memstrack): correct dependencies
memstrack does not need to depend on `bash` but does on `systemd`.
2021-03-30 17:51:55 +02:00
Harald Hoyer 957ab750f0 fix(usrmount): shellcheck for modules.d/98usrmount 2021-03-30 16:35:31 +02:00
Beniamino Galvani df1e5f06a5 fix(dbus-broker): enable the service
dbus-broker.service has a 'dbus.service' alias which is installed when the
service gets enabled.

If the alias is not present in the initrd image, services requiring D-Bus in
the initrd fail to start because they depend on dbus.service, which doesn't
exist.

Therefore, enable the service to create the alias.
2021-03-30 14:45:47 +02:00
Harald Hoyer f6597b0d51 fix(dm): shellcheck for modules.d/90dm 2021-03-30 10:28:54 +02:00
Harald Hoyer 8c0fcdd931 fix(network-legacy): shellcheck for modules.d/35network-legacy 2021-03-30 10:14:34 +02:00
Harald Hoyer 6bc9942b41 fix(systemd-modules-load): shellcheck for modules.d/01systemd-modules-load 2021-03-30 10:13:10 +02:00
Harald Hoyer c94bd1cd82 fix(busybox): shellcheck for modules.d/05busybox 2021-03-30 10:11:24 +02:00
Harald Hoyer 428ef5e471 fix(securityfs): shellcheck for modules.d/96securityfs 2021-03-30 10:07:31 +02:00
Harald Hoyer a490409702 fix(iscsi): shellcheck for modules.d/95iscsi 2021-03-30 08:56:18 +02:00
Harald Hoyer 77fa33017d fix(mdraid): shellcheck for modules.d/90mdraid 2021-03-30 04:16:57 +02:00
Harald Hoyer 4148f08bd3 fix(cifs): shellcheck for modules.d/95cifs 2021-03-30 03:39:47 +02:00
Harald Hoyer 94b0d89f17 fix(dmsquash-live): shellcheck for modules.d/90dmsquash-live 2021-03-29 15:00:07 +02:00
Harald Hoyer b130927514 fix(crypt-gpg): shellcheck for modules.d/91crypt-gpg 2021-03-29 14:45:07 +02:00
Harald Hoyer eb0d3fb9c1 fix(fcoe-uefi): shellcheck for modules.d/95fcoe-uefi 2021-03-29 14:23:02 +02:00