Browse Source

add adk-test-tools package

- scripts to shutdown qemu from linux
- only start klogd when printk is available
Waldemar Brodkorb 11 years ago
parent
commit
b782769986

+ 28 - 0
package/adk-test-tools/Makefile

@@ -0,0 +1,28 @@
+# 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:=		adk-test-tools
+PKG_VERSION:=		0.1
+PKG_RELEASE:=		1
+PKG_DESCR:=		helper tools and scripts for adk-test-framework
+PKG_SECTION:=		misc
+PKG_URL:=		http://openadk.org/
+
+NO_DISTFILES:=		1
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,ADK_TEST_TOOLS,adk-test-tools,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIG_STYLE:=		manual
+BUILD_STYLE:=		manual
+INSTALL_STYLE:=		manual
+
+adk-test-tools-install:
+	$(INSTALL_DIR) $(IDIR_ADK_TEST_TOOLS)/usr/bin
+	$(INSTALL_BIN) $(WRKBUILD)/{qmp,quit} \
+		$(IDIR_ADK_TEST_TOOLS)/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 11 - 0
package/adk-test-tools/files/test.init

@@ -0,0 +1,11 @@
+#!/bin/sh
+#PKG adk-test-tools
+#INIT 90
+[[ $1 = autostart ]] || exit 0
+echo "Starting test script ..."
+if [ -x /run.sh ];then
+	exec /run.sh
+else
+	echo "no run.sh found"
+fi
+quit

+ 4 - 0
package/adk-test-tools/src/qmp

@@ -0,0 +1,4 @@
+#!/bin/sh
+echo '{ "execute": "qmp_capabilities" }'
+sleep 1
+echo '{ "execute": "quit" }'

+ 2 - 0
package/adk-test-tools/src/quit

@@ -0,0 +1,2 @@
+#!/bin/sh
+socat exec:/usr/bin/qmp tcp:10.0.2.2:4444

+ 1 - 1
package/base-files/Makefile

@@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk
 
 PKG_NAME:=		base-files
 PKG_VERSION:=		1.0
-PKG_RELEASE:=		68
+PKG_RELEASE:=		69
 PKG_SECTION:=		base
 PKG_DESCR:=		basic files and scripts
 PKG_BUILDDEP:=		pkgconf-host file-host

+ 0 - 5
package/base-files/src/etc/init.d/boot

@@ -4,11 +4,6 @@
 
 . /etc/functions.sh
 
-# disable kernel messages
-if [ -f /proc/sys/kernel/printk ];then
-	echo 0 > /proc/sys/kernel/printk
-fi
-
 # remount /dev with smaller size
 mount -o remount,nosuid,size=128k,mode=0755 -t tmpfs mdev /dev
 

+ 4 - 0
package/base-files/src/etc/init.d/rcS

@@ -1,4 +1,8 @@
 #!/bin/sh
+# disable kernel messages
+if [ -f /proc/sys/kernel/printk ];then
+	echo 0 > /proc/sys/kernel/printk
+fi
 echo "System initialization ..."
 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
 ln -s /proc/self/fd/2 /dev/stderr

+ 1 - 1
package/busybox/Makefile

@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		busybox
 PKG_VERSION:=		1.21.1
-PKG_RELEASE:=		4
+PKG_RELEASE:=		5
 PKG_MD5SUM:=		795394f83903b5eec6567d51eebb417e
 PKG_DESCR:=		core utilities for embedded systems
 PKG_SECTION:=		base

+ 6 - 2
package/busybox/files/syslog.init

@@ -11,10 +11,14 @@ autostart)
 	;;
 start)
 	/sbin/syslogd $syslogd_flags
-	/sbin/klogd
+	if [ -f /proc/sys/kernel/printk ];then
+		/sbin/klogd
+	fi
 	;;
 stop)
-	kill $(pgrep -f /sbin/klogd)
+	if [ -f /proc/sys/kernel/printk ];then
+		kill $(pgrep -f /sbin/klogd)
+	fi
 	kill $(pgrep -f /sbin/syslogd)
 	;;
 restart)

+ 1 - 1
package/dropbear/Makefile

@@ -14,7 +14,7 @@ PKG_SITES:=		http://matt.ucc.asn.au/dropbear/releases/
 
 DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.bz2
 
-PKG_DFLT_DROPBEAR:=	y if !ADK_TOOLCHAIN_ONLY
+PKG_DFLT_DROPBEAR:=	y if !ADK_TOOLCHAIN_ONLY && !ADK_PKG_TEST
 PKG_SUBPKGS:=		DROPBEAR DBCONVERT
 PKGSD_DBCONVERT:=	Utility for converting SSH private keys
 

+ 12 - 0
package/strace/patches/patch-util_c

@@ -0,0 +1,12 @@
+--- strace-4.8.orig/util.c	2013-05-06 20:23:01.000000000 +0200
++++ strace-4.8/util.c	2014-03-07 15:34:01.074036954 +0100
+@@ -55,7 +55,9 @@
+ # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
+ #  define pt_all_user_regs XXX_pt_all_user_regs
+ # endif
++#if !defined(SH)
+ # include <linux/ptrace.h>
++#endif
+ # undef ia64_fpreg
+ # undef pt_all_user_regs
+ #endif

+ 1 - 0
target/linux/config/Config.in.debug

@@ -34,6 +34,7 @@ config ADK_KERNEL_PRINTK
 	boolean
 	select ADK_KERNEL_EARLY_PRINTK
 	default y
+	depends on !ADK_PKG_TEST
 	help
 	  Disable printk to save space and quieten bootup.
 

+ 1 - 0
target/packages/pkg-available/test

@@ -1,6 +1,7 @@
 config ADK_PKG_TEST
 	bool "Compile a ADK test framework system"
 	default n
+	select ADK_PACKAGE_ADK_TEST_TOOLS
 	select ADK_PACKAGE_STRACE
 	select ADK_PACKAGE_SOCAT
 	select ADK_PACKAGE_MAKE