From patchwork Fri Aug 14 12:44:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Hesse X-Patchwork-Id: 1756 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 8EA211A86C7BE for ; Fri, 14 Aug 2020 12:45:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=DKIM_INVALID=1, DKIM_SIGNED=0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001,RCVD_IN_MSPIKE_WL=0.001,SPF_HELO_NONE=0.001 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-BL-Results: [127.0.0.19] [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 14 Aug 2020 12:45:31 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 754871D375177C; Fri, 14 Aug 2020 12:45:29 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=eworm.de header.i=@eworm.de header.b=rXNowxxO Authentication-Results: orion.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=eworm.de header.i=@eworm.de header.b=rXNowxxO DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eworm.de; s=mail; t=1597409118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=JeWxlBtlD5/VjZ3DtJbCNyReZY4aC7MagLf2QG3UQrE=; b=rXNowxxOym59DpLp6BG91nDP2tu3z5BwXjsvyy1fzToqtcThvRxyVf7C3/+qkaPdK7crfs kAY0PQkp/XpmS1UzNbVSrjFy8MXQD77EGcNY4tS3UTZgWf5rTDoJTe9XT3FRWfiXJWOwsl +4Cqk3O2g80iAAOxKE6iUtjAkkKVDeA= From: Christian Hesse To: arch-projects@archlinux.org Cc: Christian Hesse Date: Fri, 14 Aug 2020 14:44:46 +0200 Message-Id: <20200814124446.69014-1-list@eworm.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Spamd-Bar: + Authentication-Results: mx.mylinuxtime.de; auth=pass smtp.auth=smtp-only@eworm.de smtp.mailfrom=eworm@leda.eworm.de X-Rspamd-Server: mx X-Stat-Signature: 849uko43bgiei5yf8x1m7y4suhctof18 X-Rspamd-Queue-Id: 0A0D42E395 X-Spamd-Result: default: False [1.51 / 15.00]; ARC_NA(0.00)[]; GENERIC_REPUTATION(0.00)[-0.64367270250124]; URIBL_BLOCKED(0.00)[eworm.de:email]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-2.92)[-0.975]; DKIM_SIGNED(0.00)[]; NEURAL_HAM_SHORT(-0.76)[-0.764]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; FORGED_SENDER(0.30)[list@eworm.de,eworm@leda.eworm.de]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:3320, ipnet:84.128.0.0/10, country:DE]; FROM_NEQ_ENVFROM(0.00)[list@eworm.de,eworm@leda.eworm.de] Subject: [arch-projects] [mkinitcpio] [PATCH 1/1] support zstd compression X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Arch Linux projects development discussion Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" From: Christian Hesse Linux 5.9 supports zstd compressed initramfs, so add support here. Signed-off-by: Christian Hesse --- PKGBUILD | 1 + lsinitcpio | 4 ++++ man/mkinitcpio.conf.5.txt | 6 +++--- mkinitcpio.conf | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 3536a48..c7e1ed5 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -15,6 +15,7 @@ optdepends=('xz: Use lzma or xz compression for the initramfs image' 'bzip2: Use bzip2 compression for the initramfs image' 'lzop: Use lzo compression for the initramfs image' 'lz4: Use lz4 compression for the initramfs image' + 'zstd: Use zstd compression for the initramfs image' 'mkinitcpio-nfs-utils: Support for root filesystem on NFS') backup=(etc/mkinitcpio.conf) diff --git a/lsinitcpio b/lsinitcpio index bcb4a19..4715783 100755 --- a/lsinitcpio +++ b/lsinitcpio @@ -113,6 +113,10 @@ detect_filetype() { echo 'lz4 -l' return ;; + fd2fb528) + echo 'zstd' + return + ;; esac read -rd '' bytes < <(hexdump -n 3 -e '"%c"' "$1") diff --git a/man/mkinitcpio.conf.5.txt b/man/mkinitcpio.conf.5.txt index 9c8d000..9c999d7 100644 --- a/man/mkinitcpio.conf.5.txt +++ b/man/mkinitcpio.conf.5.txt @@ -54,9 +54,9 @@ Variables Defines a program to filter the generated image through. As of linux 2.6.38, the kernel understands the compression formats yielded by the *gzip*, *bzip2*, - *lz4*, *lzop*, *lzma*, and *xz* compressors. If unspecified, this setting - defaults to *gzip* compression. In order to create an uncompressed image, define - this variable as *cat*. + *lz4*, *lzop*, *lzma*, and *xz* compressors. Compression via *zstd* was added + in linux 5.9. If unspecified, this setting defaults to *gzip* compression. + In order to create an uncompressed image, define this variable as *cat*. + It's not hard to realize that a filter such as a *tac* or *rev* will cause *mkinitcpio* to report success but generate a useless image. Similarly, using a diff --git a/mkinitcpio.conf b/mkinitcpio.conf index b926b90..ba1cce3 100644 --- a/mkinitcpio.conf +++ b/mkinitcpio.conf @@ -60,6 +60,7 @@ HOOKS=(base udev autodetect modconf block filesystems keyboard fsck) #COMPRESSION="xz" #COMPRESSION="lzop" #COMPRESSION="lz4" +#COMPRESSION="zstd" # COMPRESSION_OPTIONS # Additional options for the compressor