Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions build_library/sysext_mangle_flatcar-zfs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,8 @@ d /etc/zfs 0755 root root -
L /etc/zfs/zed.d - - - - /usr/share/zfs/etc/zfs/zed.d
L /etc/zfs/zfs-functions - - - - /usr/share/zfs/etc/zfs/zfs-functions
L /etc/zfs/zpool.d - - - - /usr/share/zfs/etc/zfs/zpool.d
C /etc/systemd/system/systemd-udevd.service.d/10-zfs.conf - - - - /usr/lib/systemd/system/systemd-udevd.service.d/10-zfs.conf
r /etc/systemd/system/systemd-udevd.service.d/10-zfs.conf - - - - -
EOF
Comment thread
Copilot marked this conversation as resolved.
Resolved

mkdir -p ./usr/lib/systemd/system/systemd-udevd.service.d
cat <<EOF >./usr/lib/systemd/system/systemd-udevd.service.d/10-zfs.conf
[Unit]
After=systemd-sysext.service
EOF
configure_modprobe flatcar-zfs
popd
10 changes: 9 additions & 1 deletion build_sysext
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,19 @@ for entry in "${BUILD_DIR}/${FLAGS_install_root_basename}"/*; do
rm -rf "${entry}"
done

EXTENSION_RELOAD_MANAGER=0
[[ -d ${BUILD_DIR}/${FLAGS_install_root_basename}/usr/lib/systemd ]] && EXTENSION_RELOAD_MANAGER=1

EXTENSION_RESTART_UNITS=()
[[ -d ${BUILD_DIR}/${FLAGS_install_root_basename}/usr/lib/tmpfiles.d ]] && EXTENSION_RESTART_UNITS+=( systemd-tmpfiles-setup-again.service )
[[ -d ${BUILD_DIR}/${FLAGS_install_root_basename}/usr/lib/udev/rules.d ]] && EXTENSION_RESTART_UNITS+=( systemd-udev-trigger.service )

grep . <<EOF | install -m0644 -D /dev/stdin "${BUILD_DIR}/${FLAGS_install_root_basename}/usr/lib/extension-release.d/extension-release.${SYSEXT_ID}"
ID='flatcar'
${VERSION_FIELD_OVERRIDE:-VERSION_ID}=${FLATCAR_VERSION_ID@Q}
ARCHITECTURE=${ARCH@Q}
EXTENSION_RELOAD_MANAGER=1
EXTENSION_RELOAD_MANAGER=${EXTENSION_RELOAD_MANAGER}
EXTENSION_RESTART_UNITS='${EXTENSION_RESTART_UNITS[*]}'
SYSEXT_ID=${SYSEXT_ID@Q}
${SYSEXT_NAME:+SYSEXT_NAME=${SYSEXT_NAME@Q}}
${PVR:+SYSEXT_VERSION_ID=${PVR@Q}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,36 @@ EOF

[Service]
SystemCallFilter=@mount
EOF
)

(
insinto "$(systemd_get_systemunitdir)/systemd-udev-trigger.service.d"
newins - flatcar.conf <<'EOF'
# Ensure udev rules are reloaded before triggering events with them because
# udevd caches its rules for 3 seconds. System extensions that include udev
# rules need them immediately loaded before triggering.

[Service]
ExecStartPre=-udevadm control --reload
EOF

insinto "$(systemd_get_systemunitdir)"
newins - systemd-tmpfiles-setup-again.service <<'EOF'
# System extensions that include tmpfiles.d configuration can restart this
# service to have it processed when merging.

[Unit]
Description=Create System Files and Directories After Booting
Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8)

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=systemd-tmpfiles --create --remove --exclude-prefix=/dev
SuccessExitStatus=DATAERR CANTCREAT
ImportCredential=tmpfiles.*
RestrictSUIDSGID=no
EOF
)
}
Loading
Loading