Made mounting/unmount of child /proc and /sys conditional for whether the host has them or not

This commit is contained in:
2012-08-05 23:55:55 -04:00
parent b84d7e8fcd
commit c3fa89727d
2 changed files with 0 additions and 6 deletions

View File

@@ -17,8 +17,6 @@ rm -rf ${DISCOROOT}/restricted/bin/*
# Prepare all the mountpoint directories # Prepare all the mountpoint directories
mkdir -p ${DISCOROOT}/chroot mkdir -p ${DISCOROOT}/chroot
mkdir -p ${DISCOROOT}/execs/bin mkdir -p ${DISCOROOT}/execs/bin
mkdir -p ${DISCOROOT}/proc/proc
mkdir -p ${DISCOROOT}/sysfs/sys
mkdir -p ${DISCOROOT}/rootfs mkdir -p ${DISCOROOT}/rootfs
mkdir -p ${DISCOROOT}/scratchfs mkdir -p ${DISCOROOT}/scratchfs
mkdir -p ${DISCOROOT}/dev/dev 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 --bind -o ro / ${DISCOROOT}/rootfs 2>&1 | grep -v "seems to be mounted read-write"
mount -o remount,ro ${DISCOROOT}/rootfs 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. # Setup filesystem layers. The read/write ones go on the top, with scratchfs ALWAYS on top.
FSLAYERS="${DISCOROOT}/scratchfs=rw" FSLAYERS="${DISCOROOT}/scratchfs=rw"

View File

@@ -9,8 +9,6 @@ if [ $? -ne 0 ]; then
fi fi
umount ${DISCOROOT}/chroot umount ${DISCOROOT}/chroot
umount ${DISCOROOT}/proc/proc
umount ${DISCOROOT}/sysfs/sys
umount ${DISCOROOT}/rootfs umount ${DISCOROOT}/rootfs
mount | grep $DISCOROOT > /dev/null 2>&1 mount | grep $DISCOROOT > /dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then