init-storage: Skip fs relabel w/o SELinux

If SELinux support is not available or enabled, attempting to relabel
files will fail.
dev/gentoo
Dustin 2024-12-13 19:21:26 -06:00
parent 8d28c55b79
commit b9356f619c
1 changed files with 3 additions and 0 deletions

View File

@ -89,6 +89,9 @@ partition_number() {
} }
relabel_all() { relabel_all() {
if [ ! "$(command -v selinuxenabled)" ] || !selinuxenabled; then
return 0
fi
selinuxtype=$(. /etc/selinux/config && echo ${SELINUXTYPE}) selinuxtype=$(. /etc/selinux/config && echo ${SELINUXTYPE})
find "${tmpdir}" | \ find "${tmpdir}" | \
setfiles \ setfiles \