mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-29 00:42:58 +02:00
OpenRC: some fixes for /run transition.
- do not mount /dev/shm anymore, it's a symlink to /run/shm. - always mount /run as tmpfs with required dirs, and created required compat symlinks if they aren't correct (rootfs must be mounted rw to work).
This commit is contained in:
parent
5ae93346f2
commit
b9b2168a3b
2 changed files with 47 additions and 54 deletions
|
@ -11,9 +11,9 @@ xbps changes:
|
||||||
(symlinked to /run, which is tmpfs).
|
(symlinked to /run, which is tmpfs).
|
||||||
* The mtab service checks if / is of type rootfs and tmpfs, and don't add it
|
* The mtab service checks if / is of type rootfs and tmpfs, and don't add it
|
||||||
into /etc/mtab, which is redundant.
|
into /etc/mtab, which is redundant.
|
||||||
* mount_svcdir() doesn't mount any tmpfs or ramfs anymore, rather uses symlinks
|
* mount_svcdir() doesn't mount any tmpfs or ramfs anymore, rather mounts an
|
||||||
pointing to the /run directory which is always a tmpfs. Compat symlinks
|
tmpfs in /run and creates compat symlinks on it for /tmp, /dev/shm, /var/tmp,
|
||||||
for common dirs are also provided.
|
/var/lock, /var/run, etc.
|
||||||
* Backported a patch to skip unmounting the /run mountpoint from upstream
|
* Backported a patch to skip unmounting the /run mountpoint from upstream
|
||||||
git repo (Gentoo).
|
git repo (Gentoo).
|
||||||
|
|
||||||
|
@ -168,9 +168,19 @@ xbps changes:
|
||||||
fi
|
fi
|
||||||
no_umounts_r="^($no_umounts_r)$"
|
no_umounts_r="^($no_umounts_r)$"
|
||||||
|
|
||||||
--- sh/init.sh.Linux.in.orig 2011-02-10 06:15:24.000000000 +0100
|
--- init.d/devfs.in.orig 2011-02-10 06:15:24.000000000 +0100
|
||||||
+++ sh/init.sh.Linux.in 2011-04-29 18:11:13.254999893 +0200
|
+++ init.d/devfs.in 2011-04-29 18:12:48.983999871 +0200
|
||||||
@@ -3,59 +3,50 @@
|
@@ -13,7 +13,6 @@ start() {
|
||||||
|
# Mount required stuff as user may not have then in /etc/fstab
|
||||||
|
for x in \
|
||||||
|
"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \
|
||||||
|
- "tmpfs /dev/shm 1777 ,nodev shm" \
|
||||||
|
; do
|
||||||
|
set -- $x
|
||||||
|
grep -Eq "[[:space:]]+$1$" /proc/filesystems || continue
|
||||||
|
--- sh/init.sh.Linux.in.orig 2011-04-29 22:12:20.648999920 +0200
|
||||||
|
+++ sh/init.sh.Linux.in 2011-04-29 22:15:20.159999881 +0200
|
||||||
|
@@ -3,59 +3,42 @@
|
||||||
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
|
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
|
||||||
# All rights reserved. Released under the 2-clause BSD license.
|
# All rights reserved. Released under the 2-clause BSD license.
|
||||||
|
|
||||||
|
@ -188,10 +198,6 @@ xbps changes:
|
||||||
- return $rc
|
- return $rc
|
||||||
-}
|
-}
|
||||||
-
|
-
|
||||||
+# /lib/rc/init.d should be rw, previously it was mounted as tmpfs or
|
|
||||||
+# ramfs. XBPS no longer mounts this, rather uses a symlink to /run/init.d
|
|
||||||
+# which is always a tmpfs.
|
|
||||||
+#
|
|
||||||
mount_svcdir()
|
mount_svcdir()
|
||||||
{
|
{
|
||||||
- # mount from fstab if we can
|
- # mount from fstab if we can
|
||||||
|
@ -199,12 +205,7 @@ xbps changes:
|
||||||
-
|
-
|
||||||
- local fs= fsopts="-o rw,noexec,nodev,nosuid"
|
- local fs= fsopts="-o rw,noexec,nodev,nosuid"
|
||||||
- local svcsize=${rc_svcsize:-1024}
|
- local svcsize=${rc_svcsize:-1024}
|
||||||
+ # Create /lib/rc/init.d symlink to /run/init.d.
|
-
|
||||||
+ if [ ! -d /run/init.d ]; then
|
|
||||||
+ mkdir -p -m 0755 /run/init.d
|
|
||||||
+ fi
|
|
||||||
+ rm -rf /lib/rc/init.d && ln -sf /run/init.d /lib/rc/init.d
|
|
||||||
|
|
||||||
- # Some buggy kernels report tmpfs even when not present :(
|
- # Some buggy kernels report tmpfs even when not present :(
|
||||||
- if grep -Eq "[[:space:]]+tmpfs$" /proc/filesystems; then
|
- if grep -Eq "[[:space:]]+tmpfs$" /proc/filesystems; then
|
||||||
- local tmpfsopts="${fsopts},mode=755,size=${svcsize}k"
|
- local tmpfsopts="${fsopts},mode=755,size=${svcsize}k"
|
||||||
|
@ -212,26 +213,24 @@ xbps changes:
|
||||||
- if [ $? -eq 0 ]; then
|
- if [ $? -eq 0 ]; then
|
||||||
- svcdir_restorecon
|
- svcdir_restorecon
|
||||||
- [ $? -eq 0 ] && return 0
|
- [ $? -eq 0 ] && return 0
|
||||||
+ # Create compatibility symlinks for:
|
+ # Mount /run as tmpfs.
|
||||||
+ #
|
+ mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
|
||||||
+ # /tmp -> /run/tmp
|
+ # Create required /run directories.
|
||||||
+ # /var/tmp -> /run/tmp
|
+ for d in init.d pid udev; do
|
||||||
+ # /var/lock -> /run/lock
|
+ mkdir -m0755 /run/${d}
|
||||||
+ # /var/run -> /run/pid
|
+ done
|
||||||
+ # /dev/shm -> /run/shm
|
+ for d in lock tmp shm; do
|
||||||
|
+ mkdir -m1777 /run/${d}
|
||||||
|
+ done
|
||||||
+
|
+
|
||||||
+ [ ! -d /run/tmp ] && mkdir -m 1777 /run/tmp
|
+ # Create /run compat symlinks.
|
||||||
+ [ ! -d /run/lock ] && mkdir -m 1777 /run/lock
|
+ if [ "$(readlink -f /lib/rc/init.d)" != "/run/init.d" ]; then
|
||||||
+ [ ! -d /run/pid ] && mkdir -m 0755 /run/pid
|
+ rm -rf /lib/rc/init.d
|
||||||
+ [ ! -d /run/shm ] && mkdir -m 1777 /run/shm
|
+ ln -sf /run/init.d /lib/rc/init.d
|
||||||
+
|
|
||||||
+ if [ -d /tmp ]; then
|
|
||||||
+ rmdir /tmp
|
|
||||||
+ ln -sf /run/tmp /tmp
|
|
||||||
fi
|
fi
|
||||||
+ if [ -d /var/tmp ]; then
|
+ if [ "$(readlink -f /tmp)" != "/run/tmp" ]; then
|
||||||
+ rmdir /var/tmp
|
+ rm -rf /tmp
|
||||||
+ ln -sf /run/tmp /var/tmp
|
+ ln -sf /run/tmp /tmp
|
||||||
fi
|
fi
|
||||||
-
|
-
|
||||||
- if grep -Eq "[[:space:]]+ramfs$" /proc/filesystems; then
|
- if grep -Eq "[[:space:]]+ramfs$" /proc/filesystems; then
|
||||||
|
@ -249,32 +248,26 @@ xbps changes:
|
||||||
- eerror "compiled into the kernel"
|
- eerror "compiled into the kernel"
|
||||||
- echo
|
- echo
|
||||||
- return 1
|
- return 1
|
||||||
+ if [ -d /var/run ]; then
|
+ if [ "$(readlink -f /var/tmp)" != "/run/tmp" ]; then
|
||||||
+ rm -rf /var/run
|
+ rm -rf /var/tmp
|
||||||
+ ln -sf /run/pid /var/run
|
+ ln -sf /run/tmp /var/tmp
|
||||||
fi
|
fi
|
||||||
-
|
-
|
||||||
- mount -n -t "$fs" $fsopts rc-svcdir "$RC_SVCDIR"
|
- mount -n -t "$fs" $fsopts rc-svcdir "$RC_SVCDIR"
|
||||||
- if [ $? -eq 0 ]; then
|
- if [ $? -eq 0 ]; then
|
||||||
- svcdir_restorecon
|
- svcdir_restorecon
|
||||||
- [ $? -eq 0 ] && return 0
|
- [ $? -eq 0 ] && return 0
|
||||||
+ if [ -d /var/lock ]; then
|
+ if [ "$(readlink -f /dev/shm)" != "/run/shm" ]; then
|
||||||
+ rmdir /var/lock
|
+ rm -rf /dev/shm
|
||||||
+ ln -sf /run/lock /var/lock
|
|
||||||
+ fi
|
|
||||||
+ if [ -d /run/shm ]; then
|
|
||||||
+ [ -d /dev/shm ] && rmdir /dev/shm
|
|
||||||
+ ln -sf /run/shm /dev/shm
|
+ ln -sf /run/shm /dev/shm
|
||||||
|
+ fi
|
||||||
|
+ if [ "$(readlink -f /var/run)" != "/run/pid" ]; then
|
||||||
|
+ rm -rf /var/run
|
||||||
|
+ ln -sf /run/pid /var/run
|
||||||
|
+ fi
|
||||||
|
+ if [ "$(readlink -f /var/lock)" != "/run/lock" ]; then
|
||||||
|
+ rm -rf /var/lock
|
||||||
|
+ ln -sf /run/lock /var/lock
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
--- init.d/devfs.in.orig 2011-02-10 06:15:24.000000000 +0100
|
|
||||||
+++ init.d/devfs.in 2011-04-29 18:12:48.983999871 +0200
|
|
||||||
@@ -13,7 +13,6 @@ start() {
|
|
||||||
# Mount required stuff as user may not have then in /etc/fstab
|
|
||||||
for x in \
|
|
||||||
"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \
|
|
||||||
- "tmpfs /dev/shm 1777 ,nodev shm" \
|
|
||||||
; do
|
|
||||||
set -- $x
|
|
||||||
grep -Eq "[[:space:]]+$1$" /proc/filesystems || continue
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'OpenRC'
|
# Template file for 'OpenRC'
|
||||||
pkgname=OpenRC
|
pkgname=OpenRC
|
||||||
version=20110211
|
version=20110211
|
||||||
revision=2
|
revision=4
|
||||||
wrksrc=openrc-${version}
|
wrksrc=openrc-${version}
|
||||||
distfiles="http://xbps.nopcode.org/distfiles/openrc-$version.tar.bz2"
|
distfiles="http://xbps.nopcode.org/distfiles/openrc-$version.tar.bz2"
|
||||||
build_style=custom-install
|
build_style=custom-install
|
||||||
|
|
Loading…
Add table
Reference in a new issue