From 77f9015f0bf09c5ef3c51009e21d8e687006c3e4 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 19 Sep 2007 13:53:40 +0000 Subject: /lib/rcscripts -> /lib/rc --- ChangeLog | 8 +++++++- Makefile | 12 ++++++------ default.mk | 1 + net.BSD/Makefile | 2 +- net.Linux/Makefile | 2 +- net.Linux/udhcpc.sh | 5 ++++- net/Makefile | 2 +- sh.BSD/Makefile | 4 ++-- sh.Linux/Makefile | 2 +- sh/Makefile | 2 +- sh/functions.sh | 6 +++--- sh/rc-functions.sh | 17 +++++++++++------ src/Makefile | 11 ++++++----- src/rc-misc.h | 2 +- 14 files changed, 46 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c1be27f..6f99ebac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,8 +3,14 @@ 19 Sep 2007; Roy Marples : + Change from /lib/rcscripts to /lib/rc and adjust our files so changing + our libdir is much easier in future. This move makes sense it's so much + more than a holding place for our scripts now. It also has the added + benefit of not loading the splash plugin for rc4 and lower which is + ABI incompatible with us now. + plugin hook function is now rc_plugin_hook instead of a name based - on the name of the plugin. + on the name of the plugin. 18 Sep 2007; Roy Marples : diff --git a/Makefile b/Makefile index b7eae221..fce9a7c3 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ SUBDIRS = conf.d etc init.d man net sh share src NAME = baselayout -VERSION = 2.0.0_rc4 +VERSION = 2.0.0_rc5 PKG = $(NAME)-$(VERSION) @@ -21,7 +21,7 @@ OS=BSD endif endif -BASE_DIRS = /$(LIB)/rcscripts/init.d /$(LIB)/rcscripts/tmp +BASE_DIRS = $(RC_LIB)/init.d $(RC_LIB)/tmp KEEP_DIRS = /boot /home /mnt /root \ /usr/local/bin /usr/local/sbin /usr/local/share/doc /usr/local/share/man \ /var/lock /var/run @@ -50,12 +50,12 @@ install:: $(INSTALL_DIR) $(DESTDIR)/etc/runlevels/single || exit $$? ; \ $(INSTALL_DIR) $(DESTDIR)/etc/runlevels/nonetwork || exit $$? ; \ fi - ln -snf ../../$(LIB)/rcscripts/sh/net.sh $(DESTDIR)/etc/init.d/$(NET_LO) || exit $$? - ln -snf ../../$(LIB)/rcscripts/sh/functions.sh $(DESTDIR)/etc/init.d || exit $$? + ln -snf ../../$(RC_LIB)/sh/net.sh $(DESTDIR)/etc/init.d/$(NET_LO) || exit $$? + ln -snf ../../$(RC_LIB)/sh/functions.sh $(DESTDIR)/etc/init.d || exit $$? # Handle lib correctly if test $(LIB) != "lib" ; then \ - sed -i'.bak' -e 's,/lib/,/$(LIB)/,g' $(DESTDIR)/$(LIB)/rcscripts/sh/functions.sh || exit $$? ; \ - rm -f $(DESTDIR)/$(LIB)/rcscripts/sh/functions.sh.bak ; \ + sed -i'.bak' -e 's,/lib/,/$(LIB)/,g' $(DESTDIR)/$(RC_LIB)/sh/functions.sh || exit $$? ; \ + rm -f $(DESTDIR)/$(RC_LIB)/sh/functions.sh.bak ; \ fi layout: diff --git a/default.mk b/default.mk index e65bad87..6cbe1b7a 100644 --- a/default.mk +++ b/default.mk @@ -4,6 +4,7 @@ DESTDIR = / ROOT = / LIB = lib +RC_LIB = /$(LIB)/rc # # Recursive rules diff --git a/net.BSD/Makefile b/net.BSD/Makefile index 11bd20a4..c000a354 100644 --- a/net.BSD/Makefile +++ b/net.BSD/Makefile @@ -1,4 +1,4 @@ -DIR = /$(LIB)/rcscripts/net +DIR = $(RC_LIB)/net FILES = ifconfig.sh iwconfig.sh TOPDIR = .. diff --git a/net.Linux/Makefile b/net.Linux/Makefile index 3059f1e4..a1472747 100644 --- a/net.Linux/Makefile +++ b/net.Linux/Makefile @@ -1,4 +1,4 @@ -DIR = /$(LIB)/rcscripts/net +DIR = $(RC_LIB)/net FILES = adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \ ccwgroup.sh clip.sh ifconfig.sh ifplugd.sh ip6to4.sh ipppd.sh \ iproute2.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh \ diff --git a/net.Linux/udhcpc.sh b/net.Linux/udhcpc.sh index af5bbea1..2fe23bd2 100644 --- a/net.Linux/udhcpc.sh +++ b/net.Linux/udhcpc.sh @@ -65,8 +65,11 @@ udhcpc_start() { ;; esac + local script="${RC_LIBDIR}"/sh/udhcpc.sh + [ -x "${script}" ] || script=/lib/rcscripts/sh/udhcpc.sh + eval "${x}" "${args}" --interface="${IFACE}" --now \ - --script="${RC_LIBDIR}"/sh/udhcpc.sh \ + --script="${script}" \ --pidfile="${pidfile}" >/dev/null eend $? || return 1 diff --git a/net/Makefile b/net/Makefile index 5ed3d8b9..0aedc1cc 100644 --- a/net/Makefile +++ b/net/Makefile @@ -1,4 +1,4 @@ -DIR = /$(LIB)/rcscripts/net +DIR = $(RC_LIB)/net FILES = dhclient.sh dhcpcd.sh macchanger.sh macnet.sh ssidnet.sh system.sh \ wpa_supplicant.sh diff --git a/sh.BSD/Makefile b/sh.BSD/Makefile index 9c08bbd6..485de3a7 100644 --- a/sh.BSD/Makefile +++ b/sh.BSD/Makefile @@ -1,5 +1,5 @@ -DIR = /$(LIB)/rcscripts/sh -EXES = init.sh +DIR = $(RC_LIB)/sh +EXES = init.sh TOPDIR = .. include $(TOPDIR)/default.mk diff --git a/sh.Linux/Makefile b/sh.Linux/Makefile index 446d624d..89cd8154 100644 --- a/sh.Linux/Makefile +++ b/sh.Linux/Makefile @@ -1,4 +1,4 @@ -DIR = /$(LIB)/rcscripts/sh +DIR = $(RC_LIB)/sh EXES = init.sh init-early.sh TOPDIR = .. diff --git a/sh/Makefile b/sh/Makefile index ac50fa90..aa9a4b45 100644 --- a/sh/Makefile +++ b/sh/Makefile @@ -1,4 +1,4 @@ -DIR = /$(LIB)/rcscripts/sh +DIR = $(RC_LIB)/sh FILES = functions.sh init-functions.sh init-common-post.sh \ rc-functions.sh rc-mount.sh EXES = gendepends.sh net.sh rc-mount.sh rc-help.sh runscript.sh diff --git a/sh/functions.sh b/sh/functions.sh index 5b4f8d91..495f2bd1 100644 --- a/sh/functions.sh +++ b/sh/functions.sh @@ -113,9 +113,9 @@ fi # This should solve both /sbin and /usr/sbin not present when # doing 'su -c foo', or for something like: PATH= rcscript start case "${PATH}" in - /lib/rcscripts/bin:/bin:/sbin:/usr/bin:/usr/sbin) ;; - /lib/rcscripts/bin:/bin:/sbin:/usr/bin:/usr/sbin:*) ;; - *) export PATH="/lib/rcscripts/bin:/bin:/sbin:/usr/bin:/usr/sbin:${PATH}" ;; + /lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin) ;; + /lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin:*) ;; + *) export PATH="/lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin:${PATH}" ;; esac for arg in "$@" ; do diff --git a/sh/rc-functions.sh b/sh/rc-functions.sh index a1a7644b..79f479fc 100755 --- a/sh/rc-functions.sh +++ b/sh/rc-functions.sh @@ -2,12 +2,17 @@ # Distributed under the terms of the GNU General Public License v2 has_addon() { - [ -e "${RC_LIBDIR}/addons/$1.sh" ] + [ -e "${RC_LIBDIR}/addons/$1.sh" ] || [ -e /lib/rcscripts/addons/"$1".sh ] } import_addon() { - has_addon "$1" || return 1 - . "${RC_LIBDIR}/addons/$1.sh" + if [ -e "${RC_LIBDIR}/addons/$1.sh" ]; then + . "${RC_LIBDIR}/addons/$1.sh" + elif [ -e /lib/rcscripts/addons/"$1".sh ]; then + . /lib/rcscripts/addons/"$1".sh + else + return 1 + fi } start_addon() { @@ -22,7 +27,7 @@ is_net_fs() { [ -z "$1" ] && return 1 local t=$(mountinfo --fstype "$1") - for x in ${RC_NET_FS_LIST} ; do + for x in ${RC_NET_FS_LIST}; do [ "${x}" = "${t}" ] && return 0 done return 1 @@ -38,12 +43,12 @@ get_bootparam() { [ -z "${match}" -o ! -r /proc/cmdline ] && return 1 set -- $(cat /proc/cmdline) - while [ -n "$1" ] ; do + while [ -n "$1" ]; do case "$1" in gentoo=*) local params="${1##*=}" local IFS=, x= - for x in ${params} ; do + for x in ${params}; do [ "${x}" = "${match}" ] && return 0 done ;; diff --git a/src/Makefile b/src/Makefile index 93e71d26..4da64061 100644 --- a/src/Makefile +++ b/src/Makefile @@ -41,6 +41,7 @@ CFLAGS += -pedantic -std=c99 \ DESTDIR = LIB = lib +RC_LIB = /$(LIB)/rc # Set PAM = pam for pam support PAM = @@ -134,13 +135,13 @@ install: $(TARGET) install -m 0755 -d $(DESTDIR)/sbin install -m 0755 $(SBIN_TARGETS) $(DESTDIR)/sbin ln -sf rc-update $(DESTDIR)/sbin/update-rc - install -m 0755 -d $(DESTDIR)/$(LIB)/rcscripts/conf.d - install -m 0644 $(SYS_WHITELIST) $(DESTDIR)/$(LIB)/rcscripts/conf.d - install -m 0755 -d $(DESTDIR)/$(LIB)/rcscripts/bin + install -m 0755 -d $(DESTDIR)/$(RC_LIB)/conf.d + install -m 0644 $(SYS_WHITELIST) $(DESTDIR)/$(RC_LIB)/conf.d + install -m 0755 -d $(DESTDIR)/$(RC_LIB)/bin for x in $(BINLINKS); do ln -sf ../sbin/rc $(DESTDIR)/bin/$$x; done for x in $(SBINLINKS); do ln -sf rc $(DESTDIR)/sbin/$$x; done - for x in $(RCLINKS); do ln -sf ../../../sbin/rc $(DESTDIR)/$(LIB)/rcscripts/bin/$$x; done - if test "$(PAM)" != "pam" ; then \ + for x in $(RCLINKS); do ln -sf ../../../sbin/rc $(DESTDIR)/$(RC_LIB)/bin/$$x; done + if test "$(PAM)" = "pam" ; then \ install -m 0755 -d $(DESTDIR)/etc/pam.d ; \ install -m 0644 start-stop-daemon.pam $(DESTDIR)/etc/pam.d/start-stop-daemon ; \ fi diff --git a/src/rc-misc.h b/src/rc-misc.h index ec29987e..0df58b5c 100644 --- a/src/rc-misc.h +++ b/src/rc-misc.h @@ -14,7 +14,7 @@ #define RC_LEVEL_BOOT "boot" #define RC_LEVEL_DEFAULT "default" -#define RC_LIBDIR "/" LIB "/rcscripts" +#define RC_LIBDIR "/" LIB "/rc" #define RC_SVCDIR RC_LIBDIR "/init.d" #define RC_DEPTREE RC_SVCDIR "/deptree" #define RC_RUNLEVELDIR "/etc/runlevels" -- cgit v1.2.3