Skip to contentSkip to conversation

tcfagent: new package

PATCH New Norbert Lange 2 participants 5 messages Jan 2, 2018 – Jan 4, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 tcfagent: new package

Add tcfpackage which contains a service "tcf-agent"

---
Changes v3 -> v4:
- handling of architectures isolated in Config.in
- use new upstream version 1.6.0
- refreshed patches
- whitespace fixes

Changes v2 -> v3:
- fix: init file still started the tool daemonized
- use same email for all signatures

Changes v1 -> v2:
- added myself to DEVELOPERS
- fixes to the init service, now uses common sheme to generate PID files
- fixed systemd unit
- renamed target executable directly in CMakeList
- allow cmake build without existing C++ compiler
- add patches to make sources compile with musl
- allow compilation with other architectures than x86_64
- some more small details suggested by Thomas Petazzoni

---
 DEVELOPERS                                         |   3 +
 package/Config.in                                  |   1 +
 ...gent-add-install-target-to-the-CMakeLists.patch |  48 ++++++++++
 ...-remove-explicit-uses-of-__ptrace_request.patch | 103 +++++++++++++++++++++
 ...de-canonicalize_file_name-for-all-c-libs-.patch |  46 +++++++++
 package/tcfagent/Config.in                         |  36 +++++++
 package/tcfagent/S55tcfagent                       |  40 ++++++++
 package/tcfagent/tcfagent.hash                     |   5 +
 package/tcfagent/tcfagent.mk                       |  39 ++++++++
 package/tcfagent/tcfagent.service                  |   9 ++
 10 files changed, 330 insertions(+)
 create mode 100644 package/tcfagent/0001-agent-add-install-target-to-the-CMakeLists.patch
 create mode 100644 package/tcfagent/0002-linux-remove-explicit-uses-of-__ptrace_request.patch
 create mode 100644 package/tcfagent/0003-linux-provide-canonicalize_file_name-for-all-c-libs-.patch
 create mode 100644 package/tcfagent/Config.in
 create mode 100755 package/tcfagent/S55tcfagent
 create mode 100644 package/tcfagent/tcfagent.hash
 create mode 100644 package/tcfagent/tcfagent.mk
 create mode 100644 package/tcfagent/tcfagent.service
DEVELOPERS +3 -0
index 7e14b5609f..20dedcfe0f 100644
@@ -1285,6 +1285,9 @@ N:	No? Rubinstein <[email protected]>
 F:	package/tpm-tools/
 F:	package/trousers/
 
+N:	Norbert Lange <[email protected]>
+F:	package/tcfagent/
+
 N:	Olaf Rempel <[email protected]>
 F:	package/ctorrent/
 
package/Config.in +1 -0
index e97d3e2e58..2926c27857 100644
@@ -124,6 +124,7 @@ menu "Debugging, profiling and benchmark"
 	source "package/stress-ng/Config.in"
 	source "package/sysdig/Config.in"
 	source "package/sysprof/Config.in"
+	source "package/tcfagent/Config.in"
 	source "package/tinymembench/Config.in"
 	source "package/trace-cmd/Config.in"
 	source "package/trinity/Config.in"
package/tcfagent/0001-agent-add-install-target-to-the-CMakeLists.patch new file +48 -0

48 lines not on this page · raw message

package/tcfagent/0002-linux-remove-explicit-uses-of-__ptrace_request.patch new file +103 -0

103 lines not on this page · raw message

package/tcfagent/0003-linux-provide-canonicalize_file_name-for-all-c-libs-.patch new file +46 -0

46 lines not on this page · raw message

package/tcfagent/Config.in new file +36 -0
new file mode 100644
index 0000000000..765d1add97
@@ -0,0 +1,36 @@
+config BR2_PACKAGE_TCFAGENT
+	bool "tcfagent"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_TCFAGENT_ARCH_SUPPORTS
+	select BR2_PACKAGE_UTIL_LINUX
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	help
+	  Target Communication Framework Agent is an example application
+	  using the Target Communication Framework Library.
+
+	  Target Communication Framework is universal, extensible, simple,
+	  lightweight, vendor agnostic framework for tools and targets to
+	  communicate for purpose of debugging, profiling, code patching
+	  and other device software development needs.
+
+	  tcf-agent is a daemon, which provides TCF services that can be
+	  used by local and remote clients.
+
+config BR2_PACKAGE_TCFAGENT_ARCH
+	string
+	default "arm"        if BR2_arm || BR2_armeb
+	default "a64"        if BR2_aarch64 || BR2_aarch64_be
+	default "i686"       if BR2_i386 && BR2_ARCH="i686"
+	default "i386"       if BR2_i386
+	default "x86_64"     if BR2_x86_64
+	default "powerpc"    if BR2_powerpc || BR2_powerpcle
+	default "ppc64"      if BR2_powerpc64 || BR2_powerpc64le
+	default "microblaze" if BR2_microblaze || BR2_microblazeel
+
+config BR2_PACKAGE_TCFAGENT_ARCH_SUPPORTS
+	bool
+	default y if BR2_PACKAGE_TCFAGENT_ARCH != ""
+
+comment "tcfagent needs a toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_TCFAGENT_ARCH_SUPPORTS
package/tcfagent/S55tcfagent new file +40 -0
new file mode 100755
index 0000000000..4418a543a5
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+DAEMON_PATH=/usr/sbin/tcf-agent
+DAEMON_NAME=tcf-agent
+DAEMON_ARGS="-L- -l0"
+
+PIDFILE=/var/run/$DAEMON_NAME.pid
+[ -r /etc/default/$DAEMON_NAME ] && . /etc/default/$DAEMON_NAME
+
+start() {
+	printf "Starting $DAEMON_NAME: "
+	start-stop-daemon -S -o -q -p $PIDFILE -m -b \
+		-x $DAEMON_PATH -- $DAEMON_ARGS
+
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+
+stop() {
+	printf "Stopping $DAEMON_NAME: "
+	start-stop-daemon -K -o -q -p $PIDFILE \
+		-x $DAEMON_PATH
+
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+
+case "$1" in
+	start)
+	start
+	;;
+	stop)
+	stop
+	;;
+	restart|reload)
+	stop
+	start
+	;;
+	*)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
package/tcfagent/tcfagent.hash new file +5 -0
new file mode 100644
index 0000000000..d46d5206a3
@@ -0,0 +1,5 @@
+# Locally computed:
+sha256  94e9277a52929791417d59b515235bf28ca29ffb05c9e89ad331ebc3256fb5df  org.eclipse.tcf.agent-1.6.0.tar.gz
+
+# Hash for license files:
+sha256  f82d01b74a513bd3504d08136026a5ac2a7e6ff62ebcde391fa74aa222d11ce0  agent/edl-v10.html
package/tcfagent/tcfagent.mk new file +39 -0
new file mode 100644
index 0000000000..1253bb64f5
@@ -0,0 +1,39 @@
+################################################################################
+#
+# TCFAGENT
+#
+################################################################################
+
+TCFAGENT_VERSION = 1.6.0
+# the tar.xz link was broken the time this file got authored
+TCFAGENT_SOURCE = org.eclipse.tcf.agent-$(TCFAGENT_VERSION).tar.gz
+TCFAGENT_SITE = http://git.eclipse.org/c/tcf/org.eclipse.tcf.agent.git/snapshot
+# see https://wiki.spdx.org/view/Legal_Team/License_List/Licenses_Under_Consideration
+TCFAGENT_LICENSE = BSD-3-Clause
+TCFAGENT_LICENSE_FILES = agent/edl-v10.html
+
+TCFAGENT_DEPENDENCIES = util-linux
+TCFAGENT_SUBDIR = agent
+
+# there is not much purpose for the shared lib,
+# if wont be used (unmodifed) outside the tcf-agent application
+TCFAGENT_CONF_OPTS = -DBUILD_SHARED_LIBS=Off
+
+TCFAGENT_ARCH = $(call qstrip,$(BR2_PACKAGE_TCFAGENT_ARCH))
+
+TCFAGENT_CONF_OPTS += -DTCF_MACHINE=$(TCFAGENT_ARCH)
+
+define TCFAGENT_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 package/tcfagent/tcfagent.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/tcfagent.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs ../../../../usr/lib/systemd/system/tcfagent.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/tcfagent.service
+endef
+
+define TCFAGENT_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 package/tcfagent/S55tcfagent \
+		$(TARGET_DIR)/etc/init.d/S55tcfagent
+endef
+
+$(eval $(cmake-package))
package/tcfagent/tcfagent.service new file +9 -0
new file mode 100644
index 0000000000..8d2023b13d
@@ -0,0 +1,9 @@
+[Unit]
+Description=Target Communication Framework Agent
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/tcf-agent -L- -l0
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
2.15.1
#1 lore raw

PATCH v4 1/1 tcfagent: new package

Hello,

Quoted 3 lines · Norbert Lange

Add tcfpackage which contains a service "tcf-agent"

Thanks, I've applied after doing the following changes:

- I've renamed the package to tcf-agent (instead of tcfagent). Indeed, the name of the project is tcf.agent, and the name of the daemon is tcf-agent, so it made sense to use tcf-agent.

- I've added a dependency on BR2_USE_MMU, because the package selects BR2_PACKAGE_UTIL_LINUX_LIBUUID, so it must inherit that dependency.

Thanks a lot for this contribution!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH v4 1/1 tcfagent: new package

In reply to Norbert Lange

Hello,

package/tcfagent/Config.in line 28

Quoted 10 lines · Norbert Lange
package/tcfagent/Config.in new file +10 -0
+config BR2_PACKAGE_TCFAGENT_ARCH
+	string
+	default "arm"        if BR2_arm || BR2_armeb
+	default "a64"        if BR2_aarch64 || BR2_aarch64_be
+	default "i686"       if BR2_i386 && BR2_ARCH="i686"
+	default "i386"       if BR2_i386
+	default "x86_64"     if BR2_x86_64
+	default "powerpc"    if BR2_powerpc || BR2_powerpcle
+	default "ppc64"      if BR2_powerpc64 || BR2_powerpc64le
+	default "microblaze" if BR2_microblaze || BR2_microblazeel

This package fails to build on Microblaze:

http://autobuild.buildroot.net/?reason=tcf-agent-1.6.0

Seems like the Microblaze port is not complete. Perhaps we should simply disable it, and you could report the issue to the upstream developers ?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH v4 1/1 tcfagent: new package

Hi,

yes, please disable it. I will open a bug-report on this.

Norbert

2018-01-03 23:26 GMT+01:00 Thomas Petazzoni
<[email protected]>:

Quoted 30 lines

Hello,

package/tcfagent/Config.in line 28

Quoted 10 lines · Norbert Lange
package/tcfagent/Config.in new file +10 -0
+config BR2_PACKAGE_TCFAGENT_ARCH
+     string
+     default "arm"        if BR2_arm || BR2_armeb
+     default "a64"        if BR2_aarch64 || BR2_aarch64_be
+     default "i686"       if BR2_i386 && BR2_ARCH="i686"
+     default "i386"       if BR2_i386
+     default "x86_64"     if BR2_x86_64
+     default "powerpc"    if BR2_powerpc || BR2_powerpcle
+     default "ppc64"      if BR2_powerpc64 || BR2_powerpc64le
+     default "microblaze" if BR2_microblaze || BR2_microblazeel

This package fails to build on Microblaze:

http://autobuild.buildroot.net/?reason=tcf-agent-1.6.0

Seems like the Microblaze port is not complete. Perhaps we should simply disable it, and you could report the issue to the upstream developers ?

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

#4 lore raw

PATCH v4 1/1 tcfagent: new package

Hello,

Quoted 1 line · Norbert Lange

yes, please disable it.

Please send a patch to do so :-)

Quoted 1 line

I will open a bug-report on this.

Thanks a lot!

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com