From a9fdc0baea39875fff9dfb6107a2b571e1e26829 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Tue, 23 Apr 2024 11:47:50 +0200 Subject: [PATCH] mcuboot: add option to specify MCUboot source git repository Configuration option MCUBOOT_REPOSITORY adds possibility to configure MCUboot GIT repository to be downloaded (for specified hash commit or version). This allows to use different forks and personal repositories. MCUboot main repository is kept as default option. Signed-off-by: Michal Lenc --- boot/mcuboot/Kconfig | 12 ++++++++++++ boot/mcuboot/Makefile | 13 +++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/boot/mcuboot/Kconfig b/boot/mcuboot/Kconfig index c09133149..f5c904a7a 100644 --- a/boot/mcuboot/Kconfig +++ b/boot/mcuboot/Kconfig @@ -12,9 +12,21 @@ menuconfig BOOT_MCUBOOT if BOOT_MCUBOOT +config MCUBOOT_REPOSITORY + string "MCUboot GIT repository" + default "github.com/mcu-tools/mcuboot" + ---help--- + Specifies the location of MCUboot GIT repository . This + is by default MCUboot main GIT repository, but it can be changed + to user's fork if required. + config MCUBOOT_VERSION string "MCUboot version" default "fefc398cc13ebbc527e297fe9df78cd98a359d75" + ---help--- + Defines MCUboot version to be downloaded. Either release tag + or commit hash should be specified. Using newer MCUboot version + may cause compatability issues. config MCUBOOT_ENABLE_LOGGING bool "Enable MCUboot logging" diff --git a/boot/mcuboot/Makefile b/boot/mcuboot/Makefile index 3fbd6c62a..8232a1250 100644 --- a/boot/mcuboot/Makefile +++ b/boot/mcuboot/Makefile @@ -20,10 +20,11 @@ include $(APPDIR)/Make.defs -MCUBOOT_VERSION := $(patsubst "%",%,$(CONFIG_MCUBOOT_VERSION)) -MCUBOOT_TARBALL = $(MCUBOOT_VERSION).tar.gz -MCUBOOT_UNPACK = mcuboot -MCUBOOT_SRCDIR = $(MCUBOOT_UNPACK)$(DELIM)boot$(DELIM)bootutil$(DELIM)src +MCUBOOT_VERSION := $(patsubst "%",%,$(CONFIG_MCUBOOT_VERSION)) +MCUBOOT_REPOSITORY := $(patsubst "%",%,$(CONFIG_MCUBOOT_REPOSITORY)) +MCUBOOT_TARBALL = $(MCUBOOT_VERSION).tar.gz +MCUBOOT_UNPACK = mcuboot +MCUBOOT_SRCDIR = $(MCUBOOT_UNPACK)$(DELIM)boot$(DELIM)bootutil$(DELIM)src DEPPATH += --dep-path $(MCUBOOT_UNPACK)$(DELIM)src DEPPATH += --dep-path $(MCUBOOT_SRCDIR) @@ -75,8 +76,8 @@ CXXFLAGS += ${INCDIR_PREFIX}mcuboot/ext/tinycrypt/lib/include endif $(MCUBOOT_TARBALL): - $(Q) echo "Downloading MCUboot-$(MCUBOOT_VERSION)" - $(Q) curl -O -L https://github.com/mcu-tools/mcuboot/archive/$(MCUBOOT_TARBALL) + $(Q) echo "Downloading MCUboot-$(MCUBOOT_VERSION) from $(MCUBOOT_REPOSITORY)" + $(Q) curl -O -L --proto-default https $(MCUBOOT_REPOSITORY)/archive/$(MCUBOOT_TARBALL) $(MCUBOOT_UNPACK): $(MCUBOOT_TARBALL) $(Q) echo "Unpacking: $(MCUBOOT_TARBALL) -> $(MCUBOOT_UNPACK)"