#!/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)
    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
