Generate symlink /etc/mtab pointing to /proc/mounts [Closes: issue1277]
authorMichael Prokop <mika@grml.org>
Thu, 26 Sep 2013 19:12:32 +0000 (21:12 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 26 Sep 2013 19:51:36 +0000 (21:51 +0200)
We don't have /etc/mtab on our rootfs by default and Debian's
initscript package provides a way to generate the /etc/mtab
symlink via its /etc/init.d/checkroot.sh init script. We don't
use this init script in Grml's live system though (e.g. to not
enable swap partitions by default).

Also /etc/init.d/mountkernfs.sh creates an *empty* /etc/mtab file
on bootup if /etc/mtab doesn't exist yet. Last but not least
live-boot's /lib/live/boot/9990-aaa-fixme.sh as well as brltty's
/scripts/init-premount/brltty [see #724695] do some further hacks
- so let's just force generation of symlink /etc/mtab pointing to
/proc/mounts to make sure the system is in a sane state.

While at it drop deprecated /live/cow related code for /etc/mtab
handling.

Thanks: Michael Biebl for the initial hint
regarding the "df: no file systems processed" issue

grml-autoconfig

index cd584f2..c0c1d47 100755 (executable)
@@ -56,13 +56,10 @@ mount_sys
 # {{{ main grml-autoconfig
 checkvalue $CONFIG_DEBUG && config_debug
 
 # {{{ main grml-autoconfig
 checkvalue $CONFIG_DEBUG && config_debug
 
-# 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 "none /sys sysfs" proc ${LIVECD_PATH} /live/cow /lib/init/rw /dev/shm /dev/pts ; do
-          grep $i /proc/mounts | grep -v /dev/.static >> /etc/mtab
-      done
-   fi
+# make sure symlink /etc/mtab exists, this is usually handled by
+# /etc/init.d/checkroot.sh but we don't execute this script on the live system
+if [ -z "$INSTALLED" ] ; then
+  ln -sf /proc/mounts /etc/mtab
 fi
 
 stage=5
 fi
 
 stage=5