OpenRC: improve shutdown sequence, by avoiding unmounting some fs.

This commit is contained in:
Juan RP 2011-05-20 14:26:10 +02:00
parent 070ecb37b7
commit c86e824b9b
2 changed files with 37 additions and 15 deletions
srcpkgs/OpenRC

View file

@ -156,17 +156,6 @@ xbps changes:
fi fi
# Clean up /tmp directories # Clean up /tmp directories
--- init.d/localmount.in.orig 2011-04-29 17:06:22.273007691 +0200
+++ init.d/localmount.in 2011-04-29 17:06:50.247007699 +0200
@@ -49,7 +49,7 @@ stop()
fi
if [ "$RC_UNAME" = Linux ]; then
- no_umounts_r="$no_umounts_r|/proc|/proc/.*|/sys|/sys/.*"
+ no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*"
fi
no_umounts_r="^($no_umounts_r)$"
--- init.d/devfs.in.orig 2011-02-10 06:15:24.000000000 +0100 --- 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 +++ init.d/devfs.in 2011-04-29 18:12:48.983999871 +0200
@@ -13,7 +13,6 @@ start() { @@ -13,7 +13,6 @@ start() {
@ -238,7 +227,7 @@ xbps changes:
- 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 pid udev; do + for d in init.d udev; do
+ mkdir -m0755 /run/${d} + mkdir -m0755 /run/${d}
+ done + done
+ for d in lock tmp shm; do + for d in lock tmp shm; do
@ -252,3 +241,34 @@ xbps changes:
fi fi
} }
--- init.d/localmount.in.orig 2011-02-10 06:15:24.000000000 +0100
+++ init.d/localmount.in 2011-05-20 09:44:24.445841901 +0200
@@ -34,7 +34,7 @@ start()
stop()
{
# We never unmount / or /dev or $RC_SVCDIR
- local x= no_umounts_r="/|/dev|/dev/.*|${RC_SVCDIR}"
+ local x= no_umounts_r="/|/dev|/dev/.*"
no_umounts_r="${no_umounts_r}|/bin|/sbin|/lib|/libexec"
# RC_NO_UMOUNTS is an env var that can be set by plugins
OIFS=$IFS SIFS=${IFS-y}
@@ -49,7 +49,7 @@ stop()
fi
if [ "$RC_UNAME" = Linux ]; then
- no_umounts_r="$no_umounts_r|/proc|/proc/.*|/sys|/sys/.*"
+ no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*|/cow|/rofs|/cdrom"
fi
no_umounts_r="^($no_umounts_r)$"
--- init.d/mount-ro.in.orig 2011-05-20 09:45:08.199841890 +0200
+++ init.d/mount-ro.in 2011-05-20 09:45:33.285841883 +0200
@@ -19,7 +19,7 @@ start()
# We need the do_unmount function
. "$RC_LIBEXECDIR"/sh/rc-mount.sh
eindent
- local m="/dev|/dev/.*|/proc|/proc.*|/sys|/sys/.*|${RC_SVCDIR}" x= fs=
+ local m="/dev|/dev/.*|/proc|/proc.*|/sys|/sys/.*|/run|/cow|/rofs|/cdrom" x= fs=
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

View file

@ -1,7 +1,7 @@
# Template file for 'OpenRC' # Template file for 'OpenRC'
pkgname=OpenRC pkgname=OpenRC
version=20110211 version=20110211
revision=5 revision=6
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
@ -41,6 +41,7 @@ Add_dependency full psmisc
Add_dependency full sysvinit Add_dependency full sysvinit
Add_dependency build diffutils Add_dependency build diffutils
_version="0.7.0-${version} #${revision}"
_branding="XBPS GNU/Linux" _branding="XBPS GNU/Linux"
do_build() do_build()
@ -53,12 +54,13 @@ do_build()
sed -i -e "s|/usr/share|/lib/kbd|g" ${wrksrc}/${f} sed -i -e "s|/usr/share|/lib/kbd|g" ${wrksrc}/${f}
done done
make ${makejobs} BRANDING="${_branding}" make ${makejobs} VERSION="${_version}" BRANDING="${_branding}"
} }
do_install() do_install()
{ {
make DESTDIR=${DESTDIR} BRANDING="${_branding}" install make DESTDIR=${DESTDIR} VERSION="${_version}" \
BRANDING="${_branding}" install
install -D -m755 ${wrksrc}/support/sysvinit/inittab \ install -D -m755 ${wrksrc}/support/sysvinit/inittab \
${DESTDIR}/etc/inittab ${DESTDIR}/etc/inittab