Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1306904ybb; Fri, 29 Mar 2019 01:42:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNeeTTwYJdj3l6wej/99EDuuXoDzyxrafYf6RAmDzz8LstdSm2PC6C/rBcCpcqjN6MtloY X-Received: by 2002:aa7:884b:: with SMTP id k11mr10810942pfo.49.1553848974058; Fri, 29 Mar 2019 01:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553848974; cv=none; d=google.com; s=arc-20160816; b=j3fGQbX3/Fjt6BLy8Od+pjODyIUac6NP68xBs55cDiL9iAfpiAbB+ycRLw78hTlLPU KzFwKF0r35Of5HJnZKRQaYkJU3ZV4QG1jPNDX0Oc4lSGAGHfoCdXWuFFdnnk/S+Nhtfu FoS8xSc7k8p7ANuZPj3ioUq4jCe0hA7sxpcyLTjqoqehT58Z9FqGNXI+vvN2bBIjwRl+ qT6pVBYmJpNGdtLW8eMFqfjRY3vHTOJQRI0VYj/gDo1C/tmAOlYzNTIzSFE2vOOF4zKq SqpxMeK63O3623nTUgdCWV5mu7bFY3XFoYAYinWtTBCU6Il/sRcLUqdt12NaUAs6lbEK NNtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=lcrRp8MjxDz2LFrpTPK67UD/95vUL1nfZPBGhp5Eo1Q=; b=W+CMgtpatTMdAVs6T/h6I+y8apaNY/6z/6WM0cZKKi0Wn3ZubWV+UxWGco6gM6JP5A LZ61VHtjuIRW3/gHaQPuYJlIFX8V3MZDrOmV0uy+vzcED+/2vjC/gVdNH8hKCRKieeNM sfGycWIVzBVsdGKuxs5HifZnxFxX1BDFa6b5m/fUZ/dMVFBvyMXHuN/c7bH4iaSidLU4 LR3ujnG09aar/bZ7r222KkFP+MgLoLOV4ZAwOYJQ/2GJPD1c1rXG2Z0JrVc1HyAU4OcP Vatu2bPtapfly+MjwfOkr43s5uPZf4a+/H+xeL+QpEVFPM1NkGcr4ajzEb9rFSgSnbie cibA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=XbUx+6a6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8si1304587pfa.97.2019.03.29.01.42.38; Fri, 29 Mar 2019 01:42:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=XbUx+6a6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729316AbfC2Ika (ORCPT + 99 others); Fri, 29 Mar 2019 04:40:30 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:64436 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729125AbfC2IkZ (ORCPT ); Fri, 29 Mar 2019 04:40:25 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44VwD64NgFz9v0nH; Fri, 29 Mar 2019 09:40:22 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=XbUx+6a6; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 8wqVf8ib4Jcz; Fri, 29 Mar 2019 09:40:22 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 44VwD633Gbz9v0n9; Fri, 29 Mar 2019 09:40:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1553848822; bh=lcrRp8MjxDz2LFrpTPK67UD/95vUL1nfZPBGhp5Eo1Q=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=XbUx+6a6q0PbBjbSAdbA7p/YN68dNlKCMAs04y3Hr05whQWJqengQpPqiEG15/3cI AyVjlpuAV1emZTUbZ5iY0rxLZFIZ3lW3oshRor9ytuCNgc8OL0oxdVH/MMLNsI25XX rYg90ESOeDE7iZNzy9qMkF2OOcdnU4flfiTmOHSc= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 69FB28B825; Fri, 29 Mar 2019 09:40:23 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Mbc6GtcGd6FH; Fri, 29 Mar 2019 09:40:23 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 502828B779; Fri, 29 Mar 2019 09:40:23 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 41C436FC95; Fri, 29 Mar 2019 08:40:23 +0000 (UTC) Message-Id: In-Reply-To: <3632dd9c8115965b37fd0b8fc50b3352395933fa.1553848759.git.christophe.leroy@c-s.fr> References: <3632dd9c8115965b37fd0b8fc50b3352395933fa.1553848759.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH v1 3/4] powerpc/boot: Add bzip2 support for uImage To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 29 Mar 2019 08:40:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch allows to generate bzip2 compressed uImage Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 1 + arch/powerpc/boot/Makefile | 2 ++ arch/powerpc/boot/wrapper | 8 +++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 69ff2476490c..6f1d49fdae98 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -202,6 +202,7 @@ config PPC select HAVE_KERNEL_GZIP select HAVE_KERNEL_XZ if PPC_BOOK3S || 44x select HAVE_KERNEL_LZMA if DEFAULT_UIMAGE + select HAVE_KERNEL_BZIP2 if DEFAULT_UIMAGE select HAVE_KPROBES select HAVE_KPROBES_ON_FTRACE select HAVE_KRETPROBES diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 9b7b11a22925..0a7f8c2dc8af 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -23,6 +23,7 @@ all: $(obj)/zImage compress-$(CONFIG_KERNEL_GZIP) := CONFIG_KERNEL_GZIP compress-$(CONFIG_KERNEL_XZ) := CONFIG_KERNEL_XZ compress-$(CONFIG_KERNEL_LZMA) := CONFIG_KERNEL_LZMA +compress-$(CONFIG_KERNEL_BZIP2) := CONFIG_KERNEL_BZIP2 ifdef CROSS32_COMPILE BOOTCC := $(CROSS32_COMPILE)gcc @@ -259,6 +260,7 @@ endif compressor-$(CONFIG_KERNEL_GZIP) := gz compressor-$(CONFIG_KERNEL_XZ) := xz compressor-$(CONFIG_KERNEL_LZMA) := lzma +compressor-$(CONFIG_KERNEL_BZIP2) := bz2 # args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd quiet_cmd_wrap = WRAP $@ diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 51dc42f5acbc..d1384e8c0c6f 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper @@ -137,7 +137,7 @@ while [ "$#" -gt 0 ]; do -Z) shift [ "$#" -gt 0 ] || usage - [ "$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 compression=".$1" uboot_comp=$1 @@ -149,6 +149,9 @@ while [ "$#" -gt 0 ]; do if [ $uboot_comp = "gz" ]; then uboot_comp=gzip fi + if [ $uboot_comp = "bz2" ]; then + uboot_comp=bzip2 + fi ;; --no-gzip) # a "feature" of the the wrapper script is that it can be used outside @@ -377,6 +380,9 @@ if [ -z "$cacheit" -o ! -f "$vmz$compression" -o "$vmz$compression" -ot "$kernel .lzma) xz --format=lzma -f -6 "$vmz.$$" ;; + .bz2) + bzip2 -f "$vmz.$$" + ;; *) # drop the compression suffix so the stripped vmlinux is used compression= -- 2.13.3