All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] serialcheck: add version 1.0.0
@ 2015-04-08 18:42 Denys Dmytriyenko
  2015-04-08 18:42 ` [PATCH 2/2] ltp-ddt: bump to " Denys Dmytriyenko
  2015-04-08 21:34 ` [PATCH 1/2] serialcheck: add " Otavio Salvador
  0 siblings, 2 replies; 4+ messages in thread
From: Denys Dmytriyenko @ 2015-04-08 18:42 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Denys Dmytriyenko

From: Denys Dmytriyenko <denys@ti.com>

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
 ...01-Add-option-to-enable-internal-loopback.patch | 80 ++++++++++++++++++++++
 .../0002-Restore-original-loopback-config.patch    | 48 +++++++++++++
 .../serialcheck/serialcheck_1.0.0.bb               | 19 +++++
 3 files changed, 147 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/serialcheck/serialcheck/0001-Add-option-to-enable-internal-loopback.patch
 create mode 100644 meta-oe/recipes-devtools/serialcheck/serialcheck/0002-Restore-original-loopback-config.patch
 create mode 100644 meta-oe/recipes-devtools/serialcheck/serialcheck_1.0.0.bb

diff --git a/meta-oe/recipes-devtools/serialcheck/serialcheck/0001-Add-option-to-enable-internal-loopback.patch b/meta-oe/recipes-devtools/serialcheck/serialcheck/0001-Add-option-to-enable-internal-loopback.patch
new file mode 100644
index 0000000..fc387d7
--- /dev/null
+++ b/meta-oe/recipes-devtools/serialcheck/serialcheck/0001-Add-option-to-enable-internal-loopback.patch
@@ -0,0 +1,80 @@
+From 059d5512e840fe68e2bb37add6c9208fa9c34d15 Mon Sep 17 00:00:00 2001
+From: Sekhar Nori <nsekhar@ti.com>
+Date: Tue, 24 Feb 2015 22:16:37 +0530
+Subject: [PATCH 1/2] Add option to enable internal loopback
+
+---
+ serialcheck.c | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+diff --git a/serialcheck.c b/serialcheck.c
+index 4f5b747..4100c37 100644
+--- a/serialcheck.c
++++ b/serialcheck.c
+@@ -12,6 +12,8 @@
+ #include <sys/ioctl.h>
+ #include <linux/serial.h>
+
++#define TIOCM_LOOP	0x8000
++
+ #define __same_type(a, b)	__builtin_types_compatible_p(typeof(a), typeof(b))
+ #define BUILD_BUG_ON_ZERO(e)	(sizeof(struct { int:-!!(e); }))
+ #define __must_be_array(a)	BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
+@@ -40,6 +42,7 @@ struct g_opt {
+	unsigned char hflow;
+	unsigned char do_termios;
+	unsigned char *cmp_buff;
++	unsigned char loopback;
+ };
+
+ /* name, key, arg, flags, doc, group */
+@@ -51,6 +54,7 @@ static struct argp_option options[] = {
+	{"mode",	'm', "M",    0, "transfer mode (d = duplex, t = send r = receive)", 0},
+	{"loops",	'l', "NUM",  0, "loops to perform (0 => wait fot CTRL-C", 0},
+	{"no-termios",	'n', NULL,   0, "No termios change (baud rate etc. remains unchanged)", 0},
++	{"loopback",	'k', NULL,   0, "loopback mode", 0},
+	{NULL, 0, NULL, 0, NULL, 0}
+ };
+
+@@ -67,6 +71,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
+		go->baudrate = 115200;
+		go->loops = UINT_MAX;
+		go->do_termios = 1;
++		go->loopback = 0;
+		break;
+	case ARGP_KEY_ARG:
+		ret =  ARGP_ERR_UNKNOWN;
+@@ -113,6 +118,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
+		} else
+			go->loops = num;
+		break;
++	case 'k':
++		go->loopback = 1;
++		break;
+	default:
+		ret = ARGP_ERR_UNKNOWN;
+	}
+@@ -487,6 +495,21 @@ int main(int argc, char *argv[])
+			die("tcflush failed: %m\n");
+	}
+
++	if (opts.loopback) {
++		unsigned int mcr;
++
++		ret = ioctl(fd, TIOCMGET, &mcr);
++		if (ret < 0)
++			die("mcr get failed: %m\n");
++
++		mcr |= TIOCM_LOOP;
++
++		ret = ioctl(fd, TIOCMSET, &mcr);
++		if (ret < 0)
++			die ("mcr set failed: %m\n");
++
++	}
++
+	ret = fcntl(fd, F_SETFL, 0);
+	if (ret)
+		printf("Failed to remove nonblock mode\n");
+--
+1.9.1
diff --git a/meta-oe/recipes-devtools/serialcheck/serialcheck/0002-Restore-original-loopback-config.patch b/meta-oe/recipes-devtools/serialcheck/serialcheck/0002-Restore-original-loopback-config.patch
new file mode 100644
index 0000000..a2ac6d0
--- /dev/null
+++ b/meta-oe/recipes-devtools/serialcheck/serialcheck/0002-Restore-original-loopback-config.patch
@@ -0,0 +1,48 @@
+From a6e5813d2f8402bf3a311c8bcda02623bfb76882 Mon Sep 17 00:00:00 2001
+From: Carlos Hernandez <ceh@ti.com>
+Date: Tue, 24 Feb 2015 16:00:34 -0500
+Subject: [PATCH 2/2] Restore original loopback config
+
+If loopback option is enabled. Disable it at the end of the test.
+
+Signed-off-by: Carlos Hernandez <ceh@ti.com>
+---
+ serialcheck.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/serialcheck.c b/serialcheck.c
+index 4100c37..06470f7 100644
+--- a/serialcheck.c
++++ b/serialcheck.c
+@@ -427,6 +427,7 @@ int main(int argc, char *argv[])
+	unsigned char *data;
+	unsigned int open_mode;
+	off_t data_len;
++	unsigned int mcr;
+
+	argp_parse(&argp, argc, argv, 0, NULL, &opts);
+	if (!opts.file_trans)
+@@ -496,8 +497,6 @@ int main(int argc, char *argv[])
+	}
+
+	if (opts.loopback) {
+-		unsigned int mcr;
+-
+		ret = ioctl(fd, TIOCMGET, &mcr);
+		if (ret < 0)
+			die("mcr get failed: %m\n");
+@@ -535,6 +534,12 @@ int main(int argc, char *argv[])
+	ret = tcsetattr(fd, TCSAFLUSH, &old_term);
+	if (ret)
+		printf("tcsetattr() of old ones failed: %m\n");
++	if (opts.loopback) {
++		mcr &= ~(TIOCM_LOOP);
++		ret = ioctl(fd, TIOCMSET, &mcr);
++	}
++	if (ret)
++		printf("disabling loopback failed: %m\n");
+
+	close(fd);
+	return status;
+--
+1.9.1
diff --git a/meta-oe/recipes-devtools/serialcheck/serialcheck_1.0.0.bb b/meta-oe/recipes-devtools/serialcheck/serialcheck_1.0.0.bb
new file mode 100644
index 0000000..6154241
--- /dev/null
+++ b/meta-oe/recipes-devtools/serialcheck/serialcheck_1.0.0.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Application to verify operation of serial ports"
+HOMEPAGE = "git://git.breakpoint.cc/bigeasy/serialcheck.git"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "git://git.breakpoint.cc/bigeasy/serialcheck.git \
+            file://0001-Add-option-to-enable-internal-loopback.patch \
+            file://0002-Restore-original-loopback-config.patch"
+
+SRCREV = "63854a2d0c0129efab132ec328a75279e013fb84"
+
+S = "${WORKDIR}/git"
+
+CFLAGS_prepend = "-Wall -Wextra -Wno-sign-compare -Wno-pointer-sign "
+
+do_install() {
+    install -d ${D}${bindir}
+    install ${S}/serialcheck ${D}${bindir}/serialcheck
+}
-- 
2.2.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ltp-ddt: bump to version 1.0.0
  2015-04-08 18:42 [PATCH 1/2] serialcheck: add version 1.0.0 Denys Dmytriyenko
@ 2015-04-08 18:42 ` Denys Dmytriyenko
  2015-04-08 21:34 ` [PATCH 1/2] serialcheck: add " Otavio Salvador
  1 sibling, 0 replies; 4+ messages in thread
From: Denys Dmytriyenko @ 2015-04-08 18:42 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Denys Dmytriyenko

From: Denys Dmytriyenko <denys@ti.com>

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
 ...ite-Make-sure-to-include-generated-header.patch | 34 ----------------------
 .../ltp-ddt/ltp-Do-not-link-against-libfl.patch    | 31 ++++++++++++++++++++
 .../ltp-ddt/{ltp-ddt_0.0.5.bb => ltp-ddt_1.0.0.bb} | 34 +++++++++++++---------
 3 files changed, 52 insertions(+), 47 deletions(-)
 delete mode 100644 meta-oe/recipes-devtools/ltp-ddt/ltp-ddt/0001-wdt_test_suite-Make-sure-to-include-generated-header.patch
 create mode 100644 meta-oe/recipes-devtools/ltp-ddt/ltp-ddt/ltp-Do-not-link-against-libfl.patch
 rename meta-oe/recipes-devtools/ltp-ddt/{ltp-ddt_0.0.5.bb => ltp-ddt_1.0.0.bb} (68%)

diff --git a/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt/0001-wdt_test_suite-Make-sure-to-include-generated-header.patch b/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt/0001-wdt_test_suite-Make-sure-to-include-generated-header.patch
deleted file mode 100644
index 56b0333..0000000
--- a/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt/0001-wdt_test_suite-Make-sure-to-include-generated-header.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 4a8f24892514cd5e4d11b9105c843db49eea921b Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 19 Feb 2014 19:41:33 -0800
-Subject: [PATCH] wdt_test_suite: Make sure to include generated headers
-
-This makes sure that its using the generated headers
-and not the raw headers from kernel, generated headers
-are built for the given machine already when kernel is
-built and are available in configured/compiled kernel tree
-already
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/ddt/wdt_test_suite/Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/testcases/ddt/wdt_test_suite/Makefile b/testcases/ddt/wdt_test_suite/Makefile
-index 90a6a90..22a1cfd 100644
---- a/testcases/ddt/wdt_test_suite/Makefile
-+++ b/testcases/ddt/wdt_test_suite/Makefile
-@@ -20,8 +20,8 @@ INCLUDES        = -I $(KERNEL_INC) -I src/interface/common -I ../utils/user
- INCLUDES        = -I src/parser \
-                   -I src/interface/common \
-                   -I ../utils/user \
--                  -I $(KERNEL_INC)/include \
--                  -I $(KERNEL_INC)/arch/arm/include
-+                  -I $(KERNEL_INC)/include/generated \
-+                  -I $(KERNEL_INC)/arch/arm/include/generated \
- 
- #List of source files- Update this on adding a new C file
- SOURCES := \
--- 
-1.9.0
-
diff --git a/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt/ltp-Do-not-link-against-libfl.patch b/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt/ltp-Do-not-link-against-libfl.patch
new file mode 100644
index 0000000..3e4aa73
--- /dev/null
+++ b/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt/ltp-Do-not-link-against-libfl.patch
@@ -0,0 +1,31 @@
+From 5bda9c0af56869c6ff2c25d38ea087179c946bc6 Mon Sep 17 00:00:00 2001
+From: Chong Lu <Chong.Lu@windriver.com>
+Date: Tue, 11 Mar 2014 14:47:22 +0800
+Subject: [PATCH] ltp: Don't link against libfl
+
+We have already defined yywrap function in scan.l file. After this, we no longer need to
+link against libfl and so no longer get errors about undefined references to yylex.
+
+Upstream-status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ pan/Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pan/Makefile b/pan/Makefile
+index 4cc6466..a4b575b 100644
+--- a/pan/Makefile
++++ b/pan/Makefile
+@@ -31,7 +31,7 @@ CPPFLAGS		+= -Wno-error
+ 
+ CPPFLAGS		+= -I$(abs_srcdir)
+ 
+-LDLIBS			+= -lm $(LEXLIB)
++LDLIBS			+= -lm
+ 
+ LFLAGS			+= -l
+ 
+-- 
+1.7.9.5
+
diff --git a/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_0.0.5.bb b/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_1.0.0.bb
similarity index 68%
rename from meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_0.0.5.bb
rename to meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_1.0.0.bb
index db62ac6..d028e88 100644
--- a/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_0.0.5.bb
+++ b/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_1.0.0.bb
@@ -7,18 +7,18 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
 PROVIDES += "ltp"
 DEPENDS += "zip-native virtual/kernel alsa-lib"
 
-RDEPENDS_${PN} += "pm-qa"
+RDEPENDS_${PN} += "pm-qa serialcheck"
 
-inherit autotools-brokensep module-base kernel-module-split
+inherit autotools module-base kernel-module-split
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-SRCREV = "903f70a11eb77cbad62d7ecbe7dcbaf61be8ff99"
+SRCREV = "f086bed6cc88bf102eaad0e96cb7ebe79944a8ad"
 BRANCH ?= "master"
 
 SRC_URI = "git://arago-project.org/git/projects/test-automation/ltp-ddt.git;branch=${BRANCH} \
-           file://0001-wdt_test_suite-Make-sure-to-include-generated-header.patch \
-          "
+    file://ltp-Do-not-link-against-libfl.patch \
+"
 
 S = "${WORKDIR}/git"
 
@@ -58,16 +58,26 @@ FILES_${PN}-dbg += " \
 FILES_${PN}-staticdev += "${LTPROOT}/lib"
 FILES_${PN} += "${LTPROOT}/*"
 
-do_configure() {
-    cp ${S}/include/config.h.default ${S}/include/config.h
-    cp ${S}/include/mk/config.mk.default ${S}/include/mk/config.mk
-    cp ${S}/include/mk/features.mk.default ${S}/include/mk/features.mk
-    echo "${TAG}" > ${S}/ChangeLog
-}
+KERNEL_MODULES_META_PACKAGE = "${PN}"
 
 kmoddir = "/lib/modules/${KERNEL_VERSION}/kernel/drivers/ddt"
 
+# ltp doesn't regenerate ffsb-6.0-rc2 configure and hardcode configure call.
+# we explicitly force regeneration of that directory and pass configure options.
+do_configure_append() {
+    (cd utils/ffsb-6.0-rc2; autoreconf -fvi; ./configure ${CONFIGUREOPTS})
+}
+
+# The makefiles make excessive use of make -C and several include testcases.mk
+# which triggers a build of the syscall header. To reproduce, build ltp,
+# then delete the header, then "make -j XX" and watch regen.sh run multiple
+# times. Its easier to generate this once here instead.
+do_compile_prepend () {
+    ( make -C ${B}/testcases/kernel include/linux_syscall_numbers.h )
+}
+
 do_compile_append () {
+    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
     oe_runmake modules
 }
 
@@ -75,8 +85,6 @@ do_install() {
     oe_runmake install
     install -d ${D}${datadir}
     install -d ${D}${kmoddir}
-    cp -a ${D}${LTPROOT}/share/* ${D}${datadir}
-    rm -rf ${D}${LTPROOT}/share/
     mv ${D}${LTPROOT}/testcases/bin/ddt/*.ko ${D}${kmoddir}
 }
 
-- 
2.2.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] serialcheck: add version 1.0.0
  2015-04-08 18:42 [PATCH 1/2] serialcheck: add version 1.0.0 Denys Dmytriyenko
  2015-04-08 18:42 ` [PATCH 2/2] ltp-ddt: bump to " Denys Dmytriyenko
@ 2015-04-08 21:34 ` Otavio Salvador
  2015-04-09  1:30   ` Denys Dmytriyenko
  1 sibling, 1 reply; 4+ messages in thread
From: Otavio Salvador @ 2015-04-08 21:34 UTC (permalink / raw)
  To: OpenEmbedded Devel List; +Cc: Denys Dmytriyenko

Hello Denys,

On Wed, Apr 8, 2015 at 3:42 PM, Denys Dmytriyenko <denis@denix.org> wrote:
> From: Denys Dmytriyenko <denys@ti.com>
>
> Signed-off-by: Denys Dmytriyenko <denys@ti.com>

There are some things I see as possible improvements:

 - a long commit log which says what is the use case for the tool
 - fix homepage to the right cgit URL
 - add Upstream-Status field in the two included patches (btw, it
would be good to send them for inclusion)
 - add nativesdk support as it is useful for SDK deployment so it can
be used for board test

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] serialcheck: add version 1.0.0
  2015-04-08 21:34 ` [PATCH 1/2] serialcheck: add " Otavio Salvador
@ 2015-04-09  1:30   ` Denys Dmytriyenko
  0 siblings, 0 replies; 4+ messages in thread
From: Denys Dmytriyenko @ 2015-04-09  1:30 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Otavio Salvador

On Wed, Apr 08, 2015 at 06:34:45PM -0300, Otavio Salvador wrote:
> Hello Denys,
> 
> On Wed, Apr 8, 2015 at 3:42 PM, Denys Dmytriyenko <denis@denix.org> wrote:
> > From: Denys Dmytriyenko <denys@ti.com>
> >
> > Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> 
> There are some things I see as possible improvements:
> 
>  - a long commit log which says what is the use case for the tool
>  - fix homepage to the right cgit URL
>  - add Upstream-Status field in the two included patches (btw, it
> would be good to send them for inclusion)
>  - add nativesdk support as it is useful for SDK deployment so it can
> be used for board test

Thanks, please see the updated v2 of the patchset.

-- 
Denys


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-09  1:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-08 18:42 [PATCH 1/2] serialcheck: add version 1.0.0 Denys Dmytriyenko
2015-04-08 18:42 ` [PATCH 2/2] ltp-ddt: bump to " Denys Dmytriyenko
2015-04-08 21:34 ` [PATCH 1/2] serialcheck: add " Otavio Salvador
2015-04-09  1:30   ` Denys Dmytriyenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.