aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/wrapper
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-03-16 13:27:59 -0400
committerPaul Mackerras <paulus@samba.org>2007-03-21 07:35:21 -0400
commita9903811bf8d130a26004f9cb27b66513a267908 (patch)
tree9c49fee3adc89e5a9f0079822eb04a163f4715c8 /arch/powerpc/boot/wrapper
parenta07940ba00218267493798e89e3f4a86fea53125 (diff)
[POWERPC] bootwrapper: Make compression of the kernel image optional.
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>
Diffstat (limited to 'arch/powerpc/boot/wrapper')
-rwxr-xr-xarch/powerpc/boot/wrapper24
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 157d8c89e13..f9238f53c1f 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -29,6 +29,7 @@ initrd=
29dtb= 29dtb=
30dts= 30dts=
31cacheit= 31cacheit=
32gzip=.gz
32 33
33# cross-compilation prefix 34# cross-compilation prefix
34CROSS= 35CROSS=
@@ -42,7 +43,7 @@ tmpdir=.
42usage() { 43usage() {
43 echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2 44 echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2
44 echo ' [-d devtree] [-s tree.dts] [-c] [-C cross-prefix]' >&2 45 echo ' [-d devtree] [-s tree.dts] [-c] [-C cross-prefix]' >&2
45 echo ' [-D datadir] [-W workingdir] [vmlinux]' >&2 46 echo ' [-D datadir] [-W workingdir] [--no-gzip] [vmlinux]' >&2
46 exit 1 47 exit 1
47} 48}
48 49
@@ -91,6 +92,9 @@ while [ "$#" -gt 0 ]; do
91 [ "$#" -gt 0 ] || usage 92 [ "$#" -gt 0 ] || usage
92 tmpdir="$1" 93 tmpdir="$1"
93 ;; 94 ;;
95 --no-gzip)
96 gzip=
97 ;;
94 -?) 98 -?)
95 usage 99 usage
96 ;; 100 ;;
@@ -142,14 +146,20 @@ esac
142vmz="$tmpdir/`basename \"$kernel\"`.$ext" 146vmz="$tmpdir/`basename \"$kernel\"`.$ext"
143if [ -z "$cacheit" -o ! -f "$vmz.gz" -o "$vmz.gz" -ot "$kernel" ]; then 147if [ -z "$cacheit" -o ! -f "$vmz.gz" -o "$vmz.gz" -ot "$kernel" ]; then
144 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$" 148 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
145 gzip -f -9 "$vmz.$$" 149
150 if [ -n "$gzip" ]; then
151 gzip -f -9 "$vmz.$$"
152 fi
153
146 if [ -n "$cacheit" ]; then 154 if [ -n "$cacheit" ]; then
147 mv -f "$vmz.$$.gz" "$vmz.gz" 155 mv -f "$vmz.$$$gzip" "$vmz$gzip"
148 else 156 else
149 vmz="$vmz.$$" 157 vmz="$vmz.$$"
150 fi 158 fi
151fi 159fi
152 160
161vmz="$vmz$gzip"
162
153case "$platform" in 163case "$platform" in
154uboot) 164uboot)
155 rm -f "$ofile" 165 rm -f "$ofile"
@@ -159,9 +169,9 @@ uboot)
159 version="-n Linux-$version" 169 version="-n Linux-$version"
160 fi 170 fi
161 mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \ 171 mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
162 $version -d "$vmz.gz" "$ofile" 172 $version -d "$vmz" "$ofile"
163 if [ -z "$cacheit" ]; then 173 if [ -z "$cacheit" ]; then
164 rm -f $vmz.gz 174 rm -f "$vmz"
165 fi 175 fi
166 exit 0 176 exit 0
167 ;; 177 ;;
@@ -173,9 +183,9 @@ addsec() {
173 --set-section-flags=$3=contents,alloc,load,readonly,data 183 --set-section-flags=$3=contents,alloc,load,readonly,data
174} 184}
175 185
176addsec $tmp "$vmz.gz" $ksection $object/empty.o 186addsec $tmp "$vmz" $ksection $object/empty.o
177if [ -z "$cacheit" ]; then 187if [ -z "$cacheit" ]; then
178 rm -f "$vmz.gz" 188 rm -f "$vmz"
179fi 189fi
180 190
181if [ -n "$initrd" ]; then 191if [ -n "$initrd" ]; then