Made mounting/unmount of child /proc and /sys conditional for whether the host has them or not
This commit is contained in:
@@ -17,8 +17,6 @@ rm -rf ${DISCOROOT}/restricted/bin/*
|
||||
# Prepare all the mountpoint directories
|
||||
mkdir -p ${DISCOROOT}/chroot
|
||||
mkdir -p ${DISCOROOT}/execs/bin
|
||||
mkdir -p ${DISCOROOT}/proc/proc
|
||||
mkdir -p ${DISCOROOT}/sysfs/sys
|
||||
mkdir -p ${DISCOROOT}/rootfs
|
||||
mkdir -p ${DISCOROOT}/scratchfs
|
||||
mkdir -p ${DISCOROOT}/dev/dev
|
||||
@@ -58,8 +56,6 @@ chmod 666 ${DISCOROOT}/dev/dev/null
|
||||
|
||||
mount --bind -o ro / ${DISCOROOT}/rootfs 2>&1 | grep -v "seems to be mounted read-write"
|
||||
mount -o remount,ro ${DISCOROOT}/rootfs
|
||||
mount -t proc -o ro none ${DISCOROOT}/proc/proc
|
||||
mount -t sysfs -o ro none ${DISCOROOT}/sysfs/sys
|
||||
|
||||
# Setup filesystem layers. The read/write ones go on the top, with scratchfs ALWAYS on top.
|
||||
FSLAYERS="${DISCOROOT}/scratchfs=rw"
|
||||
|
||||
@@ -9,8 +9,6 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
|
||||
umount ${DISCOROOT}/chroot
|
||||
umount ${DISCOROOT}/proc/proc
|
||||
umount ${DISCOROOT}/sysfs/sys
|
||||
umount ${DISCOROOT}/rootfs
|
||||
mount | grep $DISCOROOT > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
Reference in New Issue
Block a user