Re: [PATCH v2 3/4] powerpc/boot: Add bzip2 support for uImage

From: Adam Borowski
Date: Thu Apr 25 2019 - 10:37:29 EST


On Tue, Apr 23, 2019 at 02:20:43PM +0000, Christophe Leroy wrote:
> This patch allows to generate bzip2 compressed uImage

Please don't add bzip2 support, that's a waste of your time as we're trying
to remove it kernel-wide. There's a patchset to retire compressors beaten
by alternatives on the whole speed-to-size curve; reposting it is overdue.

It does:
* add ZSTD (fast and strong)
* remove BZIP2 (obsolete, only user in kernel)
* remove LZMA (redundant with XZ, uses a private copy of its library)
* makes Kconfig prose talk badly about LZO (used elsewhere in the kernel)

I believe only three compressors are worth using here: XZ, ZSTD, LZ4.
GZIP must stay because of ubiquitous support, the rest should go.

> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -199,6 +199,7 @@ config PPC
> + select HAVE_KERNEL_BZIP2 if DEFAULT_UIMAGE
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -23,6 +23,7 @@ all: $(obj)/zImage
> +compress-$(CONFIG_KERNEL_BZIP2) := CONFIG_KERNEL_BZIP2
> @@ -259,6 +260,7 @@ endif
> +compressor-$(CONFIG_KERNEL_BZIP2) := bz2
> --- a/arch/powerpc/boot/wrapper
> +++ b/arch/powerpc/boot/wrapper
> @@ -137,7 +137,7 @@ while [ "$#" -gt 0 ]; do
> - [ "$1" != "gz" -o "$1" != "xz" -o "$1" != "lzma" -o "$1" != "none" ] || usage
> + [ "$1" != "gz" -o "$1" != "xz" -o "$1" != "lzma" -o "$1" != "bz2" -o "$1" != "none" ] || usage
> @@ -149,6 +149,9 @@ while [ "$#" -gt 0 ]; do
> + if [ $uboot_comp = "bz2" ]; then
> + uboot_comp=bzip2
> + fi
> @@ -377,6 +380,9 @@ if [ -z "$cacheit" -o ! -f "$vmz$compression" -o "$vmz$compression" -ot "$kernel
> + .bz2)
> + bzip2 -f "$vmz.$$"
> + ;;


Meow!
--
âââââââ
âââââââ 10 people enter a bar: 1 who understands binary,
âââââââ 1 who doesn't, D who prefer to write it as hex,
âââââââ and 1 who narrowly avoided an off-by-one error.