From 8761805e13f037ecbdb5b265f9a57b785bcaef87 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philip=20M=C3=BCller?= <philm@manjaro.org>
Date: Mon, 14 Jun 2021 16:24:15 +0200
Subject: [PATCH] [pkg-upd] 30-2 - we still use gzip by default

---
 PKGBUILD      | 15 ++++++-----
 ab6bad7.patch | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+), 6 deletions(-)
 create mode 100644 ab6bad7.patch

diff --git a/PKGBUILD b/PKGBUILD
index 8aa88e1..b730fcb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,27 +7,29 @@
 # Maintainer: Thomas Bächler <thomas@archlinux.org>
 
 pkgname=mkinitcpio
-pkgver=29
-pkgrel=1.0
+pkgver=30
+pkgrel=2
 pkgdesc="Modular initramfs image creation utility"
 arch=('any')
 url="https://projects.archlinux.org/mkinitcpio.git/"
 license=('GPL')
 depends=('awk' 'mkinitcpio-busybox>=1.19.4-2' 'kmod' 'util-linux>=2.23' 'libarchive' 'coreutils'
-         'bash' 'diffutils' 'findutils' 'grep' 'filesystem>=2011.10-1' 'gzip' 'systemd' 'asciidoc')
+         'bash' 'diffutils' 'findutils' 'grep' 'filesystem>=2011.10-1' 'gzip' 'systemd')
 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')
 provides=('initramfs')
 backup=('etc/mkinitcpio.conf')
 source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig}
-        manjaro.patch)
+        manjaro.patch ab6bad7.patch)
 install=mkinitcpio.install
-sha256sums=('0239ba7ae91d652472819457a5dd812c574ba37c3c3d9161e7742a63b85076c2'
+sha256sums=('c7725035a06d2ab6ef6e97601b69859d6061aec95c4551e2a1ad2e27d307258f'
             'SKIP'
-            'f6a619c2dfc5a6bdd4596d9b4d9f7fdcce3ee0244390161cab51ef646b7317f8')
+            'f6a619c2dfc5a6bdd4596d9b4d9f7fdcce3ee0244390161cab51ef646b7317f8'
+            'b90b5d74a1591840e727572dca0ec7ae7c36ed19dedc02a393802ed2aad23ce4')
 validpgpkeys=('ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB'    # Giancarlo Razzolini
               '86CFFCA918CF3AF47147588051E8B148A9999C34')   # Evangelos Foutras
 
@@ -35,6 +37,7 @@ prepare() {
   cd "$pkgname-$pkgver"
   # Add changes of Manjaro
   patch -p1 -i ../manjaro.patch
+  patch -Rp1 -i ../ab6bad7.patch
 }
 
 check() {
diff --git a/ab6bad7.patch b/ab6bad7.patch
new file mode 100644
index 0000000..2d448b1
--- /dev/null
+++ b/ab6bad7.patch
@@ -0,0 +1,74 @@
+From 2f4a2b592fb98aab1a0e4f3135d4592219b7c25c Mon Sep 17 00:00:00 2001
+From: Giancarlo Razzolini <grazzolini@archlinux.org>
+Date: Tue, 16 Feb 2021 23:34:00 -0300
+Subject: Switch to zstd by default
+
+Since all the Arch kernels now support zstd, switch to it by default
+---
+ PKGBUILD                  |  6 +++---
+ man/mkinitcpio.conf.5.txt | 12 +++++-------
+ mkinitcpio                |  2 +-
+ mkinitcpio.conf           |  4 ++--
+ 4 files changed, 11 insertions(+), 13 deletions(-)
+
+diff --git a/man/mkinitcpio.conf.5.txt b/man/mkinitcpio.conf.5.txt
+index d804304..0383360 100644
+--- a/man/mkinitcpio.conf.5.txt
++++ b/man/mkinitcpio.conf.5.txt
+@@ -52,13 +52,11 @@ Variables
+ 
+ *COMPRESSION*::
+ 
+-	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. As of linux 5.9 the kernel also
+-	understands the compression formats yielded by the *zstd* compressor.
+-	If unspecified, this setting defaults to *gzip* compression.
+-	In order to create an uncompressed image, define
+-	this variable as *cat*.
++	Defines a program to filter the generated image through. The kernel
++	understands the compression formats yielded by the *zstd*, *gzip*, *bzip2*,
++	*lz4*, *lzop*, *lzma*, and *xz* compressors. If unspecified, this setting
++	defaults to *zstd* 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 b/mkinitcpio
+index 2067572..1f6a499 100755
+--- a/mkinitcpio
++++ b/mkinitcpio
+@@ -508,7 +508,7 @@ if [[ $_optgenimg ]]; then
+         die 'Unable to write to %s' "$_optgenimg"
+     fi
+ 
+-    _optcompress=${_optcompress:-${COMPRESSION:-gzip}}
++    _optcompress=${_optcompress:-${COMPRESSION:-zstd}}
+     if ! type -P "$_optcompress" >/dev/null; then
+         warning "Unable to locate compression method: %s" "$_optcompress"
+         _optcompress=cat
+diff --git a/mkinitcpio.conf b/mkinitcpio.conf
+index ba1cce3..3494fab 100644
+--- a/mkinitcpio.conf
++++ b/mkinitcpio.conf
+@@ -52,15 +52,15 @@ FILES=()
+ HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
+ 
+ # COMPRESSION
+-# Use this to compress the initramfs image. By default, gzip compression
++# Use this to compress the initramfs image. By default, zstd compression
+ # is used. Use 'cat' to create an uncompressed image.
++#COMPRESSION="zstd"
+ #COMPRESSION="gzip"
+ #COMPRESSION="bzip2"
+ #COMPRESSION="lzma"
+ #COMPRESSION="xz"
+ #COMPRESSION="lzop"
+ #COMPRESSION="lz4"
+-#COMPRESSION="zstd"
+ 
+ # COMPRESSION_OPTIONS
+ # Additional options for the compressor
+-- 
+cgit v1.2.3-1-gf6bb5
+
-- 
GitLab