]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[POWERPC] bootwrapper: Make compression of the kernel image optional.
authorScott Wood <scottwood@freescale.com>
Fri, 16 Mar 2007 17:27:59 +0000 (12:27 -0500)
committerPaul Mackerras <paulus@samba.org>
Wed, 21 Mar 2007 11:35:21 +0000 (22:35 +1100)
The --no-gzip option can be passed to the wrapper so that the kernel
image is included uncompressed into the zImage.  This is intended for
bootloaders where the zImage itself can be compressed, or where boot time
is considered more important than kernel image size.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/boot/wrapper

index 157d8c89e1386915f85351f1db836aff494a2366..f9238f53c1f353a249508ef77ff6847f4fb8831b 100755 (executable)
@@ -29,6 +29,7 @@ initrd=
 dtb=
 dts=
 cacheit=
+gzip=.gz
 
 # cross-compilation prefix
 CROSS=
@@ -42,7 +43,7 @@ tmpdir=.
 usage() {
     echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2
     echo '       [-d devtree] [-s tree.dts] [-c] [-C cross-prefix]' >&2
-    echo '       [-D datadir] [-W workingdir] [vmlinux]' >&2
+    echo '       [-D datadir] [-W workingdir] [--no-gzip] [vmlinux]' >&2
     exit 1
 }
 
@@ -91,6 +92,9 @@ while [ "$#" -gt 0 ]; do
        [ "$#" -gt 0 ] || usage
        tmpdir="$1"
        ;;
+    --no-gzip)
+        gzip=
+        ;;
     -?)
        usage
        ;;
@@ -142,14 +146,20 @@ esac
 vmz="$tmpdir/`basename \"$kernel\"`.$ext"
 if [ -z "$cacheit" -o ! -f "$vmz.gz" -o "$vmz.gz" -ot "$kernel" ]; then
     ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
-    gzip -f -9 "$vmz.$$"
+
+    if [ -n "$gzip" ]; then
+        gzip -f -9 "$vmz.$$"
+    fi
+
     if [ -n "$cacheit" ]; then
-       mv -f "$vmz.$$.gz" "$vmz.gz"
+       mv -f "$vmz.$$$gzip" "$vmz$gzip"
     else
        vmz="$vmz.$$"
     fi
 fi
 
+vmz="$vmz$gzip"
+
 case "$platform" in
 uboot)
     rm -f "$ofile"
@@ -159,9 +169,9 @@ uboot)
        version="-n Linux-$version"
     fi
     mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
-       $version -d "$vmz.gz" "$ofile"
+       $version -d "$vmz" "$ofile"
     if [ -z "$cacheit" ]; then
-       rm -f $vmz.gz
+       rm -f "$vmz"
     fi
     exit 0
     ;;
@@ -173,9 +183,9 @@ addsec() {
        --set-section-flags=$3=contents,alloc,load,readonly,data
 }
 
-addsec $tmp "$vmz.gz" $ksection $object/empty.o
+addsec $tmp "$vmz" $ksection $object/empty.o
 if [ -z "$cacheit" ]; then
-    rm -f "$vmz.gz"
+    rm -f "$vmz"
 fi
 
 if [ -n "$initrd" ]; then