#!/bin/sh

##DEBHELPER##

set -e

case "$1" in
    configure)
        if grep -q '^Allwinner D1 Nezha$' /sys/firmware/devicetree/base/model && [ -e /dev/disk/by-partlabel/loader1 ]; then
            dd if=/usr/lib/u-boot/nezha/boot0_sdcard_sun20iw1p1.bin of=/dev/disk/by-partlabel/loader1 conv=fsync
        fi
        ;;
esac

exit 0
