lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1a5bf1cf-f278-3667-6d33-c89efb4e2865@c-s.fr>
Date:   Thu, 25 Apr 2019 17:03:07 +0000
From:   Christophe Leroy <christophe.leroy@....fr>
To:     Adam Borowski <kilobyte@...band.pl>
Cc:     Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v2 3/4] powerpc/boot: Add bzip2 support for uImage



On 04/25/2019 02:37 PM, Adam Borowski wrote:
> 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.

Ok. Initially the purpose was to add lzma, then I took the opportunity 
to add all compressors supported by u-boot uImage files which are 'none, 
bzip2, gzip, lzma, lzo':

[root@...6846vm linux-powerpc]# mkimage -C -h

Invalid Compression Type - valid names are: none, bzip2, gzip, lzma, lzo
Usage: mkimage -l image
           -l ==> list image header information
        mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name 
-d data_file[:data_file...] image


So I can leave bzip2 aside.

xz, zstd and lz4 are not supported by the uImage format as far as I know 
so we have to keep lzma which gives a far better compression ratio than 
gzip (gzipped uImage don't fit in my board's NOR Flash while lzmaed 
uImage does).

Christophe


> 
>> --- 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!
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ