diff options
author | Scott Wood <scottwood@freescale.com> | 2007-03-16 13:27:59 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-03-21 07:35:21 -0400 |
commit | a9903811bf8d130a26004f9cb27b66513a267908 (patch) | |
tree | 9c49fee3adc89e5a9f0079822eb04a163f4715c8 /arch/powerpc/boot/wrapper | |
parent | a07940ba00218267493798e89e3f4a86fea53125 (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-x | arch/powerpc/boot/wrapper | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 157d8c89e138..f9238f53c1f3 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper | |||
@@ -29,6 +29,7 @@ initrd= | |||
29 | dtb= | 29 | dtb= |
30 | dts= | 30 | dts= |
31 | cacheit= | 31 | cacheit= |
32 | gzip=.gz | ||
32 | 33 | ||
33 | # cross-compilation prefix | 34 | # cross-compilation prefix |
34 | CROSS= | 35 | CROSS= |
@@ -42,7 +43,7 @@ tmpdir=. | |||
42 | usage() { | 43 | usage() { |
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 | |||
142 | vmz="$tmpdir/`basename \"$kernel\"`.$ext" | 146 | vmz="$tmpdir/`basename \"$kernel\"`.$ext" |
143 | if [ -z "$cacheit" -o ! -f "$vmz.gz" -o "$vmz.gz" -ot "$kernel" ]; then | 147 | if [ -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 |
151 | fi | 159 | fi |
152 | 160 | ||
161 | vmz="$vmz$gzip" | ||
162 | |||
153 | case "$platform" in | 163 | case "$platform" in |
154 | uboot) | 164 | uboot) |
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 | ||
176 | addsec $tmp "$vmz.gz" $ksection $object/empty.o | 186 | addsec $tmp "$vmz" $ksection $object/empty.o |
177 | if [ -z "$cacheit" ]; then | 187 | if [ -z "$cacheit" ]; then |
178 | rm -f "$vmz.gz" | 188 | rm -f "$vmz" |
179 | fi | 189 | fi |
180 | 190 | ||
181 | if [ -n "$initrd" ]; then | 191 | if [ -n "$initrd" ]; then |