Skip to contentSkip to conversation

libevl: Add debian package config

PATCH In review Hannes Diethelm 4 participants 10 messages Jul 17 – Jul 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover libevl: Add debian package config

This patch adds a debian package config that allows to build a deb's using dpkg-buildpackage -b -uc.

The packages are libevl / libevl-test similar to[1]. However, latmus is placed in libevl. One might not need the tests but still want to use latmus.

Additionally, libevl installs /usr/lib/udev/rules.d/90-libevl.rules which sets all evl device files to group evl, g+rw. libevl.postinst adds this group and triggers an udev reload.

This allows to use libevl without root. However, using SCHED_FIFO still needs either root or setcap cap_sys_nice+ep and possibly some other tweaks. Some tests and my application work with cap_sys_nice+ep. However, for example latmus fails due to unknown reasons. The debian packages sets no capabilities but this could be added if desired.

Caveats:

The test ptrace-sync fails with <timeout waiting for gdb>. dh_strip -Xptrace-sync from[1] does not help and it is not needed: When libevl-test-dbgsym is installed, the symbols are available but the test still fails. With dh_strip -Xptrace-sync, the symbols are not found:
warning: could not find '.gnu_debugaltlink' file for /usr/libexec/evl/tests/ptrace-sync

If linux-evl is also built and installed as a debian package, linux-libc-dev can not be installed due to /usr/include/evl/*-abi.h are both installed by libevl and linux-libc-dev from the kernel build. However, installing linux-libc-dev from debian trixie works fine.

[1] https://gitlab.com/Xenomai/xenomai-images/-/tree/master/recipes-xenomai/libevl/files/debian?ref_type=heads

Hannes Diethelm (1):
debian: add debian package config

 debian/README.Debian        |  6 ++++
 debian/changelog            |  5 ++++
 debian/control              | 33 ++++++++++++++++++++++
 debian/copyright            | 55 +++++++++++++++++++++++++++++++++++++
 debian/libevl-test.install  |  2 ++
 debian/libevl.install       | 11 ++++++++
 debian/libevl.postinst      | 50 +++++++++++++++++++++++++++++++++
 debian/libevl.postrm        | 41 +++++++++++++++++++++++++++
 debian/rules                | 22 +++++++++++++++
 debian/source/format        |  1 +
 debian/udev/90-libevl.rules | 12 ++++++++
 11 files changed, 238 insertions(+)
 create mode 100644 debian/README.Debian
 create mode 100644 debian/changelog
 create mode 100644 debian/control
 create mode 100644 debian/copyright
 create mode 100644 debian/libevl-test.install
 create mode 100644 debian/libevl.install
 create mode 100644 debian/libevl.postinst
 create mode 100644 debian/libevl.postrm
 create mode 100755 debian/rules
 create mode 100644 debian/source/format
 create mode 100644 debian/udev/90-libevl.rules
Signature · 1 line
2.47.3
#1 lore raw

PATCH 1/1 debian: add debian package config

---
 debian/README.Debian        |  6 ++++
 debian/changelog            |  5 ++++
 debian/control              | 33 ++++++++++++++++++++++
 debian/copyright            | 55 +++++++++++++++++++++++++++++++++++++
 debian/libevl-test.install  |  2 ++
 debian/libevl.install       | 11 ++++++++
 debian/libevl.postinst      | 50 +++++++++++++++++++++++++++++++++
 debian/libevl.postrm        | 41 +++++++++++++++++++++++++++
 debian/rules                | 22 +++++++++++++++
 debian/source/format        |  1 +
 debian/udev/90-libevl.rules | 12 ++++++++
 11 files changed, 238 insertions(+)
 create mode 100644 debian/README.Debian
 create mode 100644 debian/changelog
 create mode 100644 debian/control
 create mode 100644 debian/copyright
 create mode 100644 debian/libevl-test.install
 create mode 100644 debian/libevl.install
 create mode 100644 debian/libevl.postinst
 create mode 100644 debian/libevl.postrm
 create mode 100755 debian/rules
 create mode 100644 debian/source/format
 create mode 100644 debian/udev/90-libevl.rules
debian/README.Debian new file +6 -0
new file mode 100644
index 0000000..db81e67
@@ -0,0 +1,6 @@
+libevl for Debian
+----------------
+
+libevl creates an evl group. Members of this group can use the kernel realtime interface.
+
+ -- Hannes Diethelm <[email protected]>  Wed, 25 Mar 2026 12:22:44 +0100
debian/changelog new file +5 -0
new file mode 100644
index 0000000..099e5c0
@@ -0,0 +1,5 @@
+libevl (59) UNRELEASED; urgency=medium
+
+  * Update r59
+
+ -- Hannes Diethelm <[email protected]>  Mon, 13 Jul 2026 10:48:21 +0200
debian/control new file +33 -0
new file mode 100644
index 0000000..152b339
@@ -0,0 +1,33 @@
+Source: libevl
+Section: devel
+Priority: extra
+Maintainer: Xenomai <[email protected]>
+Rules-Requires-Root: no
+Build-Depends:
+ debhelper-compat (= 13),
+ meson,
+ pkgconf,
+ libbpf-dev,
+ cpio,
+Standards-Version: 4.7.2
+Homepage: https://v4.xenomai.org/
+
+Package: libevl
+Architecture: any
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+Recommends:
+ udev,
+Description: libevl libraries and tools
+  Xenomai4 EVL userspace libraries and tools
+
+Package: libevl-test
+Architecture: any
+Depends:
+ libevl,
+ gdb,
+ ${shlibs:Depends},
+ ${misc:Depends},
+Description: libevl test suite
+  Xenomai4 EVL test suite
debian/copyright new file +55 -0

55 lines not on this page · raw message

debian/libevl-test.install new file +2 -0
new file mode 100644
index 0000000..f835c51
@@ -0,0 +1,2 @@
+usr/libexec/evl/evl-test
+usr/libexec/evl/tests/*
debian/libevl.install new file +11 -0
new file mode 100644
index 0000000..6014542
@@ -0,0 +1,11 @@
+usr/bin/evl
+usr/bin/oob-*
+usr/bin/latmus
+usr/include/*
+usr/lib/*/pkgconfig/evl.pc
+usr/lib/*/libevl.a
+usr/lib/*/libevl.so*
+usr/libexec/evl/evl-[!t]*
+usr/libexec/evl/*trace*
+usr/libexec/evl/kconf-checklist.evl
+debian/udev/90-libevl.rules usr/lib/udev/rules.d/
debian/libevl.postinst new file +50 -0

50 lines not on this page · raw message

debian/libevl.postrm new file +41 -0

41 lines not on this page · raw message

debian/rules new file +22 -0
new file mode 100755
index 0000000..7028f23
@@ -0,0 +1,22 @@
+#!/usr/bin/make -f
+
+#export DH_VERBOSE = 1
+
+#Default: linux-evl is in same folder
+# Use UAPI=FULL_PATH dpkg-buildpackage ... to specify custom location
+#Not recommended to use /usr/include with debian packages due to:
+# - libevl installs most headers there except asm/evl
+# - linux-libc-dev installs all headers but conflicts with libevl
+#   due to some headers are installed at the same location
+UAPI ?= $(CURDIR)/../linux-evl
+
+ifeq ("$(wildcard $(UAPI))","")
+$(error UAPI not found in $(UAPI))
+endif
+
+%:
+	dh $@ --buildsystem=meson
+
+override_dh_auto_configure:
+	dh_auto_configure --buildsystem=meson -- -Duapi=$(UAPI)
+
debian/source/format new file +1 -0
new file mode 100644
index 0000000..163aaf8
@@ -0,0 +1 @@
+3.0 (quilt)
debian/udev/90-libevl.rules new file +12 -0
new file mode 100644
index 0000000..2615982
@@ -0,0 +1,12 @@
+# Xenomai4 EVL devices
+SUBSYSTEM=="evl", MODE="0660", GROUP="evl"
+KERNEL=="realtime", SUBSYSTEM=="clock", MODE="0660", GROUP="evl"
+KERNEL=="monotonic", SUBSYSTEM=="clock", MODE="0660", GROUP="evl"
+KERNEL=="monotonic_raw", SUBSYSTEM=="clock", MODE="0660", GROUP="evl"
+KERNEL=="clone", SUBSYSTEM=="monitor", MODE="0660", GROUP="evl"
+KERNEL=="clone", SUBSYSTEM=="observable", MODE="0660", GROUP="evl"
+KERNEL=="clone", SUBSYSTEM=="proxy", MODE="0660", GROUP="evl"
+KERNEL=="clone", SUBSYSTEM=="thread", MODE="0660", GROUP="evl"
+KERNEL=="clone", SUBSYSTEM=="xbuf", MODE="0660", GROUP="evl"
+KERNEL=="latmus", SUBSYSTEM=="latmus", MODE="0660", GROUP="evl"
+KERNEL=="hectic", SUBSYSTEM=="hectic", MODE="0660", GROUP="evl"
Signature · 1 line
2.47.3
#2 lore raw
In reply to Hannes Diethelm

Hi Hannes,

thanks for carrying this over.

Quoted 6 lines · Hannes Diethelm

This patch adds a debian package config that allows to build a deb's using dpkg-buildpackage -b -uc.

The packages are libevl / libevl-test similar to[1]. However, latmus is placed in libevl. One might not need the tests but still want to use latmus.

For the purpose of tuning the core, or what is the reasoning here?

Quoted 10 lines

Additionally, libevl installs /usr/lib/udev/rules.d/90-libevl.rules which sets all evl device files to group evl, g+rw. libevl.postinst adds this group and triggers an udev reload.

This allows to use libevl without root. However, using SCHED_FIFO still needs either root or setcap cap_sys_nice+ep and possibly some other tweaks. Some tests and my application work with cap_sys_nice+ep. However, for example latmus fails due to unknown reasons. The debian packages sets no capabilities but this could be added if desired.

Quoted 6 lines

Caveats:

The test ptrace-sync fails with <timeout waiting for gdb>. dh_strip -Xptrace-sync from[1] does not help and it is not needed: When libevl-test-dbgsym is installed, the symbols are available but the test still fails. With dh_strip -Xptrace-sync, the symbols are not found:
warning: could not find '.gnu_debugaltlink' file for /usr/libexec/evl/tests/ptrace-sync

But the package built by xenomai-images does not have this problem and runs the ptrace test successfully. Already dug into the key differences?

Quoted 4 lines

If linux-evl is also built and installed as a debian package, linux-libc-dev can not be installed due to /usr/include/evl/*-abi.h are both installed by libevl and linux-libc-dev from the kernel build. However, installing linux-libc-dev from debian trixie works fine.

This looks wrong: The kernel is providing us with a different UAPI, thus also needs to deliver an alternative linux-libc-dev package. It should be the role of libevl to deliver those headers as it has no knowledge about the actual kernel in use here. That's why xenomai-images is generating a new linux-libc-dev and is not relying on libevl here.

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center
#3 lore raw

Am 20.07.26 um 16:30 schrieb Jan Kiszka:

Quoted 3 lines

Hi Hannes,

thanks for carrying this over.

Thanks for all the feedback.

Quoted 10 lines · Hannes Diethelm
Quoted 6 lines

This patch adds a debian package config that allows to build a deb's using dpkg-buildpackage -b -uc.

The packages are libevl / libevl-test similar to[1]. However, latmus is placed in libevl. One might not need the tests but still want to use latmus.

For the purpose of tuning the core, or what is the reasoning here?

Yes exactly. One might need latmus but won't care about the tests.

Based on the comment from Florian, it would probably make more sense to create more packages:

- libevl (only library)
- libevl-bin (evl / latmus / oob-* tidbits)
- libevl-test (tests)
- libevl-dev (headers / libevl.a)

Quoted 13 lines
Quoted 13 lines

Additionally, libevl installs /usr/lib/udev/rules.d/90-libevl.rules which sets all evl device files to group evl, g+rw. libevl.postinst adds this group and triggers an udev reload.

This allows to use libevl without root. However, using SCHED_FIFO still needs either root or setcap cap_sys_nice+ep and possibly some other tweaks. Some tests and my application work with cap_sys_nice+ep. However, for example latmus fails due to unknown reasons. The debian packages sets no capabilities but this could be added if desired.

Caveats:

Quoted 7 lines
Quoted 4 lines

The test ptrace-sync fails with <timeout waiting for gdb>. dh_strip -Xptrace-sync from[1] does not help and it is not needed: When libevl-test-dbgsym is installed, the symbols are available but the test still fails. With dh_strip -Xptrace-sync, the symbols are not found:
warning: could not find '.gnu_debugaltlink' file for /usr/libexec/evl/tests/ptrace-sync

But the package built by xenomai-images does not have this problem and runs the ptrace test successfully. Already dug into the key differences?

Not yet. Might be just a different gdb version or path issue. I am using Debian Trixie.

Is there a way to download this images? I've seen there is a way to build them locally, i can also try this.

Quoted 6 lines
Quoted 5 lines

If linux-evl is also built and installed as a debian package, linux-libc-dev can not be installed due to /usr/include/evl/*-abi.h are both installed by libevl and linux-libc-dev from the kernel build. However, installing linux-libc-dev from debian trixie works fine.

Quoted 6 lines

This looks wrong: The kernel is providing us with a different UAPI, thus also needs to deliver an alternative linux-libc-dev package. It should be the role of libevl to deliver those headers as it has no knowledge about the actual kernel in use here. That's why xenomai-images is generating a new linux-libc-dev and is not relying on libevl here.

Yes, Philippe sent me the hint with the -Dinstall-uapi=false switch, thanks.

One remaining issue is the versioning / dependency's. For now, to keep it simple, I just used the libevl tag as the version. And it doesn't recommend a xenomai4 kernel.

For now, the packages are:
libevl_59_amd64.deb
libevl-test_59_amd64.deb dep libevl >= 59 linux-image-6.12.90-cip24-xenomai4-r59_6.12.90-3_amd64.deb (Withouth PREEMT_RT) linux-image-6.12.90-cip24-xenomai4-r59-rt_6.12.90-3_amd64.deb (With PREEMT_RT)

I am working here [1] on creating Debian xenomai4 packages for linuxcnc. Not perfect but does the job. It's still WIP but a few people got this already working without knowledge how to build kernels.
I did not yet push the latest version and I have to change from pushing the binary's to github releases.

With the uapi installed with linux-libc-dev, libevl has to depend on the right linux-libc-dev.

Version 59 is not really correct. The kernel has EVL ABI 45. Libevl has API 36, needs API >= 45. For kernel dependency's, the ABI version is important, right?

For libevl, it could be either the API = 36 / dso_version = 8.0.0 / version = 0.59.

Variant with API/ABI as version:
- libevl 36 recommends linux-image-xenomai4 >= 45 or linux-image-xenomai4-rt >= 45
- libevl-bin 36 dep libevl >= 36
- libevl-test 36 dep libevl >= 36
- libevl-dev 36 dep libevl >= 36 linux-libc-dev >= 1:45

Dependency packages, needed to convert the ABI versioning into kernel versioning:
- linux-image-xenomai4 45 dep linux-image-6.12.90-cip24-xenomai4-45 or other kernel versions
- linux-image-xenomai4-rt 45 dep linux-image-6.12.90-cip24-xenomai4-rt-45 or other kernel versions
- linux-libc-dev 1:45 dep linux-libc-dev-xenomai4-45

Kernel packages:
- linux-image-6.12.90-cip24-xenomai4-45 6.12.90
- linux-image-6.12.90-cip24-xenomai4-rt-45 6.12.90
- linux-libc-dev-xenomai4-45 6.12.90

To create a linux-libc-dev-xenomai4-45 package, I would have to add a patch for linux-evl, the standard kernel debian package system doesn't support custom names for linux-libc-dev. But this should be not to complicated.

It's the first Debian package I am working on that's not only for me. I have to read a bit more in the doc's how this dependency's are normally created properly.

Also linux-libc-dev 1:45 is a bit dirty: Using the epoch to replace the standard linux-libc-dev by a dependency package that will not be replaced by the latest stock one. It should work tough.

Alternatives:
-Install the abi with libevl
-Create a linux-libc-dev-xenomai4 package from linux-evl and depend on that / remove the evl headers from linux-libc-dev
so linux-libc-dev stock can be installed together with linux-libc-dev-xenomai4. I compared the content, most evl related files are new, only fnctl.h has
#define O_OOB 010000000000
added. However, I don't see any usage in libevl. So this should work.
-Leave the dependency's on the kernel packages away and solve this by documentation
However, you would have to place a hold on linux-libc-dev so it doesn't get replaced as soon as your OS has a newer kernel.

Do you have other ideas how to solve the version / dependency's / linux-libc-dev issue?

For now I named the kernel packages -xenomai4 but I am thinking about changing to -evl or xenomai-evl. What is more appropriate?

Quoted 2 lines

Jan

[1] https://github.com/hdiethelm/xenomai4-linuxcnc

#4 lore raw
Quoted 3 lines · Hannes Diethelm

Version 59 is not really correct. The kernel has EVL ABI 45. Libevl has API 36, needs API >= 45. For kernel dependency's, the ABI version is important, right?

We have two distinct revision levels:

- the ABI level between kernel and userland (syscalls and definitions).

- the API level which is specific to libevl, allowing apps to determine whether some feature/routine/behavior is present or not. This is more of a source-level thing. Multiple API revisions may be compatible with a single ABI revision, and conversely.

You will find EVL_ABI_PREREQ in include/evl/version.h, this is the minimum ABI revision which that particular instance of libevl can work with. This is what you need to keep in sync with the core available from the kernel part.

Signature · 1 line
Philippe.
#5 lore raw

Am 21.07.26 um 10:13 schrieb Philippe Gerum:

Quoted 14 lines
Quoted 3 lines · Hannes Diethelm

Version 59 is not really correct. The kernel has EVL ABI 45. Libevl has API 36, needs API >= 45. For kernel dependency's, the ABI version is important, right?

We have two distinct revision levels:

- the ABI level between kernel and userland (syscalls and definitions).

- the API level which is specific to libevl, allowing apps to determine whether some feature/routine/behavior is present or not. This is more of a source-level thing. Multiple API revisions may be compatible with a single ABI revision, and conversely.

Quoted 5 lines

You will find EVL_ABI_PREREQ in include/evl/version.h, this is the minimum ABI revision which that particular instance of libevl can work with. This is what you need to keep in sync with the core available from the kernel part.

Yes, you mentioned this in an other thread.

So this versioning would make the most sense I think, right?

application depends libevl >= 36
libevl version 36 recommends kernel-evl >= 45 libevl-dev version 36 depends linux-libc-evl-dev >= 45

For the library, it is simple. However, for the kernel it is a bit annoying do to kernel packages have the kernel version (6.12.90 for example) as default version. I'm still thinking how to solve this the proper way. Might be this can be solved by Provides: kernel-evl 45

An other topic: With the udev rules (90-libevl.rules) provided in this patch, I now got latmus now running without root.

latmus/latmus.c +1 -1
index 9b3ed1e..4e88326 100644
@@ -868,7 +868,7 @@ int main(int argc, char *const argv[])
                               "period=%d microseconds (may take a while)\n",
                                get_refclock_name(), period_usecs);
 
-               ret = evl_attach_self("/clock-tuner:%d", getpid());
+               ret = evl_attach_self("clock-tuner:%d", getpid());
                if (ret < 0)
                        error(1, -ret, "evl_attach_self() failed");
 
latmus/timer.c +1 -1
index b84c71c..322511d 100644
@@ -36,7 +36,7 @@ void *timer_responder(void *arg)
        int ret, efd;
 
        /* Make it a public thread only for demo purpose. */
-       efd = evl_attach_self("/timer-responder:%d", getpid());
+       efd = evl_attach_self("timer-responder:%d", getpid());
        if (efd < 0)
                error(1, -efd, "evl_attach_self() failed");
 

sudo setcap cap_sys_nice+ep latmus

Now latmus works as user.

It looks like according to [1], the / forces EVL_CLONE_PUBLIC. Somehow, EVL_CLONE_PUBLIC does only work with root. Looks like there is a race condition between the device file creation and setting the access rules.

I did some tests: As long as user access is given, it works but if only group access is given, it fails. user is member of evl group.

chown -R root:evl /dev/evl/ -> Fail
chown -R root:user /dev/evl/ -> Fail
chown -R user:user /dev/evl/ -> Ok

This fixes it but it's not nice:

lib/sys.c +1 -0
index f7fde82..ff6b95f 100644
@@ -334,6 +334,7 @@ int evl_create_element(const char *type, const char *name,
                        goto out_new;
                }
 
+               for(volatile int i=0;i<1000000000;i++);
                efd = open(edevname, O_RDWR);
                if (efd < 0) {
                        ret = -errno;

[1] https://v4.xenomai.org/core/user-api/thread/index.html#evl_attach_self

#6 lore raw
In reply to Hannes Diethelm
Quoted 20 lines · Hannes Diethelm

Am 20.07.26 um 16:30 schrieb Jan Kiszka:

Quoted 3 lines

Hi Hannes,

thanks for carrying this over.

Thanks for all the feedback.

Quoted 10 lines · Hannes Diethelm
Quoted 6 lines

This patch adds a debian package config that allows to build a deb's using dpkg-buildpackage -b -uc.

The packages are libevl / libevl-test similar to[1]. However, latmus is placed in libevl. One might not need the tests but still want to use latmus.

For the purpose of tuning the core, or what is the reasoning here?

Yes exactly. One might need latmus but won't care about the tests.

Quoted 8 lines

Based on the comment from Florian, it would probably make more sense to create more packages:

- libevl (only library)
- libevl-bin (evl / latmus / oob-* tidbits)
- libevl-test (tests)
- libevl-dev (headers / libevl.a)

Alternatively, maybe there is a way to split off the tuning feature from latmus tool, like we have with autotune in xenomai3.

Quoted 27 lines
Quoted 27 lines
Quoted 26 lines

Additionally, libevl installs /usr/lib/udev/rules.d/90-libevl.rules which sets all evl
device files to group evl, g+rw. libevl.postinst adds this group and triggers an udev reload.

This allows to use libevl without root. However, using SCHED_FIFO still needs either root or setcap cap_sys_nice+ep and possibly some other tweaks.
Some tests and my application work with cap_sys_nice+ep. However, for example latmus fails
due to unknown reasons. The debian packages sets no capabilities but this could be added
if desired.

Caveats:

The test ptrace-sync fails with <timeout waiting for gdb>. dh_strip - Xptrace-sync from[1]
does not help and it is not needed: When libevl-test-dbgsym is installed, the symbols are
available but the test still fails. With dh_strip -Xptrace-sync, the symbols are not found:
warning: could not find '.gnu_debugaltlink' file for /usr/libexec/ evl/tests/ptrace-sync

Quoted 9 lines
Quoted 2 lines

But the package built by xenomai-images does not have this problem and runs the ptrace test successfully. Already dug into the key differences?

Not yet. Might be just a different gdb version or path issue. I am using Debian Trixie.

Is there a way to download this images? I've seen there is a way to build them locally, i can also try this.

We do not ship pre-built images, you would have to build your own image here.

Quoted 97 lines
Quoted 9 lines
Quoted 8 lines

If linux-evl is also built and installed as a debian package, linux- libc-dev can not be
installed due to /usr/include/evl/*-abi.h are both installed by libevl and linux-libc-dev
from the kernel build. However, installing linux-libc-dev from debian trixie works fine.

Quoted 6 lines

This looks wrong: The kernel is providing us with a different UAPI, thus also needs to deliver an alternative linux-libc-dev package. It should be the role of libevl to deliver those headers as it has no knowledge about the actual kernel in use here. That's why xenomai-images is generating a new linux-libc-dev and is not relying on libevl here.

Yes, Philippe sent me the hint with the -Dinstall-uapi=false switch, thanks.

One remaining issue is the versioning / dependency's. For now, to keep it simple, I just used the libevl tag
as the version. And it doesn't recommend a xenomai4 kernel.

For now, the packages are:
libevl_59_amd64.deb
libevl-test_59_amd64.deb dep libevl >= 59 linux-image-6.12.90-cip24-xenomai4-r59_6.12.90-3_amd64.deb (Withouth PREEMT_RT) linux-image-6.12.90-cip24-xenomai4-r59-rt_6.12.90-3_amd64.deb (With PREEMT_RT)

I am working here [1] on creating Debian xenomai4 packages for linuxcnc. Not perfect but does the job. It's still WIP
but a few people got this already working without knowledge how to build kernels.
I did not yet push the latest version and I have to change from pushing the binary's to github releases.

With the uapi installed with linux-libc-dev, libevl has to depend on the right linux-libc-dev.

Version 59 is not really correct. The kernel has EVL ABI 45. Libevl has API 36, needs API >= 45.
For kernel dependency's, the ABI version is important, right?

For libevl, it could be either the API = 36 / dso_version = 8.0.0 / version = 0.59.

Variant with API/ABI as version:
- libevl 36 recommends linux-image-xenomai4 >= 45 or linux-image- xenomai4-rt >= 45
- libevl-bin 36 dep libevl >= 36
- libevl-test 36 dep libevl >= 36
- libevl-dev 36 dep libevl >= 36 linux-libc-dev >= 1:45

Dependency packages, needed to convert the ABI versioning into kernel versioning:
- linux-image-xenomai4 45 dep linux-image-6.12.90-cip24-xenomai4-45 or other kernel versions
- linux-image-xenomai4-rt 45 dep linux-image-6.12.90-cip24-xenomai4- rt-45 or other kernel versions
- linux-libc-dev 1:45 dep linux-libc-dev-xenomai4-45

Kernel packages:
- linux-image-6.12.90-cip24-xenomai4-45 6.12.90
- linux-image-6.12.90-cip24-xenomai4-rt-45 6.12.90
- linux-libc-dev-xenomai4-45 6.12.90

To create a linux-libc-dev-xenomai4-45 package, I would have to add a patch for linux-evl, the standard
kernel debian package system doesn't support custom names for linux- libc-dev. But this should be not to
complicated.

It's the first Debian package I am working on that's not only for me. I have to read a bit more in the
doc's how this dependency's are normally created properly.

Also linux-libc-dev 1:45 is a bit dirty: Using the epoch to replace the standard linux-libc-dev by a dependency
package that will not be replaced by the latest stock one. It should work tough.

Alternatives:

(quoted diff) +0 -2
-Install the abi with libevl
-Create a linux-libc-dev-xenomai4 package from linux-evl and depend on

that / remove the evl headers from linux-libc-dev
 so linux-libc-dev stock can be installed together with linux-libc-dev- xenomai4. I compared the content, most evl related files
 are new, only fnctl.h has
 #define O_OOB        010000000000
 added. However, I don't see any usage in libevl. So this should work. -Leave the dependency's on the kernel packages away and solve this by documentation
 However, you would have to place a hold on linux-libc-dev so it doesn't get replaced as soon as your OS has a newer kernel.

Quoted 5 lines

Do you have other ideas how to solve the version / dependency's / linux- libc-dev issue?

For now I named the kernel packages -xenomai4 but I am thinking about changing to -evl or xenomai-evl. What is more appropriate?

The topic is complicated because neither Debian nor other packaging systems I know allow to express this two-dimensional version dependency (>= ABI version X, latest kernel Y). If you encode the ABI into the package version as well, you are folding that version matrix into a single version number (>= abi-X-kernel-Y, or >= kernel-Y-ABI-X) - none is perfect.

If your target audience for those packages primarily consists of beginners, it will be best to model it via a lock-step between libevl and some kernel package that carries a specific ABI version in its name (linux-image-evlX_kernel-ver-Y etc.). This implies creating a linux-libc-dev flavor as well (linux-libc-dev-evlX or so). That package should carry Provides:, Conflicts:, and Replaces: for linux-libc-dev in its metadata.

We side-step all these issues in xenomai-images by generating and installing a set of custom packages in a curated environment where upstream will not be able to replace the self-build xenomai packages (preferences are set accordingly for local repo with those packages).

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center
#7 lore raw

Am 21.07.26 um 12:37 schrieb Jan Kiszka:

Quoted 24 lines · Hannes Diethelm
Quoted 23 lines

Am 20.07.26 um 16:30 schrieb Jan Kiszka:

Quoted 3 lines

Hi Hannes,

thanks for carrying this over.

Thanks for all the feedback.

Quoted 10 lines · Hannes Diethelm
Quoted 6 lines

This patch adds a debian package config that allows to build a deb's using dpkg-buildpackage -b -uc.

The packages are libevl / libevl-test similar to[1]. However, latmus is placed in libevl. One might not need the tests but still want to use latmus.

For the purpose of tuning the core, or what is the reasoning here?

Yes exactly. One might need latmus but won't care about the tests.

Based on the comment from Florian, it would probably make more sense to create more packages:

Quoted 8 lines
Quoted 5 lines

- libevl (only library)
- libevl-bin (evl / latmus / oob-* tidbits)
- libevl-test (tests)
- libevl-dev (headers / libevl.a)

Alternatively, maybe there is a way to split off the tuning feature from latmus tool, like we have with autotune in xenomai3.

latmus is not that big, 56k. If you are really tight on space on an embedded system, I guess using Debian packages is anyway not the way to go.

The actual sizes in k are, queried by dpkg-deb -f
libevl_59-2_amd64.deb 522
libevl-dbgsym_59-2_amd64.deb 336
libevl-test_59-2_amd64.deb 1484
libevl-test-dbgsym_59-2_amd64.deb 1618

With the proposed structure, it would be:
libevl_59-3_amd64.deb 90

libevl-dbgsym_59-3_amd64.deb       110
libevl-bin_59-3_amd64.deb          212
libevl-bin-dbgsym_59-3_amd64.deb   234
libevl-dev_59-3_amd64.deb          196

libevl-test_59-3_amd64.deb 1484
libevl-test-dbgsym_59-3_amd64.deb 1618

Other packages have similar structures, to name a few:
liblapack-dev - Library of linear algebra routines 3 - static version liblapack-doc - Library of linear algebra routines 3 - documentation liblapack-test - Library of linear algebra routines 3 - testing programs liblapack3 - Library of linear algebra routines 3 - shared version

libbpf-tools - tools for BPF Compiler Collection based on libbpf (BTF and CO-RE) libbpf-dev - eBPF helper library (development files)
libbpf1 - eBPF helper library (shared library)

libcap-dev - POSIX 1003.1e capabilities (development) libcap2 - POSIX 1003.1e capabilities (library) libcap2-bin - POSIX 1003.1e capabilities (utilities)

That matches well with:
libevl - libevl library (shared library)
libevl-bin - libevl tools
libevl-dev - libevl library (development files)
libevl-test - libevl test suite

Only difference: Many libs have a stuffix number for the major version to be able to install more than one. I think this is not needed for libevl.

Is this fine? I have to do a few checks if all files are in the correct package before I submit a patch v2.

Also the ptrace-sync test / non-root latmus is still open.

Quoted 141 lines
Quoted 28 lines
Quoted 28 lines
Quoted 27 lines

Additionally, libevl installs /usr/lib/udev/rules.d/90-libevl.rules which sets all evl
device files to group evl, g+rw. libevl.postinst adds this group and triggers an udev reload.

This allows to use libevl without root. However, using SCHED_FIFO still needs either root or setcap cap_sys_nice+ep and possibly some other tweaks.
Some tests and my application work with cap_sys_nice+ep. However, for example latmus fails
due to unknown reasons. The debian packages sets no capabilities but this could be added
if desired.

Caveats:

The test ptrace-sync fails with <timeout waiting for gdb>. dh_strip - Xptrace-sync from[1]
does not help and it is not needed: When libevl-test-dbgsym is installed, the symbols are
available but the test still fails. With dh_strip -Xptrace-sync, the symbols are not found:
warning: could not find '.gnu_debugaltlink' file for /usr/libexec/ evl/tests/ptrace-sync

Quoted 9 lines
Quoted 2 lines

But the package built by xenomai-images does not have this problem and runs the ptrace test successfully. Already dug into the key differences?

Not yet. Might be just a different gdb version or path issue. I am using Debian Trixie.

Is there a way to download this images? I've seen there is a way to build them locally, i can also try this.

We do not ship pre-built images, you would have to build your own image here.

Quoted 100 lines
Quoted 9 lines
Quoted 8 lines

If linux-evl is also built and installed as a debian package, linux- libc-dev can not be
installed due to /usr/include/evl/*-abi.h are both installed by libevl and linux-libc-dev
from the kernel build. However, installing linux-libc-dev from debian trixie works fine.

Quoted 6 lines

This looks wrong: The kernel is providing us with a different UAPI, thus also needs to deliver an alternative linux-libc-dev package. It should be the role of libevl to deliver those headers as it has no knowledge about the actual kernel in use here. That's why xenomai-images is generating a new linux-libc-dev and is not relying on libevl here.

Yes, Philippe sent me the hint with the -Dinstall-uapi=false switch, thanks.

One remaining issue is the versioning / dependency's. For now, to keep it simple, I just used the libevl tag
as the version. And it doesn't recommend a xenomai4 kernel.

For now, the packages are:
libevl_59_amd64.deb
libevl-test_59_amd64.deb dep libevl >= 59 linux-image-6.12.90-cip24-xenomai4-r59_6.12.90-3_amd64.deb (Withouth PREEMT_RT) linux-image-6.12.90-cip24-xenomai4-r59-rt_6.12.90-3_amd64.deb (With PREEMT_RT)

I am working here [1] on creating Debian xenomai4 packages for linuxcnc. Not perfect but does the job. It's still WIP
but a few people got this already working without knowledge how to build kernels.
I did not yet push the latest version and I have to change from pushing the binary's to github releases.

With the uapi installed with linux-libc-dev, libevl has to depend on the right linux-libc-dev.

Version 59 is not really correct. The kernel has EVL ABI 45. Libevl has API 36, needs API >= 45.
For kernel dependency's, the ABI version is important, right?

For libevl, it could be either the API = 36 / dso_version = 8.0.0 / version = 0.59.

Variant with API/ABI as version:
- libevl 36 recommends linux-image-xenomai4 >= 45 or linux-image- xenomai4-rt >= 45
- libevl-bin 36 dep libevl >= 36
- libevl-test 36 dep libevl >= 36
- libevl-dev 36 dep libevl >= 36 linux-libc-dev >= 1:45

Dependency packages, needed to convert the ABI versioning into kernel versioning:
- linux-image-xenomai4 45 dep linux-image-6.12.90-cip24-xenomai4-45 or other kernel versions
- linux-image-xenomai4-rt 45 dep linux-image-6.12.90-cip24-xenomai4- rt-45 or other kernel versions
- linux-libc-dev 1:45 dep linux-libc-dev-xenomai4-45

Kernel packages:
- linux-image-6.12.90-cip24-xenomai4-45 6.12.90
- linux-image-6.12.90-cip24-xenomai4-rt-45 6.12.90
- linux-libc-dev-xenomai4-45 6.12.90

To create a linux-libc-dev-xenomai4-45 package, I would have to add a patch for linux-evl, the standard
kernel debian package system doesn't support custom names for linux- libc-dev. But this should be not to
complicated.

It's the first Debian package I am working on that's not only for me. I have to read a bit more in the
doc's how this dependency's are normally created properly.

Also linux-libc-dev 1:45 is a bit dirty: Using the epoch to replace the standard linux-libc-dev by a dependency
package that will not be replaced by the latest stock one. It should work tough.

Alternatives:

(quoted diff) +0 -2
-Install the abi with libevl
-Create a linux-libc-dev-xenomai4 package from linux-evl and depend on

that / remove the evl headers from linux-libc-dev
 so linux-libc-dev stock can be installed together with linux-libc-dev-
xenomai4. I compared the content, most evl related files
 are new, only fnctl.h has
 #define O_OOB        010000000000
 added. However, I don't see any usage in libevl. So this should work.
-Leave the dependency's on the kernel packages away and solve this by documentation
 However, you would have to place a hold on linux-libc-dev so it doesn't
get replaced as soon as your OS has a newer kernel.

Do you have other ideas how to solve the version / dependency's / linux- libc-dev issue?

Quoted 9 lines
Quoted 2 lines

For now I named the kernel packages -xenomai4 but I am thinking about changing to -evl or xenomai-evl. What is more appropriate?

The topic is complicated because neither Debian nor other packaging systems I know allow to express this two-dimensional version dependency (>= ABI version X, latest kernel Y). If you encode the ABI into the package version as well, you are folding that version matrix into a single version number (>= abi-X-kernel-Y, or >= kernel-Y-ABI-X) - none is perfect.

Yes, that's an issue. But for EVL you need only the ABI version, the kernel version does not really matter. You can solve this by creating dependency packages:

libevl 36 depens linux-image-xenomai4 >= 45 linux-image-xenomai4 45 depends linux-image-6.12.90-cip24-xenomai4-45 ... linux-image-6.12.90-cip24-xenomai4-45 6.12.90

But I think this just gets to complicated for this application.

Proposal: Leave the dependency on linux-image-evl and linux-libc-dev out in libevl and add documentation in [1] how to build and install libevl / linuxevl the Debian way.

Only disadvantage: libevl-dev will fail compiling if you don't install the correct linux-libc-dev or update it later back to vanilla.

Alternative: I can create a patch for linux-evl so the resulting package changes from linux-libc-dev to linux-libc-evl-dev with the Provides Conflicts and Replaces fields.

The libevl Build-Depends could then also depend on linux-libc-evl-dev. However, there is now easy way to depend on a specific ABI.

Looks like this does the job for the renamed package:

scripts/package/builddeb +1 -1
index fb686fd3266f..5e95dad9de57 100755
@@ -149,7 +149,7 @@ case "${package}" in
 	install_linux_image_dbg "${package}";;
 linux-image-*|user-mode-linux-*)
 	install_linux_image "${package}";;
-linux-libc-dev)
+linux-libc-evl-dev)
 	install_libc_headers "${package}";;
 linux-headers-*)
 	install_kernel_headers "${package}";;
scripts/package/debian/rules +2 -2
index 2b3f9a0bd6c4..a7c50812c2a0 100755
@@ -27,12 +27,12 @@ make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) \
     $(addprefix KBUILD_BUILD_VERSION=,$(revision)) \
     $(addprefix CROSS_COMPILE=,$(CROSS_COMPILE))
 
-binary-targets := $(addprefix binary-, image image-dbg headers libc-dev)
+binary-targets := $(addprefix binary-, image image-dbg headers libc-evl-dev)
 
 all-packages = $(shell dh_listpackages)
 image-package = $(filter linux-image-% user-%, $(filter-out %-dbg, $(all-packages)))
 image-dbg-package = $(filter %-dbg, $(all-packages))
-libc-dev-package = $(filter linux-libc-dev, $(all-packages))
+libc-evl-dev-package = $(filter linux-libc-evl-dev, $(all-packages))
 headers-package = $(filter linux-headers-%, $(all-packages))
 
 mk-files = $(patsubst binary-%,debian/%.files,$1)
scripts/package/mkdebian +5 -3
index fc3b7fa709fc..1f42dadfdfc6 100755
@@ -215,11 +215,13 @@ EOF
 if [ "${SRCARCH}" != um ]; then
 cat <<EOF >> debian/control
 
-Package: linux-libc-dev
+Package: linux-libc-evl-dev
 Section: devel
-Provides: linux-kernel-headers
+Provides: linux-kernel-headers, linux-libc-dev
+Conflicts: linux-libc-dev
+Replaces: linux-libc-dev
 Architecture: $debarch
-Description: Linux support headers for userspace development
+Description: Linux / evl support headers for userspace development
  This package provides userspaces headers from the Linux kernel.  These headers
  are used by the installed headers for GNU glibc and other system libraries.
 Multi-Arch: same

If you think this is a good solution, I can provide a proper patch.

Quoted 8 lines

If your target audience for those packages primarily consists of beginners, it will be best to model it via a lock-step between libevl and some kernel package that carries a specific ABI version in its name (linux-image-evlX_kernel-ver-Y etc.). This implies creating a linux-libc-dev flavor as well (linux-libc-dev-evlX or so). That package should carry Provides:, Conflicts:, and Replaces: for linux-libc-dev in its metadata.

For my audience, I think the best is to have a fixed package set and fixed dependency's. So it is tested together, works together and generates dependency errors if you install something else.

I can easily keep a patch on my side that adds the needed fields / creates a linux-libc-evl-dev while upstream libevl doesn't have this dependency's.

Thanks for the hint with Provides / Replaces.

Quoted 5 lines

We side-step all these issues in xenomai-images by generating and installing a set of custom packages in a curated environment where upstream will not be able to replace the self-build xenomai packages (preferences are set accordingly for local repo with those packages).

Yes, with images it is easy, you can also just use make install and build a new image when something has to change.

Quoted 3 lines

Jan

[1] https://v4.xenomai.org/core/build-steps/index.html

#8 lore raw
In reply to Hannes Diethelm
Quoted 5 lines · Hannes Diethelm

If linux-evl is also built and installed as a debian package, linux-libc-dev can not be installed due to /usr/include/evl/*-abi.h are both installed by libevl and linux-libc-dev from the kernel build. However, installing linux-libc-dev from debian trixie works fine.

If this helps, we can tell libevl not to install the uapi by passing the -Dinstall-uapi=false switch to meson [setup].

Signature · 1 line
Philippe.
#9 lore raw
In reply to Hannes Diethelm

Hi Hannes,

Quoted 6 lines · Hannes Diethelm

This patch adds a debian package config that allows to build a deb's using dpkg-buildpackage -b -uc.

The packages are libevl / libevl-test similar to[1]. However, latmus is placed in libevl. One might not need the tests but still want to use latmus.

We should try to keep the minimum footprint of all runtime packages as small as possible. I'm quite sure that latmus is not needed / necessary on all the production images / machines.

Maybe we could introduce something like (lib)evl-tools or (lib)evl-utils holding latmus - and maybe even more of those tools / validators in the future?

Florian