From eef94a6668fcad4b87381abea3ee84192f3fdccb Mon Sep 17 00:00:00 2001 From: Graeme Gregory Date: Thu, 10 Jan 2008 15:42:54 +0000 Subject: linux-openmoko.inc : improve to not flash on first boot from Shoragons suggestion. Also error out if we cant find the kernel mtd. --- packages/linux/linux-openmoko.inc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'packages/linux') diff --git a/packages/linux/linux-openmoko.inc b/packages/linux/linux-openmoko.inc index 2016acdb63..4f1981c8b3 100644 --- a/packages/linux/linux-openmoko.inc +++ b/packages/linux/linux-openmoko.inc @@ -12,14 +12,22 @@ pkg_postinst_kernel-image () { if test "x$D" != "x"; then exit 1 else - echo "Upgrading Kernel in Flash" - echo "DO NOT stop this process" + if [ -f ${sysconfdir}/default/flashkernel ] ; then + echo "Upgrading Kernel in Flash" + echo "DO NOT stop this process" - MTD_KERNEL_PARTITION=`cat /proc/mtd | grep kernel | cut -d':' -f1` - MTD_KERNEL_PARTITION=/dev/$MTD_KERNEL_PARTITION + MTD_KERNEL_PARTITION=`cat /proc/mtd | grep kernel | cut -d':' -f1` + MTD_KERNEL_PARTITION=/dev/$MTD_KERNEL_PARTITION - ${bindir}/flash_eraseall $MTD_KERNEL_PARTITION - ${bindir}/nandwrite -p $MTD_KERNEL_PARTITION /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} + if [ "x$MTD_KERNEL_PARTITION" = "x" ] ; then + exit 1 + fi + + ${bindir}/flash_eraseall $MTD_KERNEL_PARTITION + ${bindir}/nandwrite -p $MTD_KERNEL_PARTITION /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} + else + touch ${sysconfdir}/default/flashkernel + fi fi } -- cgit v1.2.3