package/sigrok: update and udev rules (branch yem/sigrok)
cover package/sigrok: update and udev rules (branch yem/sigrok)
Hello All!
This small series bumps the libserialport package, and installs the libsigrok udev rules to allow non-root users to upload firmware blobs to the devices.
Ths sigrok.org server has both AAAA and A records, but there is nothing behind the IPv6, which causes huge delays when downloading file from there. This is addressed in the first patch.
Regards,
Yann E. MORIN.
----------------------------------------------------------------
Yann E. MORIN (3):
Config.in: timeout earlier when connecting to download servers package/libserialport: update to 0.1.2 package/libsigrok: install udev rules
.checkpackageignore | 1 - Config.in | 10 ++++----- package/libserialport/0001-uclinux-detection.patch | 26 ---------------------- package/libserialport/libserialport.hash | 2 +- package/libserialport/libserialport.mk | 3 +-- package/libsigrok/libsigrok.mk | 16 +++++++++++++ 6 files changed, 23 insertions(+), 35 deletions(-) delete mode 100644 package/libserialport/0001-uclinux-detection.patch
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 1/3 Config.in: timeout earlier when connecting to download servers
Some sites have broken DNS entries where some A or AAAA records point to a nonexistent machine. This causes a long delay (~135sec here) before a fallback to another IP is attempted. This is the case for example for sigrok.org, which IPv6 entry is not reachable (at least from the few locations I have access to, while other IPv6 servers are reachable).
Add a relatively small timeout on connect for the few download backends where we can easily drive that setting:
- for curl and wget, that timeout only applies when establishing the
TCP connection, i.e. the three-way handshake;
- for scp and sftp, that timeout also include the ssh handshake;
- for svn, it is not explicit what the timeout is about, but the documentation states "Timeout for HTTP requests in seconds".
In modern times, we expect that we can indeed establish those handshakes in less than 10s; anything taking longer is in practice an unreachable site...
For other download mechanism (bzr, cvs, git, hg), as well as post-processing helpers (cargo, go), it does not seem possible to set such a timeout.
--- Config.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Config.in +5 -5
@@ -114,15 +114,15 @@ menu "Commands" config BR2_CURL string "Curl command" - default "curl -q --ftp-pasv --retry 3" + default "curl -q --ftp-pasv --retry 3 --connect-timeout 10" config BR2_WGET string "Wget command" - default "wget -nd -t 3" + default "wget -nd -t 3 --connect-timeout=10" config BR2_SVN string "Subversion (svn) command" - default "svn --non-interactive" + default "svn --non-interactive --config-option servers:global:http-timeout=10" config BR2_BZR string "Bazaar (bzr) command"
@@ -142,11 +142,11 @@ config BR2_LOCALFILES config BR2_SCP string "Secure copy (scp) command" - default "scp" + default "scp -o ConnectTimeout=10" config BR2_SFTP string "Secure file transfer (sftp) command" - default "sftp" + default "sftp -o ConnectTimeout=10" config BR2_HG string "Mercurial (hg) command"
Signature · 6 lines
2.47.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/3] Config.in: timeout earlier when connecting to download servers
Quoted 35 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Some sites have broken DNS entries where some A or AAAA records point to a nonexistent machine. This causes a long delay (~135sec here) before a fallback to another IP is attempted. This is the case for example for sigrok.org, which IPv6 entry is not reachable (at least from the few locations I have access to, while other IPv6 servers are reachable).
Add a relatively small timeout on connect for the few download backends where we can easily drive that setting:
- for curl and wget, that timeout only applies when establishing the
TCP connection, i.e. the three-way handshake;- for scp and sftp, that timeout also include the ssh handshake;
- for svn, it is not explicit what the timeout is about, but the documentation states "Timeout for HTTP requests in seconds".In modern times, we expect that we can indeed establish those handshakes in less than 10s; anything taking longer is in practice an unreachable site...
For other download mechanism (bzr, cvs, git, hg), as well as post-processing helpers (cargo, go), it does not seem possible to set such a timeout.
Signed-off-by Yann E. MORIN <[email protected]>--- Config.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)Config.in +0
-0
Config.in menu "Commands" · line 117
Quoted 5 lines
Config.in +1
-1@@ -114,15 +114,15 @@ menu "Commands" config BR2_CURL string "Curl command" - default "curl -q --ftp-pasv --retry 3" + default "curl -q --ftp-pasv --retry 3 --connect-timeout 10"
It doesn't seem to be strictly needed for curl as it seems to use the happy eyeballs algorithm, but OK:
time curl -v http://sigrok.org
* Trying [2a05:bec0:20:c01::8c96:bda6]:80...
* Trying 134.255.237.124:80...
* Connected to sigrok.org (134.255.237.124) port 80 (#0)
Quoted 5 lines
GET / HTTP/1.1
Host: sigrok.org
User-Agent: curl/7.88.1
Accept: */*
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 04 Feb 2025 10:56:28 GMT
< Server: Apache/2.4.56
< X-Content-Type-Options: nosniff
< Vary: Accept-Encoding,Cookie
< Expires: Tue, 04 Feb 2025 10:56:28 GMT
< Cache-Control: private, must-revalidate, max-age=0 < Last-Modified: Tue, 04 Feb 2025 10:56:28 GMT < Location: https://sigrok.org/wiki/Main_Page
< X-Request-Id: e50b7132460e1a6484be9312
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=utf-8
<
* Connection #0 to host sigrok.org left intact
real 0m0.249s user 0m0.007s sys 0m0.011s
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/3] Config.in: timeout earlier when connecting to download servers
Peter, All,
On 2025-02-04 11:56 +0100, Peter Korsgaard spake thusly:
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Add a relatively small timeout on connect for the few download backends where we can easily drive that setting:
[--SNIP--]
Quoted 2 lines
It doesn't seem to be strictly needed for curl as it seems to use the happy eyeballs algorithm, but OK:
Sure, but the happy eyeballs algorithm does not help when the whole site is down, where we want to quickly switch over to s.b.o.
Thanks for applying!
Regards,
Yann E. MORIN.
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/3 package/libserialport: update to 0.1.2
In reply to Yann E. MORINDrop the patch, that has been upstreamed as b2359c5c994c (libserialport:
Fix Linux files not compiled in with a toolchain for ucLinux).
Accordingly, drop the now superfluous autoreconf.
--- .checkpackageignore | 1 - .../0001-uclinux-detection.patch | 26 ------------------- package/libserialport/libserialport.hash | 2 +- package/libserialport/libserialport.mk | 3 +-- 4 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 package/libserialport/0001-uclinux-detection.patch
.checkpackageignore +0 -1
@@ -711,7 +711,6 @@ package/libselinux/0001-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.pat package/libsepol/0001-support-static-only.patch lib_patch.Upstream package/libserial/0001-SerialPort.cpp-fix-build-when-size_t-is-an-unsigned-.patch lib_patch.Upstream package/libserial/0002-SerialPort.cpp-don-t-use-high-baudrates-when-not-ava.patch lib_patch.Upstream -package/libserialport/0001-uclinux-detection.patch lib_patch.Upstream package/libshdata/0001-backend-Add-missing-include-files.patch lib_patch.Upstream package/libshdata/0002-examples-stress_test-Fix-build-with-musl-libc.patch lib_patch.Upstream package/libsidplay2/0001-sidplay2-libs-2.1.1.patch lib_patch.Upstream
package/libserialport/0001-uclinux-detection.patch deleted +0 -26
@@ -1,26 +0,0 @@ -From faab9aa5879fab93556b7a3a6f24070eeb3cbf15 Mon Sep 17 00:00:00 2001 -From: Paul Cercueil <[email protected]> -Date: Mon, 29 Aug 2016 11:11:01 +0200 -Subject: [PATCH] Fix Linux files not compiled in with a toolchain for ucLinux - -Signed-off-by: Paul Cercueil <[email protected]> ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index f6b66e8..de6f5b9 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -74,7 +74,7 @@ AC_DEFINE_UNQUOTED([SP_LIB_VERSION_REVISION], [$SP_LIB_VERSION_REVISION], [.]) - AC_DEFINE_UNQUOTED([SP_LIB_VERSION_AGE], [$SP_LIB_VERSION_AGE], [.]) - AC_DEFINE_UNQUOTED([SP_LIB_VERSION_STRING], ["$SP_LIB_VERSION"], [.]) - --AM_CONDITIONAL([LINUX], [test -z "${host_os##linux*}"]) -+AM_CONDITIONAL([LINUX], [test -z "${host_os##linux*}" || test -z "${host_os##uclinux*}"]) - AM_CONDITIONAL([WIN32], [test -z "${host_os##mingw*}" || test -z "${host_os##cygwin*}"]) - AM_CONDITIONAL([MACOSX], [test -z "${host_os##darwin*}"]) - AM_CONDITIONAL([FREEBSD], [test -z "${host_os##freebsd*}"]) --- -2.8.1 -
package/libserialport/libserialport.hash +1 -1
@@ -1,3 +1,3 @@ # Locally computed -sha256 4a2af9d9c3ff488e92fb75b4ba38b35bcf9b8a66df04773eba2a7bbf1fa7529d libserialport-0.1.1.tar.gz +sha256 5deb92b5ca72c0347b07b786848350deca2dcfd975ce613b8e0e1d947a4b4ca9 libserialport-0.1.2.tar.gz sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 COPYING
package/libserialport/libserialport.mk +1 -2
@@ -4,12 +4,11 @@ # ################################################################################ -LIBSERIALPORT_VERSION = 0.1.1 +LIBSERIALPORT_VERSION = 0.1.2 LIBSERIALPORT_SITE = http://sigrok.org/download/source/libserialport LIBSERIALPORT_LICENSE = LGPL-3.0+ LIBSERIALPORT_LICENSE_FILES = COPYING LIBSERIALPORT_INSTALL_STAGING = YES LIBSERIALPORT_DEPENDENCIES = host-pkgconf -LIBSERIALPORT_AUTORECONF = YES $(eval $(autotools-package))
Signature · 6 lines
2.47.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/3] package/libserialport: update to 0.1.2
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Drop the patch, that has been upstreamed as
b2359c5c994c(libserialport:
Fix Linux files not compiled in with a toolchain for ucLinux).Accordingly, drop the now superfluous autoreconf.
Signed-off-by Yann E. MORIN <[email protected]>Cc Paul Cercueil <[email protected]>
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 3/3 package/libsigrok: install udev rules
In reply to Yann E. MORINSome devices that libsigrok can talk to, need a firmware to be uploaded. libsigrok comes with a set of rules to allow non-root users to upload those firmware blobs.
Depending on how the system is configured, different set of rules are needed [0] (yes, it's documented on the fx2lafw page, not on the libsigrok one [1]). Basically:
- 60-libsigrok.rules is always used;
- 61-libsigrok-uaccess.rules is used when systemd-logind is used;
- 61-libsigrok-plugdev.rules is used when systemd-logind is not used.
For systems without udev, it is the responsibility of the user to implement proper access management if they need non-root to upload firmware files.
[0] https://sigrok.org/wiki/Fx2lafw#Install_the_udev_rules_file
[1] https://sigrok.org/wiki/Libsigrok
--- package/libsigrok/libsigrok.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
package/libsigrok/libsigrok.mk +16 -0
@@ -65,4 +65,20 @@ else LIBSIGROK_CONF_OPTS += --disable-cxx endif +ifeq ($(BR2_PACKAGE_HAS_UDEV),y) +LIBSIGROK_UDEV_RULES = \ + 60-libsigrok.rules \ + $(if $(BR2_PACKAGE_SYSTEMD_LOGIND), \ + 61-libsigrok-uaccess.rules, \ + 61-libsigrok-plugdev.rules \ + ) +define LIBSIGROK_INSTALL_UDEV_RULES + $(foreach rule, $(LIBSIGROK_UDEV_RULES), \ + $(INSTALL) -D -m 0644 $(@D)/contrib/$(rule) \ + $(TARGET_DIR)/usr/lib/udev/rules.d/$(rule)$(sep) \ + ) +endef +LIBSIGROK_POST_INSTALL_TARGET_HOOKS += LIBSIGROK_INSTALL_UDEV_RULES +endif + $(eval $(autotools-package))
Signature · 6 lines
2.47.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 3/3] package/libsigrok: install udev rules
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Some devices that libsigrok can talk to, need a firmware to be uploaded. libsigrok comes with a set of rules to allow non-root users to upload those firmware blobs.
Depending on how the system is configured, different set of rules are needed [0] (yes, it's documented on the fx2lafw page, not on the libsigrok one [1]). Basically:
- 60-libsigrok.rules is always used;
- 61-libsigrok-uaccess.rules is used when systemd-logind is used;
- 61-libsigrok-plugdev.rules is used when systemd-logind is not used.
Quoted 8 lines
For systems without udev, it is the responsibility of the user to implement proper access management if they need non-root to upload firmware files.
[0] https://sigrok.org/wiki/Fx2lafw#Install_the_udev_rules_file
[1] https://sigrok.org/wiki/LibsigrokSigned-off-by Yann E. MORIN <[email protected]>
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot