#! /bin/bash # Copyright (C) 2011 GRNET S.A. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. ### BEGIN TASK INFO # Provides: SELinuxAutorelabel # RunBefore: EnforcePersonality # RunAfter: MountImage # Short-Description: Force the system to relabel at next boot ### END TASK INFO set -e . "@commondir@/common.sh" trap task_cleanup EXIT report_task_start # Check if the task should be prevented from running. check_if_excluded if [ ! -d "$SNF_IMAGE_TARGET" ]; then log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing" fi if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = "linux" ]; then distro=$(get_base_distro $SNF_IMAGE_TARGET) if [ "$distro" = "redhat" ]; then # we have to force a filesystem relabeling for SELinux after messing # around with the filesystem in redhat derived OSs echo "Enforce an automatic relabeling in the initial boot process..." touch "$SNF_IMAGE_TARGET/.autorelabel" fi fi exit 0 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :