Statistics
| Branch: | Tag: | Revision:

root / snf-image-helper / tasks / 40SELinuxAutorelabel.in @ bad5ca1f

History | View | Annotate | Download (809 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
. "@commondir@/common.sh"
12

    
13
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
14
	log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"	
15
fi
16

    
17
if [ "$SNF_IMAGE_TYPE" = "extdump" ]; then
18
    distro=$(get_base_distro $SNF_IMAGE_TARGET)
19

    
20
    if [ "$distro" = "redhat" ]; then
21
        # we have to force a filesystem relabeling for SELinux after messing
22
        # around with the filesystem in redhat derived OSs
23
        echo "Enforce an automatic relabeling in the initial boot process..."
24
        touch "$SNF_IMAGE_TARGET/.autorelabel"
25
    fi
26
fi
27

    
28
exit 0
29

    
30
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :