summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2008-11-23 12:42:43 +0300
committerDmitry Baryshkov <dbaryshkov@gmail.com>2008-12-01 19:27:39 +0300
commit8045219455876d6ee1468ef3cb42124be684ed46 (patch)
tree30901e7b27a12eb6220c4f09339e9562a62a07c5
parent1eaea9d442d6b01d6b4e10cd8b024e931f05575a (diff)
zaurus-updater: add support for home partition reflashing
Sometimes one needs to clean/reflash the home partition. Add support for flashing home.bin/HOME.BIN files onto "home" mtd device. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
-rw-r--r--packages/zaurus-updater/zaurus-updater.bb2
-rw-r--r--packages/zaurus-updater/zaurus-updater/updater.sh38
2 files changed, 37 insertions, 3 deletions
diff --git a/packages/zaurus-updater/zaurus-updater.bb b/packages/zaurus-updater/zaurus-updater.bb
index 56f067cbf7..6ed1c5fdd4 100644
--- a/packages/zaurus-updater/zaurus-updater.bb
+++ b/packages/zaurus-updater/zaurus-updater.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "Encrypted shellscript for the Zaurus ROM update"
DEPENDS = "encdec-updater-native"
LICENSE = "zaurus-updater"
-PR = "r21"
+PR = "r23"
PACKAGES = ""
PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/packages/zaurus-updater/zaurus-updater/updater.sh b/packages/zaurus-updater/zaurus-updater/updater.sh
index 22d4b3914d..f195aff383 100644
--- a/packages/zaurus-updater/zaurus-updater/updater.sh
+++ b/packages/zaurus-updater/zaurus-updater/updater.sh
@@ -42,6 +42,9 @@
#
# 2007.12.25 Matthias 'CoreDump' Hentges
# -Add support for installing / updating u-boot
+#
+# 2008.11.23 Dmitry 'lumag' Baryshkov
+# - Add support for reflashing home partitions
# Set to "yes" to enable
ENABLE_UBOOT_UPDATER="no"
@@ -53,6 +56,7 @@ TMPHEAD=$TMPPATH/tmphead.bin
FLASHED_KERNEL=0
FLASHED_ROOTFS=0
+FLASHED_HOMEFS=0
UNPACKED_ROOTFS=0 # spitz only
RO_MTD_LINE=`cat /proc/mtd | grep "root" | tail -n 1`
@@ -63,6 +67,14 @@ RO_MTD_NO=`echo $RO_MTD_LINE | cut -d: -f1 | cut -dd -f2`
RO_MTD=/dev/mtd$RO_MTD_NO
ROOTFS_SIZE=`echo $RO_MTD_LINE | cut -d" " -f2`
+RW_MTD_LINE=`cat /proc/mtd | grep "home" | tail -n 1`
+if [ "$RW_MTD_LINE" = "" ]; then
+ RW_MTD_LINE=`cat /proc/mtd | grep "\<NAND\>.*\<2\>" | tail -n 1`
+fi
+RW_MTD_NO=`echo $RW_MTD_LINE | cut -d: -f1 | cut -dd -f2`
+RW_MTD=/dev/mtd$RW_MTD_NO
+HOMEFS_SIZE=`echo $RO_MTD_LINE | cut -d" " -f2`
+
LOGOCAL_MTD=/dev/mtd1
VERBLOCK=0x48000
@@ -381,7 +393,7 @@ mkdir -p $TMPPATH > /dev/null 2>&1
cd $DATAPATH/
-for TARGETFILE in u-boot.bin U-BOOT.BIN zimage zImage zImage.bin zimage.bin ZIMAGE ZIMAGE.BIN initrd.bin INITRD.BIN hdimage1.tgz HDIMAGE1.TGZ
+for TARGETFILE in u-boot.bin U-BOOT.BIN zimage zImage zImage.bin zimage.bin ZIMAGE ZIMAGE.BIN initrd.bin INITRD.BIN hdimage1.tgz HDIMAGE1.TGZ home.bin HOME.BIN
do
if [ ! -e $TARGETFILE ]
then
@@ -438,6 +450,28 @@ do
FLASH_TYPE=""
;;
+ home.bin)
+ if [ $FLASHED_HOMEFS != 0 ]
+ then
+ continue
+ fi
+ echo 'home file system'
+ FLASHED_HOMEFS=1
+ ISLOGICAL=0
+ ADDR=0
+ ISFORMATTED=0
+ MTD_PART_SIZE="0x$HOMEFS_SIZE"
+ ADDR=0
+ ISFORMATTED=0
+ TARGET_MTD=$RW_MTD
+ DATAPOS=0
+ ONESIZE=1048576
+ FLASH_TYPE="home"
+ /sbin/bcut -s 16 -o $TMPHEAD $TARGETFILE
+ do_flashing
+ FLASH_TYPE=""
+ ;;
+
hdimage1.tgz)
if [ $UNPACKED_ROOTFS = 0 ]
then
@@ -446,7 +480,7 @@ do
;;
u-boot.bin)
- if [ FLASHED_UBOOT != 1 ]
+ if [ $FLASHED_UBOOT != 1 ]
then
update_uboot "$TARGETFILE"
FLASHED_UBOOT="1"