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.
This commit is contained in:
Roy Marples
2009-05-23 20:38:12 +01:00
parent 5294abe617
commit c0fd1b49e4
31 changed files with 92 additions and 82 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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