I found a better way to restore to factory default.
Porkupan's root set does flash both - system and data partition.
But flashing data partition is not necessary and is a possible cause for errors.
The factory reset done by Sony just formats the data partition which will be then will be automatically populated with default data on next boot.
A modified version of do_update.sh looks like
Code:
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin
DATA=/tmp/data
SYSTEM=/tmp/system
echo Starting $0 `date`
#mkdir -p ${DATA}
mkdir -p ${SYSTEM}
for IMAGE in mmcblk2p9 mmcblk2p10
do
if [ -f ${UPDATE_MP}/tmp/${IMAGE}.img ]
then
echo "Updating ${IMAGE}"
dd if=${UPDATE_MP}/tmp/${IMAGE}.img of=/dev/${IMAGE} bs=1024 conv=notrunc
fi
done
#mount /dev/mmcblk2p9 ${DATA}
mount -o ro /dev/mmcblk2p10 ${SYSTEM}
#ls -R ${DATA}
#echo
#echo "---------------------"
#echo
ls -R ${SYSTEM}
#umount ${DATA}
umount ${SYSTEM}
echo
echo Formating data partition...
mkfs.ext4 -L data -m 0 -j /dev/mmcblk2p9
echo Done $0 `date`
All you need to do is take one of porkupans recovery sets, goto ./sdcard/tmp and
- replace do_update.sh
- in checksum file:replace md5 checksum of do_update.sh with new one (8d61e257c885686b62079f3341814268) and remove line with mmcblk2p9 checksum
- delete mmcblk2p9.img
What is left still left for a complete factory reset is formating the READER partition. But this cannot be done with do_update.sh because it resides on that partition.
But you should be able to format reader partition yourself via Settings/Initialization
Another way to achieve this is a modified SD recovery image which does
- reflash system partition
- format data partition instead of flashing it
- format reader partition
And:
we must not forget adb which is untouched by the above steps.
Also, Sony Firmware update not only updates system partion, but also the
Linux Kernel Image!
But the kernel is untouched by recovery sets.
So, you cannot easily go back to an older firmware via recovery.
This can only be achieved with original Sony Update package.