summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-06-18 14:00:40 +0100
committerDaniel Baumann <mail@daniel-baumann.ch>2014-06-25 20:52:08 +0200
commit114a778b7a8e7641fcae4ba971e73067ed90eb12 (patch)
treea61560cb43a48c7580f2023e354cffc8ecf85612
parent547f5593436f05696c6dffc8f405b53bad4281ce (diff)
downloadvyos-live-build-114a778b7a8e7641fcae4ba971e73067ed90eb12.tar.gz
vyos-live-build-114a778b7a8e7641fcae4ba971e73067ed90eb12.zip
If /etc/mtab exists as a file, replace it with a symlink (Closes: #746570).
-rwxr-xr-xshare/hooks/0020-create-mtab-symlink.hook.chroot3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/hooks/0020-create-mtab-symlink.hook.chroot b/share/hooks/0020-create-mtab-symlink.hook.chroot
index 0cae147b0..68587a5f6 100755
--- a/share/hooks/0020-create-mtab-symlink.hook.chroot
+++ b/share/hooks/0020-create-mtab-symlink.hook.chroot
@@ -2,9 +2,10 @@
set -e
-# Create /etc/mtab symlink
+# Create /etc/mtab symlink, replacing a regular file if necessary
if [ ! -L /etc/mtab ]
then
+ rm -f /etc/mtab
ln -s /proc/mtab /etc/mtab
fi