From 153f0fd77fb278a13128b5571031309671a6e652 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 18 Feb 2011 00:51:43 +0100 Subject: package/tcpdump: ease the use of chroot Having this chroot feature enabled is not funny when no user to setuid to is defined. This patch fixes this annoyance by setting the default chroot user to "nobody", which exists as long as base-files do. --- package/tcpdump/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/tcpdump/Makefile b/package/tcpdump/Makefile index 652dc1b6b..fcc5f19f6 100644 --- a/package/tcpdump/Makefile +++ b/package/tcpdump/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= tcpdump PKG_VERSION:= 4.1.1 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= d0dd58bbd6cd36795e05c6f1f74420b0 PKG_DESCR:= A tool for network monitoring and data acquisition PKG_SECTION:= net @@ -32,7 +32,7 @@ else CONFIGURE_ARGS+= --disable-ipv6 endif ifneq (${ADK_PACKAGE_TCPDUMP_WITH_CHROOT},) -CONFIGURE_ARGS+= --with-chroot="/var/lib/tcpdump" +CONFIGURE_ARGS+= --with-chroot="/var/lib/tcpdump" --with-user="nobody" endif XAKE_FLAGS+= CCOPT="${TARGET_CFLAGS}" \ INCLS="-I. -I${STAGING_TARGET_DIR}/usr/include" -- cgit v1.2.3 From d3bf36b1f9f54e23f7b4e78f4a3202a5f1da405b Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 18 Feb 2011 00:51:44 +0100 Subject: mk/modules.mk: always pack zlib_inflate.ko along with deflate.ko Since linux-2.6.37's Kconfg unconditionally selects it. --- mk/modules.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mk/modules.mk b/mk/modules.mk index 8a8e7f2f0..89e8d0053 100644 --- a/mk/modules.mk +++ b/mk/modules.mk @@ -926,13 +926,7 @@ $(eval $(call KMOD_template,CRYPTO_FCRYPT,crypto-fcrypt,\ ,11)) ZLIB:=lib/zlib_deflate/zlib_deflate -ifeq ($(ADK_TARGET_SYSTEM_FOXBOARD_LX832),y) -ifeq ($(ADK_TARGET_SYSTEM_FOXBOARD_LX416),y) -ifeq ($(ADK_TARGET_SYSTEM_LINKSYS_AG241),y) ZLIB+=lib/zlib_inflate/zlib_inflate -endif -endif -endif $(eval $(call KMOD_template,CRYPTO_DEFLATE,crypto-deflate,\ $(foreach mod, $(ZLIB),$(MODULES_DIR)/kernel/$(mod)) \ -- cgit v1.2.3 From fbd8958d3750d5a258ed8fefe50791c53741c20f Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 18 Feb 2011 00:51:45 +0100 Subject: base-files: fix vlan support for busybox vconfig The busybox symlinks reside in /bin, so the check fails. Curiously, there is no vconfig package, so vlan support must have been broken since the beginning of time (for OpenADK). :) This patch also adds some error messages when the basic checks fail, useful helpers when debugging what's going wrong. Also, there was some whitespace fuckup in two lines. --- package/base-files/src/etc/network/if-pre-up.d/02-vlan | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/package/base-files/src/etc/network/if-pre-up.d/02-vlan b/package/base-files/src/etc/network/if-pre-up.d/02-vlan index 35b7fca59..26b33ca80 100755 --- a/package/base-files/src/etc/network/if-pre-up.d/02-vlan +++ b/package/base-files/src/etc/network/if-pre-up.d/02-vlan @@ -1,12 +1,18 @@ #!/bin/sh -[ -x /sbin/vconfig ] || exit 0 -[ -d /proc/net/vlan ] || exit 0 +which vconfig || { + echo "vconfig executable not found, aborting" + exit 0 +} +[ -d /proc/net/vlan ] || { + echo "no kernel support for 802.1q found, aborting" + exit 0 +} case "$IFACE" in vlan*) - vconfig set_name_type VLAN_PLUS_VID_NO_PAD - VLANID=`echo $IFACE|sed "s/vlan*//"` + vconfig set_name_type VLAN_PLUS_VID_NO_PAD + VLANID=`echo $IFACE|sed "s/vlan*//"` ;; eth*.*) vconfig set_name_type DEV_PLUS_VID_NO_PAD -- cgit v1.2.3 From 297ea208d0eca6e802294e75965c94f27aac8ee7 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 18 Feb 2011 00:51:46 +0100 Subject: remove leftover dependency on ADK_ENABLE_IPV6 --- target/linux/config/Config.in.netfilter | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/config/Config.in.netfilter b/target/linux/config/Config.in.netfilter index ce6e80f15..94f82ef64 100644 --- a/target/linux/config/Config.in.netfilter +++ b/target/linux/config/Config.in.netfilter @@ -146,7 +146,6 @@ source target/linux/config/Config.in.netfilter.ip4 endmenu menu "IPv6: Netfilter Configuration" - depends on ADK_ENABLE_IPV6 source target/linux/config/Config.in.netfilter.ip6 endmenu -- cgit v1.2.3 From 5085db8ce48400d364208c34f0d3bf293e5fdf5f Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 18 Feb 2011 00:51:47 +0100 Subject: asterisk-pgsql: get install files from WRKINST No need to fiddle them out of the WRKBUILD, as the regular asterisk installation in WRKINST is not being touched by other packages, at all (just the IDIRs). This could probably be done for most of the other sub-packages, too. (Which is left to the reader as an excercise. ;) --- package/asterisk/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/asterisk/Makefile b/package/asterisk/Makefile index 73ac40acb..791763cf2 100644 --- a/package/asterisk/Makefile +++ b/package/asterisk/Makefile @@ -166,10 +166,10 @@ do-install: asterisk-pgsql-install: ${INSTALL_DIR} $(IDIR_ASTERISK_PGSQL)/etc/asterisk - ${INSTALL_DATA} $(WRKBUILD)/configs/cdr_pgsql.conf.sample \ - $(IDIR_ASTERISK_PGSQL)/etc/asterisk/cdr_pgsql.conf + ${INSTALL_DATA} $(WRKINST)/etc/asterisk/cdr_pgsql.conf \ + $(IDIR_ASTERISK_PGSQL)/etc/asterisk/ ${INSTALL_DIR} $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules - ${INSTALL_BIN} $(WRKBUILD)/cdr/cdr_pgsql.so \ + ${INSTALL_BIN} $(WRKINST)/usr/lib/asterisk/modules/cdr_pgsql.so \ $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/ asterisk-sounds-install: -- cgit v1.2.3 From 844d072abc82c8f027df2229b6843838642b082e Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 18 Feb 2011 00:51:48 +0100 Subject: port GNU netcat --- package/netcat/Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 package/netcat/Makefile diff --git a/package/netcat/Makefile b/package/netcat/Makefile new file mode 100644 index 000000000..e8d344ad9 --- /dev/null +++ b/package/netcat/Makefile @@ -0,0 +1,25 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(TOPDIR)/rules.mk + +PKG_NAME:= netcat +PKG_VERSION:= 0.7.1 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 088def25efe04dcdd1f8369d8926ab34 +PKG_DESCR:= the GNU network swiss army knife +PKG_SECTION:= net/misc +PKG_URL:= http://netcat.sourceforge.net/ +PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=netcat/} + +include $(TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,NETCAT,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +post-install: + $(INSTALL_DIR) $(IDIR_NETCAT)/usr/bin + $(INSTALL_BIN) $(WRKINST)/usr/bin/netcat \ + $(IDIR_NETCAT)/usr/bin + +# please remove ALL above comments, before commiting +include ${TOPDIR}/mk/pkg-bottom.mk -- cgit v1.2.3 From 67ec049f25e299957fada55ea8738e0967547c6f Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 18 Feb 2011 00:51:49 +0100 Subject: port totd, the trick or treat daemon This is a simple DNS-ALG implementation used for NAT-PT & Co. --- package/totd/Makefile | 24 +++++++++++++++++++++ package/totd/files/totd.conf | 14 ++++++++++++ package/totd/files/totd.conffiles | 1 + package/totd/files/totd.init | 26 +++++++++++++++++++++++ package/totd/files/totd.postinst | 4 ++++ package/totd/patches/patch-Makefile_in | 39 ++++++++++++++++++++++++++++++++++ package/totd/patches/patch-ne_mesg_c | 16 ++++++++++++++ 7 files changed, 124 insertions(+) create mode 100644 package/totd/Makefile create mode 100644 package/totd/files/totd.conf create mode 100644 package/totd/files/totd.conffiles create mode 100755 package/totd/files/totd.init create mode 100644 package/totd/files/totd.postinst create mode 100644 package/totd/patches/patch-Makefile_in create mode 100644 package/totd/patches/patch-ne_mesg_c diff --git a/package/totd/Makefile b/package/totd/Makefile new file mode 100644 index 000000000..938439e9b --- /dev/null +++ b/package/totd/Makefile @@ -0,0 +1,24 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(TOPDIR)/rules.mk + +PKG_NAME:= totd +PKG_VERSION:= 1.5.1 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 7edaedae9f6aca5912dd6c123582cf08 +PKG_DESCR:= Trick or Treat Daemon (a simple DNS-ALG for NAT-PT) +PKG_SECTION:= dns +PKG_URL:= http://www.dillema.net/software/totd.html +PKG_SITES:= http://www.dillema.net/software/totd/ + +include $(TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,TOTD,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +post-install: + $(INSTALL_DIR) $(IDIR_TOTD)/{usr/sbin,etc} + ${INSTALL_DATA} ./files/totd.conf ${IDIR_TOTD}/etc/ + $(INSTALL_BIN) $(WRKINST)/usr/sbin/totd $(IDIR_TOTD)/usr/sbin/ + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/totd/files/totd.conf b/package/totd/files/totd.conf new file mode 100644 index 000000000..85a6ae73c --- /dev/null +++ b/package/totd/files/totd.conf @@ -0,0 +1,14 @@ +; you can have multiple forwarders, totd will always prefer +; forwarders listed early and only use forwarders listed later +; if the first ones are unresponsive. +forwarder ::1 + +; you can have multiple prefixes or even no prefixes at all +; totd uses them in round-robin fashion +prefix 0::ffff:ffff:0:0 + +; the port totd listens on for incoming requests +port 53 + +; the pidfile to use (default: /var/run/totd.pid) +pidfile /var/run/totd.pid diff --git a/package/totd/files/totd.conffiles b/package/totd/files/totd.conffiles new file mode 100644 index 000000000..c74a3007f --- /dev/null +++ b/package/totd/files/totd.conffiles @@ -0,0 +1 @@ +/etc/totd.conf diff --git a/package/totd/files/totd.init b/package/totd/files/totd.init new file mode 100755 index 000000000..665e36171 --- /dev/null +++ b/package/totd/files/totd.init @@ -0,0 +1,26 @@ +#!/bin/sh +#PKG totd +#INIT 60 +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + test x"${totd:-NO}" = x"NO" && exit 0 + exec sh $0 start + ;; +start) + totd $totd_flags -c /etc/totd.conf + ;; +stop) + pkill totd + ;; +restart) + sh $0 stop + sh $0 start + ;; +*) + echo "Usage: $0 {start | stop | restart}" + ;; +esac +exit $? diff --git a/package/totd/files/totd.postinst b/package/totd/files/totd.postinst new file mode 100644 index 000000000..12c7c1864 --- /dev/null +++ b/package/totd/files/totd.postinst @@ -0,0 +1,4 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf 'additional flags for totd' totd_flags "-q" +add_rcconf totd totd NO diff --git a/package/totd/patches/patch-Makefile_in b/package/totd/patches/patch-Makefile_in new file mode 100644 index 000000000..5eec23ca5 --- /dev/null +++ b/package/totd/patches/patch-Makefile_in @@ -0,0 +1,39 @@ + - set ${CC} only if unset + - drop -Werror, sources aren't that sane ;) + - don't chown the files when installing + - use DESTDIR when installing + - don't strip binaries (we do ourself, install chooses the wrong strip binary) + - create non-existing target directories +--- totd-1.5.orig/Makefile.in 2005-01-31 12:55:14.000000000 +0100 ++++ totd-1.5/Makefile.in 2010-03-25 21:21:05.085663745 +0100 +@@ -4,7 +4,7 @@ + # <$Id: Makefile.in,v 3.43 2005/01/31 11:55:14 dillema Exp $> + # + +-CC = gcc ++CC ?= gcc + + # These use the standard autoconf variables, which by default are + # rooted in @prefix@ +@@ -19,7 +19,7 @@ TOT_CONFIG_FILE=@sysconfdir@/totd.conf + + INSTALL = /usr/bin/install + +-CFLAGS = @CFLAGS@ @DEFS@ -Werror -Wall -DTOTCONF=\"$(TOT_CONFIG_FILE)\" @OPTFLAGS@ $(INCLUDEPATH) ++CFLAGS = @CFLAGS@ @DEFS@ -Wall -DTOTCONF=\"$(TOT_CONFIG_FILE)\" @OPTFLAGS@ $(INCLUDEPATH) + + # When debugging is enabled by --enable-malloc-debug flag to the configure + # script, the @DBMALLOC@ substitution will contain the empty string, thus +@@ -66,8 +66,10 @@ libswill.a: + -ranlib libswill.a + + install: $(PROG) +- $(INSTALL) -c -s -m 0555 -o bin -g bin $(PROG) $(INSTALLDIR) +- $(INSTALL) -c -m 0444 -o root -g wheel $(MAN) $(INSTALLMAN)/man8 ++ mkdir -p ${DESTDIR}/${INSTALLDIR} ++ $(INSTALL) -c -m 0555 $(PROG) ${DESTDIR}/$(INSTALLDIR) ++ mkdir -p ${DESTDIR}/${INSTALLMAN}/man8 ++ $(INSTALL) -c -m 0444 $(MAN) ${DESTDIR}/$(INSTALLMAN)/man8 + + lint: + lint ${SRCS} diff --git a/package/totd/patches/patch-ne_mesg_c b/package/totd/patches/patch-ne_mesg_c new file mode 100644 index 000000000..db9633bec --- /dev/null +++ b/package/totd/patches/patch-ne_mesg_c @@ -0,0 +1,16 @@ + fix for verbose logging +--- totd-1.5.orig/ne_mesg.c 2002-12-10 23:31:18.000000000 +0100 ++++ totd-1.5/ne_mesg.c 2010-03-25 23:45:35.185664417 +0100 +@@ -470,6 +470,12 @@ u_char *dname_decompress (u_char *buf, i + + next = NULL; + written_len = token_len = 0; ++ ++ if (!m_head) ++ m_head = dname; ++ if (!m_tail) ++ m_tail = dname + buflen; ++ + for (cp = dname; *cp; cp += token_len) { + iter = 0; + top: -- cgit v1.2.3