package/snagboot: new package

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>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Thomas Petazzoni
2025-10-18 21:43:09 +02:00
committed by Julien Olivain
parent 49a81c77d7
commit bf4e1ec19f
6 changed files with 59 additions and 0 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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/

View File

@@ -0,0 +1,3 @@
# Locally calculated
sha256 a3ace4245472141c0cdcd8e095530652ce95d804f7515a29613ddb07d2c32033 snagboot-2.4.tar.gz
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSE

View File

@@ -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))

View File

@@ -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)