]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Core Update 167: Replace /etc/mtab by symlink to /proc/self/mounts
authorPeter Müller <peter.mueller@ipfire.org>
Mon, 11 Apr 2022 19:14:43 +0000 (19:14 +0000)
committerPeter Müller <peter.mueller@ipfire.org>
Tue, 12 Apr 2022 14:10:08 +0000 (14:10 +0000)
mount, as updated via util-linux, no longer writes /etc/mtab, causing
programs to rely on this file's content (such as the check_disk Nagios
plugin) to stop working.

/proc/self/mounts contains all the necessary information, so it is fine
to replace /etc/mtab by a symlink to it.

Fixes: #12843
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
config/rootfiles/core/167/filelists/files
config/rootfiles/core/167/update.sh
lfs/stage2
src/initscripts/system/mountfs
src/initscripts/system/partresize

index 9f9ba5c34522523d6b2474f3b13b444c7e4bfc0a..18f533e932e1f2f1df1e82a6b1d89194372c8a3c 100644 (file)
@@ -1,7 +1,9 @@
 etc/collectd.conf
 etc/inittab.d
 etc/rc.d/init.d/firewall
+etc/rc.d/init.d/mountfs
 etc/rc.d/init.d/pakfire
+etc/rc.d/init.d/partresize
 etc/sysctl.conf
 lib/udev/network-hotplug-bridges
 srv/web/ipfire/cgi-bin/connections.cgi
index 0a647eb98570a9de7c6799002c549b5061e5aa37..0f98f17579a11ff06c6e3c88204d2e1dc6f41c1c 100644 (file)
@@ -386,6 +386,10 @@ hardlink -c -vv /lib/firmware
 # Regenerate all initrds
 dracut --regenerate-all --force
 
+# Replace /etc/mtab by symlink as mount no longer writes it
+rm -vf /etc/mtab
+ln -vs /proc/self/mounts /etc/mtab
+
 # Export the location database again and reload the firewall engine
 /usr/local/bin/update-location-database
 
index 9f93babe2f046e718d90fa12e765048935b2f1ee..39697a848d76afeac31f38822b91d8d90cc241e4 100644 (file)
@@ -87,7 +87,8 @@ endif
        cp -rvf $(DIR_SRC)/config/etc/* /etc;
        [ ! -d "$(DIR_SRC)/config/etc-$(BUILD_ARCH)" ] || cp -rvf $(DIR_SRC)/config/etc-$(BUILD_ARCH)/* /etc
        cp -rvf $(DIR_SRC)/config/lib/* /lib;
-       touch /etc/{fs,m}tab
+       touch /etc/fstab
+       ln -s /proc/self/mounts /etc/mtab
        echo "$(NAME) v$(VERSION) - $(SLOGAN)" >  /etc/issue
        echo "===============================" >> /etc/issue
        echo "\n running on \s \r \m"          >> /etc/issue
index b1533d6a287bfa9814b42937032b86e24432d8cd..81ed729c1088c8c2b411ba65e5b897536ecf6225 100644 (file)
@@ -31,12 +31,6 @@ case "${1}" in
                # Remove fsck-related file system watermarks.
                rm -f /fastboot /forcefsck
 
-               boot_mesg "Create /etc/mtab..."
-               > /etc/mtab
-               mount -f / || failed=1
-               (exit ${failed})
-               evaluate_retval
-
                # This will mount all filesystems that do not have _netdev in
                # their option list.  _netdev denotes a network filesystem.
                boot_mesg "Mounting remaining file systems..."
index 7605b9e2b15a618f949741687e97d8fe0ff16e20..147405e1e43e4d974670751e682a8ca7a740c3bf 100644 (file)
@@ -30,12 +30,6 @@ case "${1}" in
                        mount -o remount,rw / > /dev/null
                        evaluate_retval
 
-                       boot_mesg "Create /etc/mtab..."
-                       > /etc/mtab
-                       mount -f / || failed=1
-                       (exit ${failed})
-                       evaluate_retval
-
                        # check if serial console enabled
                        scon="off";
                        if [ ! "$(grep "console=ttyS0" /proc/cmdline)" == "" ]; then