Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4299866pxf; Tue, 30 Mar 2021 04:35:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGnhP3zJU0SPA4wDhczr6IL+9yMXZcyVCLSG3wXkU2Z5zI2bn6tjbzD3yIYqDZoRKSDXTN X-Received: by 2002:a05:6402:8c2:: with SMTP id d2mr33922041edz.4.1617104117270; Tue, 30 Mar 2021 04:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617104117; cv=none; d=google.com; s=arc-20160816; b=FXTMx04DvorQuJ2MIQ4yfpdWjpMMDN+YK6xmZsWkyPcIxsDz5iWjLVjpLUi8P/9SvR U35OJoFmkG/01I4kU3HA6GWEmhAjeDFCjbPxE7kyPSgpePhtLalO2u2tJGifyDKLKmod WYJjgcHHW5zBA9QlDZwxFg2pcnoriArXL8oh32Pw7HCxD9lQ4Jwh4Ex02m9L9cU5/Sok om1pBY0rZs4/8QNFhekJZ3dXpV/JuFyLhAIlm29QqnC25+x2ZrGTXny217njpMuyFkGo l3mhewFhLQw7B6YGVTUyez2j1kXzcxWZ+lNiYTKSiryZhd8K+hyYoq+7g2EO2R8iKnEu GdDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JuMh1wC/OLcfpt4wvao8rEFqv3gCukrAypbolc/zZxo=; b=pIMwicEXFHxm4QmZuTXh3OAIcK1qUKcqm7rBsn3S/sPDJxHTIAiScQynvXRzb3WA6s I44+NWIwAGmoRCB9NdVNF3nnV2bjFImvkqPP9zz5jPBERTzK5T6Exfuy3YGhpsmqefrF 1DyS0tvfak1TjziE5xHe2d6EtZyvW53dKCdzcCqn+OexY/zIDp8KXFz2NXJYMkuoWGMU w1Jf2dHmCFHWGUAGg9Q8LQAP6p+SsUsjMLUNKejEaO93dp8b2wmYROuD79N3sBeOZtJL yTH2QOde7VI0PeVHCIJcs6pNksykLAqZ4i+3WookQN6/BJoI7U4CSJNzM5/h0qx0Ne0S Z3EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iIfvHN7A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si15027612ede.192.2021.03.30.04.34.46; Tue, 30 Mar 2021 04:35:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iIfvHN7A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231877AbhC3Ldq (ORCPT + 99 others); Tue, 30 Mar 2021 07:33:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbhC3LdU (ORCPT ); Tue, 30 Mar 2021 07:33:20 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37A4AC061574; Tue, 30 Mar 2021 04:33:19 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id u20so19426650lja.13; Tue, 30 Mar 2021 04:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JuMh1wC/OLcfpt4wvao8rEFqv3gCukrAypbolc/zZxo=; b=iIfvHN7AACyyMx8jC4e02zGDKfXn6CavblKgpt5sigMwz1EtZMzdjYB0/XElrO3Yvd S1jMQCeHH2+IUc1I/P+6GL56rHgMBPCx4Kumxa0SeijHic6XDRX99zupYvmHIjmK9B3u YtMsoJfDk6kxk+KTHsMTJK6hCGoGSylF2MlxhtmsUcGqo0XaymyeMgn0wxZyUKZEvcPG m/ondyv0o/K7lFbC//1tNTzJNrZ09CW3jHUG8GCRZnKxesQaBwLR3b1U2EPiJZkQ5gac zqwnxcKJBXUYetH6jaAdc0QJwc2vFHW+I8wbaz58zv9hsdiLQHzM52BXmDcNzBXRozVS ngvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JuMh1wC/OLcfpt4wvao8rEFqv3gCukrAypbolc/zZxo=; b=ozMz5b5KKenX39eYyz9JKt9l9XVRgr9qKzEOv1ZmBLadnCgyEMB3ZPnMFJuE2KpZc5 Olp3LQAU0xDRt2Vy4MIxOEGgcL93nWwNCP7NZdTxCFX6hjzlQjWqz+kwfozoV8iLYNpl rxOcBcXwG59LyHxuaIUCocqVBLG3I6zuGJIf1W9uFE14Dg6nQib11NaxLcvUDB/49jJ9 O3SWGIdG3ejgTTrve8zLKEExoHUXC5qtqewksMAc943+sMUimcvx6d/xh8R2lFg/AqV3 nIhoPxVijnD/JB5jsbavZ3aQX+IQqxVSA95RrZEULnNZMjLVt+5+nm6Plkdm1noXa8e4 bkZg== X-Gm-Message-State: AOAM532Pq6tEQPBrHPZ8bsm7D2R+kB4Vw1LkYYd36ENthQj0jmoKbZLK tpGIGB5td564j1kVoPgA3FU/bwia3KQD0g== X-Received: by 2002:a2e:a177:: with SMTP id u23mr20866440ljl.286.1617103991396; Tue, 30 Mar 2021 04:33:11 -0700 (PDT) Received: from localhost.localdomain ([2a02:a31a:e13a:eb00:c5cf:27cc:1ef2:859]) by smtp.gmail.com with ESMTPSA id o139sm2148713lfa.129.2021.03.30.04.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 04:33:10 -0700 (PDT) From: Piotr Gorski To: linux-kernel@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, Oleksandr Natalenko , Masahiro Yamada , Piotr Gorski Subject: [PATCH] init: add support for zstd compressed modules Date: Tue, 30 Mar 2021 13:32:35 +0200 Message-Id: <20210330113235.2767216-1-lucjan.lucjanov@gmail.com> X-Mailer: git-send-email 2.31.0.97.g1424303384 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kmod 28 supports modules compressed in zstd format so let's add this possibility to kernel. Signed-off-by: Piotr Gorski --- Makefile | 7 +++++-- init/Kconfig | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5160ff8903c1..82f4f4cc2955 100644 --- a/Makefile +++ b/Makefile @@ -1156,8 +1156,8 @@ endif # INSTALL_MOD_STRIP export mod_strip_cmd # CONFIG_MODULE_COMPRESS, if defined, will cause module to be compressed -# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP -# or CONFIG_MODULE_COMPRESS_XZ. +# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP, +# CONFIG_MODULE_COMPRESS_XZ, or CONFIG_MODULE_COMPRESS_ZSTD. mod_compress_cmd = true ifdef CONFIG_MODULE_COMPRESS @@ -1167,6 +1167,9 @@ ifdef CONFIG_MODULE_COMPRESS ifdef CONFIG_MODULE_COMPRESS_XZ mod_compress_cmd = $(XZ) --lzma2=dict=2MiB -f endif # CONFIG_MODULE_COMPRESS_XZ + ifdef CONFIG_MODULE_COMPRESS_ZSTD + mod_compress_cmd = $(ZSTD) -T0 --rm -f -q + endif # CONFIG_MODULE_COMPRESS_ZSTD endif # CONFIG_MODULE_COMPRESS export mod_compress_cmd diff --git a/init/Kconfig b/init/Kconfig index 8c2cfd88f6ef..86a452bc2747 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -2250,8 +2250,8 @@ config MODULE_COMPRESS bool "Compress modules on installation" help - Compresses kernel modules when 'make modules_install' is run; gzip or - xz depending on "Compression algorithm" below. + Compresses kernel modules when 'make modules_install' is run; gzip, + xz, or zstd depending on "Compression algorithm" below. module-init-tools MAY support gzip, and kmod MAY support gzip and xz. @@ -2273,7 +2273,7 @@ choice This determines which sort of compression will be used during 'make modules_install'. - GZIP (default) and XZ are supported. + GZIP (default), XZ, and ZSTD are supported. config MODULE_COMPRESS_GZIP bool "GZIP" @@ -2281,6 +2281,9 @@ config MODULE_COMPRESS_GZIP config MODULE_COMPRESS_XZ bool "XZ" +config MODULE_COMPRESS_ZSTD + bool "ZSTD" + endchoice config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS -- 2.31.0.97.g1424303384