Commit Graph

6014 Commits (aaea54c732a8e8ca0ed0d6431576fcd9c0333b07)

Author SHA1 Message Date
Jóhann B. Guðmundsson aaea54c732 fix: quotes in systemd modules
Fixing quotes around *.conf in systemd modules
2021-04-23 10:56:51 +02:00
Jóhann B. Guðmundsson 2f217abdb3 refactor: check() in systemd modules
Refactoring require_binaries in check() for systemd modules
2021-04-23 10:48:54 +02:00
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
Harald Hoyer b80ee08093 ci: use /dev/disk/by-id
Due to parallel probing of the linux kernel `/dev/sd*` can't be used to
reliably address a hard disk. This can be seen by the many spurious
failures of the dracut CI, where `mdadm` failed with error 524 or tests
failed due to the success marker message written to the wrong disk.

* don't rely on `/dev/sd*` but use disk ids and `/dev/disk/by-id/ata-disk_<name>`

* specify the exact qemu machine architecture `-M q35` needed for the
  disk ids. A later patch will move this to `run-qemu`, when all tests are converted

* due to `-M q35` the interface names have changed from
  `ens2` -> `enp0s1` and `ens3` -> `enp0s2`
2021-04-22 02:55:31 +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 b37c90c8e0 fix(examples): remove the examples directory and reference to it
Let's leave it up to the yocto community to keep and maintain their own
examples.
2021-04-21 09:02:35 +02:00
Jóhann B. Guðmundsson ec4539c606 fix(dracut.sh): add global vars for modules-load
Adding modulesload modulesloadconfdir global variables
2021-04-20 16:10:12 +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 3ca9aa1d7b fix(dracut): 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 8cd50230d9 ci: use disk ids for TEST 35 ISCSI MULTI
Due to parallel probing of the linux kernel `/dev/sd*` can't be used to
reliably address a hard disk. This can be seen by the many spurious
failures of the dracut CI, where `mdadm` failed with error 524 or tests
failed due to the success marker message written to the wrong disk.

* don't rely on `/dev/sd*` but use disk ids and `/dev/disk/by-id/ata-disk_<name>`

* specify the exact qemu machine architecture `-M q35` needed for the
  disk ids. A later patch will move this to `run-qemu`, when all tests are converted

* due to `-M q35` the interface names have changed from
  `ens2` -> `enp0s1` and `ens3` -> `enp0s2`
2021-04-19 22:32:00 +02:00
Harald Hoyer 2cfd778a45 ci: add function to generate qemu disk arguments
`qemu_add_drive_args` can be used to generate arguments to specify disks
for a qemu machine (`-M q35`).

This is mostly useful to address those raw disks via `/dev/disk/by-id`,
because due to parallel probing in the kernel `/dev/sd*` can point to
anything.
2021-04-19 22:32:00 +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
Harald Hoyer 4baedd019b fix(TEST ISCSI): try to debug md error 524
While creating the striped md raid0 sometimes this error occures:

```
mdadm: Defaulting to version 1.2 metadata
mdadm: RUN_ARRAY failed: Unknown error 524
  Failed to clear hint file.
  Device /dev/md0 not found.
Powering off.
```

Add debug output with the size of the disks.

Also create disks with multiple of 4096.
2021-04-16 16:27:16 +02:00
Harald Hoyer 31612c7337 ci: remove packit config causing errors
remove the offending parameters, which cause errors described in
https://github.com/dracutdevs/dracut/issues/1346

until we found the correct config to be used.
2021-04-16 16:26:23 +02: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
Dusty Mabe 4fbccde504 fix(dracut-logger.sh): double dash trigger unknown logger warnings during run
There are a bunch of `logger: unknown facility name: --user` errors
during a run. This is because logger is getting passed something like:

```
logger -p --user.info
```

Where it should be something like:

```
logger -p user.info
```
2021-04-15 12:58:49 +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
Jóhann B. Guðmundsson 96c313333d fix(dracut.sh): omission is an addition to other omissions in conf files
When omitting a module from the command line via -o or --omit
it's expected that it behaves in the same manner as adding a module from the
command line as in it does not overwrite existing omissions of other modules in
configuration file(s).
2021-04-12 09:18:25 +02:00
Kairui Song 122657b2fe fix(dracut-functions): word splitting issue for sed in get_ucode_file
This unquated regex could be splitted into two arguments and sed will
not work. I've see giving error of wrong arguments being used on my
desktop.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-04-12 09:17:18 +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 bb69aff14d docs: clarify `netroot=dhcp`
`root=dhcp` does not work with systemd, so `netroot=dhcp` should be
used.
2021-03-31 21:32:23 +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