From 868620e157d1e26f4755f01120aecd69c985c396 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Sat, 13 May 2017 14:21:58 +0200 Subject: zaurus-updater: support flashing of Cacko's mainte_fix.bin Only for 128M clamshell models. This is necessary if you want to change rootfs size over 64 MB. It is flashed in the first 256k of the nand and overwrites the first 64k of the Parameter Area (AdjValue, BootFlag, Version, Clock). Version is included so verchg is not necessary. Signed-off-by: Andrea Adami --- recipes-bsp/zaurus-utils/zaurus-updater/updater.sh | 36 +++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/recipes-bsp/zaurus-utils/zaurus-updater/updater.sh b/recipes-bsp/zaurus-utils/zaurus-updater/updater.sh index d724a48..f638420 100644 --- a/recipes-bsp/zaurus-utils/zaurus-updater/updater.sh +++ b/recipes-bsp/zaurus-utils/zaurus-updater/updater.sh @@ -63,6 +63,7 @@ TMPPATH=/tmp/update TMPDATA=$TMPPATH/tmpdata.bin TMPHEAD=$TMPPATH/tmphead.bin +FLASHED_MAINTE=0 FLASHED_KERNEL=0 FLASHED_ROOTFS=0 FLASHED_HOMEFS=0 @@ -362,6 +363,29 @@ update_uboot() { fi } +mainte_fix() +{ +# binaries taken from Cacko 1.23 installer +case "$MODEL" in + SL-C760|SL-C860|SL-C1000|SL-C3100|SL-C3200) + echo -n 'Flashing Mainte fix for 128M flash...' + if ( /sbin/nandlogical $LOGOCAL_MTD WRITE 0x00, 327680, $TARGETFILE ) > /dev/null 2>&1 + then + echo 'done' + # unnecessary fix for FSRW end addr / size ? (kernel parser sharpslpart ignores it) + # OUTFILE=$TMPPATH/128M_fix.bin + # printf '\x08' > $OUTFILE + # /sbin/nandlogical $LOGOCAL_MTD WRITE 0x60027, 1, $OUTFILE > /dev/null 2>&1 + # /sbin/nandlogical $LOGOCAL_MTD WRITE 0x64027, 1, $OUTFILE > /dev/null 2>&1 + # rm -f $OUTFILE > /dev/null 2>&1 + exit 0 + fi + ;; + *) + ;; +esac +} + ### Check model ### /sbin/writerominfo MODEL=`cat /proc/deviceinfo/product` @@ -403,7 +427,8 @@ 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 home.bin HOME.BIN + initrd.bin INITRD.BIN hdimage1.tgz HDIMAGE1.TGZ home.bin HOME.BIN \ + mainte_fix.bin MAINTE_FIX.BIN do if [ ! -e $TARGETFILE ] then @@ -498,6 +523,15 @@ do fi ;; + mainte_fix.bin) + echo 'Mainte fix for models with 128M flash' + if [ $FLASHED_MAINTE != 1 ] + then + mainte_fix + FLASHED_MAINTE="1" + fi + ;; + *) ;; esac -- cgit 1.2.3-korg