diff options
author | Philip Tricca <flihp@twobit.us> | 2015-06-17 15:30:52 -0700 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2015-08-08 16:43:23 -0400 |
commit | 56e952f43a00f9f5de97efa09f14b0c972b698cf (patch) | |
tree | df12eb6c96bf692942b1f8a54ccaf683618c08ce /classes/selinux-image.bbclass | |
parent | 54e7104ef87200fd96d3a1c78c4409fc1445d3a2 (diff) | |
download | meta-selinux-56e952f43a00f9f5de97efa09f14b0c972b698cf.tar.gz |
selinux-image: Add new image class to label the rootfs, use it for selinux images.
Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'classes/selinux-image.bbclass')
-rw-r--r-- | classes/selinux-image.bbclass | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/classes/selinux-image.bbclass b/classes/selinux-image.bbclass new file mode 100644 index 0000000..362ca5c --- /dev/null +++ b/classes/selinux-image.bbclass | |||
@@ -0,0 +1,8 @@ | |||
1 | selinux_set_labels () { | ||
2 | POL_TYPE=$(sed -n -e "s&SELINUXTYPE[:space:]*=[:space:]*\([0-9A-Za-z_]\+\)&\1&p" ${IMAGE_ROOTFS}/${sysconfdir}/selinux/config) | ||
3 | setfiles -r ${IMAGE_ROOTFS} ${IMAGE_ROOTFS}/${sysconfdir}/selinux/${POL_TYPE}/contexts/files/file_contexts ${IMAGE_ROOTFS} || exit 1; | ||
4 | } | ||
5 | |||
6 | IMAGE_PREPROCESS_COMMAND += "selinux_set_labels ;" | ||
7 | |||
8 | inherit core-image | ||