xref: /OK3568_Linux_fs/kernel/scripts/xz_wrap.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2#
3# This is a wrapper for xz to compress the kernel image using appropriate
4# compression options depending on the architecture.
5#
6# Author: Lasse Collin <lasse.collin@tukaani.org>
7#
8# This file has been put into the public domain.
9# You can do whatever you want with this file.
10#
11
12. include/config/auto.conf
13
14BCJ=
15LZMA2OPTS=
16
17case $SRCARCH in
18	x86)            BCJ=--x86 ;;
19	powerpc)        BCJ=--powerpc ;;
20	ia64)           BCJ=--ia64; LZMA2OPTS=pb=4 ;;
21	arm)            BCJ=--arm ;;
22	sparc)          BCJ=--sparc ;;
23esac
24
25if [ -n "${CONFIG_THUMB2_KERNEL}" ]; then
26	BCJ=--armthumb
27fi
28
29exec $XZ --check=crc32 $BCJ --lzma2=$LZMA2OPTS,dict=32MiB
30