A
Android Question
Guest
Hello everyone.
I am working on creating a recovery for my phone as I haven't found one yet online. I have one phone that I bricked and another phone that is the exact same model so I can use it for creating image files and a recovery using DD and other tools. (My phone is a Blu Studio C 5+5 LTE)
From a high level I need to create 3 files in total so I can use the flash program to recover my phone. I need to create partition.xml first so that I can create 8909_msimage.mbn using the eMMC download tool from Qualcomm. I also need to create MPRG8909.mbn. Anyhow. I'll just start with trying to get my partition file created properly.
I have made a DD image of all the partitions on my device, e.g-
dd if=/dev/block/mmcblk0p21 of=/storage/sdcard1/firmware-img/system.img
I also made notes of the setup of my device as seen here-
I took a copy of the partition.xml file from a different device so I had the correct format to start with. I started to edit the copy by hand to tailor it to my device. This is what I have so far.
I have a few specific questions about the values that should go into the file.
#1 What should be listed for type or do I even need that vaule? From what I have seen online I think I need to have gdisk compiled to get the descriptor for each partition. (thus giving me "type") Once I have a correct partition.xml I can proceed to build/make my 8909_msimage.mbn file.
#2 As you can see from my fdisk printout, some of the values don't translate into an exact number of kb. In that case should I round up to the next nearest kb?
These are the partitions that ddidn't come out exactly-
1 67.1MB 134MB 67.1MB fat16 modem
17 201MB 201MB 32.8kB DDR
19 203MB 203MB 16.4kB sec
20 203MB 237MB 33.6MB boot
22 2334MB 2367MB 33.6MB ext4 persist
23 2367MB 2401MB 33.6MB ext4 apedata
25 2669MB 2703MB 33.6MB recovery
28 2752MB 2819MB 67.1MB oem
Many thanks in advance for your advice!
I am working on creating a recovery for my phone as I haven't found one yet online. I have one phone that I bricked and another phone that is the exact same model so I can use it for creating image files and a recovery using DD and other tools. (My phone is a Blu Studio C 5+5 LTE)
From a high level I need to create 3 files in total so I can use the flash program to recover my phone. I need to create partition.xml first so that I can create 8909_msimage.mbn using the eMMC download tool from Qualcomm. I also need to create MPRG8909.mbn. Anyhow. I'll just start with trying to get my partition file created properly.
I have made a DD image of all the partitions on my device, e.g-
dd if=/dev/block/mmcblk0p21 of=/storage/sdcard1/firmware-img/system.img
I also made notes of the setup of my device as seen here-
Code:
root@BLU_STUDIO_C_5_5_LTE:/ # mount
rootfs / rootfs ro,noatime 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,noatime,size=454524k,nr_inodes=113631,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,noatime,mode=600 0 0
none /dev/cpuctl cgroup rw,noatime,cpu 0 0
adb /dev/usb-ffs/adb functionfs rw,noatime 0 0
proc /proc proc rw,noatime 0 0
sysfs /sys sysfs rw,seclabel,noatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,noatime 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,noatime,size=454524k,nr_inodes=113631,mode=750,gid=1000 0 0
none /acct cgroup rw,noatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,seclabel,noatime,size=454524k,nr_inodes=113631,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,seclabel,noatime,size=454524k,nr_inodes=113631,mode=755,gid=1000 0 0
/dev/block/bootdevice/by-name/system /system ext4 ro,seclabel,noatime,data=ordered 0 0
/dev/block/bootdevice/by-name/userdata /data ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/bootdevice/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,noatime,data=ordered 0 0
/dev/block/bootdevice/by-name/persist /persist ext4 rw,seclabel,nosuid,nodev,noatime,data=ordered 0 0
/dev/block/bootdevice/by-name/modem /firmware vfat ro,context=u:object_r:firmware_file:s0,noatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0
/dev/block/bootdevice/by-name/apedata /apedata ext4 rw,seclabel,noatime,data=ordered 0 0
/dev/fuse /storage/uicc0 fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /mnt/shell/emulated/0 fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
tmpfs /storage/emulated tmpfs rw,seclabel,nosuid,nodev,noatime,size=454524k,nr_inodes=113631,mode=050,gid=1028 0 0
/dev/block/vold/179:65 /mnt/media_rw/sdcard1 vfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:65 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/0 fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/0/Android/obb fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/legacy fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/legacy/Android/obb fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
root@BLU_STUDIO_C_5_5_LTE:/ #
root@BLU_STUDIO_C_5_5_LTE:/ # df
Filesystem Size Used Free Blksize
/dev 443.9M 64.0K 443.8M 4096
/sys/fs/cgroup 443.9M 12.0K 443.9M 4096
/mnt/asec 443.9M 0.0K 443.9M 4096
/mnt/obb 443.9M 0.0K 443.9M 4096
/system 1.9G 1.5G 448.1M 4096
/data 4.5G 2.0G 2.5G 4096
/cache 248.0M 6.9M 241.1M 4096
/persist 27.5M 204.0K 27.3M 4096
/firmware 64.0M 47.3M 16.6M 16384
/apedata 27.5M 48.0K 27.4M 4096
/mnt/shell/emulated 4.5G 2.0G 2.5G 4096
/mnt/shell/emulated/0 4.5G 2.0G 2.5G 4096
/storage/emulated 443.9M 0.0K 443.9M 4096
/mnt/media_rw/sdcard1 28.8G 1.1G 27.6G 32768
/mnt/secure/asec 28.8G 1.1G 27.6G 32768
/storage/sdcard1 28.8G 1.1G 27.6G 32768
/storage/emulated/0 4.5G 2.0G 2.5G 4096
/storage/emulated/0/Android/obb 4.5G 2.0G 2.5G 4096
/storage/emulated/legacy 4.5G 2.0G 2.5G 4096
/storage/emulated/legacy/Android/obb 4.5G 2.0G 2.5G 4096
root@BLU_STUDIO_C_5_5_LTE:/ #
root@BLU_STUDIO_C_5_5_LTE:/system/bin # parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
Model: MMC H8G1e (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 67.1MB 134MB 67.1MB fat16 modem
2 134MB 135MB 524kB sbl1
3 135MB 135MB 524kB sbl1bak
4 135MB 136MB 1049kB aboot
5 136MB 137MB 1049kB abootbak
6 137MB 138MB 524kB rpm
7 138MB 138MB 524kB rpmbak
8 138MB 139MB 786kB tz
9 139MB 140MB 786kB tzbak
10 140MB 141MB 1049kB pad
11 141MB 143MB 1573kB modemst1
12 143MB 144MB 1573kB modemst2
13 144MB 145MB 1049kB misc
14 145MB 145MB 1024B fsc
15 145MB 145MB 8192B ssd
16 145MB 156MB 10.5MB splash
17 201MB 201MB 32.8kB DDR
18 201MB 203MB 1573kB fsg
19 203MB 203MB 16.4kB sec
20 203MB 237MB 33.6MB boot
21 237MB 2334MB 2097MB ext4 system
22 2334MB 2367MB 33.6MB ext4 persist
23 2367MB 2401MB 33.6MB ext4 apedata
24 2401MB 2669MB 268MB ext4 cache
25 2669MB 2703MB 33.6MB recovery
26 2703MB 2704MB 1049kB devinfo
27 2751MB 2752MB 524kB keystore
28 2752MB 2819MB 67.1MB oem
29 2819MB 2820MB 524kB config
30 2820MB 7818MB 4999MB ext4 userdata
(parted) q
q
root@BLU_STUDIO_C_5_5_LTE:/system/bin #
root@BLU_STUDIO_C_5_5_LTE:/mnt/sdcard # cat /proc/partitions
major minor #blocks name
253 0 524288 zram0
179 0 7634944 mmcblk0
179 1 65536 mmcblk0p1
179 2 512 mmcblk0p2
179 3 512 mmcblk0p3
179 4 1024 mmcblk0p4
179 5 1024 mmcblk0p5
179 6 512 mmcblk0p6
179 7 512 mmcblk0p7
179 8 768 mmcblk0p8
179 9 768 mmcblk0p9
179 10 1024 mmcblk0p10
179 11 1536 mmcblk0p11
179 12 1536 mmcblk0p12
179 13 1024 mmcblk0p13
179 14 1 mmcblk0p14
179 15 8 mmcblk0p15
179 16 10240 mmcblk0p16
179 17 32 mmcblk0p17
179 18 1536 mmcblk0p18
179 19 16 mmcblk0p19
179 20 32768 mmcblk0p20
179 21 2048000 mmcblk0p21
179 22 32768 mmcblk0p22
179 23 32768 mmcblk0p23
179 24 262144 mmcblk0p24
179 25 32768 mmcblk0p25
179 26 1024 mmcblk0p26
179 27 512 mmcblk0p27
179 28 65536 mmcblk0p28
179 29 512 mmcblk0p29
179 30 4881391 mmcblk0p30
179 32 4096 mmcblk0rpmb
179 64 30183936 mmcblk1
179 65 30182912 mmcblk1p1
root@BLU_STUDIO_C_5_5_LTE:/mnt/sdcard #
root@BLU_STUDIO_C_5_5_LTE:/ # ls -l /dev/block/platform/7824900.sdhci/by-name
lrwxrwxrwx root root 1970-01-21 12:13 DDR -> /dev/block/mmcblk0p17
lrwxrwxrwx root root 1970-01-21 12:13 aboot -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 1970-01-21 12:13 abootbak -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 1970-01-21 12:13 apedata -> /dev/block/mmcblk0p23
lrwxrwxrwx root root 1970-01-21 12:13 boot -> /dev/block/mmcblk0p20
lrwxrwxrwx root root 1970-01-21 12:13 cache -> /dev/block/mmcblk0p24
lrwxrwxrwx root root 1970-01-21 12:13 config -> /dev/block/mmcblk0p29
lrwxrwxrwx root root 1970-01-21 12:13 devinfo -> /dev/block/mmcblk0p26
lrwxrwxrwx root root 1970-01-21 12:13 fsc -> /dev/block/mmcblk0p14
lrwxrwxrwx root root 1970-01-21 12:13 fsg -> /dev/block/mmcblk0p18
lrwxrwxrwx root root 1970-01-21 12:13 keystore -> /dev/block/mmcblk0p27
lrwxrwxrwx root root 1970-01-21 12:13 misc -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 1970-01-21 12:13 modem -> /dev/block/mmcblk0p1
lrwxrwxrwx root root 1970-01-21 12:13 modemst1 -> /dev/block/mmcblk0p11
lrwxrwxrwx root root 1970-01-21 12:13 modemst2 -> /dev/block/mmcblk0p12
lrwxrwxrwx root root 1970-01-21 12:13 oem -> /dev/block/mmcblk0p28
lrwxrwxrwx root root 1970-01-21 12:13 pad -> /dev/block/mmcblk0p10
lrwxrwxrwx root root 1970-01-21 12:13 persist -> /dev/block/mmcblk0p22
lrwxrwxrwx root root 1970-01-21 12:13 recovery -> /dev/block/mmcblk0p25
lrwxrwxrwx root root 1970-01-21 12:13 rpm -> /dev/block/mmcblk0p6
lrwxrwxrwx root root 1970-01-21 12:13 rpmbak -> /dev/block/mmcblk0p7
lrwxrwxrwx root root 1970-01-21 12:13 sbl1 -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 1970-01-21 12:13 sbl1bak -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 1970-01-21 12:13 sec -> /dev/block/mmcblk0p19
lrwxrwxrwx root root 1970-01-21 12:13 splash -> /dev/block/mmcblk0p16
lrwxrwxrwx root root 1970-01-21 12:13 ssd -> /dev/block/mmcblk0p15
lrwxrwxrwx root root 1970-01-21 12:13 system -> /dev/block/mmcblk0p21
lrwxrwxrwx root root 1970-01-21 12:13 tz -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 1970-01-21 12:13 tzbak -> /dev/block/mmcblk0p9
lrwxrwxrwx root root 1970-01-21 12:13 userdata -> /dev/block/mmcblk0p30
root@BLU_STUDIO_C_5_5_LTE:/ #
I took a copy of the partition.xml file from a different device so I had the correct format to start with. I started to edit the copy by hand to tailor it to my device. This is what I have so far.
Code:
<?xml version="1.0"?>
<configuration>
<parser_instructions>
<!-- NOTE: entries here are used by the parser when generating output -->
<!-- NOTE: each filename must be on it's own line as in variable=value-->
<!-- lichm modified WRITE_PROTECT_BOUNDARY_IN_KB from 65536 to 0-->
WRITE_PROTECT_BOUNDARY_IN_KB = 0
GROW_LAST_PARTITION_TO_FILL_DISK= true
</parser_instructions>
<!-- NOTE: "physical_partition" are listed in order and apply to devices such as eMMC cards that have (for example) 3 physical partitions -->
<!-- This is physical partition 0 -->
<physical_partition>
<!-- NOTE: Define information for each partition, which will be created in order listed here -->
<!-- NOTE: Place all "readonly=true" partitions side by side for optimum space usage -->
<!-- NOTE: If OPTIMIZE_READONLY_PARTITIONS=true, then partitions won't be in the order listed here -->
<!-- they will instead be placed side by side at the beginning of the disk -->
<partition label="modem" size_in_kb="" type="" bootable="false" readonly="true" filename="modem.img"/>
<partition label="sbl1" size_in_kb="524" type="" bootable="false" readonly="false" filename="sbl1.img"/>
<partition label="sbl1bak" size_in_kb="524" type="" bootable="false" readonly="false" filename="sbl1bak.img"/>
<partition label="aboot" size_in_kb="1049" type="" bootable="false" readonly="false" filename="aboot.img"/>
<partition label="abootbak" size_in_kb="1049" type="" bootable="false" readonly="false" filename="aboot.img"/>
<partition label="rpm" size_in_kb="524" type="" bootable="false" readonly="false" filename="rpm.img"/>
<partition label="rpmbak" size_in_kb="524" type="" bootable="false" readonly="false" filename="rpmbak.img"/>
<partition label="tz" size_in_kb="786" type="" bootable="false" readonly="false" filename="tz.img"/>
<partition label="tzbak" size_in_kb="786" type="" bootable="false" readonly="false" filename="tzbak.img"/>
<partition label="pad" size_in_kb="1049" type="" bootable="false" readonly="" filename="pad.img"/>
<partition label="modemst1" size_in_kb="1573" type="" bootable="false" readonly="false" filename="modemst1.img"/>
<partition label="modemst2" size_in_kb="1573" type="" bootable="false" readonly="false" filename="modemst2.img"/>
<partition label="misc" size_in_kb="1049" type="" bootable="false" readonly="false" filename="misc.img"/>
<partition label="fsc" size_in_kb="1" type="" bootable="false" readonly="false" filename="fsc.img"/>
<partition label="ssd" size_in_kb="8" type="" bootable="false" readonly="false" filename="ssd.img"/>
<partition label="splash" size_in_kb="10752" type="" bootable="false" readonly="true" filename="splash.img"/>
<partition label="DDR" size_in_kb="" type="" bootable="false" readonly="true" filename="DDR.img"/>
<partition label="fsg" size_in_kb="1573" type="" bootable="false" readonly="fsg" filename="fsg.img"/>
<partition label="sec" size_in_kb="" type="" bootable="false" readonly="" filename="sec.img"/>
<partition label="boot" size_in_kb="" type="" bootable="false" readonly="true" filename="boot.img"/>
<partition label="system" size_in_kb="2147328" type="" bootable="false" readonly="true" filename="system.img"/>
<partition label="persist" size_in_kb="" type="" bootable="false" readonly="true" filename="persist.img"/>
<partition label="apedata" size_in_kb="" type="" bootable="false" readonly="" filename="apedata.img"/>
<partition label="cache" size_in_kb="274432" type="" bootable="false" readonly="true" filename="cache.img"/>
<partition label="recovery" size_in_kb="" type="" bootable="false" readonly="" filename="recovery.img"/>
<partition label="devinfo" size_in_kb="1049" type="" bootable="false" readonly="" filename="devinfo.img"/>
<partition label="keystore" size_in_kb="524" type="" bootable="false" readonly="" filename="keystore.img"/>
<partition label="oem" size_in_kb="" type="" bootable="false" readonly="" filename="oem.img"/>
<partition label="config" size_in_kb="524" type="" bootable="false" readonly="" filename="config.img"/>
<partition label="userdata" size_in_kb="5118976" type="" bootable="false" readonly="" filename="userdata.img"/>
</physical_partition>
</configuration>
I have a few specific questions about the values that should go into the file.
#1 What should be listed for type or do I even need that vaule? From what I have seen online I think I need to have gdisk compiled to get the descriptor for each partition. (thus giving me "type") Once I have a correct partition.xml I can proceed to build/make my 8909_msimage.mbn file.
#2 As you can see from my fdisk printout, some of the values don't translate into an exact number of kb. In that case should I round up to the next nearest kb?
These are the partitions that ddidn't come out exactly-
1 67.1MB 134MB 67.1MB fat16 modem
17 201MB 201MB 32.8kB DDR
19 203MB 203MB 16.4kB sec
20 203MB 237MB 33.6MB boot
22 2334MB 2367MB 33.6MB ext4 persist
23 2367MB 2401MB 33.6MB ext4 apedata
25 2669MB 2703MB 33.6MB recovery
28 2752MB 2819MB 67.1MB oem
Many thanks in advance for your advice!
