From 68804663ef0958756871bba40312a186d2339c74 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 25 Jun 2011 16:27:59 +0200 Subject: [PATCH] OpenRC: make /etc/mtab a symlink to /proc/self/mounts. --- srcpkgs/OpenRC/patches/xbps_changes.diff | 50 ++++++++++++++++++------ srcpkgs/OpenRC/template | 2 +- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/srcpkgs/OpenRC/patches/xbps_changes.diff b/srcpkgs/OpenRC/patches/xbps_changes.diff index 961e4d13b1..03f99ffb95 100644 --- a/srcpkgs/OpenRC/patches/xbps_changes.diff +++ b/srcpkgs/OpenRC/patches/xbps_changes.diff @@ -9,8 +9,7 @@ xbps changes: * Sets windowkeys and fix_euro in /etc/conf.d/keymaps by default. * The bootmisc service no longer cleans up /var/run, as it is now mounted tmpfs (symlinked to /run, which is tmpfs). -* The mtab service checks if / is of type rootfs and tmpfs, and don't add it - into /etc/mtab, which is redundant. +* The mtab service now symlinks /proc/self/mounts to /etc/mtab. * mount_svcdir() doesn't mount any tmpfs or ramfs anymore, rather mounts an tmpfs in /run if not already mounted and creates a compat symlink for /dev/shm. * Backported a patch to skip unmounting the /run mountpoint from upstream @@ -111,17 +110,6 @@ xbps changes: # Network fstypes. Below is the default. net_fs_list="afs cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs nfs nfs4 ocfs2 shfs smbfs" ---- init.d/mtab.in.orig 2011-01-16 12:44:28.947251849 +0100 -+++ init.d/mtab.in 2011-01-16 12:44:37.896926832 +0100 -@@ -28,7 +28,7 @@ start() - # makes / readonly and dismounts all tmpfs even if in use which is - # not good. Luckily, umount uses /etc/mtab instead of /proc/mounts - # which allows this hack to work. -- grep -v "^[^ ]* / tmpfs " /proc/mounts > /etc/mtab -+ egrep -v "^[^ ]* / (rootfs|tmpfs) " /proc/mounts > /etc/mtab - - # Remove stale backups - rm -f /etc/mtab~ /etc/mtab~~ --- init.d/bootmisc.in.orig 2011-01-16 12:45:10.633395765 +0100 +++ init.d/bootmisc.in 2011-01-16 12:46:00.591163353 +0100 @@ -97,31 +97,6 @@ start() @@ -272,3 +260,39 @@ xbps changes: m="$m|/bin|/sbin|/lib|/libexec" # RC_NO_UMOUNTS is an env var that can be set by plugins local OIFS=$IFS SIFS=${IFS-y} IFS=$IFS +--- init.d/mtab.in.orig 2011-06-25 16:16:49.284716701 +0200 ++++ init.d/mtab.in 2011-06-25 16:18:13.986716755 +0200 +@@ -6,31 +6,11 @@ description="Update /etc/mtab to match w + + depend() + { +- need root ++ need root procfs + keyword -prefix + } + + start() + { +- # /etc/mtab could be a symlink to /proc/mounts +- if [ ! -w /etc/mtab -a -L /etc/mtab ]; then +- eeinfo "Skipping mtab update (non writeable symlink)" +- return 0 +- fi +- +- ebegin "Updating /etc/mtab" +- if ! echo 2>/dev/null >/etc/mtab; then +- ewend 1 "/etc/mtab is not updateable" +- return 0 +- fi +- +- # With / as tmpfs we cannot umount -at tmpfs in localmount as that +- # makes / readonly and dismounts all tmpfs even if in use which is +- # not good. Luckily, umount uses /etc/mtab instead of /proc/mounts +- # which allows this hack to work. +- grep -v "^[^ ]* / tmpfs " /proc/mounts > /etc/mtab +- +- # Remove stale backups +- rm -f /etc/mtab~ /etc/mtab~~ +- eend 0 ++ [ ! -h /etc/mtab ] && ln -sf /proc/self/mounts /etc/mtab + } diff --git a/srcpkgs/OpenRC/template b/srcpkgs/OpenRC/template index 4798ba38f9..1255ebbf72 100644 --- a/srcpkgs/OpenRC/template +++ b/srcpkgs/OpenRC/template @@ -1,7 +1,7 @@ # Template file for 'OpenRC' pkgname=OpenRC version=20110211 -revision=9 +revision=10 wrksrc=openrc-${version} distfiles="http://xbps.nopcode.org/distfiles/openrc-$version.tar.bz2" build_style=custom-install