Skip to content

Commit 0c1ddf7

Browse files
committed
zephyr: Add Kconfig for decompression
Adds a Kconfig allowing the decompression option to be selected Signed-off-by: Jamie McCrae <[email protected]>
1 parent 91d86b8 commit 0c1ddf7

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

boot/zephyr/Kconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,33 @@ config MCUBOOT_BOOT_BANNER
729729
config BOOT_BANNER_STRING
730730
default "Using Zephyr OS build" if MCUBOOT_BOOT_BANNER
731731

732+
config BOOT_DECOMPRESSION_SUPPORT
733+
bool
734+
help
735+
Hidden symbol which should be selected if a system provided decompression support.
736+
737+
if BOOT_DECOMPRESSION_SUPPORT
738+
739+
menuconfig BOOT_DECOMPRESSION
740+
bool "Decompression"
741+
help
742+
If enabled, will include support for compressed images being loaded to the secondary slot
743+
which then get decompressed into the primary slot. This mode allows the secondary slot to
744+
be smaller than primary slot which otherwise would not be allowed.
745+
746+
if BOOT_DECOMPRESSION
747+
748+
config BOOT_DECOMPRESSION_BUFFER_SIZE
749+
int "Write buffer size"
750+
range 16 16384
751+
default 4096
752+
help
753+
The size of a secondary buffer used for writing decompressed data to the storage device.
754+
755+
endif # BOOT_DECOMPRESSION
756+
757+
endif # BOOT_DECOMPRESSION_SUPPORT
758+
732759
endmenu
733760

734761
config MCUBOOT_DEVICE_SETTINGS

boot/zephyr/include/mcuboot_config/mcuboot_config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@
127127
#define MCUBOOT_ENCRYPT_X25519
128128
#endif
129129

130+
#ifdef CONFIG_BOOT_DECOMPRESSION
131+
#define MCUBOOT_DECOMPRESS_IMAGES
132+
#endif
133+
130134
#ifdef CONFIG_BOOT_BOOTSTRAP
131135
#define MCUBOOT_BOOTSTRAP 1
132136
#endif

0 commit comments

Comments
 (0)