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