prepare-root.sh: mount /sys/fs/selinux in /sysroot

This commit is contained in:
Harald Hoyer 2018-09-18 13:49:11 +02:00
parent cb66f23295
commit bab477b0c9

View file

@ -139,7 +139,7 @@ readonly MY_TMPDIR="$(mktemp -p "$TMPDIR/" -d -t ${PROGNAME}.XXXXXX)"
trap ' trap '
ret=$?; ret=$?;
mountpoint -q "$sysroot"/var/cache/dnf && umount "$sysroot"/var/cache/dnf mountpoint -q "$sysroot"/var/cache/dnf && umount "$sysroot"/var/cache/dnf
for i in "$sysroot"/{dev,sys,proc,run}; do for i in "$sysroot"/{dev,sys/fs/selinux,sys,proc,run}; do
[[ -d "$i" ]] && mountpoint -q "$i" && umount "$i" [[ -d "$i" ]] && mountpoint -q "$i" && umount "$i"
done done
[[ $MY_TMPDIR ]] && rm -rf --one-file-system -- "$MY_TMPDIR" [[ $MY_TMPDIR ]] && rm -rf --one-file-system -- "$MY_TMPDIR"
@ -169,6 +169,7 @@ mkdir -p "$sysroot"/{dev,proc,sys,run}
mount --bind /proc "$sysroot/proc" mount --bind /proc "$sysroot/proc"
#mount --bind /run "$sysroot/run" #mount --bind /run "$sysroot/run"
mount --bind /sys "$sysroot/sys" mount --bind /sys "$sysroot/sys"
mount --bind /sys/fs/selinux "$sysroot/sys/fs/selinux"
mount -t devtmpfs devtmpfs "$sysroot/dev" mount -t devtmpfs devtmpfs "$sysroot/dev"
mkdir -p "$sysroot"/var/cache/dnf mkdir -p "$sysroot"/var/cache/dnf
@ -514,7 +515,7 @@ 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
for i in "$sysroot"/{dev,sys,proc,run}; do for i in "$sysroot"/{dev,sys/fs/selinux,sys,proc,run}; do
[[ -d "$i" ]] && mountpoint -q "$i" && umount "$i" [[ -d "$i" ]] && mountpoint -q "$i" && umount "$i"
done done