From ac9b574b278ff0ac4abc74a4bf7fa3848175fa9a Mon Sep 17 00:00:00 2001 From: Igor Belwon Date: Sat, 23 Aug 2025 18:39:52 +0200 Subject: [PATCH] project: Add new compression options Add support for compressing the uniLoader image with lz4, and while we're at it add two new Kconfig variables for setting compression tools used in the build. --- Kconfig | 13 +++++++++++++ Makefile | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/Kconfig b/Kconfig index a9331c4..ccb9bc9 100644 --- a/Kconfig +++ b/Kconfig @@ -19,6 +19,19 @@ menu "Building options" int "Verbosity of logs" default 7 + config COMPRESS_GZIP + bool "Compress the uniLoader image with gzip" + default y + help + Select this if you want to use gzip to compress the final uniLoader image. + + config COMPRESS_LZ4 + bool "Compress the uniLoader image with lz4" + default n + help + Select this if you want to use lz4 to compress the final uniLoader image. + This is required on some new MediaTek devices. + config EMBED_LINUX bool "Embed linux kernel and device tree" default y diff --git a/Makefile b/Makefile index 91c6cdf..d898cc4 100644 --- a/Makefile +++ b/Makefile @@ -399,10 +399,18 @@ quiet_cmd_uniloader_objcopy = OBJCOPY $@ quiet_cmd_gzip_uniloader = GZIP $@.gz cmd_gzip_uniloader = gzip -c uniLoader > uniLoader.gz +quiet_cmd_lz4_uniloader = LZ4 $@.lz4 + cmd_lz4_uniloader = lz4 uniLoader -l -f -q + uniLoader: $(uniloader-all) arch/$(ARCH)/linker.lds FORCE $(call if_changed,uniloader_link) $(call if_changed,uniloader_objcopy) +ifdef CONFIG_COMPRESS_GZIP $(call if_changed,gzip_uniloader) +endif +ifdef CONFIG_COMPRESS_LZ4 + $(call if_changed,lz4_uniloader) +endif # The actual objects are generated when descending, # make sure no implicit rule kicks in