diff options
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 | } | ||
