[Vibrant Q&A, Help & Troubleshooting] ssiddiqi1:
Guide to manually formatting using redband

From https://z4ziggy.wordpress.com/tag/android/

It is for I900, you will need to edit /dev/blocks for T959 vibran in case you want to try, also you need to be comfortable with Linux OS for these kind of hacks

EDIT: Fixed a major problem in the script which prevented rebooting]

a few days have passed, and its time for a little update. a major advance has been made regarding ROM flashing in linux, more particularly with redbend_ua usage.

so we learned that Samsung uses a proprietary tool named redbend_ua to flash the nand partitions (bml1..bml12). here is the partitions list taken from here:

bml1 256 KB contain boot.bin (262144 bytes), Primary Boot Loader (low-level hardware initialization)

bml2 256 KB contains PIT file first 512 bytes

bml3 10240 KB /dev/block/stl3 /efs

bml4 1280 KB contain Sbl.bin (1310720 bytes) Secondary Boot Loader (loads the Linux kernel and passes the necessary arguments)

bml5 1280 KB contains Secondary Boot Loader (for recovery, ect)

bml6 5120 KB param.lfs /mnt/.lfs j4fs

bml7 7680 KB contain zImage and initramfs

bml8 7680 KB empty

bml9 293376 KB factoryfs.rfs ( /system RFS Partition) /dev/block/stl9

bml10 137216 KB dbdata.rfs ( /dbdata RFS Partition) /dev/block/stl10

bml11 35840 KB cache.rfs ( /cache RFS Partition) /dev/block/stl11

bml12 12800 KB modem.bin

a few remarks:

* we can ignore the pit file which does NOT contain a new partition-table layout. it contains only the partition list (without sizes) – parition id, partition name, partition dump filename

* i got confirmation that dbdata.rfs & cache.rfs can be ignored on ROM update as they only contain 3rd party applications and data.

* we can dump the partitions using dd, and flash back using redbend_ua

so now we can see we have 6 partitions to flash: bml1, bml4, bml6, bml7, bml9, bml12. you can look at the above table to see their corresponding data file and functionality.

so, i thought about adopting update.zip file, and here is what i think could be a viable ROM updater-script:

WARNING: THIS HAS NOT BEEN TESTED! THIS IS ONLY A SHOWCASE.

view source

print?

01	# updater-script for ROM flash

02	# work-in-progress, (c) z4ziggy aka Elia Yehuda

03	# License : BSD

04

05	ui_print("--[ ROM Flasher");

06

07	# mount the sdcard

08	ui_print("--[ Mounting sdcard");

09	mount("vfat", "/dev/block/mmcblk1", "/sdcard/sd");

10

11	# extract needed files in ramdisk

12	ui_print("--[ Extracting files");

13	package_extract_file("redbend_ua", "redbend_ua");

14	set_perm(0, 0, 0755, "redbend_ua");

15

16	# formatting dbdata & cache

17	# is that needed? (to prevent old cache/dbdata problems)

18	ui_print("--[ Formatting");

19	format("MTD", "dbdata");

20	format("MTD", "cache");

21

22	# disable reboot since redbend_ua reboots after each run

23	# the following actually changes permissions to toolbox...

24	#set_perm(0, 0, 0644, "/sbin/reboot");

25	delete("/sbin/reboot");

26

27	# running the flash operation

28	ui_print("--[ Flashing partitions");

29	run_program("redbend_ua", "restore", "/sdcard/sd/boot.bin", "/dev/block/bml1");

30	run_program("redbend_ua", "restore", "/sdcard/sd/Sbl.bin", "/dev/block/bml4");

31	run_program("redbend_ua", "restore", "/sdcard/sd/param.lfs", "/dev/block/bml6");

32	run_program("redbend_ua", "restore", "/sdcard/sd/zImage", "/dev/block/bml7");

33	run_program("redbend_ua", "restore", "/sdcard/sd/factoryfs.rfs", "/dev/block/bml9");

34	run_program("redbend_ua", "restore", "/sdcard/sd/modem.bin", "/dev/block/bml12");

35

36	# reboot

37	unmount("/sdcard/sd");

38	#set_perm(0, 0, 0755, "/sbin/reboot");

39	symlink("/sbin/toolbox", "/sbin/reboot");

40	run_program("reboot", "now");