Commit Graph

3598 Commits (056)

Author SHA1 Message Date
Harald Hoyer 8a51ee1fa6 fix(network-manager): set timeout via command line option
With Fedora 32, only the command line option works for `nm-online`.
2021-04-22 16:17:11 +02:00
Jóhann B. Guðmundsson e942d86c9d feat(systemd-network-management): introducing systemd-network-management module
Introducing the systemd-network-management meta module which will
allow distribution users and vendors to easily include
systemd + systemd's network management modules by simply include this
module instead of systemd network modules individually.

Obviously if the intent is to glue together somekind of network stack
out of random existing modules such as NetworkManager and or Wicked,
this meta module should not be enabled.
2021-04-22 16:00:16 +02:00
Jóhann B. Guðmundsson 4982e16dd5 fix(network): user variable for sdnetworkd instead of path
Use globalvariable for systemd networkd instead of path
2021-04-22 15:40:58 +02:00
Jóhann B. Guðmundsson 2aa652349c fix(systemd-hostnamed): extra quote 2021-04-22 15:10:15 +02:00
Jóhann B. Guðmundsson ea779750c3 fix(systemd-networkd): make systemd-networkd a proper network provider
Make systemd-networkd a proper network service provider. Fixes #737
2021-04-22 14:45:23 +02:00
Jóhann B. Guðmundsson 020212534b feat(systemd-timedated): add systemd-timedated module to the spec file 2021-04-22 14:25:36 +02:00
Jóhann B. Guðmundsson 1c41cc90c5 feat(systemd-timedated): introducing the systemd-timedated module
Introducing the systemd-timedated module
2021-04-22 14:25:36 +02:00
Harald Hoyer 4d03404f49 fix(network-manager): run after dracut-cmdline
dracut-cmdline runs `nm-config.sh`, which generates the configurations.

Also remove the now unused `nm-run.service`.
2021-04-22 13:10:19 +02:00
Lev Veyde 85eb96802c fix(img-lib): ignored null byte in input
The system currently throws numerous nasty warning messages during
the boot, about ignored null bytes in input.

This patch adds a filter to the dd command, to filter these null
bytes out, and thus to prevent these warning messages.

Signed-off-by: Lev Veyde <lveyde@redhat.com>
2021-04-22 11:23:22 +02:00
Jóhann B. Guðmundsson 782ac8f1f6 fix(systemd-modules-load): misc repairs
- Removing dependency on the systemd meta module since it causes circular dependency,
  prevents the existance of multiple systemd based meta modules and is redunant.

- Removing directory creation for modules-load since it should not be
  necessary and if it turns out that it is, it will be re-introduced in the
  form of a systemd tmpfile instead of inst_dir.

- Add a missing inclusion of configuration files placed in /usr/lib/modules-load.d
  and /etc/modules-load.d ( hostonly ) directories.

- Fix a spelling error in the systemd type unit file conf directory overwrite
  in the hostonly section.
2021-04-22 10:50:20 +02:00
Jóhann B. Guðmundsson b7d3caef67 feat(systemd-resolved): introducing the systemd-resolved module
Introducing the systemd-resolved module
2021-04-22 10:48:56 +02:00
Jóhann B. Guðmundsson bf273e3e86 feat(systemd-hostnamed): introducing the systemd-hostnamed module
Introducing the systemd-hostnamed module.
2021-04-22 10:47:35 +02:00
Jóhann B. Guðmundsson e740723069 feat(systemd-ac-power): introducing the systemd-ac-power module
Introducing the systemd-ac-power module
2021-04-22 10:44:29 +02:00
Jóhann B. Guðmundsson afef455718 fix(systemd-modules): remove dependency on systemd meta module
Depending on systemd meta module causes circular dependency,
prevents the existance of multiple systemd based meta modules
and is redunant.
2021-04-22 10:40:48 +02:00
Jóhann B. Guðmundsson 2257d54583 feat(systemd-timesyncd): introducing the systemd-timesyncd module
Introducing the systemd-timesyncd module
2021-04-22 10:39:59 +02:00
Harald Hoyer 49b614961d fix(network-manager): create /run directories
Create the `/run/NetworkManager/initrd` directory before creating
`/run/NetworkManager/initrd/neednet`. Somehow on Fedora 32 this
directory is missing, when the script is running.

This fixes all NetworkManager tests for Fedora 32.
2021-04-22 09:28:35 +02:00
Jóhann B. Guðmundsson 5912f4fbc0 fix(systemd): include hosts and nsswitch.conf in hostonly mode
Adding /etc/hosts and /etc/nsswitch.conf to the hostonly install section.
2021-04-21 15:13:35 +02:00
Peter Robinson 3a60c036db fix(90kernel-modules): add watchdog drivers for generic initrd
The watchdog module pulls in the device specific watchdog if that
module is enabled, but in the case where we need a generic initrd
we don't get all watchdog drivers which means if we have a watchdog
enabled for that usecase it may get kicked too late in the boot
process so we need the drivers in the initrd for the generic case too.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2021-04-21 14:31:30 +02:00
Jóhann B. Guðmundsson 02acedd09e fix(systemd-sysctl): sysctl global variables 2021-04-20 10:52:45 +02:00
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
Harald Hoyer 3a04fdff87 fix(fstab-sys): shellcheck for modules.d/95fstab-sys 2021-03-29 13:36:58 +02:00
Harald Hoyer d8d0b03cb4 fix(lunmask): shellcheck for modules.d/95lunmask 2021-03-29 13:36:38 +02:00
Harald Hoyer a201be999e fix(nbd): shellcheck for modules.d/95nbd 2021-03-29 13:36:20 +02:00
Harald Hoyer c5dd11f99f fix(fcoe): shellcheck for modules.d/95fcoe 2021-03-29 13:21:55 +02:00
Harald Hoyer 11e82f3ecc fix(nfs): shellcheck for modules.d/95nfs 2021-03-29 11:40:39 +02:00
Harald Hoyer c305877c58 fix(nvmf): shellcheck for modules.d/95nvmf 2021-03-29 11:39:52 +02:00
Harald Hoyer d15441cef4 fix(qeth_rules): shellcheck for modules.d/95qeth_rules 2021-03-29 11:39:07 +02:00
Harald Hoyer 88a83e0db1 fix(resume): shellcheck for modules.d/95resume 2021-03-29 11:37:56 +02:00
Harald Hoyer 4cbe12a31f fix(rootfs-block): shellcheck for modules.d/95rootfs-block 2021-03-29 11:35:08 +02:00
Harald Hoyer a15a7a1a34 fix(ssh-client): shellcheck for modules.d/95ssh-client 2021-03-29 11:34:46 +02:00
Harald Hoyer 0c4b5cabcf fix(udev-rules): shellcheck for modules.d/95udev-rules 2021-03-29 11:34:31 +02:00
Harald Hoyer e72c1310fa fix(virtfs): shellcheck for modules.d/95virtfs 2021-03-29 11:34:13 +02:00
Harald Hoyer 2e3e2e0820 fix(zfcp): shellcheck for modules.d/95zfcp 2021-03-29 11:31:55 +02:00
Harald Hoyer 032ecd95c9 fix(zfcp_rules): shellcheck for modules.d/95zfcp_rules 2021-03-29 11:31:31 +02:00
Harald Hoyer c0efaeca11 fix(znet): shellcheck for modules.d/95znet 2021-03-29 11:30:55 +02:00
Harald Hoyer f07e695fc5 fix(masterkey): shellcheck for modules.d/97masterkey 2021-03-29 11:30:31 +02:00
Harald Hoyer 7b584edac0 fix(dracut-systemd): shellcheck for modules.d/98dracut-systemd 2021-03-29 11:30:05 +02:00
Harald Hoyer 94157eec8e fix(ecryptfs): shellcheck for modules.d/98ecryptfs 2021-03-29 11:21:35 +02:00
Harald Hoyer 895dd4eb25 fix(integrity): shellcheck for modules.d/98integrity 2021-03-29 11:21:13 +02:00
Harald Hoyer a2faaf8652 fix(pollcdrom): shellcheck for modules.d/98pollcdrom 2021-03-29 11:20:08 +02:00
Harald Hoyer cdf927d3ba fix(selinux): shellcheck for modules.d/98selinux 2021-03-29 11:19:47 +02:00
Harald Hoyer 005a7bda8d fix(img-lib): shellcheck for modules.d/99img-lib 2021-03-29 11:19:26 +02:00
Harald Hoyer f5a14d0f30 fix(memstrack): shellcheck for modules.d/99memstrack 2021-03-29 11:18:14 +02:00
Harald Hoyer 56ea45bd5a fix(shutdown): shellcheck for modules.d/99shutdown 2021-03-29 11:17:11 +02:00
Harald Hoyer 3e1248da7d fix(syslog): shellcheck for modules.d/98syslog 2021-03-29 11:16:05 +02:00
Harald Hoyer 82d9fbf193 fix(fs-lib): shellcheck for modules.d/99fs-lib 2021-03-29 11:15:27 +02:00
Harald Hoyer 4fdc34e503 fix(uefi-lib): shellcheck for modules.d/99uefi-lib 2021-03-29 10:59:40 +02:00
Harald Hoyer f732667d14 fix(dcssblk): shellcheck for modules.d/95dcssblk 2021-03-29 10:56:39 +02:00
Harald Hoyer a19ab29197 fix(dasd_rules): shellcheck for modules.d/95dasd_rules 2021-03-29 10:56:21 +02:00
Harald Hoyer f1c7833a56 fix(dasd_mod): shellcheck for modules.d/95dasd_mod 2021-03-29 10:55:46 +02:00
Harald Hoyer 9dd4d42265 fix(dasd): shellcheck for modules.d/95dasd 2021-03-29 10:55:34 +02:00
Harald Hoyer d75b029a8c fix(zipl): shellcheck for modules.d/91zipl 2021-03-29 10:54:23 +02:00
Harald Hoyer 2d98cb6f63 fix(crypt-loop): shellcheck for modules.d/91crypt-loop 2021-03-29 10:53:56 +02:00
Harald Hoyer ad4f8d13f1 fix(qemu): shellcheck for modules.d/90qemu 2021-03-29 10:53:27 +02:00
Harald Hoyer e601a1ee46 fix(ppcmac): shellcheck for modules.d/90ppcmac 2021-03-29 10:53:07 +02:00
Harald Hoyer 352d6110d0 fix(nvdimm): shellcheck for modules.d/90nvdimm 2021-03-29 10:52:44 +02:00
Harald Hoyer 80f5e83ed5 fix(multipath): shellcheck for modules.d/90multipath 2021-03-29 10:52:28 +02:00
Harald Hoyer 37b1f66f00 fix(lvm): shellcheck for modules.d/90lvm 2021-03-29 10:51:34 +02:00
Harald Hoyer 0315e16955 fix(livenet): shellcheck for modules.d/90livenet 2021-03-29 10:50:51 +02:00
Harald Hoyer f0ad24623a fix(kernel-network-modules): shellcheck for modules.d/90kernel-network-modules 2021-03-29 10:50:16 +02:00
Harald Hoyer 27f5e75893 fix(kernel-modules-extra): shellcheck for modules.d/90kernel-modules-extra 2021-03-29 10:49:52 +02:00
Harald Hoyer a26e12cefc fix(kernel-modules): shellcheck for modules.d/90kernel-modules 2021-03-29 10:46:46 +02:00
Harald Hoyer 1b3b55894e fix(dmraid): shellcheck for modules.d/90dmraid 2021-03-29 10:45:33 +02:00
Harald Hoyer e08c644ee6 fix(cms): shellcheck for modules.d/80cms 2021-03-29 10:43:55 +02:00
Harald Hoyer a4cdc25210 fix(plymouth): shellcheck for modules.d/50plymouth 2021-03-29 10:42:20 +02:00
Harald Hoyer 91f49acd1c fix(gensplash): shellcheck for modules.d/50gensplash 2021-03-29 10:41:38 +02:00
Harald Hoyer 0ba7a48695 fix(drm): shellcheck for modules.d/50drm 2021-03-29 10:12:46 +02:00
Harald Hoyer 8e84fa7262 fix(url-lib): shellcheck for modules.d/45url-lib 2021-03-29 10:12:19 +02:00
Harald Hoyer 8df14af245 fix(ifcfg): shellcheck for modules.d/45ifcfg 2021-03-29 10:11:15 +02:00
Harald Hoyer e8857c59b1 fix(lvmmerge): shellcheck for modules.d/80lvmmerge 2021-03-29 10:10:06 +02:00
Harald Hoyer abc9879c9d fix(cio_ignore): shellcheck for modules.d/81cio_ignore 2021-03-29 10:09:51 +02:00
Harald Hoyer 640458bbf6 fix(btrfs): shellcheck for modules.d/90btrfs 2021-03-29 10:09:26 +02:00
Harald Hoyer 682b297207 fix(crypt): shellcheck for modules.d/90crypt 2021-03-29 10:08:59 +02:00
Harald Hoyer e25c536c70 fix(network): shellcheck for modules.d/40network 2021-03-29 09:57:50 +02:00
Harald Hoyer d76a2cfe21 fix(network-wicked): shellcheck for modules.d/35network-wicked 2021-03-29 09:57:23 +02:00
Harald Hoyer 00ca6bed37 fix(i18n): shellcheck for modules.d/10i18n 2021-03-29 09:56:49 +02:00
Harald Hoyer 10616019de fix(systemd): shellcheck for modules.d/00systemd 2021-03-26 15:16:07 +01:00
Harald Hoyer 25f6841344 fix(network-manager): shellcheck for modules.d/35network-manager 2021-03-26 15:02:59 +01:00
Harald Hoyer ec12017055 fix(convertfs): shellcheck for modules.d/30convertfs 2021-03-26 13:44:20 +01:00
Harald Hoyer 4042816955 fix(dbus-daemon): shellcheck for modules.d/06dbus-daemon 2021-03-26 13:24:45 +01:00
Harald Hoyer 5a420e6183 fix(watchdog): shellcheck for modules.d/04watchdog 2021-03-26 13:24:17 +01:00
Harald Hoyer 7193b6f0cb fix(dbus-broker): shellcheck for modules.d/06dbus-broker 2021-03-26 13:23:59 +01:00
Harald Hoyer 95729721cc fix(watchdog-modules): shellcheck for modules.d/04watchdog-modules 2021-03-26 13:22:53 +01:00
Harald Hoyer fac7505b69 fix(modsign): shellcheck for modules.d/03modsign 2021-03-26 13:14:16 +01:00
Harald Hoyer 231917e9b5 fix(systemd-networkd): shellcheck for modules.d/02systemd-networkd 2021-03-26 13:02:57 +01:00
Harald Hoyer 3dbc6c3d44 fix(caps): shellcheck for modules.d/02caps 2021-03-26 13:01:34 +01:00
Harald Hoyer 8bf6861b58 fix(systemd-sysusers): shellcheck for modules.d/01systemd-sysusers 2021-03-26 13:01:17 +01:00
Harald Hoyer 8e10fa7d27 fix(systemd-sysctl): shellcheck for modules.d/01systemd-sysctl 2021-03-26 12:59:52 +01:00
Harald Hoyer ddc7bf456a fix(systemd-repart): shellcheck for modules.d/01systemd-repart 2021-03-26 12:59:20 +01:00
Harald Hoyer c3a9a8cf3d fix(systemd-initrd): shellcheck for modules.d/01systemd-initrd 2021-03-26 12:27:24 +01:00
Harald Hoyer b8ca67280f fix(systemd-coredump): shellcheck for modules.d/01systemd-coredump 2021-03-26 12:24:22 +01:00
Harald Hoyer 3f114d3e31 fix(systemd-ask-password): shellcheck for modules.d/01systemd-ask-password 2021-03-26 12:21:09 +01:00
Harald Hoyer 6aa59dd8ab fix(fips): shellcheck for modules.d/01fips 2021-03-26 12:20:15 +01:00
Harald Hoyer f8e90c8f70 fix(warpclock): shellcheck for modules.d/00warpclock 2021-03-26 12:17:19 +01:00
Harald Hoyer 2fabaaa62d fix(base): shellcheck for modules.d/99base
Also remove some functions, which are not used and broken anyway.
2021-03-26 12:17:00 +01:00
Harald Hoyer cbef7cf3da fix(squash): shellcheck for modules.d/99squash 2021-03-26 11:26:02 +01:00
Harald Hoyer f274cf4c81 fix(biosdevname): shellcheck for modules.d/97biosdevname 2021-03-26 11:23:23 +01:00
Harald Hoyer 2097e38490 fix(terminfo): shellcheck for modules.d/95terminfo 2021-03-26 11:22:09 +01:00
Harald Hoyer 3736ed7ca4 fix(debug): shellcheck for modules.d/95debug 2021-03-26 11:19:13 +01:00
Harald Hoyer fb3a30efbf fix(qemu-net): shellcheck for modules.d/90qemu-net 2021-03-26 11:17:07 +01:00
Harald Hoyer 8109b6c0d4 fix(dmsquash-live-ntfs): shellcheck for modules.d/90dmsquash-live-ntfs 2021-03-26 11:13:04 +01:00
Harald Hoyer 1ce0eeffab fix(dbus): shellcheck for modules.d/09dbus 2021-03-26 11:07:59 +01:00
Harald Hoyer 74668e212d fix(rngd): shellcheck for modules.d/06rngd 2021-03-26 11:07:45 +01:00
Harald Hoyer f32b5e582e fix(rescue): shellcheck for modules.d/03rescue 2021-03-26 11:06:05 +01:00
Harald Hoyer f506c4268b fix(mksh): shellcheck for modules.d/00mksh 2021-03-26 10:56:54 +01:00
Harald Hoyer b470a79c18 fix(dash): shellcheck for modules.d/00dash 2021-03-26 10:55:53 +01:00
Harald Hoyer dafdf37268 fix(bash): shellcheck for modules.d/00bash 2021-03-26 10:55:36 +01:00
David Hildenbrand f3dcb60619 feat(qemu): include the virtio_mem kernel module
This adds support for virtio-mem devices, which provide a dynamic
amount of memory in a VM. Right now, the driver gets loaded and any
memory gets added to the system when loading the kernel module from disk.

While not strictly required to boot, we want to be able to
1) add virito-mem provided memory to the system early while booting up
2) add virtio-mem provided memory even when booting without a disk
3) add virtio-mem devices without adding actual memory in kdump
   environments such that we can query things like:
 a) is a certain PFN currently plugged in the hypervisor and, therefore,
    should actually be read when creating a system dump. (kexec-tools
    prepares the vmcore header, like on x86-64)
 b) which ranges of a virtio-mem device are currently plugged in the
    hypervisor and, therefore, should be added to the dump. (vmcore header
    gets prepared by the crashkernel, like on s390x)
 Note that loading virtio-mem in kdump environments currently fails with
 -EBUSY -- but there are plans to install proper hooks instead to support
  especially a) in the near future.

1) and 2) are only really effective when memory hotplug is configured to
automatically online all added system RAM in the kernel (and not late,
via udev rules): e.g., via "mhp_default_state=online" on the kernel
cmdline or via CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE in the kernel.

Especially 2) and 3) require the module to be present inside the initial
ramdisk. The primary use case for including it in the initial ramdisk
is 3).

Signed-off-by: David Hildenbrand <david@redhat.com>
2021-03-18 15:04:10 +01:00
Harald Hoyer 567c455753 fix(udev-rules): add btrfs udev rules by default
Install `64-btrfs.rules` unconditionally to mark btrfs devices ready or
not.

In case no `btrfs` kernel module is available in the initramfs, the
device should not be ready.

Depends on: https://github.com/systemd/systemd/pull/18802

Fixes: https://github.com/dracutdevs/dracut/issues/947
2021-03-13 20:13:13 +01:00
Harald Hoyer d4caa86aba feat(btrfs): add 64-btrfs-dm.rules rules 2021-03-13 19:12:54 +00:00
Harald Hoyer 75d758e8f1 style: shfmt -s reformat
reproducible with:

```
$ shfmt_version=3.0.1
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w -s .
```
2021-03-13 20:10:43 +01:00
Harald Hoyer 9a52c3fdb0 style: shfmt reformat
reproducible with:

```
$ shfmt_version=3.0.1
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w .
```
2021-03-13 20:10:43 +01:00
Harald Hoyer 560402c3dc style: shfmt pre correction 2021-03-13 20:10:43 +01:00
Harald Hoyer 60a34d8b11 fix(network-legacy): silence getargs 2021-03-10 19:31:19 +01:00
Harald Hoyer 1b61cfdbec fix: use getargs with _cryptgetargsname 2021-03-10 19:31:19 +01:00
Harald Hoyer b800edd698 fix(base): wait_for_dev quote shell variables 2021-03-10 19:31:19 +01:00
Harald Hoyer d3532978de refactor: factor out label_uuid_to_dev 2021-03-10 19:31:19 +01:00
Harald Hoyer 501d82f796 fix: correctly handle kernel parameters
The kernel has an odd way to handle `"` surrounded parameters.
To handle the parameters as the kernel would do, no simple shell script
suffices, so a new utility `dracut-util` is introduced. Written in "C"
it handles `dracut-getarg` and `dracut-getargs` as the old shell script
functions `_dogetarg` and `_dogetargs` would.
2021-03-10 19:31:19 +01:00
Jonas Jelten b12f8188a4 feat(nbd): support ipv6 link local nbds 2021-03-09 13:58:10 +00:00
Kairui Song 90f269f6af feat(squash): use busybox for early setup if available
Use busybox can help reduce the size of early setup environment.

With this change, everything is packed in the squash image, and
the setup files will be dropped once squash image setup is done,
so initramfs stage memory usage is reduced to the minimun,
and initramfs decompress is also faster.

File layout of a squash initramfs looks like this:

========================================================================
drwxr-xr-x   1 root     root            0 Feb 15 14:07 .
-rwxr-xr-x   1 root     root          946 Feb 15 14:07 init
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 lib -> usr/lib
drwxr-xr-x   1 root     root            0 Feb 15 14:07 squash
-rw-r--r--   1 root     root     91000832 Feb 15 14:07 squash-root.img
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/bin
-rwxr-xr-x   1 root     root      1293688 Jul 27  2020 usr/bin/busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/echo -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/mkdir -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/modprobe -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/mount -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/sh -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/switch_root -> busybox
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/dracut
-rw-r--r--   1 root     root           23 Feb 15 14:07 usr/lib/dracut/build-parameter.txt
-rw-r--r--   1 root     root           31 Feb 15 14:07 usr/lib/dracut/dracut-051-93.git20210215.fc33
-rw-r--r--   1 root     root          358 Feb 15 14:07 usr/lib/dracut/modules.txt
-rw-r--r--   1 root     root            0 Feb 15 14:07 usr/lib/dracut/need-initqueue
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64/kernel
<... kernel module misc files skipped ... >
========================================================================
2021-03-09 13:40:35 +00:00
Kairui Song 8f7c332e48 refactor(squash): structure in a cleaner way
Simplify the squash mount layout. Instead of overlay on each top
directory (/etc, /usr), just mount and switch_root into the squash
image, with a overlay on top of it.

Also install the binaries and setup scripts separately, so the squash
setup code and the squash image content is independent of each other,
all squash setup script and binaries can be deleted safely upon
switch_root.

With this change, previous squash clean up service and other tricky
implementations are all gone.

This commit depends on systemd commits from:
https://github.com/systemd/systemd/pull/18124

Previouly systemd doesn't recognize non-ramfs initramfs, now this is
doable with SYSTEMD_IN_INITRD=lenient

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-03-09 13:40:35 +00:00
Kairui Song bdd194bb8c refactor(squash): don't record mount points in text file
The squasn mount points are recorded in text file so later clean up
script can umount them, this is not needed, the mount points are fixed
so just detect the umount by hardcoded pattern.
2021-03-09 13:40:35 +00:00
Kairui Song 5a18b24a8b feat(squash): install and depmod modules seperately
Separately install the modules required for squash image setup.
These modules can be deleted after squash image setup to save
memory.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-03-09 13:40:35 +00:00
Kairui Song f9f4264d03 refactor(squash): move all setup code to init-squash.sh
Seperate of init.sh and setup-squash.sh is pointless, merge them into one.
2021-03-09 13:40:35 +00:00
Kairui Song 95ea16aa60 refactor(squash): move the post install scripts into the module-setup.sh
No function change, just move the post install code to 99squash to clean
up dracut.sh.
2021-03-09 13:40:35 +00:00
Kairui Song c552c99ef8 fix(squash): this module shouldn't depend on bash
Any other shell should just work.
2021-03-09 13:40:35 +00:00
Jóhann B. Guðmundsson 9cf7b1c529 fix: always use mkdir -p
Ensuring that directory creations dont trigger error if directory
previously existed as well as create parent directories if needed.
2021-03-03 13:06:02 +01:00
Daniel Molkentin 92e6a8f879 fix(kernel-modules): optionally add /usr/lib/modules.d to initramfs
On SUSE, there is no /lib/modules.d, only /usr/lib/modules.d.

Upstream-Bug: http://bugzilla.opensuse.org/show_bug.cgi?id=1180822

Reference: bsc#1180822
2021-03-03 11:42:09 +01:00
Lennart Poettering a96900a82c fix(dracut-systemd): don't refuse root=tmpfs when systemd is used
A match for systemd PR#18847
2021-03-02 21:23:03 +00:00
Evgeni Golov c3f241849d fix: skip empty modalias files in drm module setup
on my system (ThinkPad X201s) I have several modalias entries that are
empty:

    /sys/bus/platform/devices/dock.0/modalias
    /sys/bus/platform/devices/dock.1/modalias
    /sys/bus/platform/devices/dock.2/modalias

executing the drm module setup thus results in the following errors

    dracut-install: No SOURCE argument given

when calling dracut_instmods and hostonly mode is enabled.

Skip those entries, as there are no modules to load in this case
anyways.

Note: it is not sufficient to use [['s -s test (file size is greater
than zero), as all those files are 4096B if you stat them.
2021-02-22 14:55:44 +01:00
Lukas Nykryn c17c5b7604 fix(network-manager): run as a service if systemd module is present
In the current state, services that depend on network need to
use dracut hooks, since nothing with pull in the network
targets into the transaction.

In the future, it would be nice to provide developers on systemd-only
systems the possibility to not use dracut hooks at all, but simply put
normal systemd services into the initrd.

Also, some modules even right now depend on systemd ordering, like
cryptsetup, so let's make sure, that the ordering inside systemd work
properly as well.
2021-02-19 11:20:59 +01:00
Lukas Nykryn 34c73b339b fix(network-manager): rework how NM is started in debug mode
Instead of running directly NM with --debug, create a drop-in in
nm-config.sh. This will make sure, that we can get the debug output
regardless the way how NM will be started.
2021-02-19 11:20:59 +01:00
Lukas Nykryn 6f7823bce6 fix(fcoe): rename rd.nofcoe to rd.fcoe
The current name of this bool is kinda stupid. Based on the manpage
setting it to 0 turns off fcoe, which means that nofcoe=1 should mean
that it is on.

Let's just do the same thing as with rd.lvm=0, rd.luks=0,....
2021-02-19 09:28:57 +00:00
Lukas Nykryn 805b46c2a8 fix(fcoe): rd.nofcoe=0 should disable fcoe
8446c8f9 Changed the default behavior, but also flipped meaning of 0/1.
Right now rd.nofcoe=0 enables fcoe, which is the opposite what manpage
says.
2021-02-19 09:28:57 +00:00
Harald Hoyer 5387ed24c8 fix(i18n): get rid of `eval` calls
By changing KBDSUBDIRS to a bash array, all kinds of `eval` quirks are
avoided.
2021-02-16 15:49:02 +01:00
Harald Hoyer 9e1c7f3dea fix(i18n): create the keyboard symlinks again
Invalid space broke the creation of the keyboard subdirectories,
leading to a symbolic link

usr/share/consolefonts,consoletrans,keymaps,unimaps ->
/usr/lib/kbd/consolefonts,consoletrans,keymaps,unimaps

in the created initramfs.

With this fix the correct symlinks are created again:

usr/share/consolefonts -> /usr/lib/kbd/consolefonts
usr/share/consoletrans -> /usr/lib/kbd/consoletrans
usr/share/keymaps -> /usr/lib/kbd/keymaps
usr/share/unimaps -> /usr/lib/kbd/unimaps
2021-02-16 15:49:02 +01:00
Harald Hoyer 6510ab3f9d fix: shellcheck for modules.d/99squash/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 73f5cc7c37 fix: shellcheck for modules.d/99squash/clear-squash.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 119bb1b81d fix: shellcheck for modules.d/99fs-lib/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 18ff79021c fix: shellcheck for modules.d/99base/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 060732d927 fix: shellcheck for modules.d/99base/dracut-lib.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 9ea66e5682 fix: shellcheck for modules.d/95zfcp_rules/parse-zfcp.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 9eb77ff864 fix: shellcheck for modules.d/95udev-rules/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 10d01cc45d fix: shellcheck for modules.d/95terminfo/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer a1b3c13e3a fix: shellcheck for modules.d/95ssh-client/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer dbdd7ad4c1 fix: shellcheck for modules.d/95rootfs-block/block-genrules.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 9fb16311a4 fix: shellcheck for modules.d/95resume/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 748293ff56 fix: shellcheck for modules.d/95nfs/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer d18e808358 fix: shellcheck for modules.d/95iscsi/cleanup-iscsi.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 865390c7ca fix: shellcheck for modules.d/95fstab-sys/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer d4b1d669d7 fix: shellcheck for modules.d/95fcoe/module-setup.sh 2021-02-15 11:00:37 +01:00