~ubuntu-branches/ubuntu/lucid/selinux/lucid

« back to all changes in this revision

Viewing changes to restorecon

  • Committer: Bazaar Package Importer
  • Author(s): J. Tang
  • Date: 2008-01-29 12:00:00 UTC
  • Revision ID: james.westby@ubuntu.com-20080129120000-lo5k9hah75x78n0o
Tags: 0.1
Initial Release.  The package supersedes selinux-basics.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
set -e
 
3
 
 
4
. /scripts/functions
 
5
 
 
6
PREREQ="framebuffer console_setup"
 
7
 
 
8
prereqs () {
 
9
        echo "$PREREQ"
 
10
}
 
11
 
 
12
case $1 in
 
13
        prereqs)
 
14
                prereqs
 
15
                exit 0
 
16
                ;;
 
17
esac
 
18
 
 
19
# temporarily mount so that it can be relabeled
 
20
mount --bind -o rw /dev ${rootmnt}/dev
 
21
 
 
22
set +e
 
23
 
 
24
# restore the labels in /dev
 
25
chroot ${rootmnt} /sbin/restorecon -R /dev
 
26
 
 
27
RET=$?
 
28
if [ $RET -ne 0 ]
 
29
then
 
30
    log_warning_msg "Restorecon failed to relabel /dev, continuing" 
 
31
fi
 
32
 
 
33
set -e
 
34
 
 
35
umount ${rootmnt}/dev
 
36
 
 
37
exit 0