Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
From 4d4d17e2810f793b9f7fd8acad2a3c551dbff2b5 Mon Sep 17 00:00:00 2001
From: Marcus Hoffmann <marcus.hoffmann@othermo.de>
Date: Fri, 31 Mar 2023 20:13:07 +0200
Subject: [PATCH] bindings: python: fix library loading
On Linux the find_library() function requires ld, gcc, objdump
or ldconfig on the target, which might not be present on a
buildroot system. [1]
We do not actually need this function at all, as we know the iio library
will be referencable in the system under the name "libiio.so".
So instead of kicking of this complicated cross-platform/cross-distro
compatible machinery, we just pass in the name of the library we already
know.
[1] https://docs.python.org/3/library/ctypes.html#finding-shared-libraries
Upstream: N/A, buildroot doesn't have to care about different OS's and
distro setups, so we can just hardcode the lib name, but we cannot
submit that upstream.
Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
---
bindings/python/iio.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/python/iio.py b/bindings/python/iio.py
index b91260cc..bde17694 100644
--- a/bindings/python/iio.py
+++ b/bindings/python/iio.py
@@ -224,7 +224,7 @@ else:
# Non-windows, possibly Posix system
_iiolib = "iio"
-_lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True)
+_lib = _cdll("libiio.so", use_errno=True, use_last_error=True)
_get_backends_count = _lib.iio_get_backends_count
_get_backends_count.restype = c_uint
--
2.25.1

98
package/libiio/Config.in Normal file
View File

@@ -0,0 +1,98 @@
config BR2_PACKAGE_LIBIIO
bool "libiio"
select BR2_PACKAGE_LIBIIO_LOCAL_BACKEND if !BR2_PACKAGE_LIBIIO_XML_BACKEND
help
Libiio is a library to ease the development of software
interfacing Linux Industrial I/O (IIO) devices.
http://wiki.analog.com/resources/tools-software/linux-software/libiio
if BR2_PACKAGE_LIBIIO
config BR2_PACKAGE_LIBIIO_LOCAL_BACKEND
bool "Local backend"
default y
help
Enable the local backend of the library.
config BR2_PACKAGE_LIBIIO_XML_BACKEND
bool "XML backend"
default y
select BR2_PACKAGE_LIBXML2
help
Enable the XML backend of the library.
config BR2_PACKAGE_LIBIIO_NETWORK_BACKEND
bool "Network backend"
default y
select BR2_PACKAGE_LIBIIO_XML_BACKEND
help
Enable the network backend of the library.
config BR2_PACKAGE_LIBIIO_USB_BACKEND
bool "USB backend"
default y
depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # libusb
select BR2_PACKAGE_LIBIIO_XML_BACKEND
select BR2_PACKAGE_LIBUSB
help
Enable the USB backend of the library.
comment "The USB backend needs a toolchain w/ threads, gcc >= 4.9"
depends on !BR2_TOOLCHAIN_HAS_THREADS || \
!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
config BR2_PACKAGE_LIBIIO_SERIAL_BACKEND
bool "Serial backend"
default y
select BR2_PACKAGE_LIBIIO_XML_BACKEND
select BR2_PACKAGE_LIBSERIALPORT
help
Enable the serial backend of the library.
config BR2_PACKAGE_LIBIIO_IIOD
bool "IIO Daemon"
default y
depends on BR2_TOOLCHAIN_HAS_THREADS
select BR2_PACKAGE_LIBIIO_LOCAL_BACKEND
help
Install the IIO Daemon.
config BR2_PACKAGE_LIBIIO_IIOD_USBD
bool "USB support in the IIO Daemon (FunctionFS)"
depends on BR2_PACKAGE_LIBIIO_IIOD
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18 # usb_functionfs_descs_head_v2
select BR2_PACKAGE_LIBAIO
help
Add support for USB through FunctionFS with IIOD.
comment "USB support in the IIO Daemon requires headers >= 3.18"
depends on BR2_PACKAGE_LIBIIO_IIOD
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
comment "IIO Daemon needs a toolchain w/ threads"
depends on !BR2_TOOLCHAIN_HAS_THREADS
config BR2_PACKAGE_LIBIIO_TESTS
bool "Install test programs"
depends on BR2_TOOLCHAIN_HAS_THREADS
help
Install the test programs (iio_info, iio_genxml, iio_readdev).
comment "IIO test programs need a toolchain w/ threads"
depends on !BR2_TOOLCHAIN_HAS_THREADS
config BR2_PACKAGE_LIBIIO_BINDINGS_CSHARP
bool "Install C# bindings"
depends on BR2_PACKAGE_MONO
help
Install the C# bindings.
config BR2_PACKAGE_LIBIIO_BINDINGS_PYTHON
bool "Install Python bindings"
depends on BR2_PACKAGE_PYTHON3
help
Install the Python bindings.
endif

56
package/libiio/S60iiod Normal file
View File

@@ -0,0 +1,56 @@
#!/bin/sh
DAEMON="iiod"
PIDFILE="/var/run/$DAEMON.pid"
# Server-side demuxing by default
IIOD_OPTS="-D"
# shellcheck source=/dev/null
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
start() {
printf 'Starting %s: ' "$DAEMON"
# shellcheck disable=SC2086 # we need the word splitting
start-stop-daemon --start --background --make-pidfile \
--pidfile "$PIDFILE" --exec "/usr/sbin/$DAEMON" \
-- $IIOD_OPTS
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
stop() {
printf 'Stopping %s: ' "$DAEMON"
start-stop-daemon --stop --pidfile "$PIDFILE" --exec "/usr/sbin/$DAEMON"
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
return "$status"
fi
while start-stop-daemon --stop --test --quiet --pidfile "$PIDFILE" \
--exec "/usr/sbin/$DAEMON"; do
sleep 0.1
done
rm -f "$PIDFILE"
return "$status"
}
restart() {
stop
start
}
case "$1" in
start|stop|restart)
"$1";;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

View File

@@ -0,0 +1,3 @@
# Locally calculated
sha256 fb445fb860ef1248759f45d4273a4eff360534480ec87af64c6b8db3b99be7e5 libiio-0.26.tar.gz
sha256 102900208eef27b766380135906d431dba87edaa7ec6aa72e6ebd3dd67f3a97b COPYING.txt

108
package/libiio/libiio.mk Normal file
View File

@@ -0,0 +1,108 @@
################################################################################
#
# libiio
#
################################################################################
LIBIIO_VERSION = 0.26
LIBIIO_SITE = $(call github,analogdevicesinc,libiio,v$(LIBIIO_VERSION))
LIBIIO_INSTALL_STAGING = YES
LIBIIO_LICENSE = LGPL-2.1+
LIBIIO_LICENSE_FILES = COPYING.txt
LIBIIO_CONF_OPTS = -DENABLE_IPV6=ON \
-DWITH_LOCAL_BACKEND=$(if $(BR2_PACKAGE_LIBIIO_LOCAL_BACKEND),ON,OFF) \
-DWITH_NETWORK_BACKEND=$(if $(BR2_PACKAGE_LIBIIO_NETWORK_BACKEND),ON,OFF) \
-DINSTALL_UDEV_RULE=$(if $(BR2_PACKAGE_HAS_UDEV),ON,OFF) \
-DWITH_TESTS=$(if $(BR2_PACKAGE_LIBIIO_TESTS),ON,OFF) \
-DWITH_DOC=OFF
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
LIBIIO_CONF_OPTS += -DNO_THREADS=OFF
else
LIBIIO_CONF_OPTS += -DNO_THREADS=ON
endif
ifeq ($(BR2_PACKAGE_LIBIIO_XML_BACKEND),y)
LIBIIO_DEPENDENCIES += libxml2
LIBIIO_CONF_OPTS += -DWITH_XML_BACKEND=ON
else
LIBIIO_CONF_OPTS += -DWITH_XML_BACKEND=OFF
endif
ifeq ($(BR2_PACKAGE_LIBIIO_USB_BACKEND),y)
LIBIIO_DEPENDENCIES += libusb
LIBIIO_CONF_OPTS += -DWITH_USB_BACKEND=ON
else
LIBIIO_CONF_OPTS += -DWITH_USB_BACKEND=OFF
endif
ifeq ($(BR2_PACKAGE_LIBIIO_SERIAL_BACKEND),y)
LIBIIO_DEPENDENCIES += libserialport
LIBIIO_CONF_OPTS += -DWITH_SERIAL_BACKEND=ON
else
LIBIIO_CONF_OPTS += -DWITH_SERIAL_BACKEND=OFF
endif
ifeq ($(BR2_PACKAGE_LIBIIO_IIOD),y)
LIBIIO_DEPENDENCIES += host-flex host-bison
LIBIIO_CONF_OPTS += -DWITH_IIOD=ON
else
LIBIIO_CONF_OPTS += -DWITH_IIOD=OFF
endif
ifeq ($(BR2_PACKAGE_LIBIIO_IIOD_USBD),y)
LIBIIO_DEPENDENCIES += libaio
LIBIIO_CONF_OPTS += -DWITH_IIOD_USBD=ON
else
LIBIIO_CONF_OPTS += -DWITH_IIOD_USBD=OFF
endif
ifeq ($(BR2_PACKAGE_LIBAIO),y)
LIBIIO_DEPENDENCIES += libaio
LIBIIO_CONF_OPTS += -DWITH_AIO=ON
else
LIBIIO_CONF_OPTS += -DWITH_AIO=OFF
endif
ifeq ($(BR2_PACKAGE_AVAHI_LIBAVAHI_CLIENT),y)
LIBIIO_DEPENDENCIES += avahi
LIBIIO_CONF_OPTS += -DHAVE_DNS_SD=ON
else
LIBIIO_CONF_OPTS += -DHAVE_DNS_SD=OFF
endif
ifeq ($(BR2_PACKAGE_LIBIIO_BINDINGS_PYTHON),y)
LIBIIO_DEPENDENCIES += host-python-setuptools python3
LIBIIO_CONF_OPTS += \
-DPYTHON_BINDINGS=ON \
-DPYTHON_EXECUTABLE=$(HOST_DIR)/bin/python3
else
LIBIIO_CONF_OPTS += -DPYTHON_BINDINGS=OFF
endif
ifeq ($(BR2_PACKAGE_LIBIIO_BINDINGS_CSHARP),y)
define LIBIIO_INSTALL_CSHARP_BINDINGS_TO_TARGET
$(HOST_DIR)/bin/gacutil -root $(TARGET_DIR)/usr/lib -i \
$(TARGET_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll
endef
define LIBIIO_INSTALL_CSHARP_BINDINGS_TO_STAGING
$(HOST_DIR)/bin/gacutil -root $(STAGING_DIR)/usr/lib -i \
$(STAGING_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll
endef
LIBIIO_POST_INSTALL_TARGET_HOOKS += LIBIIO_INSTALL_CSHARP_BINDINGS_TO_TARGET
LIBIIO_POST_INSTALL_STAGING_HOOKS += LIBIIO_INSTALL_CSHARP_BINDINGS_TO_STAGING
LIBIIO_DEPENDENCIES += mono
LIBIIO_CONF_OPTS += -DCSHARP_BINDINGS=ON
else
LIBIIO_CONF_OPTS += -DCSHARP_BINDINGS=OFF
endif
ifeq ($(BR2_PACKAGE_LIBIIO_IIOD),y)
define LIBIIO_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/libiio/S60iiod \
$(TARGET_DIR)/etc/init.d/S60iiod
endef
endif
$(eval $(cmake-package))