mirror of
git://git.yoctoproject.org/meta-selinux
synced 2026-01-01 13:58:04 +00:00
This is the result of automated script conversion: poky/scripts/contrib/convert-overrides.py meta-selinux Converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Joe MacDonald <joe@deserted.net>
16 lines
596 B
Plaintext
16 lines
596 B
Plaintext
selinux_set_labels () {
|
|
POL_TYPE=$(sed -n -e "s&^SELINUXTYPE[[:space:]]*=[[:space:]]*\([0-9A-Za-z_]\+\)&\1&p" ${IMAGE_ROOTFS}/${sysconfdir}/selinux/config)
|
|
if ! setfiles -m -r ${IMAGE_ROOTFS} ${IMAGE_ROOTFS}/${sysconfdir}/selinux/${POL_TYPE}/contexts/files/file_contexts ${IMAGE_ROOTFS}
|
|
then
|
|
echo WARNING: Unable to set filesystem context, setfiles / restorecon must be run on the live image.
|
|
touch ${IMAGE_ROOTFS}/.autorelabel
|
|
exit 0
|
|
fi
|
|
}
|
|
|
|
DEPENDS += "policycoreutils-native"
|
|
|
|
IMAGE_PREPROCESS_COMMAND:append = " selinux_set_labels ;"
|
|
|
|
inherit core-image
|