Tampilkan postingan dengan label block. Tampilkan semua postingan
Tampilkan postingan dengan label block. Tampilkan semua postingan

switch to another modem version without recovery

This is actually part of my freeNANDmod for the Samsung Galaxy S I9000. However, I would like to introduce this trick to all Samsung Galaxy SII I9100 users too.

The only difference is, for I9000, /dev/block/bml12 is used for holding the modem.bin file, while for I9100, it's /dev/block/mmcblk0p8.

In order to do the trick, put a modem file somewhere, say /data/modem/modem.bin, and create a symlink to it like the example below:

for I9000
ln -s /data/modem/modem.bin /dev/block/bml12

for I9100
ln -s /data/modem/modem.bin /dev/block/mmcblk0p8


Put it in a script file and place it under your init.d, usually /etc/init.d (or /system/etc/init.d), and it is suggested to name it with prefix 00 (zero zero) like 00-load-modem so that it can be executed first since scripts in init.d are executed in sequential order.

A sample init script should look like:

for I9000
rm /dev/block/bml12; ln -s /data/modem/modem.bin /dev/block/bml12

for I9100
rm /dev/block/mmcblk0p8; ln -s /data/modem/modem.bin /dev/block/mmcblk0p8


The "rm /dev/block/bml12" or "rm /dev/block/mmcblk0p8" command is used to remove the block device bml12 or mmcblk0p8 created by the system during init. You have to remove it first before you can create a symlink with the same name.

To see if it run correctly, put another version of modem instead of the one already on your phone to /data/modem/modem.bin after the init script is created. Reboot your phone and type *#1234# in the dialpad, you should see the new modem version is in use now. Note that after you have replaced the /data/modem/modem.bin with another modem, you'll need to reboot the phone.


So if you want to, you can place different versions of modem.bin file in /data/modem/ and symlink to modem.bin or overwritting it by copy and paste.


reference to my post: freeNANDmod - get more space from NAND - PART IV

Free more available disk space from NAND - PART II

As to change the partition layout of the nand disk, we have to create the pit file ourself for custom partitions size. The pit file can be obtained by compiling a C file containing the partition info. Below shows part of the s1_odin_20100512.c provided by coolya

* /dev/block/stl1 - 6 omitted
{ 0, 0, 0x06, 0x00, 0, 256, 30, "", "KERNEL", "zImage"},
{ 0, 0, 0x07, 0x00, 0, 256, 30, "", "RECOVERY", "zImage"},
{ 0, 0, 0x16, 0x02, 0, 256, 1146, "", "FACTORYFS", "factoryfs.rfs"},
{ 0, 0, 0x17, 0x02, 0, 256, 536, "", "DBDATAFS", "dbdata.rfs"},
{ 0, 0, 0x18, 0x02, 0, 256, 140, "", "CACHE", "cache.rfs"},
{ 0, 0, 0x0b, 0x00, 0, 256, 50, "", "MODEM", "modem.bin"},

The first entry is mapped as /dev/block/stl7 (/dev/block/bml7), and so forth. Thus MODEM will be mapped to /dev/block/stl12 (/dev/block/bml12). For the meaning of each of the column above, we have to refer to the structure listed below from the C file:

unsigned int _00; /* unknown. set to 1 is entry unused */
unsigned int _04; /* unknown. set to 1 is entry unused */
unsigned int partid; /* partition ID */
unsigned int flags; /* flags. 0x 00= RO, 0x02=R/W */
unsigned int _14; /* unknown */
unsigned int blocksize; /* blocksize in 512 byte units */
unsigned int partsize; /* partition size in blocks */
char _20[8]; /* unknown */
char partname[32]; /* partition name */
char filename[64]; /* filename */

Take the CACHE partition as example, the partition info stated in s1_odin_20100512.c reads:

{ 0, 0, 0x18, 0x02, 0, 256, 140, "", "CACHE", "cache.rfs"}

That is to say, the properties of the CACHE partition should be, starts from column one:
0 - the partition is being used
0 - the partition is being used
0x18 - the partition ID
0x02 - the partition allows read/write
0 - (unknown)
256 - blocksize
140 - partition size
"empty" - (unknown)
CACHE - the partition is known as CACHE
cache.rfs - the file to be filled


Normally, we only need to deal with columns 1, 2, 4, 7, 9 and 10:
- column 1 and 2: set to 0 to mark this partition usable
- column 4: set to 0x02 for both read/write accesses
- column 7: set this to 140 units (or 35MB) for this partition, where 140 x 256 / 1024 = 35MB, ie each unit = 0.25MB
- column 9: set this as CACHE for internal reference
- column 10: set the filename required for filling this partition

So for the KERNEL or /dev/block/stl7 (/dev/block/bm7):

{ 0, 0, 0x06, 0x00, 0, 256, 30, "", "KERNEL", "zImage"}

means that this partition is known as KERNEL, with 7.5MB disk space allocated, and the required file is zImage



read more:
Free more available disk space from NAND - PART I
freeNANDmod - get more space from NAND - PART III
freeNANDmod - get more space from NAND - PART IV