From 9e95af677f3f9fc2be8529b76875678fca8d80d6 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 26 Sep 2013 21:12:32 +0200 Subject: [PATCH] Generate symlink /etc/mtab pointing to /proc/mounts [Closes: issue1277] 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 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/grml-autoconfig b/grml-autoconfig index cd584f2..c0c1d47 100755 --- a/grml-autoconfig +++ b/grml-autoconfig @@ -56,13 +56,10 @@ mount_sys # {{{ 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 -- 2.1.4