xref: /freebsd/sys/contrib/xz-embedded/linux/scripts/xz_wrap.sh (revision 6cec9cad762b6476313fb1f8e931a1647822db6b)
163dab8eeSAdrian Chadd#!/bin/sh
263dab8eeSAdrian Chadd#
363dab8eeSAdrian Chadd# This is a wrapper for xz to compress the kernel image using appropriate
463dab8eeSAdrian Chadd# compression options depending on the architecture.
563dab8eeSAdrian Chadd#
663dab8eeSAdrian Chadd# Author: Lasse Collin <lasse.collin@tukaani.org>
763dab8eeSAdrian Chadd#
863dab8eeSAdrian Chadd# This file has been put into the public domain.
963dab8eeSAdrian Chadd# You can do whatever you want with this file.
1063dab8eeSAdrian Chadd#
1163dab8eeSAdrian Chadd
1263dab8eeSAdrian ChaddBCJ=
1363dab8eeSAdrian ChaddLZMA2OPTS=
1463dab8eeSAdrian Chadd
15*f0bd5302SXin LIcase $SRCARCH in
16*f0bd5302SXin LI	x86)            BCJ=--x86 ;;
1763dab8eeSAdrian Chadd	powerpc)        BCJ=--powerpc ;;
1863dab8eeSAdrian Chadd	ia64)           BCJ=--ia64; LZMA2OPTS=pb=4 ;;
1963dab8eeSAdrian Chadd	arm)            BCJ=--arm ;;
2063dab8eeSAdrian Chadd	sparc)          BCJ=--sparc ;;
2163dab8eeSAdrian Chaddesac
2263dab8eeSAdrian Chadd
2363dab8eeSAdrian Chaddexec xz --check=crc32 $BCJ --lzma2=$LZMA2OPTS,dict=32MiB
24