summaryrefslogtreecommitdiff
path: root/scripts/Makefile.modinst
diff options
context:
space:
mode:
authorPiotr Gorski <lucjan.lucjanov@gmail.com>2021-04-07 18:09:27 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2021-04-25 05:25:06 +0900
commitc3d7ef377eb2564b165b1e8fdb4646952c90ac17 (patch)
treeeaff8d062e73fd0406c50b7ddfa3d3faee3007b5 /scripts/Makefile.modinst
parentd4bbe942098b0c9b487d424a3c545c9ed56462d7 (diff)
kbuild: add support for zstd compressed modules
kmod 28 supports modules compressed in zstd format so let's add this possibility to kernel. Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com> Reviewed-by: Oleksandr Natalenko <oleksandr@natalenko.name> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/Makefile.modinst')
-rw-r--r--scripts/Makefile.modinst6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 191408f7a91a..ff9b09e4cfca 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -21,6 +21,7 @@ endif
suffix-y :=
suffix-$(CONFIG_MODULE_COMPRESS_GZIP) := .gz
suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz
+suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst
modules := $(patsubst $(extmod_prefix)%, $(dst)/%$(suffix-y), $(modules))
@@ -95,6 +96,8 @@ quiet_cmd_gzip = GZIP $@
cmd_gzip = $(KGZIP) -n -f $<
quiet_cmd_xz = XZ $@
cmd_xz = $(XZ) --lzma2=dict=2MiB -f $<
+quiet_cmd_zstd = ZSTD $@
+ cmd_zstd = $(ZSTD) -T0 --rm -f -q $<
$(dst)/%.ko.gz: $(dst)/%.ko FORCE
$(call cmd,gzip)
@@ -102,6 +105,9 @@ $(dst)/%.ko.gz: $(dst)/%.ko FORCE
$(dst)/%.ko.xz: $(dst)/%.ko FORCE
$(call cmd,xz)
+$(dst)/%.ko.zst: $(dst)/%.ko FORCE
+ $(call cmd,zstd)
+
PHONY += FORCE
FORCE: