Skip to content

Commit

Permalink
Merge pull request #85 from ader1990/fix_kmod_static_nodes
Browse files Browse the repository at this point in the history
Added flatcar systemd-tmpfiles-setup-dev-early.service
  • Loading branch information
ader1990 authored Feb 13, 2024
2 parents 0b32311 + 5f73716 commit a85e197
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
12 changes: 6 additions & 6 deletions dracut/10diskless-generator/diskless-generator
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions dracut/10usr-generator/usr-generator
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ if [[ "${usr}" != /* ]]; then
cat >"${UNIT_DIR}/sysusr-usr.mount.d/10-norecovery.conf" <<EOF
[Unit]
DefaultDependencies=no
Wants=systemd-tmpfiles-setup-dev.service
After=systemd-udevd.service systemd-tmpfiles-setup-dev.service
Wants=systemd-tmpfiles-setup-dev-early.service
After=systemd-udevd.service systemd-tmpfiles-setup-dev-early.service
[Mount]
Options=${mount_usrflags}
EOF
Expand Down Expand Up @@ -115,8 +115,8 @@ cat >"${UNIT_DIR}/sysusr-usr.mount" <<EOF
SourcePath=/proc/cmdline
Conflicts=initrd-switch-root.target
DefaultDependencies=no
Wants=systemd-tmpfiles-setup-dev.service
After=systemd-udevd.service systemd-tmpfiles-setup-dev.service
Wants=systemd-tmpfiles-setup-dev-early.service
After=systemd-udevd.service systemd-tmpfiles-setup-dev-early.service
[Mount]
What=${usr}
Expand Down
12 changes: 12 additions & 0 deletions dracut/11tmpfiles-early/module-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# called by dracut
depends() {
echo systemd-networkd
}

# called by dracut
install() {
inst_simple "$moddir/systemd-tmpfiles-setup-dev-early.service" \
"$systemdsystemunitdir/systemd-tmpfiles-setup-dev-early.service"
}
24 changes: 24 additions & 0 deletions dracut/11tmpfiles-early/systemd-tmpfiles-setup-dev-early.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

[Unit]
Description=Create Static Device Nodes in /dev gracefully
Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8)

DefaultDependencies=no
Before=sysinit.target local-fs-pre.target systemd-udevd.service
Wants=local-fs-pre.target
Conflicts=shutdown.target initrd-switch-root.target
Before=shutdown.target initrd-switch-root.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=systemd-tmpfiles --prefix=/dev --create --boot
SuccessExitStatus=DATAERR CANTCREAT

0 comments on commit a85e197

Please sign in to comment.