Skip to content

Commit

Permalink
Remove oversize binaries (#21976)
Browse files Browse the repository at this point in the history
This stops a situation where a user could end up flashing oversize firmware soft bricking hardware.
  • Loading branch information
daskygit authored Sep 12, 2023
1 parent 3561c3a commit 62105b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builddefs/common_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ check-size:
if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \
$(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \
if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then \
$(REMOVE) $(TARGET).$(FIRMWARE_FORMAT); \
$(REMOVE) $(BUILD_DIR)/$(TARGET).{hex,bin,uf2}; \
printf "\n * $(MSG_FILE_TOO_BIG)"; $(PRINT_ERROR_PLAIN); \
else \
if [ $(FREE_SIZE) -lt $(SIZE_MARGIN) ]; then \
Expand Down

0 comments on commit 62105b5

Please sign in to comment.