13 Commits

Author SHA1 Message Date
Bartosz Golaszewski f2c5f3fadc libgpiod: update to v2.2.4
Bug-fix release addressing several issues discovered during an
AI-augmented security audit. The most severe bug was found in the C
extension code of the python bindings - which also get an update - but
there were some memory leaks and integer overflow bugs in the core C
library as well as in tools and DBus daemon.

Full changelog:

Bug fixes:
- fix buffer over-read bugs when translating uAPI structs to library types
- fix variable and argument types where necessary
- sanitize values returned by the kernel to avoid potential buffer overflows
- fix memory leaks in gpio-tools
- add missing return value checks in gpio-tools
- fix period parsing in gpio-tools
- use correct loop counter in error path in gpio-manager

Improvements:
- make tests work with newer coreutils by removing cases checking tools'
  behavior on SIGINT which stopped working due to changes in behavior of the
  timeout tool

Also: drop the patch that's now upstream from the recipe.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-04-10 07:59:58 -07:00
Bartosz Golaszewski 216b1c7cb2 libgpiod: fix gpio-tools tests failure with new coreutils
openembedded-core updated to coreutils v9.10 in which commit
8c2461933411 ("timeout: honor ignored signal dispositions") changed the
behavior of timeout. It will no longer propagate SIGINT to background
shell jobs which breaks test-cases for gpio-tools which verify that they
exit correctly after receiving SIGINT. This backports the patch sent
upstream that removed the offending test-cases as we already have a
similar set of tests for SIGTERM.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2026-03-18 14:33:34 -07:00
Bartosz Golaszewski 1e0beab0ed libgpiod: update to v2.2.1
The main set of changes in this release doesn't concern yocto - it
brings in proper sphinx docs infrastructure for publishin on
readthedocs. We still have a bunch of code fixes though and we can also
remove the patch we're carrying in the recipe as it's upstream now.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-02-19 09:36:17 -08:00
Bartosz Golaszewski 9d8ef59ebd libgpiod: fix ptests failure
Linux kernel commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an
instantiated device depends on") revealed an issue in libgpiod bindings
tests where a GPIO simulator device is not disabled before removing its
configfs entries.

Add a patch (already submitted upstream) that fixes the observed ptest
failures.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-02-04 10:14:36 -08:00
Bartosz Golaszewski 9626e8a2c8 libgpiod: update to v2.2
This is a big update for libgpiod bringing in the D-Bus daemon and its
command-line client. This is why the patch is pretty hefty. The majority
of the line count comes from the removed patch that is now upstream but
the v2.2 recipe also now contains a lot of bits and pieces that make the
D-Bus daemon work both with system as well as sysvinit.

The project now packages the systemd service and udev rules that allow
the manager to run under its own user in a well sandboxed environment
but the sysvsinit script is carried in the recipe as I don't want to
put support for legacy systems in libgpiod repo.

The patch also updates the ptests for libgpiod to run three new
test-suites: one for GLib bindings, one for the command-line D-Bus
client and finally one testing some daemon corner-cases not supported by
the client.

Build tested with various config options with systemd and sysvinit (the
latter with glibc and musl) on 32- and 64-bit architectures.

The complete changelog since v2.1 (taken verbatim from the NEWS file) is
below:

libgpiod v2.2
=============

New features:
- add GObject bindings with introspection
- add a D-Bus interface to libgpiod together with a daemon implementing it and
  a command-line client
- split out the common shell test code for gpio-tools into a reusable test
  harness for GPIO command-line tools
- add minutes as a new supported time unit for tools and allow longer periods
  for timeouts, line holding, etc.
- add a script for generating sdist and wheels for python bindings
- migrate C++ tests to using Catch2 v3

Improvements:
- relicense C++ bindings under LGPL-2.1-or-later in order to make the project
  more attractive to users with GPL-3.0 restrictions
- remove dependency on grep from tools' tests
- make shell scripts pass shellcheck treewide
- use ppoll() in tools to actually achieve the advertised microsecond
  granularity of timeouts
- documentation improvements
- improve typing info in python bindings
- improve __repr__() implementations in python bindings
- make reconfiguring lines more flexible in python bindings by relaxing the
  requirement to carry the ordering of the config entries from the request
- support casting of line.Value to bool in python bindings
- various new test-cases for improved coverage treewide
- align the test cases with the current kernel requirement for specifying
  direction explicitly when reconfiguring lines

Bug fixes:
- fix C++ bindings build using slibtool
- accept the new style automatic GPIO chip labels from gpio-sim in bash tests
- fix C++ tests with recent kernels which introduced stricter reconfigure
  behavior
- fix a use-after-free bug in python bindings
- fix passing the event clock property to line requests in python bindings
- fix a memory leak in tools
- make sure the string buffers in line-info and chip-info are big enough to not
  truncate the strings they hold below the size accepted by the kernel
- remove buggy and unnecessary flags sanitization from line-config
- fix python bindings installation with Makefile build
- sanitize the return values of GPIO ioctl()s which in some cases may be
  erroneously positive
- fix requesting lines by name with multiple entries in python bindings

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-10-24 07:06:31 -07:00
Khem Raj 2c8d82ea2f libgpiod: Migrate to catch2 v3
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-06-11 07:46:44 -07:00
Bartosz Golaszewski 44bb7f130f libgpiod: update to v2.1
This is a small release bringing in a bunch of improvements and a couple
new interfaces. Details are available in NEWS.

We need to move the code in recipes around a bit as the tests now use
shunit2.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-11-03 15:07:16 -07:00
Bartosz Golaszewski 54e11a6c5b libgpiod: update to v2.0.2
This is a small bug-fix release addressing a segfault, a memory
corruption bug and a couple minor issues.

This also removes the patch that's already upstream.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-08-26 17:32:45 -07:00
Martin Jansa dd2a100449 libgpiod: fix malformed Upstream-Status
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-06-21 07:36:18 -07:00
Joe Slater 45a8bb2620 libgpiod: modify test 'gpioset: toggle (continuous)'
Look for level transitions when testing toggling
values because using fixed delays to assume value
changes is not reliable.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-06-14 09:50:28 -07:00
Khem Raj 3174a9da4c Revert "libgpiod: modify test 'gpioset: toggle (continuous)'"
This reverts commit d891624096.
2023-06-01 12:17:15 -07:00
Joe Slater d891624096 libgpiod: modify test 'gpioset: toggle (continuous)'
Look for level transitions when testing toggling
values because using fixed delays to assume value
changes is not reliable.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-05-25 08:56:32 -07:00
Bartosz Golaszewski cf6291bf64 libgpiod: generalize the local files directories
In order to avoid having to rename the directories containing ptest
scripts on every update, use a more generic, per-major-release name and
extend the FILESEXTRAPATHS.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-04-11 14:54:22 -07:00