lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame^] | 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 | if ! setfiles -m -r ${IMAGE_ROOTFS} ${IMAGE_ROOTFS}/${sysconfdir}/selinux/${POL_TYPE}/contexts/files/file_contexts ${IMAGE_ROOTFS} |
| 4 | then |
| 5 | echo WARNING: Unable to set filesystem context, setfiles / restorecon must be run on the live image. |
| 6 | touch ${IMAGE_ROOTFS}/.autorelabel |
| 7 | exit 0 |
| 8 | fi |
| 9 | } |
| 10 | |
| 11 | DEPENDS += "policycoreutils-native" |
| 12 | |
| 13 | IMAGE_PREPROCESS_COMMAND_append = " selinux_set_labels ;" |
| 14 | |
| 15 | inherit core-image |