Commit 59204d36 authored by Sören Tempel's avatar Sören Tempel

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.
parent 961726b6
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment