new file mode 100644
@@ -0,0 +1,22 @@
+BB_CONF_FRAGMENT_SUMMARY = "Enable SELinux support in the image"
+BB_CONF_FRAGMENT_DESCRIPTION = "Add the selinux DISTRO_FEATURE together with pam and \
+xattr, pull in the SELinux kernel features and a reference policy, and install \
+policycoreutils (for sestatus, setenforce, ...) plus auditd for logging denials. \
+The policy defaults to refpolicy-mcs; set PREFERRED_PROVIDER_virtual/refpolicy to \
+use another one. auditd is provided by meta-oe (openembedded-layer), so that layer \
+needs to be in bblayers.conf too."
+
+DISTRO_FEATURES:append = " pam xattr selinux"
+
+KERNEL_FEATURES:append = " cgl/features/selinux/selinux.scc cgl/features/selinux/selinux-dev.scc"
+
+PREFERRED_PROVIDER_virtual/refpolicy ?= "refpolicy-mcs"
+
+# Label the rootfs at image build time instead of relabelling on first boot.
+IMAGE_CLASSES:append = " selinux-image"
+FIRST_BOOT_RELABEL ?= "0"
+
+IMAGE_INSTALL:append = " packagegroup-core-selinux auditd policycoreutils"
+
+# Use a standalone syslog rather than busybox-syslog.
+VIRTUAL-RUNTIME_base-utils-syslog ?= "sysklogd"