提交 a9903811 编写于 作者: S Scott Wood 提交者: Paul Mackerras

[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: NScott Wood <scottwood@freescale.com>
Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 a07940ba
...@@ -29,6 +29,7 @@ initrd= ...@@ -29,6 +29,7 @@ initrd=
dtb= dtb=
dts= dts=
cacheit= cacheit=
gzip=.gz
# cross-compilation prefix # cross-compilation prefix
CROSS= CROSS=
...@@ -42,7 +43,7 @@ tmpdir=. ...@@ -42,7 +43,7 @@ tmpdir=.
usage() { usage() {
echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2 echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2
echo ' [-d devtree] [-s tree.dts] [-c] [-C cross-prefix]' >&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 exit 1
} }
...@@ -91,6 +92,9 @@ while [ "$#" -gt 0 ]; do ...@@ -91,6 +92,9 @@ while [ "$#" -gt 0 ]; do
[ "$#" -gt 0 ] || usage [ "$#" -gt 0 ] || usage
tmpdir="$1" tmpdir="$1"
;; ;;
--no-gzip)
gzip=
;;
-?) -?)
usage usage
;; ;;
...@@ -142,14 +146,20 @@ esac ...@@ -142,14 +146,20 @@ esac
vmz="$tmpdir/`basename \"$kernel\"`.$ext" vmz="$tmpdir/`basename \"$kernel\"`.$ext"
if [ -z "$cacheit" -o ! -f "$vmz.gz" -o "$vmz.gz" -ot "$kernel" ]; then if [ -z "$cacheit" -o ! -f "$vmz.gz" -o "$vmz.gz" -ot "$kernel" ]; then
${CROSS}objcopy $objflags "$kernel" "$vmz.$$" ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
if [ -n "$gzip" ]; then
gzip -f -9 "$vmz.$$" gzip -f -9 "$vmz.$$"
fi
if [ -n "$cacheit" ]; then if [ -n "$cacheit" ]; then
mv -f "$vmz.$$.gz" "$vmz.gz" mv -f "$vmz.$$$gzip" "$vmz$gzip"
else else
vmz="$vmz.$$" vmz="$vmz.$$"
fi fi
fi fi
vmz="$vmz$gzip"
case "$platform" in case "$platform" in
uboot) uboot)
rm -f "$ofile" rm -f "$ofile"
...@@ -159,9 +169,9 @@ uboot) ...@@ -159,9 +169,9 @@ uboot)
version="-n Linux-$version" version="-n Linux-$version"
fi fi
mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \ 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 if [ -z "$cacheit" ]; then
rm -f $vmz.gz rm -f "$vmz"
fi fi
exit 0 exit 0
;; ;;
...@@ -173,9 +183,9 @@ addsec() { ...@@ -173,9 +183,9 @@ addsec() {
--set-section-flags=$3=contents,alloc,load,readonly,data --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 if [ -z "$cacheit" ]; then
rm -f "$vmz.gz" rm -f "$vmz"
fi fi
if [ -n "$initrd" ]; then if [ -n "$initrd" ]; then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册