summaryrefslogtreecommitdiff
path: root/sh.BSD
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-31 09:48:58 +0000
committerRoy Marples <roy@marples.name>2008-01-31 09:48:58 +0000
commit9300fa240d40b563034752f34860e418f044e738 (patch)
treeccc9309c124d3db073d54ec393aef35e491fc0e4 /sh.BSD
parent0ce909e12b29cbe52e8161bc50b72ec40acaaf19 (diff)
downloadopenrc-9300fa240d40b563034752f34860e418f044e738.tar.gz
openrc-9300fa240d40b563034752f34860e418f044e738.tar.bz2
openrc-9300fa240d40b563034752f34860e418f044e738.tar.xz
Tidy up some code and remove the redundant single_user function as we now use exit codes.
Diffstat (limited to 'sh.BSD')
-rwxr-xr-xsh.BSD/init.sh12
1 files changed, 4 insertions, 8 deletions
diff --git a/sh.BSD/init.sh b/sh.BSD/init.sh
index 71902c5..a9797c9 100755
--- a/sh.BSD/init.sh
+++ b/sh.BSD/init.sh
@@ -2,13 +2,6 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
-# void single_user()
-# Drop to a shell, remount / ro, and then reboot
-single_user()
-{
- exit 1
-}
-
# This basically mounts $svcdir as a ramdisk, but preserving its content
# which allows us to run depscan.sh
# FreeBSD has a nice ramdisk - we don't set a size as we should always
@@ -17,7 +10,7 @@ single_user()
# FreeBSD-7 supports tmpfs now :)
mount_svcdir()
{
- local dotmp=false release=false
+ local dotmp=false release=false retval=0
if [ -e "${RC_SVCDIR}"/deptree ]; then
dotmp=true
if ! mount -t tmpfs none "${RC_LIBDIR}"/tmp 2>/dev/null; then
@@ -34,12 +27,15 @@ mount_svcdir()
newfs -b 4096 -i 1024 -n /dev/md0
mount -o rw,noexec,nosuid /dev/md0 "${RC_SVCDIR}"
fi
+ retval=$?
if ${dotmp}; then
cp -p "${RC_LIBDIR}"/tmp/deptree "${RC_LIBDIR}"/tmp/depconfig \
"${RC_LIBDIR}"/tmp/nettree "${RC_SVCDIR}" 2>/dev/null
umount "${RC_LIBDIR}"/tmp
${release} && mdconfig -d -u 1
fi
+
+ return ${retval}
}
. "${RC_LIBDIR}"/sh/functions.sh