From: Thomas Devoogdt <thomas@devoogdt.com>
To: thomas@devoogdt.com
Cc: buildroot@buildroot.org, jorik.devreese@barco.com,
thomas.petazzoni@bootlin.com
Subject: [Buildroot] [PATCH v2] package/sema-linux-ec: add new adlink sema drivers package
Date: Mon, 9 Mar 2026 08:51:43 +0100 [thread overview]
Message-ID: <20260309075143.1526466-1-thomas@devoogdt.com> (raw)
In-Reply-To: <20251223221403.61295-1-thomas@devoogdt.com>
From: Devreese Jorik <jorik.devreese@barco.com>
SEMA (Smart Embedded Management Agent) is an agent used to
manage system health and access the I/O pins through an API.
Signed-off-by: Devreese Jorik <jorik.devreese@barco.com>
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
---
v2: reworked patch
- Added user sw step.
- Fixed help text.
- Fixed hash and license info.
---
package/Config.in | 1 +
...CC-variable-instead-of-hardcoded-gcc.patch | 54 +++++++++++++++++++
package/sema-linux-ec/Config.in | 12 +++++
package/sema-linux-ec/sema-linux-ec.hash | 5 ++
package/sema-linux-ec/sema-linux-ec.mk | 40 ++++++++++++++
5 files changed, 112 insertions(+)
create mode 100644 package/sema-linux-ec/0001-Makefile-use-CC-variable-instead-of-hardcoded-gcc.patch
create mode 100644 package/sema-linux-ec/Config.in
create mode 100644 package/sema-linux-ec/sema-linux-ec.hash
create mode 100644 package/sema-linux-ec/sema-linux-ec.mk
diff --git a/package/Config.in b/package/Config.in
index 07d7e49ae7b..ef1920edb58 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -604,6 +604,7 @@ endmenu
source "package/sane-backends/Config.in"
source "package/sdparm/Config.in"
source "package/sedutil/Config.in"
+ source "package/sema-linux-ec/Config.in"
source "package/setserial/Config.in"
source "package/sg3_utils/Config.in"
source "package/sigrok-cli/Config.in"
diff --git a/package/sema-linux-ec/0001-Makefile-use-CC-variable-instead-of-hardcoded-gcc.patch b/package/sema-linux-ec/0001-Makefile-use-CC-variable-instead-of-hardcoded-gcc.patch
new file mode 100644
index 00000000000..0b8fa8e2a78
--- /dev/null
+++ b/package/sema-linux-ec/0001-Makefile-use-CC-variable-instead-of-hardcoded-gcc.patch
@@ -0,0 +1,54 @@
+From b0fe05883637d006a7f958a9e735b84f4ba6ba90 Mon Sep 17 00:00:00 2001
+From: Devreese Jorik <jorik.devreese@barco.com>
+Date: Mon, 19 Jan 2026 15:00:00 +0000
+Subject: [PATCH] Makefile: use CC variable instead of hardcoded gcc
+
+Allow the compiler to be overridden via the CC variable for
+cross-compilation support.
+
+Upstream: https://github.com/ADLINK/sema-linux-ec/pull/14
+Signed-off-by: Devreese Jorik <jorik.devreese@barco.com>
+Signed-off-by: Hendrik De Vloed <hendrik.devloed@dekimo.com>
+Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
+---
+ Makefile | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 440e377..ad02cf9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -25,7 +25,7 @@ all: libsema.so semautil wdogtest modules
+ driver: modules
+
+ libsema.so: $(SEMA_OBJS)
+- @gcc -shared -fPIC -g -o lib/$@ $^
++ @$(CC) -shared -fPIC -g -o lib/$@ $^
+
+ modules:
+ @make -C /lib/modules/`uname -r`/build M=`pwd` $@
+@@ -91,16 +91,16 @@ app_clean:
+ @rm -f semautil wdogtest app/*.o lib/*.o lib/*.so
+
+ semautil: $(APP_OBJS)
+- @gcc -g -o $@ $^ -Llib -lsema -luuid
++ @$(CC) -g -o $@ $^ -Llib -lsema -luuid
+
+ wdogtest: $(WDOG_OBJS)
+- @gcc $^ -g -o $@
++ @$(CC) $^ -g -o $@
+
+ lib/%.o: lib/%.c
+- @gcc -Wall -I lib -g -fPIC -c $< -o $@
++ @$(CC) -Wall -I lib -g -fPIC -c $< -o $@
+
+ app/%.o: app/%.c
+- @gcc -Wall -I lib -g -fPIC -c $< -o $@
++ @$(CC) -Wall -I lib -g -fPIC -c $< -o $@
+
+ watchdogtest/%.o: watchdogtest/%.c
+- @gcc -Wall -I lib -g -fPIC -c $< -o $@
++ @$(CC) -Wall -I lib -g -fPIC -c $< -o $@
+--
+2.43.0
+
diff --git a/package/sema-linux-ec/Config.in b/package/sema-linux-ec/Config.in
new file mode 100644
index 00000000000..8d6d0e17a53
--- /dev/null
+++ b/package/sema-linux-ec/Config.in
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_SEMA_LINUX_EC
+ bool "sema-linux-ec"
+ depends on !BR2_s390x
+ depends on BR2_LINUX_KERNEL
+ help
+ SEMA (Smart Embedded Management Agent) is an agent used to
+ manage system health and access the I/O pins through an API.
+
+ https://github.com/ADLINK/sema-linux-ec
+
+comment "sema-linux-ec needs a Linux kernel to be built"
+ depends on !BR2_LINUX_KERNEL
diff --git a/package/sema-linux-ec/sema-linux-ec.hash b/package/sema-linux-ec/sema-linux-ec.hash
new file mode 100644
index 00000000000..d32864316e1
--- /dev/null
+++ b/package/sema-linux-ec/sema-linux-ec.hash
@@ -0,0 +1,5 @@
+# locally computed
+sha256 daef5a95e686ce1fa59511280759ccdaf59d41eb698b7c5df0a35e98c0718127 sema-linux-ec-v4.3.12.tar.gz
+sha256 c45298c445058c0f8413c94be71ecedd55f306f3149ed2aea90b0e098ddc8810 LICENSE.BSD3
+sha256 d8c320ffc0030d1b096ae4732b50d2b811cf95e9a9b7377c1127b2563e0a0388 LICENSE.GPLv2
+sha256 2358eef45f799ab496fe93f4791f509524d3d65ca046e562706e62d72f738f20 LICENSE.dual
diff --git a/package/sema-linux-ec/sema-linux-ec.mk b/package/sema-linux-ec/sema-linux-ec.mk
new file mode 100644
index 00000000000..475f8a8c371
--- /dev/null
+++ b/package/sema-linux-ec/sema-linux-ec.mk
@@ -0,0 +1,40 @@
+################################################################################
+#
+# sema-linux-ec
+#
+################################################################################
+
+SEMA_LINUX_EC_VERSION = v4.3.12
+SEMA_LINUX_EC_SITE = $(call github,ADLINK,sema-linux-ec,$(SEMA_LINUX_EC_VERSION))
+SEMA_LINUX_EC_LICENSE = BSD-3-Clause or GPL-2.0
+SEMA_LINUX_EC_LICENSE_FILES = LICENSE.BSD3 LICENSE.GPLv2 LICENSE.dual
+
+SEMA_LINUX_EC_MAKE_OPTS = \
+ $(LINUX_MAKE_FLAGS) \
+ KERNELDIR=$(LINUX_DIR)
+
+define SEMA_LINUX_EC_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(SEMA_LINUX_EC_MAKE_OPTS) -C $(@D) \
+ libsema.so semautil wdogtest
+endef
+
+define SEMA_LINUX_EC_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/lib/libsema.so $(TARGET_DIR)/usr/lib/libsema.so
+ $(INSTALL) -D -m 0755 $(@D)/semautil $(TARGET_DIR)/usr/bin/semautil
+ $(INSTALL) -D -m 0755 $(@D)/wdogtest $(TARGET_DIR)/usr/bin/wdogtest
+endef
+
+define SEMA_LINUX_EC_LINUX_CONFIG_FIXUPS
+ $(call KCONFIG_ENABLE_OPT,CONFIG_BACKLIGHT_CLASS_DEVICE)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_GPIO_SYSFS)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_GPIOLIB)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_HWMON)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_I2C)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_I2C_BOARDINFO)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_NVMEM)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_WATCHDOG)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_WATCHDOG_CORE)
+endef
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2026-03-09 7:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 22:14 [Buildroot] [PATCH] package/sema-linux-ec: add ADLINK sema drivers package Thomas Devoogdt
2026-03-09 7:51 ` Thomas Devoogdt [this message]
2026-03-09 15:57 ` [Buildroot] [PATCH v3] package/sema-linux-ec: add new adlink " Thomas Devoogdt
2026-03-09 21:10 ` [Buildroot] [PATCH v4] " Thomas Devoogdt
2026-03-10 9:09 ` [Buildroot] [PATCH v5] " Thomas Devoogdt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260309075143.1526466-1-thomas@devoogdt.com \
--to=thomas@devoogdt.com \
--cc=buildroot@buildroot.org \
--cc=jorik.devreese@barco.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox