diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2020-05-28 14:27:45 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2020-05-28 14:32:05 +0000 |
commit | ec584ac1d51a44ec86dd7a603b648b69668a1f8d (patch) | |
tree | 7d5378599cbe6e92ca74a26eb548332d707b2f9d | |
parent | 4a3fa3a81140b1e67aa61e09e85ed994658bc728 (diff) | |
download | alpine_aports-ec584ac1d51a44ec86dd7a603b648b69668a1f8d.tar.bz2 alpine_aports-ec584ac1d51a44ec86dd7a603b648b69668a1f8d.tar.xz alpine_aports-ec584ac1d51a44ec86dd7a603b648b69668a1f8d.zip |
main/mkinitfs: backport performance fix for initramfs
-rw-r--r-- | main/mkinitfs/0001-mkinitfs-add-optional-support-for-pigz.patch | 46 | ||||
-rw-r--r-- | main/mkinitfs/APKBUILD | 9 |
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 @@ | |||
1 | From 59204d36985de5ba2444d5f3e0d50a119287ec51 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net> | ||
3 | Date: Sat, 25 Jan 2020 12:04:32 +0100 | ||
4 | Subject: [PATCH] mkinitfs: add optional support for pigz | ||
5 | |||
6 | pigz(1) is a parallel gzip implementation. As such, it significantly | ||
7 | faster than gzip(1). This patch uses pigz(1) instead of gzip(1), | ||
8 | if it is installed, otherwise it just falls back to gzip(1). This is | ||
9 | similar to the current pigz support in abuild. | ||
10 | |||
11 | Without this patch: | ||
12 | |||
13 | $ time mkinitfs | ||
14 | ==> initramfs: creating /boot/initramfs-lts | ||
15 | real 0m 38.19s | ||
16 | user 0m 35.47s | ||
17 | sys 0m 0.49s | ||
18 | |||
19 | With this patch applied and pigz installed: | ||
20 | |||
21 | ==> initramfs: creating /boot/initramfs-lts | ||
22 | real 0m 13.24s | ||
23 | user 0m 38.30s | ||
24 | sys 0m 0.56s | ||
25 | |||
26 | This change was discussed on IRC with _ikke_ and mps. | ||
27 | --- | ||
28 | mkinitfs.in | 2 +- | ||
29 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
30 | |||
31 | diff --git a/mkinitfs.in b/mkinitfs.in | ||
32 | index 9bd95f9..9676fce 100755 | ||
33 | --- a/mkinitfs.in | ||
34 | +++ b/mkinitfs.in | ||
35 | @@ -278,7 +278,7 @@ if [ -z "$list_sources" ] && [ -z "$quiet" ]; then | ||
36 | fi | ||
37 | |||
38 | case "$initfscomp" in | ||
39 | - gzip) comp="gzip -9" ;; | ||
40 | + gzip) comp="$(command -v pigz 2>/dev/null || echo gzip) -9" ;; | ||
41 | xz) cmd_exists xz; comp="xz -C crc32 -T 0" ;; | ||
42 | *) echo "Initramfs compression \"$initfscomp\" not supported!"; exit 1 ;; | ||
43 | esac | ||
44 | -- | ||
45 | 2.26.2 | ||
46 | |||
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 @@ | |||
2 | pkgname=mkinitfs | 2 | pkgname=mkinitfs |
3 | pkgver=3.4.5 | 3 | pkgver=3.4.5 |
4 | _ver=${pkgver%_git*} | 4 | _ver=${pkgver%_git*} |
5 | pkgrel=2 | 5 | pkgrel=3 |
6 | pkgdesc="Tool to generate initramfs images for Alpine" | 6 | pkgdesc="Tool to generate initramfs images for Alpine" |
7 | url="https://git.alpinelinux.org/cgit/mkinitfs" | 7 | url="https://git.alpinelinux.org/cgit/mkinitfs" |
8 | arch="all" | 8 | arch="all" |
@@ -15,7 +15,9 @@ depends="busybox>=1.28.2-r1 apk-tools>=2.9.1 lddtree>=1.25 kmod" | |||
15 | subpackages="$pkgname-doc" | 15 | subpackages="$pkgname-doc" |
16 | install="$pkgname.pre-upgrade $pkgname.post-install $pkgname.post-upgrade" | 16 | install="$pkgname.pre-upgrade $pkgname.post-install $pkgname.post-upgrade" |
17 | triggers="$pkgname.trigger=/usr/share/kernel/*" | 17 | triggers="$pkgname.trigger=/usr/share/kernel/*" |
18 | source="https://dev.alpinelinux.org/archive/mkinitfs/mkinitfs-$_ver.tar.xz" | 18 | source="https://dev.alpinelinux.org/archive/mkinitfs/mkinitfs-$_ver.tar.xz |
19 | 0001-mkinitfs-add-optional-support-for-pigz.patch | ||
20 | " | ||
19 | 21 | ||
20 | build() { | 22 | build() { |
21 | make VERSION=$pkgver-r$pkgrel | 23 | make VERSION=$pkgver-r$pkgrel |
@@ -25,4 +27,5 @@ package() { | |||
25 | make install DESTDIR="$pkgdir" | 27 | make install DESTDIR="$pkgdir" |
26 | } | 28 | } |
27 | 29 | ||
28 | sha512sums="e12f603dd9a51c0afbafeca7b4a061733514c4cf509b1dd61cc37c94e6102e5b3439d7a0379e1e4179aeaff13a382dab985c9737812e52803f038c1b2bb97cf8 mkinitfs-3.4.5.tar.xz" | 30 | sha512sums="e12f603dd9a51c0afbafeca7b4a061733514c4cf509b1dd61cc37c94e6102e5b3439d7a0379e1e4179aeaff13a382dab985c9737812e52803f038c1b2bb97cf8 mkinitfs-3.4.5.tar.xz |
31 | 50411c3cddbfc49837d750620c57393dc8dfa7beb91f02816345fd66c8068b12d9aef266e50fd7cdc2b3b5fa81f477cbfaed00a2b264055cfd34b61ceb03e63a 0001-mkinitfs-add-optional-support-for-pigz.patch" | ||