Make sure /dev/shm/resolvconf exists
[grml-autoconfig.git] / grml-autoconfig
index 04625a9..581c989 100755 (executable)
@@ -4,7 +4,7 @@
 # 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.
-# Latest change: Mit Jul 25 19:59:07 CEST 2007 [mika]
+# Latest change: Sam Sep 08 12:15:12 CEST 2007 [mika]
 ################################################################################
 
 # http://wiki.debian.org/LSBInitScripts =>
@@ -67,6 +67,24 @@ if checkbootparam "textsplash" || checkbootparam "tsplash"; then
    SPLASH=1
 fi
 
+# update /etc/mtab if running in live-initramfs mode:
+if [ -z "$INSTALLED" -a -e /live/cow ] ; then
+   if ! grep -q rootfs /etc/mtab ; then
+      for i in rootfs sysfs proc /live/image /live/cow /lib/init/rw /dev/shm /dev/pts ; do
+          grep $i /proc/mounts >> /etc/mtab
+      done
+   fi
+fi
+
+# make sure /etc/resolv.conf points to /dev/shm/resolvconf
+# and /dev/shm/resolvconf exists:
+if [ -z "$INSTALLED" ] ; then
+   if [[ $(readlink /etc/resolv.conf) == /etc/resolvconf/run/resolv.conf ]] && \
+      [[ $(readlink /etc/resolvconf/run) == /dev/shm/resolvconf ]] ; then
+      mkdir /dev/shm/resolvconf
+   fi
+fi
+
 if [ -z "$SPLASH" ] ; then
   stage=5
   rundebugshell