From f3cc98651b738ac7f2dc56ea772afa9f874b9d3b Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 7 Apr 2014 17:23:11 +0200 Subject: allow to enable daemons on startup via menuconfig --- package/busybox/Makefile | 6 ++++- package/busybox/config/miscutils/Config.in | 6 ++--- package/busybox/config/networking/Config.in | 2 +- package/busybox/config/networking/udhcp/Config.in | 2 +- package/busybox/files/busybox.postinst | 3 ++- package/busybox/files/network | 27 +++++++++++++++++++ package/busybox/files/network.init | 27 ------------------- package/busybox/files/syslog.init | 33 ----------------------- package/busybox/files/udhcpd.init | 2 +- 9 files changed, 40 insertions(+), 68 deletions(-) create mode 100644 package/busybox/files/network delete mode 100644 package/busybox/files/network.init delete mode 100644 package/busybox/files/syslog.init (limited to 'package/busybox') diff --git a/package/busybox/Makefile b/package/busybox/Makefile index fce16fa32..6b07623b0 100644 --- a/package/busybox/Makefile +++ b/package/busybox/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:= busybox PKG_VERSION:= 1.21.1 -PKG_RELEASE:= 5 +PKG_RELEASE:= 6 PKG_MD5SUM:= 795394f83903b5eec6567d51eebb417e PKG_DESCR:= core utilities for embedded systems PKG_SECTION:= base @@ -60,6 +60,10 @@ do-build: do-install: $(MAKE) ${BB_MAKE_FLAGS} install $(MAKE_TRACE) $(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/ +ifeq ($(BUSYBOX_IFUPDOWN),y) + $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/init.d + $(INSTALL_BIN) ./files/network $(IDIR_BUSYBOX)/etc/init.d +endif ifeq ($(ADK_DEBUG),y) ${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \ $(IDIR_BUSYBOX)/bin/busybox diff --git a/package/busybox/config/miscutils/Config.in b/package/busybox/config/miscutils/Config.in index 4c05e5dae..f13267eac 100644 --- a/package/busybox/config/miscutils/Config.in +++ b/package/busybox/config/miscutils/Config.in @@ -281,7 +281,7 @@ config BUSYBOX_CHRT config BUSYBOX_CROND bool "crond" - default y + default n select BUSYBOX_FEATURE_SYSLOG help Crond is a background daemon that parses individual crontab @@ -301,7 +301,7 @@ config BUSYBOX_FEATURE_CROND_D config BUSYBOX_FEATURE_CROND_CALL_SENDMAIL bool "Report command output via email (using sendmail)" - default y + default n depends on BUSYBOX_CROND help Command output will be sent to corresponding user via email. @@ -747,7 +747,7 @@ config BUSYBOX_WALL config BUSYBOX_WATCHDOG bool "watchdog" - default y + default n depends on !BUSYBOX_DISABLE_WATCHDOG select BUSYBOX_PLATFORM_LINUX help diff --git a/package/busybox/config/networking/Config.in b/package/busybox/config/networking/Config.in index e350a1b16..fa5a7cd47 100644 --- a/package/busybox/config/networking/Config.in +++ b/package/busybox/config/networking/Config.in @@ -748,7 +748,7 @@ config BUSYBOX_NSLOOKUP config BUSYBOX_NTPD bool "ntpd" depends on !BUSYBOX_DISABLE_NTPD - default y + default n select BUSYBOX_PLATFORM_LINUX help The NTP client/server daemon. diff --git a/package/busybox/config/networking/udhcp/Config.in b/package/busybox/config/networking/udhcp/Config.in index 6ece73097..e0f20fc49 100644 --- a/package/busybox/config/networking/udhcp/Config.in +++ b/package/busybox/config/networking/udhcp/Config.in @@ -12,7 +12,7 @@ config BUSYBOX_UDHCPC6 config BUSYBOX_UDHCPD bool "udhcp server (udhcpd)" - default y + default n select BUSYBOX_PLATFORM_LINUX help udhcpd is a DHCP server geared primarily toward embedded systems, diff --git a/package/busybox/files/busybox.postinst b/package/busybox/files/busybox.postinst index c71a536ce..d403ff481 100644 --- a/package/busybox/files/busybox.postinst +++ b/package/busybox/files/busybox.postinst @@ -5,7 +5,8 @@ add_rcconf network network YES add_rcconf crond crond NO add_rcconf watchdog watchdog NO add_rcconf watchdog_flags watchdog_flags '-t 10 -T 20' -add_rcconf 'use "-C32" normally, "NO" to disable' syslogd_flags '-C32' +add_rcconf syslogd NO +add_rcconf 'use "-C32" normally' syslogd_flags '-C32' add_rcconf inetd inetd NO add_rcconf ntpd ntpd NO add_rcconf ntpd_flags ntpd_flags '-p time.fu-berlin.de' diff --git a/package/busybox/files/network b/package/busybox/files/network new file mode 100644 index 000000000..4989fcbcb --- /dev/null +++ b/package/busybox/files/network @@ -0,0 +1,27 @@ +#!/bin/sh +#PKG busybox +#INIT 40 +. /etc/rc.conf +case $1 in +autostart) + test x"${network:-NO}" = x"NO" && exit 0 + exec sh $0 start + ;; +start) + [ -f /etc/network/interfaces ] || exit 1 + ifup -a + ;; +autostop|stop) + [ -f /etc/network/interfaces ] || exit 1 + ifdown -a + ;; +restart) + sh $0 stop + exec sh $0 start + ;; +*) + echo "Usage: $0 {start | stop | restart}" + exit 1 + ;; +esac +exit $? diff --git a/package/busybox/files/network.init b/package/busybox/files/network.init deleted file mode 100644 index 4989fcbcb..000000000 --- a/package/busybox/files/network.init +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -#PKG busybox -#INIT 40 -. /etc/rc.conf -case $1 in -autostart) - test x"${network:-NO}" = x"NO" && exit 0 - exec sh $0 start - ;; -start) - [ -f /etc/network/interfaces ] || exit 1 - ifup -a - ;; -autostop|stop) - [ -f /etc/network/interfaces ] || exit 1 - ifdown -a - ;; -restart) - sh $0 stop - exec sh $0 start - ;; -*) - echo "Usage: $0 {start | stop | restart}" - exit 1 - ;; -esac -exit $? diff --git a/package/busybox/files/syslog.init b/package/busybox/files/syslog.init deleted file mode 100644 index 7a85430ca..000000000 --- a/package/busybox/files/syslog.init +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -#PKG busybox -#INIT 05 -. /etc/rc.conf - -case $1 in -autostop) ;; -autostart) - test x"${syslogd_flags:-NO}" = x"NO" && exit 0 - exec sh $0 start - ;; -start) - /sbin/syslogd $syslogd_flags - if [ -f /proc/sys/kernel/printk ];then - /sbin/klogd - fi - ;; -stop) - if [ -f /proc/sys/kernel/printk ];then - kill $(pgrep -f /sbin/klogd) - fi - kill $(pgrep -f /sbin/syslogd) - ;; -restart) - sh $0 stop - sh $0 start - ;; -*) - echo "Usage: $0 {start | stop | restart}" - exit 1 - ;; -esac -exit $? diff --git a/package/busybox/files/udhcpd.init b/package/busybox/files/udhcpd.init index f626fb732..edec3ac91 100644 --- a/package/busybox/files/udhcpd.init +++ b/package/busybox/files/udhcpd.init @@ -1,5 +1,5 @@ #!/bin/sh -#PKG udhcpd +#PKG busybox #INIT 50 . /etc/rc.conf -- cgit v1.2.3