Ensure /etc/mtab is always present
authorChristian Hofstaedtler <ch+git@zeha.at>
Fri, 30 Oct 2009 16:09:41 +0000 (17:09 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 30 Oct 2009 18:47:33 +0000 (19:47 +0100)
Newer debootstrap versions no longer create /etc/mtab, so we need to provide
our own.

etc/grml/fai/config/scripts/GRMLBASE/02-mtab [new file with mode: 0755]

diff --git a/etc/grml/fai/config/scripts/GRMLBASE/02-mtab b/etc/grml/fai/config/scripts/GRMLBASE/02-mtab
new file mode 100755 (executable)
index 0000000..a7efced
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Filename:      /etc/grml/fai/config/scripts/GRMLBASE/02-mtab
+# Purpose:       create mtab if it does not yet exist
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2 or any later version.
+################################################################################
+
+set -u
+set -e
+
+[ -r /etc/grml/grml-live.conf ]  && . /etc/grml/grml-live.conf
+[ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
+
+# newer debootstrap does not create an mtab.
+# create it and fill it with what is probably already mounted.
+if [ ! -e $target/etc/mtab ] ; then
+  cat > $target/etc/mtab << EOF
+proc /proc proc rw 0 0
+sysfs /sys sysfs rw 0 0
+/dev /dev tmpfs rw 0 0
+devpts /dev/pts devpts rw 0 0
+EOF
+fi
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3