So far, zstd use was only possible from squashfs and ubifs. Give it an update and add the necessary hooks to have it usable everywhere where LZO and friends can be used. zstd would've been a good default for barebox proper compression, but unfortunately, the decompressor going into the PBL would be quite big: lz4 lzo gzip xz zstd uncompressed thumb2 barebox proper 671K 614K 544K 456K 531K 1022K thumb2 barebox PBL 10K 10K 18K 17K 41K 9K RIoTboard FDT 12K 11K 9K 7K 8K 39K total thumb2 image 693K 635K 571K 480K 580K 974K So, don't touch the defaults for now. Series applies on top of https://lore.barebox.org/barebox/20220713095730.1878941-1-a.fatoum@xxxxxxxxxxxxxx/T/#t Ahmad Fatoum (5): lib: zstd: adopt Linux directory structure lib: zstd: sync with Linux decompressor: define macros for non-PBL case as well ARM: cpu: uncompress: increase early malloc pool to 256K lib: uncompress: add general zstd support arch/arm/include/asm/barebox-arm.h | 2 +- common/bootm.c | 8 + common/filetype.c | 4 + fs/squashfs/zstd_wrapper.c | 4 +- fs/ubifs/ubifs.c | 4 +- include/filetype.h | 2 + include/linux/decompress/mm.h | 11 +- include/linux/decompress/unzstd.h | 11 + include/linux/limits.h | 1 + include/linux/zstd.h | 1252 ++------ include/linux/zstd_errors.h | 77 + include/linux/zstd_lib.h | 2432 ++++++++++++++++ lib/Makefile | 1 + lib/decompress_unzstd.c | 351 +++ lib/uncompress.c | 6 + lib/zstd/Makefile | 27 +- lib/zstd/bitstream.h | 374 --- lib/zstd/common/bitstream.h | 437 +++ lib/zstd/common/compiler.h | 177 ++ lib/zstd/common/cpu.h | 194 ++ lib/zstd/common/debug.c | 24 + lib/zstd/common/debug.h | 101 + lib/zstd/common/entropy_common.c | 357 +++ lib/zstd/common/error_private.c | 56 + lib/zstd/common/error_private.h | 69 + lib/zstd/common/fse.h | 710 +++++ lib/zstd/common/fse_decompress.c | 390 +++ lib/zstd/common/huf.h | 356 +++ lib/zstd/common/mem.h | 259 ++ lib/zstd/common/zstd_common.c | 83 + lib/zstd/common/zstd_deps.h | 125 + lib/zstd/common/zstd_internal.h | 450 +++ lib/zstd/decompress.c | 2528 ----------------- lib/zstd/decompress/huf_decompress.c | 1206 ++++++++ lib/zstd/decompress/zstd_ddict.c | 241 ++ lib/zstd/decompress/zstd_ddict.h | 44 + lib/zstd/decompress/zstd_decompress.c | 2085 ++++++++++++++ lib/zstd/decompress/zstd_decompress_block.c | 1540 ++++++++++ lib/zstd/decompress/zstd_decompress_block.h | 62 + .../decompress/zstd_decompress_internal.h | 202 ++ lib/zstd/decompress_sources.h | 28 + lib/zstd/entropy_common.c | 243 -- lib/zstd/error_private.h | 53 - lib/zstd/fse.h | 575 ---- lib/zstd/fse_decompress.c | 332 --- lib/zstd/huf.h | 212 -- lib/zstd/huf_decompress.c | 960 ------- lib/zstd/mem.h | 151 - lib/zstd/zstd_common.c | 75 - lib/zstd/zstd_decompress_module.c | 105 + lib/zstd/zstd_internal.h | 263 -- lib/zstd/zstd_opt.h | 1014 ------- pbl/Kconfig | 4 + pbl/decomp.c | 4 + scripts/Makefile.lib | 29 + 55 files changed, 12538 insertions(+), 7773 deletions(-) create mode 100644 include/linux/decompress/unzstd.h create mode 100644 include/linux/zstd_errors.h create mode 100644 include/linux/zstd_lib.h create mode 100644 lib/decompress_unzstd.c delete mode 100644 lib/zstd/bitstream.h create mode 100644 lib/zstd/common/bitstream.h create mode 100644 lib/zstd/common/compiler.h create mode 100644 lib/zstd/common/cpu.h create mode 100644 lib/zstd/common/debug.c create mode 100644 lib/zstd/common/debug.h create mode 100644 lib/zstd/common/entropy_common.c create mode 100644 lib/zstd/common/error_private.c create mode 100644 lib/zstd/common/error_private.h create mode 100644 lib/zstd/common/fse.h create mode 100644 lib/zstd/common/fse_decompress.c create mode 100644 lib/zstd/common/huf.h create mode 100644 lib/zstd/common/mem.h create mode 100644 lib/zstd/common/zstd_common.c create mode 100644 lib/zstd/common/zstd_deps.h create mode 100644 lib/zstd/common/zstd_internal.h delete mode 100644 lib/zstd/decompress.c create mode 100644 lib/zstd/decompress/huf_decompress.c create mode 100644 lib/zstd/decompress/zstd_ddict.c create mode 100644 lib/zstd/decompress/zstd_ddict.h create mode 100644 lib/zstd/decompress/zstd_decompress.c create mode 100644 lib/zstd/decompress/zstd_decompress_block.c create mode 100644 lib/zstd/decompress/zstd_decompress_block.h create mode 100644 lib/zstd/decompress/zstd_decompress_internal.h create mode 100644 lib/zstd/decompress_sources.h delete mode 100644 lib/zstd/entropy_common.c delete mode 100644 lib/zstd/error_private.h delete mode 100644 lib/zstd/fse.h delete mode 100644 lib/zstd/fse_decompress.c delete mode 100644 lib/zstd/huf.h delete mode 100644 lib/zstd/huf_decompress.c delete mode 100644 lib/zstd/mem.h delete mode 100644 lib/zstd/zstd_common.c create mode 100644 lib/zstd/zstd_decompress_module.c delete mode 100644 lib/zstd/zstd_internal.h delete mode 100644 lib/zstd/zstd_opt.h -- 2.30.2