aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2020-05-28 14:27:45 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2020-05-28 14:32:05 +0000
commitec584ac1d51a44ec86dd7a603b648b69668a1f8d (patch)
tree7d5378599cbe6e92ca74a26eb548332d707b2f9d
parent4a3fa3a81140b1e67aa61e09e85ed994658bc728 (diff)
downloadaports-ec584ac1d51a44ec86dd7a603b648b69668a1f8d.tar.gz
aports-ec584ac1d51a44ec86dd7a603b648b69668a1f8d.tar.bz2
aports-ec584ac1d51a44ec86dd7a603b648b69668a1f8d.tar.xz
main/mkinitfs: backport performance fix for initramfs
-rw-r--r--main/mkinitfs/0001-mkinitfs-add-optional-support-for-pigz.patch46
-rw-r--r--main/mkinitfs/APKBUILD9
2 files changed, 52 insertions, 3 deletions
diff --git a/main/mkinitfs/0001-mkinitfs-add-optional-support-for-pigz.patch b/main/mkinitfs/0001-mkinitfs-add-optional-support-for-pigz.patch
new file mode 100644
index 0000000000..9f73cf775a
--- /dev/null
+++ b/main/mkinitfs/0001-mkinitfs-add-optional-support-for-pigz.patch
@@ -0,0 +1,46 @@
+From 59204d36985de5ba2444d5f3e0d50a119287ec51 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
+Date: Sat, 25 Jan 2020 12:04:32 +0100
+Subject: [PATCH] mkinitfs: add optional support for pigz
+
+pigz(1) is a parallel gzip implementation. As such, it significantly
+faster than gzip(1). This patch uses pigz(1) instead of gzip(1),
+if it is installed, otherwise it just falls back to gzip(1). This is
+similar to the current pigz support in abuild.
+
+Without this patch:
+
+ $ time mkinitfs
+ ==> initramfs: creating /boot/initramfs-lts
+ real 0m 38.19s
+ user 0m 35.47s
+ sys 0m 0.49s
+
+With this patch applied and pigz installed:
+
+ ==> initramfs: creating /boot/initramfs-lts
+ real 0m 13.24s
+ user 0m 38.30s
+ sys 0m 0.56s
+
+This change was discussed on IRC with _ikke_ and mps.
+---
+ mkinitfs.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mkinitfs.in b/mkinitfs.in
+index 9bd95f9..9676fce 100755
+--- a/mkinitfs.in
++++ b/mkinitfs.in
+@@ -278,7 +278,7 @@ if [ -z "$list_sources" ] && [ -z "$quiet" ]; then
+ fi
+
+ case "$initfscomp" in
+- gzip) comp="gzip -9" ;;
++ gzip) comp="$(command -v pigz 2>/dev/null || echo gzip) -9" ;;
+ xz) cmd_exists xz; comp="xz -C crc32 -T 0" ;;
+ *) echo "Initramfs compression \"$initfscomp\" not supported!"; exit 1 ;;
+ esac
+--
+2.26.2
+
diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD
index 9b5653307e..4b839c292c 100644
--- a/main/mkinitfs/APKBUILD
+++ b/main/mkinitfs/APKBUILD
@@ -2,7 +2,7 @@
pkgname=mkinitfs
pkgver=3.4.5
_ver=${pkgver%_git*}
-pkgrel=2
+pkgrel=3
pkgdesc="Tool to generate initramfs images for Alpine"
url="https://git.alpinelinux.org/cgit/mkinitfs"
arch="all"
@@ -15,7 +15,9 @@ depends="busybox>=1.28.2-r1 apk-tools>=2.9.1 lddtree>=1.25 kmod"
subpackages="$pkgname-doc"
install="$pkgname.pre-upgrade $pkgname.post-install $pkgname.post-upgrade"
triggers="$pkgname.trigger=/usr/share/kernel/*"
-source="https://dev.alpinelinux.org/archive/mkinitfs/mkinitfs-$_ver.tar.xz"
+source="https://dev.alpinelinux.org/archive/mkinitfs/mkinitfs-$_ver.tar.xz
+ 0001-mkinitfs-add-optional-support-for-pigz.patch
+ "
build() {
make VERSION=$pkgver-r$pkgrel
@@ -25,4 +27,5 @@ package() {
make install DESTDIR="$pkgdir"
}
-sha512sums="e12f603dd9a51c0afbafeca7b4a061733514c4cf509b1dd61cc37c94e6102e5b3439d7a0379e1e4179aeaff13a382dab985c9737812e52803f038c1b2bb97cf8 mkinitfs-3.4.5.tar.xz"
+sha512sums="e12f603dd9a51c0afbafeca7b4a061733514c4cf509b1dd61cc37c94e6102e5b3439d7a0379e1e4179aeaff13a382dab985c9737812e52803f038c1b2bb97cf8 mkinitfs-3.4.5.tar.xz
+50411c3cddbfc49837d750620c57393dc8dfa7beb91f02816345fd66c8068b12d9aef266e50fd7cdc2b3b5fa81f477cbfaed00a2b264055cfd34b61ceb03e63a 0001-mkinitfs-add-optional-support-for-pigz.patch"