fs/cpio: add zstd as compression option
authorJosé Luis Salvador Rufo <salvador.joseluis@gmail.com>
Sun, 10 Jan 2021 19:05:59 +0000 (20:05 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 16 Jan 2021 21:45:34 +0000 (22:45 +0100)
U-Boot mkimage zstd is available since v2020.10:
https://gitlab.denx.de/u-boot/u-boot/-/commit/26073f9ed3ab0aaf3c2a2b433fecb30a95a067d6

Signed-off-by: José Luis Salvador Rufo <salvador.joseluis@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
fs/common.mk
fs/cpio/Config.in

index 84e13d1b7e562aae35baebba20df2571f31f300f..afab7b50fb7e13cbba4d4253d4216d82e7ea877d 100644 (file)
@@ -154,6 +154,11 @@ ifeq ($(BR2_REPRODUCIBLE),)
 ROOTFS_$(2)_COMPRESS_CMD += -T $(PARALLEL_JOBS)
 endif
 endif
+ifeq ($(BR2_TARGET_ROOTFS_$(2)_ZSTD),y)
+ROOTFS_$(2)_DEPENDENCIES += host-zstd
+ROOTFS_$(2)_COMPRESS_EXT = .zst
+ROOTFS_$(2)_COMPRESS_CMD = zstd -19 -z -f -T$(PARALLEL_JOBS)
+endif
 
 $$(BINARIES_DIR)/$$(ROOTFS_$(2)_FINAL_IMAGE_NAME): ROOTFS=$(2)
 $$(BINARIES_DIR)/$$(ROOTFS_$(2)_FINAL_IMAGE_NAME): FAKEROOT_SCRIPT=$$(ROOTFS_$(2)_DIR)/fakeroot
index 83a7fa5824d117217324a283b94c69054a8c8fbe..c1151a2881dc94c4d72d991584f77ccc1fb1bea5 100644 (file)
@@ -51,6 +51,11 @@ config BR2_TARGET_ROOTFS_CPIO_XZ
        help
          Do compress the cpio filesystem with xz.
 
+config BR2_TARGET_ROOTFS_CPIO_ZSTD
+       bool "zstd"
+       help
+         Do compress the cpio filesystem with zstd.
+
 endchoice
 
 config BR2_TARGET_ROOTFS_CPIO_UIMAGE