summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2009-07-23 10:44:36 (GMT)
committerColin Watson <cjwatson@debian.org>2009-07-23 10:44:36 (GMT)
commitfda43dbccf4ee29e5bd58877e2a8543ce81becff (patch)
tree4159692d9a2ee88c0fef79f03b2741ae06d1f1e7 /functions
parent0d31f5faa4fc5ab0ca3a205bc2c4b856322107ac (diff)
downloaddebootstrap-fda43dbccf4ee29e5bd58877e2a8543ce81becff.zip
debootstrap-fda43dbccf4ee29e5bd58877e2a8543ce81becff.tar.gz
debootstrap-fda43dbccf4ee29e5bd58877e2a8543ce81becff.tar.bz2
On Linux, clear out /etc/mtab on exit if it's not a symlink. Should fix
problems Wouter Verhelst and Martin Michlmayr are seeing with initramfs-tools MODULES=dep, although it probably isn't a perfect solution. r59637
Diffstat (limited to 'functions')
-rw-r--r--functions7
1 files changed, 7 insertions, 0 deletions
diff --git a/functions b/functions
index ae8fd3f..989fb6e 100644
--- a/functions
+++ b/functions
@@ -815,6 +815,12 @@ umount_on_exit () {
fi
}
+clear_mtab () {
+ if [ -f "$TARGET/etc/mtab" ] && [ ! -h "$TARGET/etc/mtab" ]; then
+ rm -f "$TARGET/etc/mtab"
+ fi
+}
+
setup_proc () {
case "$ARCH" in
kfreebsd-*)
@@ -838,6 +844,7 @@ setup_proc () {
umount "$TARGET/sys" 2>/dev/null || true
in_target mount -t sysfs sysfs /sys
fi
+ on_exit clear_mtab
;;
esac
umount_on_exit /lib/init/rw