aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-05-23 20:38:12 +0100
committerRoy Marples <roy@marples.name>2009-05-23 20:38:12 +0100
commitc0fd1b49e49cec28c1f5a3a76f9db11c62e550dc (patch)
treefe1f406f976dbcec3d7225ccf1b0f08f6957dfcc /sh
parent5294abe6171610a1aa0eb093774bed9bb965c9cf (diff)
Move non compiled libraries from /lib/rc to /libexec/rc
OpenRC version is now stored as plaintext in /libexec/rc/version Plugins (cursplash, splashutils) will have to be re-compiled to pickup the new directories. State data needs to be moved from /lib/rc/init.d to /libexec/rc/init.d as well.
Diffstat (limited to 'sh')
-rw-r--r--sh/Makefile7
-rw-r--r--sh/functions.sh.in6
-rw-r--r--sh/init-common-post.sh.in9
-rw-r--r--sh/init-early.sh.Linux.in13
-rw-r--r--sh/init.sh.BSD.in4
-rw-r--r--sh/init.sh.Linux.in4
-rw-r--r--sh/rc-functions.sh.in10
-rw-r--r--sh/runscript.sh.in2
8 files changed, 28 insertions, 27 deletions
diff --git a/sh/Makefile b/sh/Makefile
index 7ee04338..73d46418 100644
--- a/sh/Makefile
+++ b/sh/Makefile
@@ -1,4 +1,4 @@
-DIR= ${PREFIX}/${RC_LIB}/sh
+DIR= ${LIBEXECDIR}/sh
SRCS= functions.sh.in gendepends.sh.in init-common-post.sh.in \
rc-functions.sh.in runscript.sh.in
INC= init-common-post.sh rc-mount.sh functions.sh rc-functions.sh
@@ -13,9 +13,8 @@ include ${MK}/scripts.mk
_installafter:
${INSTALL} -d ${DESTDIR}/${INITDIR}
- @# Put functions.sh into the init.d dir so 3rd party apps don't have to
- @# be multilib aware
- ln -snf ${PREFIX}/${RC_LIB}/sh/functions.sh ${DESTDIR}/${INITDIR} || exit $$?
+ @# Put functions.sh into init for backwards compat
+ ln -snf ${LIBEXECDIR}/sh/functions.sh ${DESTDIR}/${INITDIR} || exit $$?
check test::
./runtests.sh
diff --git a/sh/functions.sh.in b/sh/functions.sh.in
index 3f4a15ac..da2e51a9 100644
--- a/sh/functions.sh.in
+++ b/sh/functions.sh.in
@@ -47,7 +47,7 @@ _sanitize_path()
local IFS=":" p= path=
for p in $PATH; do
case "$p" in
- @PREFIX@/@LIB@/rc/bin|@PREFIX@/@LIB@/rc/sbin);;
+ @LIBEXECDIR@/bin|@LIBEXECDIR@/sbin);;
@PREFIX@/bin|@PREFIX@/sbin|/usr/bin|/usr/sbin);;
@PKG_PREFIX@/bin|@PKG_PREFIX@/sbin);;
@LOCAL_PREFIX@/bin|@LOCAL_PREFIX@/sbin);;
@@ -70,7 +70,7 @@ _PREFIX=@PREFIX@
_PKG_PREFIX=@PKG_PREFIX@
_LOCAL_PREFIX=@LOCAL_PREFIX@
_LOCAL_PREFIX=${_LOCAL_PREFIX:-/usr/local}
-_PATH=@PREFIX@/@LIB@/rc/bin
+_PATH=@LIBEXECDIR@/bin
case "$_PREFIX" in
"$_PKG_PREFIX"|"$_LOCAL_PREFIX") ;;
*) _PATH="$_PATH:$_PREFIX/bin:$_PREFIX/sbin";;
@@ -104,7 +104,7 @@ else
# the last ecmd
for _e in ebegin eend error errorn einfo einfon ewarn ewarnn ewend \
vebegin veend veinfo vewarn vewend; do
- eval "$_e() { local _r; @PREFIX@/@LIB@/rc/bin/$_e \"\$@\"; _r=$?; \
+ eval "$_e() { local _r; @LIBEXECDIR@/bin/$_e \"\$@\"; _r=$?; \
export EINFO_LASTCMD=$_e; return \$_r; }"
done
unset _e
diff --git a/sh/init-common-post.sh.in b/sh/init-common-post.sh.in
index 10ec9541..0649cb31 100644
--- a/sh/init-common-post.sh.in
+++ b/sh/init-common-post.sh.in
@@ -1,10 +1,11 @@
-# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
+# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# mount $RC_SVCDIR as something we can write to if it's not rw
# On vservers, / is always rw at this point, so we need to clean out
# the old service state data
-: ${RC_SVCDIR:=/@LIB@/rc/init.d}
+: ${RC_LIBEXECDIR:=@LIBEXECDIR@}
+: ${RC_SVCDIR:=@LIBEXECDIR@/init.d}
case "$(rc --sys)" in
OPENVZ|VSERVER) rm -rf "$RC_SVCDIR"/*;;
*) if mountinfo --quiet "$RC_SVCDIR"; then
@@ -16,8 +17,8 @@ case "$(rc --sys)" in
esac
retval=$?
-if [ -e "$RC_LIBDIR"/cache/deptree ]; then
- cp -p "$RC_LIBDIR"/cache/* "$RC_SVCDIR" 2>/dev/null
+if [ -e "$RC_LIBEXECDIR"/cache/deptree ]; then
+ cp -p "$RC_LIBEXECDIR"/cache/* "$RC_SVCDIR" 2>/dev/null
fi
echo sysinit >"$RC_SVCDIR"/softlevel
diff --git a/sh/init-early.sh.Linux.in b/sh/init-early.sh.Linux.in
index a533d52b..e13af131 100644
--- a/sh/init-early.sh.Linux.in
+++ b/sh/init-early.sh.Linux.in
@@ -3,8 +3,9 @@
# All rights reserved. Released under the 2-clause BSD license.
: ${CONSOLE:=/dev/console}
+: ${RC_LIBEXECDIR:=@LIBEXECDIR@}
-if [ -e "$RC_LIBDIR"/console/unicode ]; then
+if [ -e "$RC_LIBEXECDIR"/console/unicode ]; then
termencoding="%G"
kmode="-u"
else
@@ -16,10 +17,10 @@ fi
if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/consolefont \
-o -e /etc/runlevels/"$RC_BOOTLEVEL"/consolefont ]; then
printf "\033%s" "$termencoding" >"$CONSOLE" 2>/dev/null
- if [ -r "$RC_LIBDIR"/console/font -a -x /bin/setfont ]; then
- font="$(cat "$RC_LIBDIR"/console/font)"
+ if [ -r "$RC_LIBEXECDIR"/console/font -a -x /bin/setfont ]; then
+ font="$(cat "$RC_LIBEXECDIR"/console/font)"
[ -c "$CONSOLE" ] && cons="-C $CONSOLE"
- setfont $cons "$RC_LIBDIR"/console/"$font" 2>/dev/null
+ setfont $cons "$RC_LIBEXECDIR"/console/"$font" 2>/dev/null
fi
fi
@@ -27,8 +28,8 @@ fi
if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/keymaps \
-o -e /etc/runlevels/"$RC_BOOTLEVEL"/keymaps ]; then
kbd_mode $kmode -C "$CONSOLE" 2>/dev/null
- if [ -r "$RC_LIBDIR"/console/keymap ]; then
- loadkeys "$RC_LIBDIR"/console/keymap 2>/dev/null
+ if [ -r "$RC_LIBEXECDIR"/console/keymap ]; then
+ loadkeys "$RC_LIBEXECDIR"/console/keymap 2>/dev/null
fi
fi
diff --git a/sh/init.sh.BSD.in b/sh/init.sh.BSD.in
index 2472825a..de3b4366 100644
--- a/sh/init.sh.BSD.in
+++ b/sh/init.sh.BSD.in
@@ -21,7 +21,7 @@ mount_svcdir()
fi
}
-. "$RC_LIBDIR"/sh/functions.sh
+. "$RC_LIBEXECDIR"/sh/functions.sh
[ -r /etc/rc.conf ] && . /etc/rc.conf
# Disable devd until we need it
@@ -29,4 +29,4 @@ if [ -z "$RC_SYS" -a "$RC_UNAME" = "FreeBSD" ]; then
sysctl hw.bus.devctl_disable=1 >/dev/null
fi
-. "$RC_LIBDIR"/sh/init-common-post.sh
+. "$RC_LIBEXECDIR"/sh/init-common-post.sh
diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in
index b98a5708..23be1952 100644
--- a/sh/init.sh.Linux.in
+++ b/sh/init.sh.Linux.in
@@ -38,7 +38,7 @@ mount_svcdir()
fi
}
-. /etc/init.d/functions.sh
+. "$RC_LIBEXECDIR"/sh/functions.sh
[ -r /etc/rc.conf ] && . /etc/rc.conf
# By default VServer already has /proc mounted, but OpenVZ does not!
@@ -68,4 +68,4 @@ if $mountproc; then
eend $?
fi
-. "$RC_LIBDIR"/sh/init-common-post.sh
+. "$RC_LIBEXECDIR"/sh/init-common-post.sh
diff --git a/sh/rc-functions.sh.in b/sh/rc-functions.sh.in
index 6e1ef01f..2a656bc8 100644
--- a/sh/rc-functions.sh.in
+++ b/sh/rc-functions.sh.in
@@ -4,7 +4,7 @@
has_addon()
{
- [ -e "$RC_LIBDIR/addons/$1.sh" -o -e /@LIB@/rcscripts/addons/"$1".sh ]
+ [ -e /@LIB@/rc/addons/"$1".sh -o -e /@LIB@/rcscripts/addons/"$1".sh ]
}
_addon_warn()
@@ -17,9 +17,9 @@ _addon_warn()
import_addon()
{
- if [ -e "$RC_LIBDIR/addons/$1.sh" ]; then
+ if [ -e /@LIB@/rc/addons/"$1".sh ]; then
_addon_warn
- . "$RC_LIBDIR/addons/$1.sh"
+ . /@LIB@/rc/addons/"$1".sh
elif [ -e /@LIB@/rcscripts/addons/"$1".sh ]; then
_addon_warn
. /@LIB@/rcscripts/addons/"$1".sh
@@ -86,6 +86,6 @@ get_bootparam()
# Add our sbin to $PATH
case "$PATH" in
- "$RC_LIBDIR"/sbin|"$RC_LIBDIR"/sbin:*);;
- *) export PATH="$RC_LIBDIR/sbin:$PATH";;
+ "$RC_LIBEXECDIR"/sbin|"$RC_LIBEXECDIR"/sbin:*);;
+ *) export PATH="$RC_LIBEXECDIR/sbin:$PATH";;
esac
diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index a8172dc4..f39ed0af 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -5,7 +5,7 @@
# All rights reserved. Released under the 2-clause BSD license.
. @SYSCONFDIR@/init.d/functions.sh
-. "$RC_LIBDIR"/sh/rc-functions.sh
+. @LIBEXECDIR@/sh/rc-functions.sh
# Support LiveCD foo
if [ -r /sbin/livecd-functions.sh ]; then