[arch-dev-public] [RFC] Initialize /etc/mtab by copying /proc/mounts
Our current process of initializing /etc/mtab is hackish and probably error-prone, replace it by simply copying /proc/mounts. --- rc.sysinit | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 8349860..b78d3e7 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -295,13 +295,7 @@ fi stat_busy "Mounting Local Filesystems" /bin/mount -n -o remount,rw / -: >| /etc/mtab -# make sure / gets written to /etc/mtab -/bin/mount -o remount,rw / -# Write /proc, /sys and /dev to /etc/mtab -if [ -e /proc/mounts ]; then - /bin/grep -e "/proc " -e "/sys " -e "/dev " /proc/mounts >> /etc/mtab -fi +cat /proc/mounts >| /etc/mtab run_hook sysinit_premount # now mount all the local filesystems /bin/mount -a -t $NETFS -O no_netdev -- 1.7.1
On Tue, Jun 8, 2010 at 5:48 PM, Thomas Bächler <thomas@archlinux.org> wrote:
Our current process of initializing /etc/mtab is hackish and probably error-prone, replace it by simply copying /proc/mounts. ---
Looks good to me (but untested). This goes way back to the roots of Arch, wow.
rc.sysinit | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit index 8349860..b78d3e7 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -295,13 +295,7 @@ fi
stat_busy "Mounting Local Filesystems" /bin/mount -n -o remount,rw / -: >| /etc/mtab -# make sure / gets written to /etc/mtab -/bin/mount -o remount,rw / -# Write /proc, /sys and /dev to /etc/mtab -if [ -e /proc/mounts ]; then - /bin/grep -e "/proc " -e "/sys " -e "/dev " /proc/mounts >> /etc/mtab -fi +cat /proc/mounts >| /etc/mtab run_hook sysinit_premount # now mount all the local filesystems /bin/mount -a -t $NETFS -O no_netdev -- 1.7.1
Am 09.06.2010 03:40, schrieb Dan McGee:
On Tue, Jun 8, 2010 at 5:48 PM, Thomas Bächler <thomas@archlinux.org> wrote:
Our current process of initializing /etc/mtab is hackish and probably error-prone, replace it by simply copying /proc/mounts. ---
Looks good to me (but untested). This goes way back to the roots of Arch, wow.
The only weirdness that I found is that "rootfs" is now shown as a mount: rootfs / rootfs rw 0 0 Technically this is correct, but some tools might become confused. Another way would be to grep -v ^rootfs from /proc/mounts when creating mtab. I am entirely unsure what the "right way" is here.
participants (2)
-
Dan McGee
-
Thomas Bächler