prepare-root.sh: add altfiles to selinux
This commit is contained in:
parent
7b9117d5de
commit
0d5cfac2ac
|
@ -459,14 +459,22 @@ rm -f "$sysroot"/etc/systemd/system/*.wants/multipathd*
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# selinux
|
# selinux
|
||||||
|
cp -avr "$sysroot"/usr/share/factory/cfg "$sysroot"/
|
||||||
|
|
||||||
sed -i -e 's#^SELINUX=.*#SELINUX=permissive#g' "$sysroot"/etc/selinux/config
|
sed -i -e 's#^SELINUX=.*#SELINUX=permissive#g' "$sysroot"/etc/selinux/config
|
||||||
chroot "$sysroot" semanage fcontext -a -e /etc /cfg
|
chroot "$sysroot" semanage fcontext -a -e /etc /cfg
|
||||||
chroot "$sysroot" semanage fcontext -a -e /etc /usr/share/factory/etc
|
chroot "$sysroot" semanage fcontext -a -e /etc /usr/share/factory/cfg
|
||||||
chroot "$sysroot" semanage fcontext -a -e /var /usr/share/factory/var
|
chroot "$sysroot" semanage fcontext -a -e /var /usr/share/factory/var
|
||||||
|
for i in passwd shadow group gshadow; do
|
||||||
|
chroot "$sysroot" semanage fcontext -a -e /etc/$i /usr/lib/$i
|
||||||
|
done
|
||||||
chroot "$sysroot" fixfiles -v -F -f relabel || :
|
chroot "$sysroot" fixfiles -v -F -f relabel || :
|
||||||
chroot "$sysroot" restorecon -v -R /usr/share/factory/ || :
|
chroot "$sysroot" restorecon -v -R /usr/share/factory/ || :
|
||||||
rm -fr "$sysroot"/var/lib/selinux
|
rm -fr "$sysroot"/var/lib/selinux
|
||||||
|
|
||||||
|
rm -fr "$sysroot"/cfg/*
|
||||||
|
|
||||||
|
|
||||||
#---------------
|
#---------------
|
||||||
# var
|
# var
|
||||||
rm -fr "$sysroot"/var/lib/rpm
|
rm -fr "$sysroot"/var/lib/rpm
|
||||||
|
@ -502,7 +510,6 @@ rm -fr "$sysroot"/var/*
|
||||||
rm -fr "$sysroot"/home/*
|
rm -fr "$sysroot"/home/*
|
||||||
rm -f "$sysroot"/etc/yum.repos.d/*
|
rm -f "$sysroot"/etc/yum.repos.d/*
|
||||||
mkdir -p "$sysroot"/home
|
mkdir -p "$sysroot"/home
|
||||||
mkdir -p "$sysroot"/cfg
|
|
||||||
|
|
||||||
for i in "$sysroot"/{dev,sys,proc,run}; do
|
for i in "$sysroot"/{dev,sys,proc,run}; do
|
||||||
[[ -d "$i" ]] && mountpoint -q "$i" && umount "$i"
|
[[ -d "$i" ]] && mountpoint -q "$i" && umount "$i"
|
||||||
|
|
Loading…
Reference in a new issue