#!/bin/sh
set -e

#DEBHELPER#

if [ "$1" = "configure" ] && [ -x "`which update-initramfs 2>/dev/null`" ]; then
	update-initramfs -u
	if [ -n "$2" ]; then
		if [ ! -e /proc/mtd ]; then
		        echo "/proc is not mounted" >&2
		fi
		if grep -q '"Loader"$' /proc/mtd ; then
			flash-kernel
		fi
	fi
fi
