From 5f73716fe5370ee9a269f080d445c85479b745ab Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Fri, 9 Feb 2024 13:46:51 +0000 Subject: [PATCH] Added flatcar systemd-tmpfiles-setup-dev-early.service systemd-tmpfiles-setup-dev-early.service is required to be added instead of systemd-tmpfiles-setup-dev.service, as the kmod-static-nodes service needs to run before the systemd-tmpfiles-setup-dev service. Otherwise, the static links like /dev/vhost-net, will not be created. Once systemd >= 253 is used, the systemd-tmpfiles-setup-dev-early.service definition can be removed, as it is already built in. `--gracefuly` flag is not supported for the systemd 252 version, so it had to be removed. See systemd upstream definition: https://github.com/systemd/systemd/blob/main/units/systemd-tmpfiles-setup-dev-early.service Signed-off-by: Adrian Vladu --- .../10diskless-generator/diskless-generator | 12 +++++----- dracut/10usr-generator/usr-generator | 8 +++---- dracut/11tmpfiles-early/module-setup.sh | 12 ++++++++++ .../systemd-tmpfiles-setup-dev-early.service | 24 +++++++++++++++++++ 4 files changed, 46 insertions(+), 10 deletions(-) create mode 100755 dracut/11tmpfiles-early/module-setup.sh create mode 100644 dracut/11tmpfiles-early/systemd-tmpfiles-setup-dev-early.service diff --git a/dracut/10diskless-generator/diskless-generator b/dracut/10diskless-generator/diskless-generator index 024e0ae..72a7667 100755 --- a/dracut/10diskless-generator/diskless-generator +++ b/dracut/10diskless-generator/diskless-generator @@ -45,8 +45,8 @@ Before=initrd-root-fs.target Wants=remount-sysroot.service After=remount-sysroot.service # Make sure the loop device nodes are available -Wants=systemd-tmpfiles-setup-dev.service -After=systemd-tmpfiles-setup-dev.service +Wants=systemd-tmpfiles-setup-dev-early.service +After=systemd-tmpfiles-setup-dev-early.service [Mount] What=/usr.squashfs @@ -57,8 +57,8 @@ EOF # Automatically generated by diskless-generator [Unit] # Make sure the loop device nodes are available -Wants=systemd-tmpfiles-setup-dev.service -After=systemd-tmpfiles-setup-dev.service +Wants=systemd-tmpfiles-setup-dev-early.service +After=systemd-tmpfiles-setup-dev-early.service Conflicts=initrd-switch-root.target DefaultDependencies=no After=systemd-udevd.service @@ -110,8 +110,8 @@ EOF [Unit] DefaultDependencies=no # Make sure the loop device nodes are available -Wants=systemd-tmpfiles-setup-dev.service -After=systemd-tmpfiles-setup-dev.service +Wants=systemd-tmpfiles-setup-dev-early.service +After=systemd-tmpfiles-setup-dev-early.service [Service] Type=oneshot diff --git a/dracut/10usr-generator/usr-generator b/dracut/10usr-generator/usr-generator index d027cd7..c5e2679 100755 --- a/dracut/10usr-generator/usr-generator +++ b/dracut/10usr-generator/usr-generator @@ -80,8 +80,8 @@ if [[ "${usr}" != /* ]]; then cat >"${UNIT_DIR}/sysusr-usr.mount.d/10-norecovery.conf" <"${UNIT_DIR}/sysusr-usr.mount" <