* [Buildroot] [PATCH 00/11] Add support for building Snagboot
@ 2025-10-18 19:42 Thomas Petazzoni via buildroot
2025-10-18 19:42 ` [Buildroot] [PATCH 01/11] support/testing/infra: improve run_cmd_on_host() to show stdout/stderr Thomas Petazzoni via buildroot
` (10 more replies)
0 siblings, 11 replies; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:42 UTC (permalink / raw)
To: Buildroot List; +Cc: romain.gantois, Thomas Petazzoni
Hello,
Snagboot <https://github.com/bootlin/snagboot/> is an open-source and
platform-agnostic tool to recover and reflash embedded platforms,
replacing vendor-specific tools by a single unified tool.
This patch series aims at allowing to build Snagboot for the host as
part of a Buildroot build, so that a Buildroot user can use Snagboot
after the build to recover/reflash an embedded platform.
Snagboot requires a number of dependencies, which is why we are adding
python-crccheck, python-fs and python-pyfatfs as new packages, and
also enabling host variants for the existing python-tftpy,
python-pyusb, python-xmodem and python-appdirs packages.
Since we're adding so many host Python packages, we thought it would
be a good idea to test them, but our runtime testing infrastructure
wasn't really convenient to test host packages. The first two patches
therefore propose some improvements to the testing infrastructure,
which are then use by the remaining patches to make sure we at least
minimally test that host Python packages work.
Let me know what you think!
Thomas
Thomas Petazzoni (11):
support/testing/infra: improve run_cmd_on_host() to show stdout/stderr
support/testing/infra/basetest.py: add BRHostPkgTest class
package/python-crccheck: new package
support/testing/tests/package/test_python_serial.py: new test case
package/python-tftpy: add host variant
package/python-pyusb: enable host variant
package/python-xmodem: add host variant
package/python-appdirs: add host variant
package/python-fs: new package
package/python-pyfatfs: new package
package/snagboot: new package
DEVELOPERS | 11 ++++
package/Config.in.host | 1 +
package/python-appdirs/python-appdirs.mk | 1 +
package/python-crccheck/python-crccheck.hash | 4 ++
package/python-crccheck/python-crccheck.mk | 15 ++++++
package/python-fs/python-fs.hash | 5 ++
package/python-fs/python-fs.mk | 15 ++++++
...oject.toml-relax-version-constraints.patch | 45 ++++++++++++++++
package/python-pyfatfs/python-pyfatfs.hash | 4 ++
package/python-pyfatfs/python-pyfatfs.mk | 17 ++++++
package/python-pyusb/python-pyusb.mk | 2 +
package/python-tftpy/python-tftpy.mk | 1 +
package/python-xmodem/python-xmodem.mk | 1 +
package/snagboot/Config.in.host | 8 +++
package/snagboot/snagboot.hash | 3 ++
package/snagboot/snagboot.mk | 29 ++++++++++
support/testing/infra/__init__.py | 19 +++++--
support/testing/infra/basetest.py | 22 ++++++++
.../tests/package/test_python_crccheck.py | 10 ++++
.../testing/tests/package/test_python_fs.py | 9 ++++
.../tests/package/test_python_pyfatfs.py | 53 +++++++++++++++++++
.../tests/package/test_python_pyusb.py | 9 ++++
.../tests/package/test_python_serial.py | 12 +++++
.../tests/package/test_python_tftpy.py | 9 ++++
.../tests/package/test_python_xmodem.py | 9 ++++
.../testing/tests/package/test_snagboot.py | 16 ++++++
26 files changed, 325 insertions(+), 5 deletions(-)
create mode 100644 package/python-crccheck/python-crccheck.hash
create mode 100644 package/python-crccheck/python-crccheck.mk
create mode 100644 package/python-fs/python-fs.hash
create mode 100644 package/python-fs/python-fs.mk
create mode 100644 package/python-pyfatfs/0001-pyproject.toml-relax-version-constraints.patch
create mode 100644 package/python-pyfatfs/python-pyfatfs.hash
create mode 100644 package/python-pyfatfs/python-pyfatfs.mk
create mode 100644 package/snagboot/Config.in.host
create mode 100644 package/snagboot/snagboot.hash
create mode 100644 package/snagboot/snagboot.mk
create mode 100644 support/testing/tests/package/test_python_crccheck.py
create mode 100644 support/testing/tests/package/test_python_fs.py
create mode 100644 support/testing/tests/package/test_python_pyfatfs.py
create mode 100644 support/testing/tests/package/test_python_pyusb.py
create mode 100644 support/testing/tests/package/test_python_serial.py
create mode 100644 support/testing/tests/package/test_python_xmodem.py
create mode 100644 support/testing/tests/package/test_snagboot.py
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 01/11] support/testing/infra: improve run_cmd_on_host() to show stdout/stderr
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
@ 2025-10-18 19:42 ` Thomas Petazzoni via buildroot
2025-10-30 21:03 ` Julien Olivain via buildroot
2025-11-17 19:56 ` Arnout Vandecappelle via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 02/11] support/testing/infra/basetest.py: add BRHostPkgTest class Thomas Petazzoni via buildroot
` (9 subsequent siblings)
10 siblings, 2 replies; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:42 UTC (permalink / raw)
To: Buildroot List; +Cc: romain.gantois, Thomas Petazzoni, Ricardo Martincoski
When run_cmd_on_host() runs a command that fails, we only get an
exception with no details to debug what happened. Let's improve that
by catching the exception, and printing the command output. This
requires redirecting stderr to stdout (instead of /dev/null) and
asking to get the output in text format.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
support/testing/infra/__init__.py | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/support/testing/infra/__init__.py b/support/testing/infra/__init__.py
index 1f003f24c6..52308395a3 100644
--- a/support/testing/infra/__init__.py
+++ b/support/testing/infra/__init__.py
@@ -59,11 +59,20 @@ def download(dldir, filename):
def run_cmd_on_host(builddir, cmd):
"""Call subprocess.check_output and return the text output."""
- out = subprocess.check_output(cmd,
- stderr=open(os.devnull, "w"),
- cwd=builddir,
- env={"LANG": "C"},
- universal_newlines=True)
+ try:
+ out = subprocess.check_output(cmd,
+ cwd=builddir,
+ env={"LANG": "C"},
+ stderr=subprocess.STDOUT,
+ text=True,
+ universal_newlines=True)
+ except subprocess.CalledProcessError as e:
+ print(f"Command failed with return code {e.returncode}")
+ print("=== STDOUT/STDERR ===")
+ print(e.output)
+ print("=====================")
+ raise
+
return out
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 02/11] support/testing/infra/basetest.py: add BRHostPkgTest class
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
2025-10-18 19:42 ` [Buildroot] [PATCH 01/11] support/testing/infra: improve run_cmd_on_host() to show stdout/stderr Thomas Petazzoni via buildroot
@ 2025-10-18 19:43 ` Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 03/11] package/python-crccheck: new package Thomas Petazzoni via buildroot
` (8 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:43 UTC (permalink / raw)
To: Buildroot List; +Cc: romain.gantois, Thomas Petazzoni, Ricardo Martincoski
Runtime test cases are currently mostly used to test target packages,
and the BRTest class is perfect for that as we can easily feed a
Buildroot configuration, boot it under Qemu and run commands inside
the emulator.
A few tests use the more basic BRConfigTest when they have special
needs that don't match with BRTest.
However, as we are going to add a number of tests to verify the proper
functionality of some host only packages, which have no visible
menuconfig option, it makes sense to add another BRHostPkgTest class
that allows to easily trigger the build of "make host-<foo>
host-<bar>", and then run some commands on the host machine. Such
tests could be done by using BRConfigTest, but that would require a
bit of duplicated boilerplate, which BRHostPkgTest allows to remove.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
support/testing/infra/basetest.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py
index 9fb9dffc53..13f9b2d398 100644
--- a/support/testing/infra/basetest.py
+++ b/support/testing/infra/basetest.py
@@ -60,6 +60,28 @@ class BRConfigTest(unittest.TestCase):
self.b.delete()
+class BRHostPkgTest(BRConfigTest):
+ """Test up to the build stage of a host package. Define hostpkgs in
+ the class to the list of host packages that should be built."""
+ config = \
+ BASIC_TOOLCHAIN_CONFIG + \
+ MINIMAL_CONFIG
+ hostpkgs = None
+
+ def __init__(self, names):
+ super(BRHostPkgTest, self).__init__(names)
+
+ def setUp(self):
+ super(BRHostPkgTest, self).setUp()
+ if not self.b.is_finished():
+ self.show_msg("Building")
+ self.b.build(make_extra_opts=self.hostpkgs)
+ self.show_msg("Building done")
+
+ def tearDown(self):
+ super(BRHostPkgTest, self).tearDown()
+
+
class BRTest(BRConfigTest):
"""Test up to the build stage and instantiate an emulator."""
def __init__(self, names):
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 03/11] package/python-crccheck: new package
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
2025-10-18 19:42 ` [Buildroot] [PATCH 01/11] support/testing/infra: improve run_cmd_on_host() to show stdout/stderr Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 02/11] support/testing/infra/basetest.py: add BRHostPkgTest class Thomas Petazzoni via buildroot
@ 2025-10-18 19:43 ` Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 04/11] support/testing/tests/package/test_python_serial.py: new test case Thomas Petazzoni via buildroot
` (7 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:43 UTC (permalink / raw)
To: Buildroot List; +Cc: James Hilliard, Thomas Petazzoni, romain.gantois
This commit adds a new host only package for the crccheck Python
module, which is a dependency of Snagboot.
Homepage on PyPi: https://pypi.org/project/crccheck/
This commit also adds a very basic test case that allows to verify
that the Python module can be imported and that some minimal
functionality works.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
DEVELOPERS | 2 ++
package/python-crccheck/python-crccheck.hash | 4 ++++
package/python-crccheck/python-crccheck.mk | 15 +++++++++++++++
.../testing/tests/package/test_python_crccheck.py | 10 ++++++++++
4 files changed, 31 insertions(+)
create mode 100644 package/python-crccheck/python-crccheck.hash
create mode 100644 package/python-crccheck/python-crccheck.mk
create mode 100644 support/testing/tests/package/test_python_crccheck.py
diff --git a/DEVELOPERS b/DEVELOPERS
index 69f22259e8..ec52defef8 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3251,6 +3251,7 @@ F: package/pkg-autotools.mk
F: package/pkg-generic.mk
F: package/python3/
F: package/python-augeas/
+F: package/python-crccheck/
F: package/python-flask-expects-json/
F: package/python-git/
F: package/python-qrcode/
@@ -3280,6 +3281,7 @@ F: support/testing/tests/package/sample_python_git.py
F: support/testing/tests/package/sample_python_unittest_xml_reporting.py
F: support/testing/tests/package/test_nodejs.py
F: support/testing/tests/package/test_python_augeas.py
+F: support/testing/tests/package/test_python_crccheck.py
F: support/testing/tests/package/test_python_flask.py
F: support/testing/tests/package/test_python_flask_expects_json.py
F: support/testing/tests/package/test_python_git.py
diff --git a/package/python-crccheck/python-crccheck.hash b/package/python-crccheck/python-crccheck.hash
new file mode 100644
index 0000000000..3fb58a7299
--- /dev/null
+++ b/package/python-crccheck/python-crccheck.hash
@@ -0,0 +1,4 @@
+# From https://pypi.org/project/crccheck/#crccheck-1.3.1.tar.gz
+sha256 1544c0110bf0a697d875d4f29dc40d7079f9d4d402a9317383f55f90ca72563a crccheck-1.3.1.tar.gz
+# Locally calculated
+sha256 1237ab8ea60caa782d77d9d2ac0cdccd765475e3848b0b91b5751d3f299e9d31 LICENSE.txt
diff --git a/package/python-crccheck/python-crccheck.mk b/package/python-crccheck/python-crccheck.mk
new file mode 100644
index 0000000000..32c1341d32
--- /dev/null
+++ b/package/python-crccheck/python-crccheck.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-crccheck
+#
+################################################################################
+
+PYTHON_CRCCHECK_VERSION = 1.3.1
+PYTHON_CRCCHECK_SOURCE = crccheck-$(PYTHON_CRCCHECK_VERSION).tar.gz
+PYTHON_CRCCHECK_SITE = https://files.pythonhosted.org/packages/3c/d1/a943f4f1ca899917cc3fe1cb89d59348edd1b407503e4b02608e8d6b421e
+PYTHON_CRCCHECK_LICENSE = MIT
+PYTHON_CRCCHECK_LICENSE_FILES = LICENSE.txt
+PYTHON_CRCCHECK_SETUP_TYPE = setuptools
+HOST_PYTHON_CRCCHECK_DEPENDENCIES = host-python-setuptools-scm
+
+$(eval $(host-python-package))
diff --git a/support/testing/tests/package/test_python_crccheck.py b/support/testing/tests/package/test_python_crccheck.py
new file mode 100644
index 0000000000..d51bdc7c9f
--- /dev/null
+++ b/support/testing/tests/package/test_python_crccheck.py
@@ -0,0 +1,10 @@
+import infra.basetest
+
+
+class TestHostPythonCrccheck(infra.basetest.BRHostPkgTest):
+ hostpkgs = ["host-python-crccheck"]
+
+ def test_run(self):
+ cmd = ["host/bin/python3", "-c", "import crccheck; print(crccheck.crc.Crc32.calc(bytearray.fromhex('DEADBEEF')))"]
+ res = infra.run_cmd_on_host(self.builddir, cmd)
+ self.assertEqual(res.strip(), "2090640218")
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 04/11] support/testing/tests/package/test_python_serial.py: new test case
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
` (2 preceding siblings ...)
2025-10-18 19:43 ` [Buildroot] [PATCH 03/11] package/python-crccheck: new package Thomas Petazzoni via buildroot
@ 2025-10-18 19:43 ` Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 05/11] package/python-tftpy: add host variant Thomas Petazzoni via buildroot
` (6 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:43 UTC (permalink / raw)
To: Buildroot List; +Cc: romain.gantois, Thomas Petazzoni
This quickly tests that the host-python-serial package at least
minimally works.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
DEVELOPERS | 1 +
support/testing/tests/package/test_python_serial.py | 12 ++++++++++++
2 files changed, 13 insertions(+)
create mode 100644 support/testing/tests/package/test_python_serial.py
diff --git a/DEVELOPERS b/DEVELOPERS
index ec52defef8..6b525538d7 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3285,6 +3285,7 @@ F: support/testing/tests/package/test_python_crccheck.py
F: support/testing/tests/package/test_python_flask.py
F: support/testing/tests/package/test_python_flask_expects_json.py
F: support/testing/tests/package/test_python_git.py
+F: support/testing/tests/package/test_python_serial.py
F: support/testing/tests/package/test_python_unittest_xml_reporting.py
F: support/testing/tests/toolchain/test_external_arm.py
F: toolchain/
diff --git a/support/testing/tests/package/test_python_serial.py b/support/testing/tests/package/test_python_serial.py
new file mode 100644
index 0000000000..c4b05a10fb
--- /dev/null
+++ b/support/testing/tests/package/test_python_serial.py
@@ -0,0 +1,12 @@
+import infra.basetest
+
+
+class TestHostPythonSerial(infra.basetest.BRHostPkgTest):
+ hostpkgs = ["host-python-serial"]
+
+ def test_run(self):
+ cmd = ["host/bin/python3", "-c", "import serial"]
+ infra.run_cmd_on_host(self.builddir, cmd)
+
+ cmd = ["host/bin/python3", "-m", "serial.tools.list_ports"]
+ infra.run_cmd_on_host(self.builddir, cmd)
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 05/11] package/python-tftpy: add host variant
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
` (3 preceding siblings ...)
2025-10-18 19:43 ` [Buildroot] [PATCH 04/11] support/testing/tests/package/test_python_serial.py: new test case Thomas Petazzoni via buildroot
@ 2025-10-18 19:43 ` Thomas Petazzoni via buildroot
2025-10-20 15:18 ` Colin Foster
2025-10-18 19:43 ` [Buildroot] [PATCH 06/11] package/python-pyusb: enable " Thomas Petazzoni via buildroot
` (5 subsequent siblings)
10 siblings, 1 reply; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:43 UTC (permalink / raw)
To: Buildroot List
Cc: James Hilliard, Colin Foster, Thomas Petazzoni, romain.gantois
A host variant of python-tftpy will be needed for Snagboot, so enable
it, and add a very simple test for the host package. We considered
adding a test that actually starts a TFTP server with tftpy and then
downloads from that server with the client-side of tftpy, but
allocating an available UDP port reliably is tricky, so we kept the
test case very simple for now.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
package/python-tftpy/python-tftpy.mk | 1 +
support/testing/tests/package/test_python_tftpy.py | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/package/python-tftpy/python-tftpy.mk b/package/python-tftpy/python-tftpy.mk
index 66de17eaab..322d514f1f 100644
--- a/package/python-tftpy/python-tftpy.mk
+++ b/package/python-tftpy/python-tftpy.mk
@@ -11,3 +11,4 @@ PYTHON_TFTPY_LICENSE_FILES = LICENSE
PYTHON_TFTPY_SETUP_TYPE = setuptools
$(eval $(python-package))
+$(eval $(host-python-package))
diff --git a/support/testing/tests/package/test_python_tftpy.py b/support/testing/tests/package/test_python_tftpy.py
index d64f2c29d7..1dfbde0b67 100644
--- a/support/testing/tests/package/test_python_tftpy.py
+++ b/support/testing/tests/package/test_python_tftpy.py
@@ -1,4 +1,5 @@
from tests.package.test_python import TestPythonPackageBase
+import infra.basetest
class TestPythonTftpy(TestPythonPackageBase):
@@ -9,3 +10,11 @@ class TestPythonTftpy(TestPythonPackageBase):
BR2_PACKAGE_PYTHON_TFTPY=y
"""
sample_scripts = ["tests/package/sample_python_tftpy.py"]
+
+
+class TestHostPythonTftpy(infra.basetest.BRHostPkgTest):
+ hostpkgs = ["host-python-tftpy"]
+
+ def test_run(self):
+ cmd = ["host/bin/python3", "-c", "import tftpy"]
+ infra.run_cmd_on_host(self.builddir, cmd)
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 06/11] package/python-pyusb: enable host variant
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
` (4 preceding siblings ...)
2025-10-18 19:43 ` [Buildroot] [PATCH 05/11] package/python-tftpy: add host variant Thomas Petazzoni via buildroot
@ 2025-10-18 19:43 ` Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 07/11] package/python-xmodem: add " Thomas Petazzoni via buildroot
` (4 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:43 UTC (permalink / raw)
To: Buildroot List
Cc: Wojciech M. Zabolotny, James Hilliard, Thomas Petazzoni,
romain.gantois
The host variant of python-pyusb will be neded for Snagboot, so it is
enabled with this commit. In addition, we're adding a very simple test
case to validate that host-python-pyusb minimally works.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
DEVELOPERS | 1 +
package/python-pyusb/python-pyusb.mk | 2 ++
support/testing/tests/package/test_python_pyusb.py | 9 +++++++++
3 files changed, 12 insertions(+)
create mode 100644 support/testing/tests/package/test_python_pyusb.py
diff --git a/DEVELOPERS b/DEVELOPERS
index 6b525538d7..4501a1c98d 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3285,6 +3285,7 @@ F: support/testing/tests/package/test_python_crccheck.py
F: support/testing/tests/package/test_python_flask.py
F: support/testing/tests/package/test_python_flask_expects_json.py
F: support/testing/tests/package/test_python_git.py
+F: support/testing/tests/package/test_python_pyusb.py
F: support/testing/tests/package/test_python_serial.py
F: support/testing/tests/package/test_python_unittest_xml_reporting.py
F: support/testing/tests/toolchain/test_external_arm.py
diff --git a/package/python-pyusb/python-pyusb.mk b/package/python-pyusb/python-pyusb.mk
index 7f4c9724f2..cce48e0df8 100644
--- a/package/python-pyusb/python-pyusb.mk
+++ b/package/python-pyusb/python-pyusb.mk
@@ -11,5 +11,7 @@ PYTHON_PYUSB_LICENSE = BSD-3-Clause
PYTHON_PYUSB_LICENSE_FILES = LICENSE
PYTHON_PYUSB_SETUP_TYPE = setuptools
PYTHON_PYUSB_DEPENDENCIES = host-python-setuptools-scm libusb
+HOST_PYTHON_PYUSB_DEPENDENCIES = host-python-setuptools-scm host-libusb
$(eval $(python-package))
+$(eval $(host-python-package))
diff --git a/support/testing/tests/package/test_python_pyusb.py b/support/testing/tests/package/test_python_pyusb.py
new file mode 100644
index 0000000000..1e0dbba446
--- /dev/null
+++ b/support/testing/tests/package/test_python_pyusb.py
@@ -0,0 +1,9 @@
+import infra.basetest
+
+
+class TestHostPythonPyusb(infra.basetest.BRHostPkgTest):
+ hostpkgs = ["host-python-pyusb"]
+
+ def test_run(self):
+ cmd = ["host/bin/python3", "-c", "import usb"]
+ infra.run_cmd_on_host(self.builddir, cmd)
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 07/11] package/python-xmodem: add host variant
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
` (5 preceding siblings ...)
2025-10-18 19:43 ` [Buildroot] [PATCH 06/11] package/python-pyusb: enable " Thomas Petazzoni via buildroot
@ 2025-10-18 19:43 ` Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 08/11] package/python-appdirs: " Thomas Petazzoni via buildroot
` (3 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:43 UTC (permalink / raw)
To: Buildroot List
Cc: James Hilliard, Marcin Niestroj, Thomas Petazzoni, romain.gantois
The host variant of python-xmodem will be needed by Snagboot, so this
commit enables it. We also add a very simple test case that simply
makes sure we can import the module. Testing xmodem more extensively
is difficult without an actual serial port to open.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
DEVELOPERS | 1 +
package/python-xmodem/python-xmodem.mk | 1 +
support/testing/tests/package/test_python_xmodem.py | 9 +++++++++
3 files changed, 11 insertions(+)
create mode 100644 support/testing/tests/package/test_python_xmodem.py
diff --git a/DEVELOPERS b/DEVELOPERS
index 4501a1c98d..63c8d5673c 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3288,6 +3288,7 @@ F: support/testing/tests/package/test_python_git.py
F: support/testing/tests/package/test_python_pyusb.py
F: support/testing/tests/package/test_python_serial.py
F: support/testing/tests/package/test_python_unittest_xml_reporting.py
+F: support/testing/tests/package/test_python_xmodem.py
F: support/testing/tests/toolchain/test_external_arm.py
F: toolchain/
diff --git a/package/python-xmodem/python-xmodem.mk b/package/python-xmodem/python-xmodem.mk
index d7040f7245..1ef5f53bec 100644
--- a/package/python-xmodem/python-xmodem.mk
+++ b/package/python-xmodem/python-xmodem.mk
@@ -12,3 +12,4 @@ PYTHON_XMODEM_LICENSE = MIT
PYTHON_XMODEM_LICENSE_FILES = LICENSE
$(eval $(python-package))
+$(eval $(host-python-package))
diff --git a/support/testing/tests/package/test_python_xmodem.py b/support/testing/tests/package/test_python_xmodem.py
new file mode 100644
index 0000000000..b9feb78109
--- /dev/null
+++ b/support/testing/tests/package/test_python_xmodem.py
@@ -0,0 +1,9 @@
+import infra.basetest
+
+
+class TestHostPythonXmodem(infra.basetest.BRHostPkgTest):
+ hostpkgs = ["host-python-xmodem"]
+
+ def test_run(self):
+ cmd = ["host/bin/python3", "-c", "import xmodem"]
+ infra.run_cmd_on_host(self.builddir, cmd)
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 08/11] package/python-appdirs: add host variant
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
` (6 preceding siblings ...)
2025-10-18 19:43 ` [Buildroot] [PATCH 07/11] package/python-xmodem: add " Thomas Petazzoni via buildroot
@ 2025-10-18 19:43 ` Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 09/11] package/python-fs: new package Thomas Petazzoni via buildroot
` (2 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:43 UTC (permalink / raw)
To: Buildroot List; +Cc: James Hilliard, Thomas Petazzoni, romain.gantois
The host variant will be needed by the host-python-fs package, soon to
be added.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
package/python-appdirs/python-appdirs.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/python-appdirs/python-appdirs.mk b/package/python-appdirs/python-appdirs.mk
index 222aadbb29..3ecf281db0 100644
--- a/package/python-appdirs/python-appdirs.mk
+++ b/package/python-appdirs/python-appdirs.mk
@@ -12,3 +12,4 @@ PYTHON_APPDIRS_LICENSE = MIT
PYTHON_APPDIRS_LICENSE_FILES = LICENSE.txt
$(eval $(python-package))
+$(eval $(host-python-package))
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 09/11] package/python-fs: new package
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
` (7 preceding siblings ...)
2025-10-18 19:43 ` [Buildroot] [PATCH 08/11] package/python-appdirs: " Thomas Petazzoni via buildroot
@ 2025-10-18 19:43 ` Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 10/11] package/python-pyfatfs: " Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 11/11] package/snagboot: " Thomas Petazzoni via buildroot
10 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:43 UTC (permalink / raw)
To: Buildroot List; +Cc: James Hilliard, Thomas Petazzoni, romain.gantois
This commit adds a host package for the Python 'fs' module, needed as
a dependency of pyfatfs, itself needed by Snagboot.
Homepage: https://pypi.org/project/fs/
In addition, a very simple test case is adding to check that
host-python-fs is minimally working.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
DEVELOPERS | 2 ++
package/python-fs/python-fs.hash | 5 +++++
package/python-fs/python-fs.mk | 15 +++++++++++++++
support/testing/tests/package/test_python_fs.py | 9 +++++++++
4 files changed, 31 insertions(+)
create mode 100644 package/python-fs/python-fs.hash
create mode 100644 package/python-fs/python-fs.mk
create mode 100644 support/testing/tests/package/test_python_fs.py
diff --git a/DEVELOPERS b/DEVELOPERS
index 63c8d5673c..a774c30341 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3253,6 +3253,7 @@ F: package/python3/
F: package/python-augeas/
F: package/python-crccheck/
F: package/python-flask-expects-json/
+F: package/python-fs/
F: package/python-git/
F: package/python-qrcode/
F: package/python-serial/
@@ -3284,6 +3285,7 @@ F: support/testing/tests/package/test_python_augeas.py
F: support/testing/tests/package/test_python_crccheck.py
F: support/testing/tests/package/test_python_flask.py
F: support/testing/tests/package/test_python_flask_expects_json.py
+F: support/testing/tests/package/test_python_fs.py
F: support/testing/tests/package/test_python_git.py
F: support/testing/tests/package/test_python_pyusb.py
F: support/testing/tests/package/test_python_serial.py
diff --git a/package/python-fs/python-fs.hash b/package/python-fs/python-fs.hash
new file mode 100644
index 0000000000..5ebb49128d
--- /dev/null
+++ b/package/python-fs/python-fs.hash
@@ -0,0 +1,5 @@
+# From https://pypi.org/project/fs/#fs-2.4.16.tar.gz
+sha256 ae97c7d51213f4b70b6a958292530289090de3a7e15841e108fbe144f069d313 fs-2.4.16.tar.gz
+
+# Locally calculated
+sha256 bcc1fbae1da071a15d17fd7609519af1160a3d72c65622047b61e19ba63e780d LICENSE
diff --git a/package/python-fs/python-fs.mk b/package/python-fs/python-fs.mk
new file mode 100644
index 0000000000..8d684e6ebd
--- /dev/null
+++ b/package/python-fs/python-fs.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-fs
+#
+################################################################################
+
+PYTHON_FS_VERSION = 2.4.16
+PYTHON_FS_SOURCE = fs-$(PYTHON_FS_VERSION).tar.gz
+PYTHON_FS_SITE = https://files.pythonhosted.org/packages/5d/a9/af5bfd5a92592c16cdae5c04f68187a309be8a146b528eac3c6e30edbad2
+PYTHON_FS_SETUP_TYPE = setuptools
+PYTHON_FS_LICENSE = MIT
+PYTHON_FS_LICENSE_FILES = LICENSE
+HOST_PYTHON_FS_DEPENDENCIES = host-python-six host-python-appdirs
+
+$(eval $(host-python-package))
diff --git a/support/testing/tests/package/test_python_fs.py b/support/testing/tests/package/test_python_fs.py
new file mode 100644
index 0000000000..a53d8a64c8
--- /dev/null
+++ b/support/testing/tests/package/test_python_fs.py
@@ -0,0 +1,9 @@
+import infra.basetest
+
+
+class TestHostPythonFs(infra.basetest.BRHostPkgTest):
+ hostpkgs = ["host-python-fs"]
+
+ def test_run(self):
+ cmd = ["host/bin/python3", "-c", "import fs; fs.open_fs('mem://'); fs.open_fs('temp://')"]
+ infra.run_cmd_on_host(self.builddir, cmd)
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 10/11] package/python-pyfatfs: new package
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
` (8 preceding siblings ...)
2025-10-18 19:43 ` [Buildroot] [PATCH 09/11] package/python-fs: new package Thomas Petazzoni via buildroot
@ 2025-10-18 19:43 ` Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 11/11] package/snagboot: " Thomas Petazzoni via buildroot
10 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:43 UTC (permalink / raw)
To: Buildroot List; +Cc: James Hilliard, Thomas Petazzoni, romain.gantois
This commit adds a new host package for python-pyfatfs, which is
needed by Snagboot.
Homepage: https://pypi.org/project/pyfatfs/
A small test doing some minimal verification that pyfatfs works is
also added.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
DEVELOPERS | 2 +
...oject.toml-relax-version-constraints.patch | 45 ++++++++++++++++
package/python-pyfatfs/python-pyfatfs.hash | 4 ++
package/python-pyfatfs/python-pyfatfs.mk | 17 ++++++
.../tests/package/test_python_pyfatfs.py | 53 +++++++++++++++++++
5 files changed, 121 insertions(+)
create mode 100644 package/python-pyfatfs/0001-pyproject.toml-relax-version-constraints.patch
create mode 100644 package/python-pyfatfs/python-pyfatfs.hash
create mode 100644 package/python-pyfatfs/python-pyfatfs.mk
create mode 100644 support/testing/tests/package/test_python_pyfatfs.py
diff --git a/DEVELOPERS b/DEVELOPERS
index a774c30341..7d48975896 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3255,6 +3255,7 @@ F: package/python-crccheck/
F: package/python-flask-expects-json/
F: package/python-fs/
F: package/python-git/
+F: package/python-pyfatfs/
F: package/python-qrcode/
F: package/python-serial/
F: package/python-unittest-xml-reporting/
@@ -3287,6 +3288,7 @@ F: support/testing/tests/package/test_python_flask.py
F: support/testing/tests/package/test_python_flask_expects_json.py
F: support/testing/tests/package/test_python_fs.py
F: support/testing/tests/package/test_python_git.py
+F: support/testing/tests/package/test_python_pyfatfs.py
F: support/testing/tests/package/test_python_pyusb.py
F: support/testing/tests/package/test_python_serial.py
F: support/testing/tests/package/test_python_unittest_xml_reporting.py
diff --git a/package/python-pyfatfs/0001-pyproject.toml-relax-version-constraints.patch b/package/python-pyfatfs/0001-pyproject.toml-relax-version-constraints.patch
new file mode 100644
index 0000000000..791401f876
--- /dev/null
+++ b/package/python-pyfatfs/0001-pyproject.toml-relax-version-constraints.patch
@@ -0,0 +1,45 @@
+From 9d40ef086d25c8434adcf6552de1d8bb5022a277 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Date: Mon, 22 Sep 2025 23:27:47 +0200
+Subject: [PATCH] pyproject.toml: relax version constraints
+
+The version constraints defined with ~= in pyproject.toml are too
+strict, and don't allow using pyfatfs with newer versions.
+
+We have successfully tested with:
+
+- setuptools 80.9.0
+- setuptools-scm 8.3.1
+- python 3.13
+- fs 2.4.16
+
+Upstream: https://github.com/nathanhi/pyfatfs/pull/47
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ pyproject.toml | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index 9649c10..a6eb198 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -1,13 +1,13 @@
+ [build-system]
+-requires = ["setuptools ~= 67.8", "setuptools_scm[toml] ~= 7.1"]
++requires = ["setuptools >= 67.8", "setuptools_scm[toml] >= 7.1"]
+ build-backend = "setuptools.build_meta"
+
+ [project]
+ name = "pyfatfs"
+ description = "FAT12/FAT16/FAT32 implementation with VFAT support"
+ readme = "README.rst"
+-requires-python = "~=3.8"
+-dependencies = ["fs~=2.4"]
++requires-python = ">=3.8"
++dependencies = ["fs>=2.4"]
+ keywords = ["filesystem", "PyFilesystem2", "FAT12", "FAT16", "FAT32", "VFAT", "LFN"]
+ license = {file = "LICENSE"}
+ classifiers = [
+--
+2.51.0
+
diff --git a/package/python-pyfatfs/python-pyfatfs.hash b/package/python-pyfatfs/python-pyfatfs.hash
new file mode 100644
index 0000000000..05e940779e
--- /dev/null
+++ b/package/python-pyfatfs/python-pyfatfs.hash
@@ -0,0 +1,4 @@
+# From https://pypi.org/project/pyfatfs/#pyfatfs-1.1.0.tar.gz
+sha256 9725ccd0a4da1c09c27358abbf10f08c043ac84210af576803e087f51a2b30e0 pyfatfs-1.1.0.tar.gz
+# Locally calculated
+sha256 df8f053d3cbf23fe7002e6a34b06580653a74d40dc2e54f3b717a963ea9b70cb LICENSE
diff --git a/package/python-pyfatfs/python-pyfatfs.mk b/package/python-pyfatfs/python-pyfatfs.mk
new file mode 100644
index 0000000000..a61fb1afb2
--- /dev/null
+++ b/package/python-pyfatfs/python-pyfatfs.mk
@@ -0,0 +1,17 @@
+################################################################################
+#
+# python-pyfatfs
+#
+################################################################################
+
+PYTHON_PYFATFS_VERSION = 1.1.0
+PYTHON_PYFATFS_SOURCE = pyfatfs-$(PYTHON_PYFATFS_VERSION).tar.gz
+PYTHON_PYFATFS_SITE = https://files.pythonhosted.org/packages/44/3f/d08f1dbc44a7eef9c7fb355b83423fbd15bb3e487c250479a2c179cb39bf
+PYTHON_PYFATFS_LICENSE = MIT
+PYTHON_PYFATFS_LICENSE_FILES = LICENSE
+PYTHON_PYFATFS_SETUP_TYPE = setuptools
+# host-python-fs is not a build time dependency, but is needed at
+# runtime for host-python-pyfatfs to work
+HOST_PYTHON_PYFATFS_DEPENDENCIES = host-python-setuptools-scm host-python-fs
+
+$(eval $(host-python-package))
diff --git a/support/testing/tests/package/test_python_pyfatfs.py b/support/testing/tests/package/test_python_pyfatfs.py
new file mode 100644
index 0000000000..ceb4e924a1
--- /dev/null
+++ b/support/testing/tests/package/test_python_pyfatfs.py
@@ -0,0 +1,53 @@
+import infra.basetest
+import os
+
+
+class TestHostPythonPyfatfs(infra.basetest.BRHostPkgTest):
+ hostpkgs = ["host-python-pyfatfs",
+ "host-genimage",
+ "host-dosfstools",
+ "host-mtools"]
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + infra.basetest.MINIMAL_CONFIG + \
+ """
+ BR2_PACKAGE_HOST_GENIMAGE=y
+ BR2_PACKAGE_HOST_DOSFSTOOLS=y
+ BR2_PACKAGE_HOST_MTOOLS=y
+ """
+
+ genimage_cfg = """
+image test.vfat {
+ vfat {
+ files = {
+ "test.txt"
+ }
+ }
+
+ size = 8M
+}"""
+
+ def test_run(self):
+ os.makedirs(os.path.join(self.builddir, "genimage-input"),
+ exist_ok=True)
+ with open(os.path.join(self.builddir, "genimage-input", "test.txt"), "w") as f:
+ f.write("Hello World!")
+ with open(os.path.join(self.builddir, "genimage.cfg"), "w") as f:
+ f.write(self.genimage_cfg)
+ os.makedirs(os.path.join(self.builddir, "genimage-tmp"),
+ exist_ok=True)
+ os.makedirs(os.path.join(self.builddir, "genimage-root"),
+ exist_ok=True)
+
+ cmd = ["host/bin/genimage",
+ "--config", os.path.join(self.builddir, "genimage.cfg"),
+ "--outputpath", self.builddir,
+ "--inputpath", os.path.join(self.builddir, "genimage-input"),
+ "--tmppath", os.path.join(self.builddir, "genimage-tmp"),
+ "--rootpath", os.path.join(self.builddir, "genimage-root"),
+ "--mkdosfs", os.path.join(self.builddir, "host", "sbin", "mkdosfs"),
+ "--mcopy", os.path.join(self.builddir, "host", "bin", "mcopy")
+ ]
+ infra.run_cmd_on_host(self.builddir, cmd)
+
+ cmd = ["host/bin/python3", "-c",
+ "import fs; fatfs = fs.open_fs('fat://test.vfat'); assert(fatfs.listdir('/') == ['TEST.TXT'])"]
+ infra.run_cmd_on_host(self.builddir, cmd)
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Buildroot] [PATCH 11/11] package/snagboot: new package
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
` (9 preceding siblings ...)
2025-10-18 19:43 ` [Buildroot] [PATCH 10/11] package/python-pyfatfs: " Thomas Petazzoni via buildroot
@ 2025-10-18 19:43 ` Thomas Petazzoni via buildroot
2025-10-20 7:17 ` Romain Gantois via buildroot
10 siblings, 1 reply; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-18 19:43 UTC (permalink / raw)
To: Buildroot List; +Cc: romain.gantois, Thomas Petazzoni
This commit adds a package for Snagboot, the open-source
vendor-neutral recover and reflashing tool for embedded targets. We
install the dependencies needed for snagrecover and snagflash, but we
don't bother installing the dependencies of the GUI-based snagfactory,
as that would require Kivy on the host, which is Qt based.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
DEVELOPERS | 2 ++
package/Config.in.host | 1 +
package/snagboot/Config.in.host | 8 +++++
package/snagboot/snagboot.hash | 3 ++
package/snagboot/snagboot.mk | 29 +++++++++++++++++++
.../testing/tests/package/test_snagboot.py | 16 ++++++++++
6 files changed, 59 insertions(+)
create mode 100644 package/snagboot/Config.in.host
create mode 100644 package/snagboot/snagboot.hash
create mode 100644 package/snagboot/snagboot.mk
create mode 100644 support/testing/tests/package/test_snagboot.py
diff --git a/DEVELOPERS b/DEVELOPERS
index 7d48975896..1bc0824952 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3267,6 +3267,7 @@ F: package/rt-tests/
F: package/rtc-tools/
F: package/sam-ba/
F: package/scons/
+F: package/snagboot/
F: package/squashfs/
F: package/tinifier/
F: package/wayland/
@@ -3291,6 +3292,7 @@ F: support/testing/tests/package/test_python_git.py
F: support/testing/tests/package/test_python_pyfatfs.py
F: support/testing/tests/package/test_python_pyusb.py
F: support/testing/tests/package/test_python_serial.py
+F: support/testing/tests/package/test_snagboot.py
F: support/testing/tests/package/test_python_unittest_xml_reporting.py
F: support/testing/tests/package/test_python_xmodem.py
F: support/testing/tests/toolchain/test_external_arm.py
diff --git a/package/Config.in.host b/package/Config.in.host
index b0f7529a13..d0088364d0 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -112,6 +112,7 @@ menu "Host utilities"
source "package/sentry-cli/Config.in.host"
source "package/skopeo/Config.in.host"
source "package/sloci-image/Config.in.host"
+ source "package/snagboot/Config.in.host"
source "package/squashfs/Config.in.host"
source "package/starfive-spltool/Config.in.host"
source "package/sunxi-tools/Config.in.host"
diff --git a/package/snagboot/Config.in.host b/package/snagboot/Config.in.host
new file mode 100644
index 0000000000..3087348a87
--- /dev/null
+++ b/package/snagboot/Config.in.host
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HOST_SNAGBOOT
+ bool "host snagboot"
+ help
+ Snagboot intends to be an open-source and generic
+ replacement to the vendor-specific, sometimes proprietary,
+ tools used to recover and/or reflash embedded platforms.
+
+ https://github.com/bootlin/snagboot/
diff --git a/package/snagboot/snagboot.hash b/package/snagboot/snagboot.hash
new file mode 100644
index 0000000000..e5978617aa
--- /dev/null
+++ b/package/snagboot/snagboot.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 a3ace4245472141c0cdcd8e095530652ce95d804f7515a29613ddb07d2c32033 snagboot-2.4.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSE
diff --git a/package/snagboot/snagboot.mk b/package/snagboot/snagboot.mk
new file mode 100644
index 0000000000..12f77c0b14
--- /dev/null
+++ b/package/snagboot/snagboot.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# snagboot
+#
+################################################################################
+
+SNAGBOOT_VERSION = 2.4
+SNAGBOOT_SITE = $(call github,bootlin,snagboot,v$(SNAGBOOT_VERSION))
+SNAGBOOT_LICENSE = GPL-2.0
+SNAGBOOT_LICENSE_FILES = LICENSE
+SNAGBOOT_SETUP_TYPE = setuptools
+HOST_SNAGBOOT_DEPENDENCIES = \
+ host-python-pyyaml \
+ host-python-pyusb \
+ host-python-serial \
+ host-python-xmodem \
+ host-python-tftpy \
+ host-python-crccheck \
+ host-python-pylibfdt \
+ host-python-packaging \
+ host-python-pyfatfs
+
+# We do not install the dependencies for the snagfactory GUI
+define SNAGBOOT_REMOVE_SNAGFACTORY
+ $(RM) $(HOST_DIR)/bin/snagfactory
+endef
+HOST_SNAGBOOT_POST_INSTALL_HOOKS += SNAGBOOT_REMOVE_SNAGFACTORY
+
+$(eval $(host-python-package))
diff --git a/support/testing/tests/package/test_snagboot.py b/support/testing/tests/package/test_snagboot.py
new file mode 100644
index 0000000000..65fe196520
--- /dev/null
+++ b/support/testing/tests/package/test_snagboot.py
@@ -0,0 +1,16 @@
+import infra.basetest
+
+
+class TestHostSnagboot(infra.basetest.BRHostPkgTest):
+ hostpkgs = ["host-snagboot"]
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+ """
+ BR2_PACKAGE_HOST_SNAGBOOT=y
+ """
+
+ def test_run(self):
+ cmd = ["host/bin/snagrecover", "--help"]
+ infra.run_cmd_on_host(self.builddir, cmd)
+
+ cmd = ["host/bin/snagflash", "--help"]
+ infra.run_cmd_on_host(self.builddir, cmd)
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [Buildroot] [PATCH 11/11] package/snagboot: new package
2025-10-18 19:43 ` [Buildroot] [PATCH 11/11] package/snagboot: " Thomas Petazzoni via buildroot
@ 2025-10-20 7:17 ` Romain Gantois via buildroot
2025-10-20 7:54 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 18+ messages in thread
From: Romain Gantois via buildroot @ 2025-10-20 7:17 UTC (permalink / raw)
To: Buildroot List, Thomas Petazzoni; +Cc: Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 526 bytes --]
Hi Thomas,
On Saturday, 18 October 2025 21:43:09 CEST Thomas Petazzoni wrote:
> This commit adds a package for Snagboot, the open-source
...
> +
> +# We do not install the dependencies for the snagfactory GUI
> +define SNAGBOOT_REMOVE_SNAGFACTORY
> + $(RM) $(HOST_DIR)/bin/snagfactory
> +endef
Only the "gui" variant of the Snagboot package provides Snagfactory, the base
version doesn't, so is this removal really necessary?
Thanks!
--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Buildroot] [PATCH 11/11] package/snagboot: new package
2025-10-20 7:17 ` Romain Gantois via buildroot
@ 2025-10-20 7:54 ` Thomas Petazzoni via buildroot
2025-10-29 8:13 ` Romain Gantois via buildroot
0 siblings, 1 reply; 18+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-10-20 7:54 UTC (permalink / raw)
To: Romain Gantois; +Cc: Buildroot List
Hello Romain,
On Mon, 20 Oct 2025 09:17:49 +0200
Romain Gantois <romain.gantois@bootlin.com> wrote:
> Only the "gui" variant of the Snagboot package provides Snagfactory, the base
> version doesn't, so is this removal really necessary?
From my testing, the snagfactory main script gets installed, which is
why I had to remove it.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Buildroot] [PATCH 05/11] package/python-tftpy: add host variant
2025-10-18 19:43 ` [Buildroot] [PATCH 05/11] package/python-tftpy: add host variant Thomas Petazzoni via buildroot
@ 2025-10-20 15:18 ` Colin Foster
0 siblings, 0 replies; 18+ messages in thread
From: Colin Foster @ 2025-10-20 15:18 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: James Hilliard, romain.gantois, Buildroot List
On Sat, Oct 18, 2025 at 09:43:03PM +0200, Thomas Petazzoni wrote:
> A host variant of python-tftpy will be needed for Snagboot, so enable
> it, and add a very simple test for the host package. We considered
> adding a test that actually starts a TFTP server with tftpy and then
> downloads from that server with the client-side of tftpy, but
> allocating an available UDP port reliably is tricky, so we kept the
> test case very simple for now.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Looks good to me. For what its worth:
Reviewed-by: Colin Foster <colin.foster@in-advantage.com>
The tftpy package is a little out of date. There were some issues with
packaging / setuptools. I don't think it should make a difference to
Buildroot, but I've been letting the dust settle either way. I can send
a patch to the latest (0.8.6) if that's desired.
Colin
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Buildroot] [PATCH 11/11] package/snagboot: new package
2025-10-20 7:54 ` Thomas Petazzoni via buildroot
@ 2025-10-29 8:13 ` Romain Gantois via buildroot
0 siblings, 0 replies; 18+ messages in thread
From: Romain Gantois via buildroot @ 2025-10-29 8:13 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Buildroot List
[-- Attachment #1.1: Type: text/plain, Size: 564 bytes --]
Hi Thomas,
On Monday, 20 October 2025 09:54:51 CET Thomas Petazzoni wrote:
> Hello Romain,
>
> On Mon, 20 Oct 2025 09:17:49 +0200
>
> Romain Gantois <romain.gantois@bootlin.com> wrote:
> > Only the "gui" variant of the Snagboot package provides Snagfactory, the
> > base version doesn't, so is this removal really necessary?
>
> From my testing, the snagfactory main script gets installed, which is
> why I had to remove it.
Okay, lets just keep the removal for now then.
--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Buildroot] [PATCH 01/11] support/testing/infra: improve run_cmd_on_host() to show stdout/stderr
2025-10-18 19:42 ` [Buildroot] [PATCH 01/11] support/testing/infra: improve run_cmd_on_host() to show stdout/stderr Thomas Petazzoni via buildroot
@ 2025-10-30 21:03 ` Julien Olivain via buildroot
2025-11-17 19:56 ` Arnout Vandecappelle via buildroot
1 sibling, 0 replies; 18+ messages in thread
From: Julien Olivain via buildroot @ 2025-10-30 21:03 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Buildroot List, romain.gantois, Ricardo Martincoski
On 18/10/2025 21:42, Thomas Petazzoni via buildroot wrote:
> When run_cmd_on_host() runs a command that fails, we only get an
> exception with no details to debug what happened. Let's improve that
> by catching the exception, and printing the command output. This
> requires redirecting stderr to stdout (instead of /dev/null) and
> asking to get the output in text format.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Series applied to master, thanks.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Buildroot] [PATCH 01/11] support/testing/infra: improve run_cmd_on_host() to show stdout/stderr
2025-10-18 19:42 ` [Buildroot] [PATCH 01/11] support/testing/infra: improve run_cmd_on_host() to show stdout/stderr Thomas Petazzoni via buildroot
2025-10-30 21:03 ` Julien Olivain via buildroot
@ 2025-11-17 19:56 ` Arnout Vandecappelle via buildroot
1 sibling, 0 replies; 18+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2025-11-17 19:56 UTC (permalink / raw)
To: Thomas Petazzoni, Buildroot List; +Cc: romain.gantois, Ricardo Martincoski
On 18/10/2025 21:42, Thomas Petazzoni via buildroot wrote:
> When run_cmd_on_host() runs a command that fails, we only get an
> exception with no details to debug what happened. Let's improve that
> by catching the exception, and printing the command output. This
> requires redirecting stderr to stdout (instead of /dev/null) and
> asking to get the output in text format.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Applied to 2025.02.x and 2025.08.x, thanks.
Regards,
Arnout
> ---
> support/testing/infra/__init__.py | 19 ++++++++++++++-----
> 1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/support/testing/infra/__init__.py b/support/testing/infra/__init__.py
> index 1f003f24c6..52308395a3 100644
> --- a/support/testing/infra/__init__.py
> +++ b/support/testing/infra/__init__.py
> @@ -59,11 +59,20 @@ def download(dldir, filename):
>
> def run_cmd_on_host(builddir, cmd):
> """Call subprocess.check_output and return the text output."""
> - out = subprocess.check_output(cmd,
> - stderr=open(os.devnull, "w"),
> - cwd=builddir,
> - env={"LANG": "C"},
> - universal_newlines=True)
> + try:
> + out = subprocess.check_output(cmd,
> + cwd=builddir,
> + env={"LANG": "C"},
> + stderr=subprocess.STDOUT,
> + text=True,
> + universal_newlines=True)
> + except subprocess.CalledProcessError as e:
> + print(f"Command failed with return code {e.returncode}")
> + print("=== STDOUT/STDERR ===")
> + print(e.output)
> + print("=====================")
> + raise
> +
> return out
>
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2025-11-17 19:56 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-18 19:42 [Buildroot] [PATCH 00/11] Add support for building Snagboot Thomas Petazzoni via buildroot
2025-10-18 19:42 ` [Buildroot] [PATCH 01/11] support/testing/infra: improve run_cmd_on_host() to show stdout/stderr Thomas Petazzoni via buildroot
2025-10-30 21:03 ` Julien Olivain via buildroot
2025-11-17 19:56 ` Arnout Vandecappelle via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 02/11] support/testing/infra/basetest.py: add BRHostPkgTest class Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 03/11] package/python-crccheck: new package Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 04/11] support/testing/tests/package/test_python_serial.py: new test case Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 05/11] package/python-tftpy: add host variant Thomas Petazzoni via buildroot
2025-10-20 15:18 ` Colin Foster
2025-10-18 19:43 ` [Buildroot] [PATCH 06/11] package/python-pyusb: enable " Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 07/11] package/python-xmodem: add " Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 08/11] package/python-appdirs: " Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 09/11] package/python-fs: new package Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 10/11] package/python-pyfatfs: " Thomas Petazzoni via buildroot
2025-10-18 19:43 ` [Buildroot] [PATCH 11/11] package/snagboot: " Thomas Petazzoni via buildroot
2025-10-20 7:17 ` Romain Gantois via buildroot
2025-10-20 7:54 ` Thomas Petazzoni via buildroot
2025-10-29 8:13 ` Romain Gantois via buildroot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.