OpenRC: only mount /run if not mounted, check if dirs exist before creating them.

This commit is contained in:
Juan RP 2011-06-19 01:19:04 +02:00
parent d9dd98aa86
commit 26f8495bf6
2 changed files with 6 additions and 6 deletions

View File

@ -12,7 +12,7 @@ xbps changes:
* 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 mounts an * mount_svcdir() doesn't mount any tmpfs or ramfs anymore, rather mounts an
tmpfs in /run and creates a compat symlink for /dev/shm. 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 * Backported a patch to skip unmounting the /run mountpoint from upstream
git repo (Gentoo). git repo (Gentoo).
@ -220,18 +220,18 @@ xbps changes:
- echo - echo
- return 1 - return 1
- fi - fi
+ # Mount /run as tmpfs. + # Mount /run as tmpfs if not mounted already.
+ mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run + mountinfo -q /run || mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
- 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
+ for d in init.d udev; do + for d in init.d udev; do
+ mkdir -m0755 /run/${d} + [ ! -d /run/${d} ] && mkdir -m0755 /run/${d}
+ done + done
+ for d in lock tmp shm; do + for d in lock tmp shm; do
+ mkdir -m1777 /run/${d} + [ ! -d /run/${d} ] && mkdir -m1777 /run/${d}
+ done + done
+ +
+ # Create /dev/shm -> /run/shm compat symlink. + # Create /dev/shm -> /run/shm compat symlink.

View File

@ -1,7 +1,7 @@
# Template file for 'OpenRC' # Template file for 'OpenRC'
pkgname=OpenRC pkgname=OpenRC
version=20110211 version=20110211
revision=7 revision=8
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