Skip to content

Commit c35e78d

Browse files
committed
bricks/ev3: download u-boot.bin
Download u-boot.bin instead of committing it to the repository. We should not be committing binary blobs to source control. instead, we can commit the SHA256 checksum to ensure we are getting what we expect and only download the file when needed.
1 parent c24798f commit c35e78d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

bricks/_common/arm_none_eabi.mk

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,20 @@ $(BUILD)/firmware-obj.bin: $(BUILD)/firmware.elf
628628
$(ECHO) "`wc -c < $@` bytes"
629629

630630
ifeq ($(PB_MCU_FAMILY),TIAM1808)
631-
UBOOT_FILE = $(PBTOP)/bricks/ev3/u-boot.bin
631+
632+
# REVISIT: downloading things doesn't belong in a Makefile.
633+
$(BUILD)/u-boot.bin:
634+
$(ECHO) "Downloading u-boot.bin"
635+
$(Q)mkdir -p $(dir $@)
636+
$(Q)curl -sL -o $@ https://github.com/pybricks/u-boot/releases/download/pybricks/v1.0.2/u-boot.bin
637+
$(Q)echo "62fe9df8138a4676d61b72c6844f9e7c3cbfd85470b9cea1418abec4f79228ac $@" | sha256sum -c --strict
638+
632639
MAKE_BOOTABLE_IMAGE = $(PBTOP)/bricks/ev3/make_bootable_image.py
640+
633641
# For EV3, merge firmware blob with u-boot to create a bootable image.
634-
$(BUILD)/firmware-base.bin: $(BUILD)/uImage
635-
$(Q)$(MAKE_BOOTABLE_IMAGE) $(UBOOT_FILE) $(BUILD)/uImage $(BUILD)/firmware-base.bin
642+
$(BUILD)/firmware-base.bin: $(MAKE_BOOTABLE_IMAGE) $(BUILD)/u-boot.bin $(BUILD)/uImage
643+
$(Q)$^ $@
644+
636645
else
637646
# For embeded systems, the firmware is just the base file.
638647
$(BUILD)/firmware-base.bin: $(BUILD)/firmware-obj.bin

bricks/ev3/u-boot.bin

-238 KB
Binary file not shown.

0 commit comments

Comments
 (0)