* Unmount only the filesystems that the installer actually mounted.
So if the user mounted /mnt/boot or something, don't unmount it. svn path=/nixos/trunk/; revision=11792
This commit is contained in:
parent
98748a319a
commit
728a278641
@ -69,18 +69,23 @@ cat /mnt/etc/mtab
|
|||||||
# That could spoil mtab with litter.
|
# That could spoil mtab with litter.
|
||||||
mount --rbind / $mountPoint/mnt
|
mount --rbind / $mountPoint/mnt
|
||||||
|
|
||||||
cleanup() {
|
umountUnder() {
|
||||||
# !!! don't umount anything we didn't mount ourselves
|
local dir="$1"
|
||||||
for i in $(grep -F "$mountPoint" /proc/mounts \
|
for i in $(grep -F " $dir" /proc/mounts \
|
||||||
| @perl@/bin/perl -e 'while (<>) { /^\S+\s+(\S+)\s+/; print "$1\n"; }' \
|
| @perl@/bin/perl -e 'while (<>) { /^\S+\s+(\S+)\s+/; print "$1\n"; }' \
|
||||||
| sort -r);
|
| sort -r);
|
||||||
do
|
do
|
||||||
if test "$i" != "$mountPoint" -a "$i" != / -a -e "$i"; then
|
|
||||||
umount $i || true
|
umount $i || true
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
umountUnder $mountPoint/mnt
|
||||||
|
umountUnder $mountPoint/dev
|
||||||
|
umountUnder $mountPoint/proc
|
||||||
|
umountUnder $mountPoint/sys
|
||||||
|
}
|
||||||
|
|
||||||
trap "cleanup" EXIT
|
trap "cleanup" EXIT
|
||||||
|
|
||||||
mkdir -m 01777 -p $mountPoint/tmp
|
mkdir -m 01777 -p $mountPoint/tmp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user