diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-10 04:33:43 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-10 21:04:20 +0000 |
| commit | a71e7b0499c51c74686e41e7810e2f202d851ce6 (patch) | |
| tree | 427d8b0fde510ce30f4dc3bb9a5ca5c93d634f21 /recipes-extended/container-systemd-config | |
| parent | 56f78049cff106e52a57e2544d025ea94fd0c702 (diff) | |
| download | meta-virtualization-a71e7b0499c51c74686e41e7810e2f202d851ce6.tar.gz | |
container-systemd-base: replace ROOTFS_POSTPROCESS_COMMAND with package
Factor systemd service masking into container-systemd-config package
that installs mask symlinks via do_install. This replaces the
ROOTFS_POSTPROCESS_COMMAND approach which is ignored in multi-layer
OCI mode.
The mask list is customizable via CONTAINER_SYSTEMD_MASK variable.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended/container-systemd-config')
| -rw-r--r-- | recipes-extended/container-systemd-config/container-systemd-config_1.0.bb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/recipes-extended/container-systemd-config/container-systemd-config_1.0.bb b/recipes-extended/container-systemd-config/container-systemd-config_1.0.bb new file mode 100644 index 00000000..a808fcd1 --- /dev/null +++ b/recipes-extended/container-systemd-config/container-systemd-config_1.0.bb | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | SUMMARY = "Systemd service masking for container use" | ||
| 2 | DESCRIPTION = "Masks systemd services that are inappropriate inside containers \ | ||
| 3 | (udev, hwdb, serial-getty, etc.). Installed as a package so it works \ | ||
| 4 | with both single-layer and multi-layer OCI images." | ||
| 5 | LICENSE = "MIT" | ||
| 6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 7 | |||
| 8 | inherit allarch | ||
| 9 | |||
| 10 | # Default services to mask in containers | ||
| 11 | # Customizable: CONTAINER_SYSTEMD_MASK:pn-container-systemd-config:append = " extra.service" | ||
| 12 | CONTAINER_SYSTEMD_MASK ?= "\ | ||
| 13 | systemd-udevd.service \ | ||
| 14 | systemd-udevd-control.socket \ | ||
| 15 | systemd-udevd-kernel.socket \ | ||
| 16 | proc-sys-fs-binfmt_misc.automount \ | ||
| 17 | sys-fs-fuse-connections.mount \ | ||
| 18 | sys-kernel-debug.mount \ | ||
| 19 | systemd-hwdb-update.service \ | ||
| 20 | serial-getty@ttyS0.service \ | ||
| 21 | dev-ttyS0.device \ | ||
| 22 | console-getty.service \ | ||
| 23 | serial-getty@.service \ | ||
| 24 | " | ||
| 25 | |||
| 26 | do_install() { | ||
| 27 | install -d ${D}${sysconfdir}/systemd/system | ||
| 28 | for service in ${CONTAINER_SYSTEMD_MASK}; do | ||
| 29 | ln -sf /dev/null ${D}${sysconfdir}/systemd/system/$service | ||
| 30 | done | ||
| 31 | } | ||
