#!/bin/bash -e

# Play nice when run under debconf.
exec </dev/null >&2

abi=$1
target=/boot/firmware
dtb_dir=/usr/lib/linux-image-$abi/

cp /boot/vmlinuz-${abi} ${target}/vmlinuz
cp ${dtb_dir}/broadcom/*.dtb ${target}/
cp -r ${dtb_dir}/overlays ${target}/
sync -f ${target}/vmlinuz || true

exit 0
