summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Beisert <j.beisert@pengutronix.de>2006-11-11 19:32:32 +0000
committerJuergen Beisert <j.beisert@pengutronix.de>2006-11-11 19:32:32 +0000
commit789b48c64737246cfe4faf2194384a0475c04f35 (patch)
tree1e30b01a8674e425dbfd7bd91b080bcca2cc87e1
parent7131464d91d57d8d705f0c7fdad7f500bd3b490c (diff)
downloadptxdist-789b48c64737246cfe4faf2194384a0475c04f35.tar.gz
ptxdist-789b48c64737246cfe4faf2194384a0475c04f35.tar.xz
* portmap (rpc)
- starting from inetd or standalone - lets user select his own startscript - adding entries in /etc/services and /etc/inetd.conf automatically - adding rc.d link git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@6299 33e552b5-05e3-0310-8538-816dae2090ed
-rw-r--r--generic/etc/inetd.conf1
-rwxr-xr-xgeneric/etc/init.d/portmapd12
-rw-r--r--generic/etc/services1
-rw-r--r--rules/portmap.in62
-rw-r--r--rules/portmap.make37
-rw-r--r--rules/rootfs_inetd.inc23
-rw-r--r--rules/rootfs_rc_d_links.in12
7 files changed, 139 insertions, 9 deletions
diff --git a/generic/etc/inetd.conf b/generic/etc/inetd.conf
index e07735708..ff2a24a42 100644
--- a/generic/etc/inetd.conf
+++ b/generic/etc/inetd.conf
@@ -7,4 +7,5 @@
@RSYNCD@
@FAMD@
@TELNETD@
+@PORTMAPD@
diff --git a/generic/etc/init.d/portmapd b/generic/etc/init.d/portmapd
new file mode 100755
index 000000000..5a3f36315
--- /dev/null
+++ b/generic/etc/init.d/portmapd
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# portmap
+#
+case $1 in
+
+ start)
+ echo "portmap starting"
+ /sbin/portmap
+ ;;
+
+esac
diff --git a/generic/etc/services b/generic/etc/services
index 4bc98ef9c..7be423b7b 100644
--- a/generic/etc/services
+++ b/generic/etc/services
@@ -6,4 +6,5 @@
@CVSD@
@RSYNCD@
@TELNETD@
+@PORTMAPD@
diff --git a/rules/portmap.in b/rules/portmap.in
index c19a46023..de4638f11 100644
--- a/rules/portmap.in
+++ b/rules/portmap.in
@@ -11,6 +11,68 @@ menuconfig PORTMAP
config PORTMAP_INSTALL_PORTMAPPER
bool
depends on PORTMAP
+ default y
prompt "Install /sbin/portmap"
help
Install the portmapper into /sbin/portmap
+
+comment "runtime options ---"
+ depends on PORTMAP
+
+choice
+ prompt "Kind of startup"
+ default PORTMAP_STARTUP_TYPE_STANDALONE
+ depends on PORTMAP
+
+ config PORTMAP_INETD_SERVER
+ bool
+ prompt "inetd driven"
+ help
+ portmap will be started on demand from inetd. This installs
+ a startup configuration for portmap from inetd. It adds to the
+ /etc/inetd.conf a line like this:
+ portmap stream tcp nowait root /sbin/portmap portmap
+ Note: You must enable one of the two possible inet daemons:
+ There is one embedded in busybox and one in packet inetutils.
+
+ config PORTMAP_STARTUP_TYPE_STANDALONE
+ bool
+ prompt "standalone"
+ help
+ This installs a startup script into /etc/init.d/portmapd. With
+ this script portmap will be started at system startup and waits
+ for connections
+
+endchoice
+
+config PORTMAP_INETD_STRING
+ string
+ depends on PORTMAP
+ depends on PORTMAP_INETD_SERVER
+ prompt "inetd service entry"
+ default "portmap stream tcp nowait root /sbin/portmap portmap"
+ help
+ This string is added to inetd's configuration /etc/inetd.conf.
+
+choice
+ prompt "Kind of startup script"
+ default ROOTFS_ETC_INITD_PORTMAP_DEFAULT
+ depends on PORTMAP
+ depends on PORTMAP_STARTUP_TYPE_STANDALONE
+
+ config ROOTFS_ETC_INITD_PORTMAP_DEFAULT
+ bool
+ prompt "Use generic"
+ help
+ Installs a generic /etc/init.d/portmapd startup script.
+ See <ptxdist-install>/generic/etc/init.d/portmapd
+
+ config ROOTFS_ETC_INITD_PORTMAP_USER
+ bool
+ prompt "User defined"
+ help
+ This uses a user defined portmap startup script. PTXdist
+ uses files projectroot/etc/init.d/portmapd in your local
+ project
+
+endchoice
diff --git a/rules/portmap.make b/rules/portmap.make
index 7675d512f..8f6335d9c 100644
--- a/rules/portmap.make
+++ b/rules/portmap.make
@@ -1,8 +1,8 @@
# -*-makefile-*-
-# $Id:$
+# $Id$
#
# Copyright (C) 2002 by Pengutronix e.K., Hildesheim, Germany
-# See CREDITS for details about who has contributed to this project.
+# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
@@ -14,7 +14,7 @@
PACKAGES-$(PTXCONF_PORTMAP) += portmap
#
-# Paths and names
+# Paths and names
#
PORTMAP_VERSION := 5beta
PORTMAP := portmap_$(PORTMAP_VERSION)
@@ -115,9 +115,32 @@ $(STATEDIR)/portmap.targetinstall: $(portmap_targetinstall_deps_default)
@$(call install_fixup, portmap,DESCRIPTION,missing)
ifdef PTXCONF_PORTMAP_INSTALL_PORTMAPPER
+ @$(call install_copy, portmap, 0, 0, 0755, $(PORTMAP_DIR)/portmap, \
+ /sbin/portmap)
+endif
- @$(call install_copy, portmap, 0, 0, 0755, $(PORTMAP_DIR)/portmap, /sbin/portmap)
+ifdef PTXCONF_ROOTFS_ETC_INITD_PORTMAP_DEFAULT
+# install the generic one
+ @$(call install_copy, portmap, 0, 0, 0755, \
+ $(PTXDIST_TOPDIR)/generic/etc/init.d/portmapd, \
+ /etc/init.d/portmapd, n)
+endif
+ifdef PTXCONF_ROOTFS_ETC_INITD_PORTMAP_USER
+# install users one
+ @$(call install_copy, portmap, 0, 0, 0755, \
+ ${PTXDIST_WORKSPACE}/projectroot/etc/init.d/portmapd, \
+ /etc/init.d/portmapd, n)
endif
+#
+# FIXME: Is this packet the right location for the link?
+#
+ifneq ($(PTXCONF_ROOTFS_ETC_INITD_PORTMAP_LINK),"")
+ @$(call install_copy, portmap, 0, 0, 0755, /etc/rc.d)
+ @$(call install_link, portmap, ../init.d/portmapd, \
+ /etc/rc.d/$(PTXCONF_ROOTFS_ETC_INITD_PORTMAP_LINK))
+endif
+
+
@$(call install_finish, portmap)
@$(call touch, $@)
@@ -125,9 +148,9 @@ endif
# Clean
# ----------------------------------------------------------------------------
-portmap_clean:
- rm -rf $(STATEDIR)/portmap.*
- rm -rf $(IMAGEDIR)/portmap_*
+portmap_clean:
+ rm -rf $(STATEDIR)/portmap.*
+ rm -rf $(IMAGEDIR)/portmap_*
rm -rf $(PORTMAP_DIR)
# vim: syntax=make
diff --git a/rules/rootfs_inetd.inc b/rules/rootfs_inetd.inc
index 6bd2b13f2..ef0220e8c 100644
--- a/rules/rootfs_inetd.inc
+++ b/rules/rootfs_inetd.inc
@@ -161,7 +161,7 @@ ifdef PTXCONF_BB_CONFIG_FEATURE_TELNETD_INETD
# add default string to start the telnetd from busybox into inetd.conf
@$(call install_replace, rootfs, /etc/inetd.conf, \
@TELNETD@, \
- "telnet stream tcp wait root /usr/sbin/famd famd -c /etc/fam.conf" )
+ "telnet stream tcp wait root /sbin/telnetd" )
@$(call install_replace, rootfs, \
/etc/services, \
@@ -169,11 +169,30 @@ ifdef PTXCONF_BB_CONFIG_FEATURE_TELNETD_INETD
"telnet 23/tcp" )
endif
+################################
+# add portmap if enabled
+#
+ifdef PORTMAP_INETD_SERVER
+ifneq ($(PTXCONF_PORTMAP_INETD_STRING),"")
+# add default string to start the portmap into inetd.conf
+ @$(call install_replace, rootfs, /etc/inetd.conf, \
+ @PORTMAPD@, \
+ "portmap stream tcp nowait root /sbin/portmap portmap" )
+else
+ @$(call install_replace, rootfs, /etc/inetd.conf, \
+ @PORTMAPD@, $(PTXCONF_PORTMAP_INETD_STRING) )
+endif
+ @$(call install_replace, rootfs, \
+ /etc/services, \
+ @PORTMAPD@, \
+ "sunrpc 111/tcp\nsunrpc 111/udp" )
+endif
+
#
###########################################################################################
endif
-# telnet from Busybox, utelnet, thttpd, pureftpd, portmapper???, nfs-utils???,
+# telnet from Busybox, utelnet, thttpd, pureftpd, nfs-utils???,
# famd????,
# does the user wants his own file?
diff --git a/rules/rootfs_rc_d_links.in b/rules/rootfs_rc_d_links.in
index 8f99a8f7d..573c884c9 100644
--- a/rules/rootfs_rc_d_links.in
+++ b/rules/rootfs_rc_d_links.in
@@ -155,3 +155,15 @@ config ROOTFS_ETC_INITD_DNSMASQ_LINK
help
Set a link into /etc/rc.d which points to /etc/init.d/dnsmasq to
start dnsmasq as a standalone service when system starts.
+
+
+############################ portmap #########################################
+
+config ROOTFS_ETC_INITD_PORTMAP_LINK
+ depends on PORTMAP_STARTUP_TYPE_STANDALONE
+ string
+ prompt "portmap link name"
+ default "S11_portmapd"
+ help
+ Set a link into /etc/rc.d which points to /etc/init.d/portmapd to
+ start portmap as a standalone service when system starts.