View Single Post
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#4
@pichlo,

I once started doing this, but ended up somewhere else

Here my notes:
Code:
* extract
mkdir parts
cd parts
../flasher-3.5 -F ../RX-51...COMBINED.bin --unpack
cp rootfs.jffs2 ../rootfs.ubi # it is really a ubi image
cd ..
# rm -rf parts

* mount rootfs
su -
modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa \
                 third_id_byte=0x00 fourth_id_byte=0x15
#/dev/mtd0 should be present, if not run "mknod /dev/mtd0 c 90 0"
dd if=rootfs.ubi of=/dev/mtd0 bs=2048
modprobe ubi mtd=0
mkdir mount
mount -t ubifs /dev/ubi0_0 mount

* make a copy
mkdir rootme
rsync -a mount/. rootme/.

* modify stuff -- either manually or using chroot?
...

* generate new image
su -
mkfs.ubifs -m 2048 -e 129024 -c 2047 -r rootme rootme.ubifs

* ubinize the file
cat > ubi.cfg <<EOF
[rootfs]
mode=ubi
image=rootme.ubifs
vol_id=0
vol_size=200MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize
vol_alignment=1
EOF
./ubinize -o rootme.ubi -p 128KiB -m 2048 -s 512 ubi.cfg

* flash the image
su -
./flasher-3.5 -F RX-51_2009SE_10.2010.19-1.002_PR_COMBINED_002_ARM.bin -f
./flasher-3.5 --rootfs rootme.ubi -f
./flasher-3.5 -F RX-51_2009SE_10.2010.13-2.VANILLA_PR_EMMC_MR0_ARM.bin -f
Didn't test any of this. It was more like a gedankenexperiment.
 

The Following 3 Users Say Thank You to reinob For This Useful Post: