powerpc/boot: Add lzo support for uImage
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 14 Jun 2019 10:16:25 +0000 (10:16 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 4 Jul 2019 16:06:38 +0000 (02:06 +1000)
This patch allows to generate lzo compressed uImage

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/Kconfig
arch/powerpc/boot/Makefile
arch/powerpc/boot/wrapper

index 016bd351e5fe69d22184240917e4838d09096927..12cee37f15c47a39483454af02ad2314ace39d34 100644 (file)
@@ -199,6 +199,7 @@ config PPC
        select HAVE_IRQ_EXIT_ON_IRQ_STACK
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_LZMA                 if DEFAULT_UIMAGE
+       select HAVE_KERNEL_LZO                  if DEFAULT_UIMAGE
        select HAVE_KERNEL_XZ                   if PPC_BOOK3S || 44x
        select HAVE_KPROBES
        select HAVE_KPROBES_ON_FTRACE
index 9b7b11a229256812258b8ca6131836bd4cb66545..36fb51a9329f906498d5e5beafa07f9c16c0524f 100644 (file)
@@ -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_LZO)   := CONFIG_KERNEL_LZO
 
 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_LZO) := lzo
 
 # args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd
 quiet_cmd_wrap = WRAP    $@
index 51dc42f5acbca27c1f10f67c280fc30b3c8681a0..4ed18d63d8924cf9770c3f94af2c1e36928e057d 100755 (executable)
@@ -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" != "lzo" -o "$1" != "none" ] || usage
 
        compression=".$1"
        uboot_comp=$1
@@ -377,6 +377,9 @@ if [ -z "$cacheit" -o ! -f "$vmz$compression" -o "$vmz$compression" -ot "$kernel
     .lzma)
         xz --format=lzma -f -6 "$vmz.$$"
        ;;
+    .lzo)
+        lzop -f -9 "$vmz.$$"
+       ;;
     *)
         # drop the compression suffix so the stripped vmlinux is used
         compression=