aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@opendreambox.org>2011-01-20 17:24:17 +0000
committerThomas Zimmermann <zimmermann@vdm-design.de>2011-02-20 13:24:10 +0100
commit1564731b8da596e70e0b6bd4ede8180e5ebfa187 (patch)
tree0fac230347bbb0058b871394e7f3a8856bee32d2
parentd177fbe27851ca85e227deb661cb9d97e7331c16 (diff)
downloadopenembedded-1564731b8da596e70e0b6bd4ede8180e5ebfa187.tar.gz
busybox: create busybox-inetd package
* Empty package unless CONFIG_INETD=y. * Use update-alternatives with priority 50. * Install initscript and inetd.conf. * RPROVIDE inetd Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Acked-by: Otavio Salvador <otavio@ossystems.com.br> Acked-by: Eric BĂ©nard <eric@eukrea.com>
-rw-r--r--recipes/busybox/busybox.inc45
-rw-r--r--recipes/busybox/busybox_1.1x.inc2
-rwxr-xr-xrecipes/busybox/files/inetd33
-rw-r--r--recipes/busybox/files/inetd.conf20
4 files changed, 98 insertions, 2 deletions
diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
index 03efc997d8..9c0bddc3a4 100644
--- a/recipes/busybox/busybox.inc
+++ b/recipes/busybox/busybox.inc
@@ -11,7 +11,7 @@ LICENSE = "GPLv2"
SECTION = "base"
PRIORITY = "required"
-INC_PR = "r41"
+INC_PR = "r42"
SRC_URI = "\
file://busybox-cron \
@@ -22,6 +22,8 @@ SRC_URI = "\
file://hwclock.sh \
file://hwclock-default \
file://ifupdown-spurious-environ.patch \
+ file://inetd \
+ file://inetd.conf \
file://mount.busybox \
file://passwd \
file://shadow \
@@ -35,7 +37,7 @@ SRC_URI_append_nylon = " file://xargs-double-size.patch"
export EXTRA_CFLAGS = "${CFLAGS}"
EXTRA_OEMAKE_append = " CROSS=${HOST_PREFIX}"
-PACKAGES =+ "${PN}-mountall ${PN}-httpd ${PN}-syslog ${PN}-udhcpd"
+PACKAGES =+ "${PN}-mountall ${PN}-httpd ${PN}-inetd ${PN}-syslog ${PN}-udhcpd"
PACKAGES =+ "${PN}-passwd ${PN}-shadow"
# We need this RRECOMMENDS_${PN} because libc dlopens libgcc
@@ -49,7 +51,11 @@ RDEPENDS_${PN} += "${PN}-mountall"
# Make busybox recommend busybox-syslog for those images that expect it
RRECOMMENDS_${PN} += "libgcc ${PN}-syslog"
+RPROVIDES_${PN}-inetd = "inetd"
+
FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
+FILES_${PN}-inetd = "${sysconfdir}/init.d/inetd.${PN} \
+ ${sysconfdir}/inetd.conf"
FILES_${PN}-passwd = "${sysconfdir}/passwd.${PN}"
FILES_${PN}-shadow = "${sysconfdir}/shadow.${PN}"
FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} \
@@ -62,14 +68,17 @@ FILES_${PN} += "${datadir}/udhcpc"
# update-rc.d and update-alternatives is important (see below)
INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-udhcpd"
INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
+INITSCRIPT_NAME_${PN}-inetd = "inetd"
INITSCRIPT_NAME_${PN}-syslog = "syslog"
INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
+CONFFILES_${PN}-inetd = "${sysconfdir}/inetd.conf"
CONFFILES_${PN}-syslog = "${sysconfdir}/default/busybox-syslog"
# This disables the syslog startup links in slugos (see slugos-init)
INITSCRIPT_PARAMS_${PN}-syslog_slugos = "start 20 ."
RDEPENDS_${PN}-httpd += "${PN}"
+RDEPENDS_${PN}-inetd += "${PN}"
RDEPENDS_${PN}-passwd += "${PN}"
RDEPENDS_${PN}-shadow += "${PN}-passwd"
RDEPENDS_${PN}-syslog += "${PN}"
@@ -224,6 +233,10 @@ do_install () {
install -d ${D}${sysconfdir}/default
install -m 644 ${WORKDIR}/mountall ${D}${sysconfdir}/default/mountall.${PN}
fi
+ if grep "CONFIG_INETD=y" ${WORKDIR}/defconfig; then
+ install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${PN}
+ install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/
+ fi
install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
}
@@ -292,6 +305,34 @@ pkg_prerm_${PN}-shadow () {
update-alternatives --remove default_shadow shadow.${PN}
}
+pkg_postinst_${PN}-inetd () {
+ update-alternatives --install ${sysconfdir}/init.d/inetd inetd-init inetd.${PN} 50
+
+ [ -n "$D" ] && OPT="-r $D" || OPT="-s"
+ # remove all rc.d-links potentially created from alternative
+ # inetd packages before creating new ones
+ update-rc.d $OPT -f inetd remove
+ update-rc.d $OPT inetd start 20 2 3 4 5 . stop 90 0 1 6 .
+}
+
+pkg_prerm_${PN}-inetd () {
+ if test "x$D" = "x"; then
+ if test "$1" = "upgrade" -o "$1" = "remove"; then
+ /etc/init.d/inetd stop
+ fi
+ fi
+
+ update-alternatives --remove inetd-init inetd.${PN}
+}
+
+pkg_postrm_${PN}-inetd () {
+ if test "$1" = "remove" -o "$1" = "purge"; then
+ if ! test -e "/etc/init.d/inetd"; then
+ [ -n "$D" ] && OPT="-r $D" || OPT="-s"
+ update-rc.d $OPT inetd remove
+ fi
+ fi
+}
pkg_postinst_${PN}-syslog () {
update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 50
diff --git a/recipes/busybox/busybox_1.1x.inc b/recipes/busybox/busybox_1.1x.inc
index 1078aac2fd..763b324613 100644
--- a/recipes/busybox/busybox_1.1x.inc
+++ b/recipes/busybox/busybox_1.1x.inc
@@ -15,6 +15,8 @@ SRC_URI = "\
file://default.script file://simple.script \
file://hwclock.sh \
file://hwclock-default \
+ file://inetd \
+ file://inetd.conf \
file://mount.busybox \
file://mountall \
file://passwd \
diff --git a/recipes/busybox/files/inetd b/recipes/busybox/files/inetd
new file mode 100755
index 0000000000..cf50bcd546
--- /dev/null
+++ b/recipes/busybox/files/inetd
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# start/stop inetd super server.
+
+if ! [ -x /usr/sbin/inetd ]; then
+ exit 0
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting internet superserver:"
+ echo -n " inetd" ; start-stop-daemon -S -x /usr/sbin/inetd > /dev/null
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping internet superserver:"
+ echo -n " inetd" ; start-stop-daemon -K -x /usr/sbin/inetd > /dev/null
+ echo "."
+ ;;
+ restart)
+ echo -n "Restarting internet superserver:"
+ echo -n " inetd "
+ killall -HUP inetd
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/inetd {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/recipes/busybox/files/inetd.conf b/recipes/busybox/files/inetd.conf
new file mode 100644
index 0000000000..b02fe850c9
--- /dev/null
+++ b/recipes/busybox/files/inetd.conf
@@ -0,0 +1,20 @@
+# /etc/inetd.conf: see inetd(8) for further informations.
+#
+# Internet server configuration database
+#
+# If you want to disable an entry so it isn't touched during
+# package updates just comment it out with a single '#' character.
+#
+# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
+#
+#:INTERNAL: Internal services
+#echo stream tcp nowait root internal
+#echo dgram udp wait root internal
+#chargen stream tcp nowait root internal
+#chargen dgram udp wait root internal
+#discard stream tcp nowait root internal
+#discard dgram udp wait root internal
+#daytime stream tcp nowait root internal
+#daytime dgram udp wait root internal
+#time stream tcp nowait root internal
+#time dgram udp wait root internal