#!/bin/sh

# Copyright (C) 2006 Paul Mackerras, IBM Corporation <paulus@samba.org>
# This program may be used under the terms of version 2 of the GNU
# General Public License.

# This script takes a kernel binary and optionally an initrd image
# and/or a device-tree blob, and creates a bootable zImage for a
# given platform.

# Options:
# -o zImage	specify output file
# -p platform	specify platform (links in $platform.o)
# -i initrd	specify initrd file
# -d devtree	specify device-tree blob
# -s tree.dts	specify device-tree source file (needs dtc installed)
# -c		cache $kernel.strip.gz (use if present & newer, else make)
# -C prefix	specify command prefix for cross-building tools
#		(strip, objcopy, ld)
# -D dir	specify directory containing data files used by script
#		(default ./arch/powerpc/boot)
# -W dir	specify working directory for temporary files (default .)

# Stop execution if any command fails
set -e

# Allow for verbose output
if [ "$V" = 1 ]; then
    set -x
fi

# defaults
kernel=
ofile=zImage
platform=of
initrd=
dtb=
dts=
cacheit=
binary=
gzip=.gz

# cross-compilation prefix
CROSS=

# directory for object and other files used by this script
object=arch/powerpc/boot
objbin=$object

# directory for working files
tmpdir=.

usage() {
    echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2
    echo '       [-d devtree] [-s tree.dts] [-c] [-C cross-prefix]' >&2
    echo '       [-D datadir] [-W workingdir] [--no-gzip] [vmlinux]' >&2
    exit 1
}

while [ "$#" -gt 0 ]; do
    case "$1" in
    -o)
	shift
	[ "$#" -gt 0 ] || usage
	ofile="$1"
	;;
    -p)
	shift
	[ "$#" -gt 0 ] || usage
	platform="$1"
	;;
    -i)
	shift
	[ "$#" -gt 0 ] || usage
	initrd="$1"
	;;
    -d)
	shift
	[ "$#" -gt 0 ] || usage
	dtb="$1"
	;;
    -s)
	shift
	[ "$#" -gt 0 ] || usage
	dts="$1"
	;;
    -c)
	cacheit=y
	;;
    -C)
	shift
	[ "$#" -gt 0 ] || usage
	CROSS="$1"
	;;
    -D)
	shift
	[ "$#" -gt 0 ] || usage
	object="$1"
	objbin="$1"
	;;
    -W)
	shift
	[ "$#" -gt 0 ] || usage
	tmpdir="$1"
	;;
    --no-gzip)
        gzip=
        ;;
    -?)
	usage
	;;
    *)
	[ -z "$kernel" ] || usage
	kernel="$1"
	;;
    esac
    shift
done

if [ -n "$dts" ]; then
    if [ ! -r "$dts" -a -r "$object/dts/$dts" ]; then
	dts="$object/dts/$dts"
    fi
    if [ -z "$dtb" ]; then
	dtb="$platform.dtb"
    fi
    $object/dtc -O dtb -o "$dtb" -b 0 "$dts"
fi

if [ -z "$kernel" ]; then
    kernel=vmlinux
fi

platformo=$object/"$platform".o
lds=$object/zImage.lds
ext=strip
objflags=-S
tmp=$tmpdir/zImage.$$.o
ksection=.kernel:vmlinux.strip
isection=.kernel:initrd

case "$platform" in
pmac|pseries|chrp)
    platformo=$object/of.o
    ;;
coff)
    platformo=$object/of.o
    lds=$object/zImage.coff.lds
    ;;
miboot|uboot)
    # miboot and U-boot want just the bare bits, not an ELF binary
    ext=bin
    objflags="-O binary"
    tmp="$ofile"
    ksection=image
    isection=initrd
    ;;
cuboot*)
    binary=y
    gzip=
    ;;
ps3)
    platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o"
    lds=$object/zImage.ps3.lds
    gzip=
    ext=bin
    objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data"
    ksection=.kernel:vmlinux.bin
    isection=.kernel:initrd
    ;;
ep88xc|ep405|redboot*|ep8248e)
    platformo="$object/fixed-head.o $object/$platform.o"
    binary=y
    ;;
esac

vmz="$tmpdir/`basename \"$kernel\"`.$ext"
if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then
    ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"

    if [ -n "$gzip" ]; then
        gzip -f -9 "$vmz.$$"
    fi

    if [ -n "$cacheit" ]; then
	mv -f "$vmz.$$$gzip" "$vmz$gzip"
    else
	vmz="$vmz.$$"
    fi
fi

vmz="$vmz$gzip"

# Extract kernel version information, some platforms want to include
# it in the image header
version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \
    cut -d' ' -f3`
if [ -n "$version" ]; then
    uboot_version="-n Linux-$version"
fi

case "$platform" in
uboot)
    rm -f "$ofile"
    mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
	$uboot_version -d "$vmz" "$ofile"
    if [ -z "$cacheit" ]; then
	rm -f "$vmz"
    fi
    exit 0
    ;;
esac

addsec() {
    ${CROSS}objcopy $4 $1 \
	--add-section=$3="$2" \
	--set-section-flags=$3=contents,alloc,load,readonly,data
}

addsec $tmp "$vmz" $ksection $object/empty.o
if [ -z "$cacheit" ]; then
    rm -f "$vmz"
fi

if [ -n "$initrd" ]; then
    addsec $tmp "$initrd" $isection
fi

if [ -n "$dtb" ]; then
    addsec $tmp "$dtb" .kernel:dtb
    if [ -n "$dts" ]; then
	rm $dtb
    fi
fi

if [ "$platform" != "miboot" ]; then
    ${CROSS}ld -m elf32ppc -T $lds -o "$ofile" \
	$platformo $tmp $object/wrapper.a
    rm $tmp
fi

# Some platforms need the zImage's entry point and base address
base=0x`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1`
entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | cut -d' ' -f3`

if [ -n "$binary" ]; then
    mv "$ofile" "$ofile".elf
    ${CROSS}objcopy -O binary "$ofile".elf "$ofile"
fi

# post-processing needed for some platforms
case "$platform" in
pseries|chrp)
    $objbin/addnote "$ofile"
    ;;
coff)
    ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"
    $objbin/hack-coff "$ofile"
    ;;
cuboot*)
    gzip -f -9 "$ofile"
    mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
            $uboot_version -d "$ofile".gz "$ofile"
    ;;
treeboot*)
    mv "$ofile" "$ofile.elf"
    $objbin/mktree "$ofile.elf" "$ofile" "$base" "$entry"
    if [ -z "$cacheit" ]; then
	rm -f "$ofile.elf"
    fi
    exit 0
    ;;
ps3)
    # The ps3's loader supports loading gzipped binary images from flash
    # rom to addr zero. The loader enters the image at addr 0x100.  A
    # bootwrapper overlay is use to arrange for the kernel to be loaded
    # to addr zero and to have a suitable bootwrapper entry at 0x100.
    # To construct the rom image, 0x100 bytes from offset 0x100 in the
    # kernel is copied to the bootwrapper symbol __system_reset_kernel.
    # The 0x100 bytes at the bootwrapper symbol __system_reset_overlay is
    # then copied to offset 0x100.  At runtime the bootwrapper program
    # copies the 0x100 bytes at __system_reset_kernel to addr 0x100.

    system_reset_overlay=0x`${CROSS}nm "$ofile" \
        | grep ' __system_reset_overlay$'       \
        | cut -d' ' -f1`
    system_reset_overlay=`printf "%d" $system_reset_overlay`
    system_reset_kernel=0x`${CROSS}nm "$ofile" \
        | grep ' __system_reset_kernel$'       \
        | cut -d' ' -f1`
    system_reset_kernel=`printf "%d" $system_reset_kernel`
    overlay_dest="256"
    overlay_size="256"

    ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"

    dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
        skip=$overlay_dest seek=$system_reset_kernel  \
        count=$overlay_size bs=1

    dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
        skip=$system_reset_overlay seek=$overlay_dest \
        count=$overlay_size bs=1

    odir="$(dirname "$ofile.bin")"
    rm -f "$odir/otheros.bld"
    gzip --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
    ;;
esac
