/lib/rcscripts -> /lib/rc
This commit is contained in:
		| @@ -3,8 +3,14 @@ | |||||||
|  |  | ||||||
|   19 Sep 2007; Roy Marples <uberlord@gentoo.org>: |   19 Sep 2007; Roy Marples <uberlord@gentoo.org>: | ||||||
|  |  | ||||||
|  |     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 |     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 <uberlord@gentoo.org>: |   18 Sep 2007; Roy Marples <uberlord@gentoo.org>: | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										12
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Makefile
									
									
									
									
									
								
							| @@ -10,7 +10,7 @@ | |||||||
| SUBDIRS = conf.d etc init.d man net sh share src | SUBDIRS = conf.d etc init.d man net sh share src | ||||||
|  |  | ||||||
| NAME = baselayout | NAME = baselayout | ||||||
| VERSION = 2.0.0_rc4 | VERSION = 2.0.0_rc5 | ||||||
|  |  | ||||||
| PKG = $(NAME)-$(VERSION) | PKG = $(NAME)-$(VERSION) | ||||||
|  |  | ||||||
| @@ -21,7 +21,7 @@ OS=BSD | |||||||
| endif | endif | ||||||
| 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 \ | KEEP_DIRS = /boot /home /mnt /root \ | ||||||
| 	/usr/local/bin /usr/local/sbin /usr/local/share/doc /usr/local/share/man \ | 	/usr/local/bin /usr/local/sbin /usr/local/share/doc /usr/local/share/man \ | ||||||
| 	/var/lock /var/run | 	/var/lock /var/run | ||||||
| @@ -50,12 +50,12 @@ install:: | |||||||
| 		$(INSTALL_DIR) $(DESTDIR)/etc/runlevels/single || exit $$? ; \ | 		$(INSTALL_DIR) $(DESTDIR)/etc/runlevels/single || exit $$? ; \ | ||||||
| 		$(INSTALL_DIR) $(DESTDIR)/etc/runlevels/nonetwork || exit $$? ; \ | 		$(INSTALL_DIR) $(DESTDIR)/etc/runlevels/nonetwork || exit $$? ; \ | ||||||
| 	fi | 	fi | ||||||
| 	ln -snf ../../$(LIB)/rcscripts/sh/net.sh $(DESTDIR)/etc/init.d/$(NET_LO) || exit $$? | 	ln -snf ../../$(RC_LIB)/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/functions.sh $(DESTDIR)/etc/init.d || exit $$? | ||||||
| 	# Handle lib correctly | 	# Handle lib correctly | ||||||
| 	if test $(LIB) != "lib" ; then \ | 	if test $(LIB) != "lib" ; then \ | ||||||
| 		sed -i'.bak' -e 's,/lib/,/$(LIB)/,g' $(DESTDIR)/$(LIB)/rcscripts/sh/functions.sh || exit $$? ; \ | 		sed -i'.bak' -e 's,/lib/,/$(LIB)/,g' $(DESTDIR)/$(RC_LIB)/sh/functions.sh || exit $$? ; \ | ||||||
| 		rm -f $(DESTDIR)/$(LIB)/rcscripts/sh/functions.sh.bak ; \ | 		rm -f $(DESTDIR)/$(RC_LIB)/sh/functions.sh.bak ; \ | ||||||
| 	fi | 	fi | ||||||
|  |  | ||||||
| layout: | layout: | ||||||
|   | |||||||
| @@ -4,6 +4,7 @@ | |||||||
| DESTDIR = / | DESTDIR = / | ||||||
| ROOT = / | ROOT = / | ||||||
| LIB = lib | LIB = lib | ||||||
|  | RC_LIB = /$(LIB)/rc | ||||||
|  |  | ||||||
| # | # | ||||||
| # Recursive rules | # Recursive rules | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| DIR   = /$(LIB)/rcscripts/net  | DIR   = $(RC_LIB)/net  | ||||||
| FILES = ifconfig.sh iwconfig.sh | FILES = ifconfig.sh iwconfig.sh | ||||||
|  |  | ||||||
| TOPDIR = .. | TOPDIR = .. | ||||||
|   | |||||||
| @@ -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 \ | 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 \ | 	ccwgroup.sh clip.sh ifconfig.sh ifplugd.sh ip6to4.sh ipppd.sh \ | ||||||
| 	iproute2.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh \ | 	iproute2.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh \ | ||||||
|   | |||||||
| @@ -65,8 +65,11 @@ udhcpc_start() { | |||||||
| 			;; | 			;; | ||||||
| 	esac | 	esac | ||||||
|  |  | ||||||
|  | 	local script="${RC_LIBDIR}"/sh/udhcpc.sh | ||||||
|  | 	[ -x "${script}" ] || script=/lib/rcscripts/sh/udhcpc.sh | ||||||
|  |  | ||||||
| 	eval "${x}" "${args}" --interface="${IFACE}" --now \ | 	eval "${x}" "${args}" --interface="${IFACE}" --now \ | ||||||
| 		--script="${RC_LIBDIR}"/sh/udhcpc.sh \ | 		--script="${script}" \ | ||||||
| 		--pidfile="${pidfile}" >/dev/null | 		--pidfile="${pidfile}" >/dev/null | ||||||
| 	eend $? || return 1 | 	eend $? || return 1 | ||||||
|  |  | ||||||
|   | |||||||
| @@ -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 \ | FILES = dhclient.sh dhcpcd.sh macchanger.sh macnet.sh ssidnet.sh system.sh \ | ||||||
| 	wpa_supplicant.sh | 	wpa_supplicant.sh | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| DIR   = /$(LIB)/rcscripts/sh | DIR   = $(RC_LIB)/sh | ||||||
| EXES = init.sh  | EXES = init.sh | ||||||
|  |  | ||||||
| TOPDIR = .. | TOPDIR = .. | ||||||
| include $(TOPDIR)/default.mk | include $(TOPDIR)/default.mk | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| DIR   = /$(LIB)/rcscripts/sh | DIR   = $(RC_LIB)/sh | ||||||
| EXES = init.sh init-early.sh | EXES = init.sh init-early.sh | ||||||
|  |  | ||||||
| TOPDIR = .. | TOPDIR = .. | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| DIR   = /$(LIB)/rcscripts/sh | DIR   = $(RC_LIB)/sh | ||||||
| FILES = functions.sh init-functions.sh init-common-post.sh \ | FILES = functions.sh init-functions.sh init-common-post.sh \ | ||||||
| 	rc-functions.sh rc-mount.sh | 	rc-functions.sh rc-mount.sh | ||||||
| EXES  = gendepends.sh net.sh rc-mount.sh rc-help.sh runscript.sh | EXES  = gendepends.sh net.sh rc-mount.sh rc-help.sh runscript.sh | ||||||
|   | |||||||
| @@ -113,9 +113,9 @@ fi | |||||||
| # This should solve both /sbin and /usr/sbin not present when | # This should solve both /sbin and /usr/sbin not present when | ||||||
| # doing 'su -c foo', or for something like:  PATH= rcscript start | # doing 'su -c foo', or for something like:  PATH= rcscript start | ||||||
| case "${PATH}" in | case "${PATH}" in | ||||||
| 	/lib/rcscripts/bin:/bin:/sbin:/usr/bin:/usr/sbin) ;; | 	/lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin) ;; | ||||||
| 	/lib/rcscripts/bin:/bin:/sbin:/usr/bin:/usr/sbin:*) ;; | 	/lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin:*) ;; | ||||||
| 	*) export PATH="/lib/rcscripts/bin:/bin:/sbin:/usr/bin:/usr/sbin:${PATH}" ;; | 	*) export PATH="/lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin:${PATH}" ;; | ||||||
| esac | esac | ||||||
|  |  | ||||||
| for arg in "$@" ; do | for arg in "$@" ; do | ||||||
|   | |||||||
| @@ -2,12 +2,17 @@ | |||||||
| # Distributed under the terms of the GNU General Public License v2 | # Distributed under the terms of the GNU General Public License v2 | ||||||
|  |  | ||||||
| has_addon() { | has_addon() { | ||||||
| 	[ -e "${RC_LIBDIR}/addons/$1.sh" ] | 	[ -e "${RC_LIBDIR}/addons/$1.sh" ] || [ -e /lib/rcscripts/addons/"$1".sh ] | ||||||
| } | } | ||||||
|  |  | ||||||
| import_addon() { | import_addon() { | ||||||
| 	has_addon "$1" || return 1 | 	if [ -e "${RC_LIBDIR}/addons/$1.sh" ]; then | ||||||
| 	. "${RC_LIBDIR}/addons/$1.sh" | 		. "${RC_LIBDIR}/addons/$1.sh" | ||||||
|  | 	elif [ -e /lib/rcscripts/addons/"$1".sh ]; then | ||||||
|  | 		. /lib/rcscripts/addons/"$1".sh | ||||||
|  | 	else | ||||||
|  | 		return 1 | ||||||
|  | 	fi | ||||||
| } | } | ||||||
|  |  | ||||||
| start_addon() { | start_addon() { | ||||||
| @@ -22,7 +27,7 @@ is_net_fs() { | |||||||
| 	[ -z "$1" ] && return 1 | 	[ -z "$1" ] && return 1 | ||||||
|  |  | ||||||
| 	local t=$(mountinfo --fstype "$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 | 		[ "${x}" = "${t}" ] && return 0 | ||||||
| 	done | 	done | ||||||
| 	return 1 | 	return 1 | ||||||
| @@ -38,12 +43,12 @@ get_bootparam() { | |||||||
| 	[ -z "${match}" -o ! -r /proc/cmdline ] && return 1 | 	[ -z "${match}" -o ! -r /proc/cmdline ] && return 1 | ||||||
|  |  | ||||||
| 	set -- $(cat /proc/cmdline) | 	set -- $(cat /proc/cmdline) | ||||||
| 	while [ -n "$1" ] ; do | 	while [ -n "$1" ]; do | ||||||
| 		case "$1" in | 		case "$1" in | ||||||
| 			gentoo=*) | 			gentoo=*) | ||||||
| 				local params="${1##*=}" | 				local params="${1##*=}" | ||||||
| 				local IFS=, x= | 				local IFS=, x= | ||||||
| 				for x in ${params} ; do | 				for x in ${params}; do | ||||||
| 					[ "${x}" = "${match}" ] && return 0 | 					[ "${x}" = "${match}" ] && return 0 | ||||||
| 				done | 				done | ||||||
| 				;; | 				;; | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								src/Makefile
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/Makefile
									
									
									
									
									
								
							| @@ -41,6 +41,7 @@ CFLAGS += -pedantic -std=c99 \ | |||||||
|  |  | ||||||
| DESTDIR = | DESTDIR = | ||||||
| LIB = lib | LIB = lib | ||||||
|  | RC_LIB = /$(LIB)/rc | ||||||
|  |  | ||||||
| # Set PAM = pam for pam support | # Set PAM = pam for pam support | ||||||
| PAM =  | PAM =  | ||||||
| @@ -134,13 +135,13 @@ install: $(TARGET) | |||||||
| 	install -m 0755 -d $(DESTDIR)/sbin | 	install -m 0755 -d $(DESTDIR)/sbin | ||||||
| 	install -m 0755 $(SBIN_TARGETS) $(DESTDIR)/sbin | 	install -m 0755 $(SBIN_TARGETS) $(DESTDIR)/sbin | ||||||
| 	ln -sf rc-update $(DESTDIR)/sbin/update-rc | 	ln -sf rc-update $(DESTDIR)/sbin/update-rc | ||||||
| 	install -m 0755 -d $(DESTDIR)/$(LIB)/rcscripts/conf.d | 	install -m 0755 -d $(DESTDIR)/$(RC_LIB)/conf.d | ||||||
| 	install -m 0644 $(SYS_WHITELIST) $(DESTDIR)/$(LIB)/rcscripts/conf.d | 	install -m 0644 $(SYS_WHITELIST) $(DESTDIR)/$(RC_LIB)/conf.d | ||||||
| 	install -m 0755 -d $(DESTDIR)/$(LIB)/rcscripts/bin | 	install -m 0755 -d $(DESTDIR)/$(RC_LIB)/bin | ||||||
| 	for x in $(BINLINKS); do ln -sf ../sbin/rc $(DESTDIR)/bin/$$x; done | 	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 $(SBINLINKS); do ln -sf rc $(DESTDIR)/sbin/$$x; done | ||||||
| 	for x in $(RCLINKS); do ln -sf ../../../sbin/rc $(DESTDIR)/$(LIB)/rcscripts/bin/$$x; done | 	for x in $(RCLINKS); do ln -sf ../../../sbin/rc $(DESTDIR)/$(RC_LIB)/bin/$$x; done | ||||||
| 	if test "$(PAM)" != "pam" ; then \ | 	if test "$(PAM)" = "pam" ; then \ | ||||||
| 		install -m 0755 -d $(DESTDIR)/etc/pam.d ; \ | 		install -m 0755 -d $(DESTDIR)/etc/pam.d ; \ | ||||||
| 		install -m 0644 start-stop-daemon.pam $(DESTDIR)/etc/pam.d/start-stop-daemon ; \ | 		install -m 0644 start-stop-daemon.pam $(DESTDIR)/etc/pam.d/start-stop-daemon ; \ | ||||||
| 	fi | 	fi | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ | |||||||
| #define RC_LEVEL_BOOT           "boot" | #define RC_LEVEL_BOOT           "boot" | ||||||
| #define RC_LEVEL_DEFAULT        "default" | #define RC_LEVEL_DEFAULT        "default" | ||||||
|  |  | ||||||
| #define RC_LIBDIR               "/" LIB "/rcscripts" | #define RC_LIBDIR               "/" LIB "/rc" | ||||||
| #define RC_SVCDIR               RC_LIBDIR "/init.d" | #define RC_SVCDIR               RC_LIBDIR "/init.d" | ||||||
| #define RC_DEPTREE              RC_SVCDIR "/deptree" | #define RC_DEPTREE              RC_SVCDIR "/deptree" | ||||||
| #define RC_RUNLEVELDIR          "/etc/runlevels" | #define RC_RUNLEVELDIR          "/etc/runlevels" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user