diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-10-20 20:09:12 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-10-23 11:55:19 +0200 |
commit | 910b10d79ab17dadadb318b60d336f495a35be78 (patch) | |
tree | 5105dbfb3e4823c75eb4dfaac2b3777738013bcb /scripts | |
parent | 8375004d1cb6d59ecdc36f02b9e5212588f31782 (diff) | |
download | barebox-910b10d79ab17dadadb318b60d336f495a35be78.tar.gz barebox-910b10d79ab17dadadb318b60d336f495a35be78.tar.xz |
decompress: xz: enable armthumb BCJ filter for Thumb-2 barebox
The XZ decompressor in barebox has BCJ filter support for THUMB, but
like Linux, it's unused and instead the ARM BCJ filter is used.
Fixing that lets us save a few kilobytes, which is especially useful for
legacy configuration that fit a whole barebox into limited on-chip SRAM
(and not only the prebootloader). For example, with this patch applied
barebox-am33xx-beaglebone-mlo.img is shrinked 3K from 109236 to 106028 bytes.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231020180912.2914428-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/xz_wrap.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/xz_wrap.sh b/scripts/xz_wrap.sh index 5b5f3adcff..a6373a7481 100755 --- a/scripts/xz_wrap.sh +++ b/scripts/xz_wrap.sh @@ -20,6 +20,10 @@ case $SRCARCH in sparc) BCJ=--sparc ;; esac +if grep -q '^CONFIG_THUMB2_BAREBOX=y$' include/config/auto.conf; then + BCJ=--armthumb +fi + # clear BCJ filter if unsupported xz -H | grep -q -- $BCJ || BCJ= |