Got dual-mount of the noop/real filesystems working, made all apps aware of it, broke out the initialization logic into disco-fs-init so you can mount/unmount as much as you want, but the time consuming init process won't be repeated unless you ask

This commit is contained in:
2012-08-07 10:33:29 -04:00
parent 651b0c86d9
commit f51124252e
5 changed files with 127 additions and 89 deletions

View File

@@ -8,23 +8,22 @@ if [ $? -ne 0 ]; then
exit 1
fi
#Unmount the proc/sys mirrors if they were mounted
mount | grep " on ${DISCOROOT}/chroot/proc" >/dev/null 2>&1
if [ $? -eq 0 ]; then
umount ${DISCOROOT}/chroot/proc
fi
mount | grep " on ${DISCOROOT}/chroot/sys" >/dev/null 2>&1
if [ $? -eq 0 ]; then
umount ${DISCOROOT}/chroot/sys
fi
umount ${DISCOROOT}/chroot
umount ${DISCOROOT}/proc/proc
umount ${DISCOROOT}/rootfs
mount | grep $DISCOROOT > /dev/null 2>&1
if [ $? -eq 0 ]; then
# Sometimes required
umount ${DISCOROOT}/rootfs
fi
#Unmount the proc/sys mirrors if they were mounted
mount | grep " on ${DISCOROOT}/proc/proc" >/dev/null 2>&1
if [ $? -eq 0 ]; then
mount -t proc -o ro none ${DISCOROOT}/proc/proc
fi
mount | grep " on ${DISCOROOT}/sysfs/sys" >/dev/null 2>&1
if [ $? -eq 0 ]; then
mount -t sysfs -o ro none ${DISCOROOT}/sysfs/sys
fi
rm -rf ${DISCOROOT}/scratchfs/* ${DISCOROOT}/scratchfs/.unionfs
rm -rf ${DISCOROOT}/dev/*