summaryrefslogtreecommitdiff
path: root/packages/linux/linux-openmoko.inc
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2008-01-17 19:23:03 +0000
committerDaniel Willmann <daniel@totalueberwachung.de>2008-01-17 19:23:03 +0000
commit5f89da2c9521b9bff73a34b933929c1767c454ae (patch)
treea6eb507e8e20dbbc500655ea515ece4cb5500bd9 /packages/linux/linux-openmoko.inc
parent1bf5c3346ac395825d49f895922a61bcdbb238e5 (diff)
parent3c378f37f55ee00c41fce4897f8a09cb51b59f94 (diff)
merge of '15abe433106a3416f43fe1507eb0032a960434bb'
and '2538d8c9c6f9647baba548394a1e20a2e4467a19'
Diffstat (limited to 'packages/linux/linux-openmoko.inc')
-rw-r--r--packages/linux/linux-openmoko.inc19
1 files changed, 15 insertions, 4 deletions
diff --git a/packages/linux/linux-openmoko.inc b/packages/linux/linux-openmoko.inc
index b659153733..4f1981c8b3 100644
--- a/packages/linux/linux-openmoko.inc
+++ b/packages/linux/linux-openmoko.inc
@@ -12,11 +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"
- ${bindir}/flash_eraseall ${MTD_KERNEL_PARTITION}
- ${bindir}/nandwrite -p ${MTD_KERNEL_PARTITION} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
+ MTD_KERNEL_PARTITION=`cat /proc/mtd | grep kernel | cut -d':' -f1`
+ MTD_KERNEL_PARTITION=/dev/$MTD_KERNEL_PARTITION
+
+ 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
}