[Buildroot] [git commit] package/snagboot: new package
Julien Olivain
ju.o at free.fr
Thu Oct 30 20:16:47 UTC 2025
commit: https://git.buildroot.net/buildroot/commit/?id=bf4e1ec19f7714b03243afaa29b15f8b29ba8fea
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
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 at bootlin.com>
Signed-off-by: Julien Olivain <ju.o at free.fr>
---
DEVELOPERS | 2 ++
package/Config.in.host | 1 +
package/snagboot/Config.in.host | 8 +++++++
package/snagboot/snagboot.hash | 3 +++
package/snagboot/snagboot.mk | 29 ++++++++++++++++++++++++++
support/testing/tests/package/test_snagboot.py | 16 ++++++++++++++
6 files changed, 59 insertions(+)
diff --git a/DEVELOPERS b/DEVELOPERS
index fa9fe7bbe2..7c2967f41d 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3271,6 +3271,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/
@@ -3295,6 +3296,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)
More information about the buildroot
mailing list