root / helper / tasks / 40SELinuxAutorelabel.sh @ 0a35a4ab
History | View | Annotate | Download (775 Bytes)
1 |
#! /bin/bash |
---|---|
2 |
|
3 |
### BEGIN TASK INFO |
4 |
# Provides: SELinuxAutorelabel |
5 |
# RunBefore: UmountImage |
6 |
# RunAfter: MountImage |
7 |
# Short-Description: Force the system to relabel at next boot |
8 |
### END TAST INFO |
9 |
|
10 |
set -e |
11 |
. /usr/share/snf-image/common.sh |
12 |
|
13 |
if [ -z "$SNF_IMAGE_TARGET" ]; then |
14 |
log_error "Target dir is missing" |
15 |
fi |
16 |
|
17 |
if [ "$SNF_IMAGE_TYPE" != "extdump" ]; then |
18 |
exit 0 |
19 |
fi |
20 |
|
21 |
distro=$(get_base_distro $SNF_IMAGE_TARGET) |
22 |
|
23 |
if [ "$distro" = "redhat" ]; then |
24 |
# we have to force a filesystem relabeling for SELinux after messing |
25 |
# around with the filesystem in redhat derived OSs |
26 |
echo "Enforce an automatic relabeling in the initial boot process..." |
27 |
touch $SNF_IMAGE_TARGET/.autorelabel |
28 |
fi |
29 |
|
30 |
exit 0 |
31 |
|
32 |
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai : |