Re: [PATCH 0/1] libevl: Add debian package config
Hannes Diethelm <[email protected]> Wed, 22 Jul 2026 16:10:57 +0200
| Newsgroups | dev.linux.lists.xenomai |
|---|---|
| Message-ID | <[email protected]> |
Am 21.07.26 um 10:13 schrieb Philippe Gerum: > Hannes Diethelm <[email protected]> writes: >> >> 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. > 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. diff --git a/latmus/latmus.c b/latmus/latmus.c index 9b3ed1e..4e88326 100644 --- a/latmus/latmus.c +++ b/latmus/latmus.c @@ -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"); diff --git a/latmus/timer.c b/latmus/timer.c index b84c71c..322511d 100644 --- a/latmus/timer.c +++ b/latmus/timer.c @@ -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: diff --git a/lib/sys.c b/lib/sys.c index f7fde82..ff6b95f 100644 --- a/lib/sys.c +++ b/lib/sys.c @@ -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