[Backup Script]Backup all paritions on i9505 to odin rom - Galaxy S 4 Developer Discussion [Developers-Only]

This morning I was coding this script, but didn't feel like extending it further. it basically just dumps all known partitions to the chosen dir and then makes a (compressed) odin rom from it, if chosen.
if anyone wants to use this, feel free to do whatever you want with it. I will occasionally dump some items on this forum that I find share worthy. just to share some inside stuff that will never get released when I don't share it here
Code:
#!/system/bin/sh
# Complete backup for Galaxy S4 (i9505)
# Created by broodplank1337
# Developer Sample (free for all kinds of use)
# www.broodplank.net
MAKEODIN="n";
ODINUSECOMPRESS="n";
BACKUPNONODIN="n";
OUTPATH="/storage/sdcard1/backup/";
echo "Starting backup..."
echo "Overall process may take upto 30 minutes"
echo
echo "BACKUP MODEM"
echo
echo "1. NON-HLOS.bin"
busybox dd if=/dev/block/mmcblk0p1 of=${OUTPATH}NON-HLOS.bin
echo "2. modem.bin"
busybox dd if=/dev/block/mmcblk0p2 of=${OUTPATH}modem.bin
echo
echo "BACKUP BOOTLOADER"
echo
echo "1. sbl1.mbn"
busybox dd if=/dev/block/mmcblk0p3 of=${OUTPATH}sbl1.mbn
echo "2. sbl2.mbn"
busybox dd if=/dev/block/mmcblk0p4 of=${OUTPATH}sbl2.mbn
echo "3. sbl3.mbn"
busybox dd if=/dev/block/mmcblk0p5 of=${OUTPATH}sbl3.mbn
echo "4. aboot.mbn"
busybox dd if=/dev/block/mmcblk0p6 of=${OUTPATH}aboot.mbn
echo "5. rpm.mbn"
busybox dd if=/dev/block/mmcblk0p7 of=${OUTPATH}rpm.mbn
echo "6. tz.mbn"
busybox dd if=/dev/block/mmcblk0p8 of=${OUTPATH}tz.mbn
echo
echo "BACKUP PLATFORM"
echo
echo "1. system.img.ext4"
busybox dd if=/dev/block/mmcblk0p16 of=${OUTPATH}system.img.ext4
echo "2. recovery.img"
busybox dd if=/dev/block/mmcblk0p21 of=${OUTPATH}recovery.img
echo "3. boot.img"
busybox dd if=/dev/block/mmcblk0p20 of=${OUTPATH}boot.img
echo
echo "BACKUP CSC"
echo
echo "1. cache.img.ext4"
busybox dd if=/dev/block/mmcblk0p18 of=${OUTPATH}cache.img.ext4
if [[ $MAKEODIN != "n" ]]; then
echo
echo "Making odin package, this may take a while"
echo
cd ${OUTPATH}
GETDATE=`busybox date -I`;
if [[ $ODINUSECOMPRESS != "n" ]]; then
echo "Making compressed tar ball"
busybox tar -cz NON-HLOS.bin modem.bin sbl1.mbn sbl2.mbn sbl3.mbn aboot.mbn rpm.mbn tz.mbn system.img.ext4 recovery.img boot.img cache.img.ext4 > odin-${GETDATE}.tar.gz
echo "Writing MD5 sums..."
busybox md5sum -t odin-${GETDATE}.tar.gz >> odin-${GETDATE}.tar.gz
echo "Renaming..."
busybox mv odin-${GETDATE}.tar.gz odin-${GETDATE}.tar.md5.gz
else
echo "Making tar ball"
busybox tar -c NON-HLOS.bin modem.bin sbl1.mbn sbl2.mbn sbl3.mbn aboot.mbn rpm.mbn tz.mbn system.img.ext4 recovery.img boot.img cache.img.ext4 > odin-${GETDATE}.tar
echo "Writing MD5 sums..."
busybox md5sum -t odin-${GETDATE}.tar >> odin-${GETDATE}.tar
echo "Renaming..."
busybox mv odin-${GETDATE}.tar odin-${GETDATE}.tar.md5
fi;
echo
echo "Odin package has been created"
echo
fi;
if [[ ${BACKUPNONODIN} != "n" ]]; then
echo
echo "backup non odin (others).."
echo
busybox dd if=/dev/block/mmcblk0p9 of=${OUTPATH}PAD
busybox dd if=/dev/block/mmcblk0p10 of=${OUTPATH}efs.img.ext4
busybox dd if=/dev/block/mmcblk0p11 of=${OUTPATH}nvrebuild1.bin
busybox dd if=/dev/block/mmcblk0p12 of=${OUTPATH}nvrebuild2.bin
busybox dd if=/dev/block/mmcblk0p13 of=${OUTPATH}m9kefs1.bin
busybox dd if=/dev/block/mmcblk0p14 of=${OUTPATH}m9kefs2.bin
busybox dd if=/dev/block/mmcblk0p15 of=${OUTPATH}m9kefs3.bin
busybox dd if=/dev/block/mmcblk0p17 of=${OUTPATH}PERSIST
busybox dd if=/dev/block/mmcblk0p19 of=${OUTPATH}param.lfs
busybox dd if=/dev/block/mmcblk0p22 of=${OUTPATH}FOTA
busybox dd if=/dev/block/mmcblk0p23 of=${OUTPATH}BACKUP
busybox dd if=/dev/block/mmcblk0p24 of=${OUTPATH}FSG
busybox dd if=/dev/block/mmcblk0p25 of=${OUTPATH}SSD
busybox dd if=/dev/block/mmcblk0p26 of=${OUTPATH}persdata.img.ext4
busybox dd if=/dev/block/mmcblk0p27 of=${OUTPATH}hidden.img.ext4
busybox dd if=/dev/block/mmcblk0p29 of=${OUTPATH}userdata.img.ext4
busybox dd if=/dev/block/mmcblk0p28 of=${OUTPATH}carrier.img.ext4
fi;
echo
echo "BACKUP COMPLETED!"
echo

Thanks friend! :good:
regards!

I'm pretty sure this needs to run as root because some of those partitions are likely read protected.

CNexus said:
I'm pretty sure this needs to run as root because some of those partitions are likely read protected.
Click to expand...
Click to collapse
Anyone tried restoring an odin tar generated with this using the odin app? I thought the files had to be signed by samsung to be accepted by odin?
Also, do you set the tar.md5 file generated in the "PDA" field of Odin?

prisonnet said:
Anyone tried restoring an odin tar generated with this using the odin app? I thought the files had to be signed by samsung to be accepted by odin?
Also, do you set the tar.md5 file generated in the "PDA" field of Odin?
Click to expand...
Click to collapse
Nope, only zips to be flashed through (stock) recovery need to be signed by Samsung

found a typo:
line 38: if [[ ${BACKUPNONODIN} != "n" ]]; then
and on some roms may need to edit:
OUTPATH="/storage/extSdCard/backup/";

TRusselo said:
found a typo:
line 38: if [[ ${BACKUPNONODIN} != "n" ]]; then
and on some roms may need to edit:
OUTPATH="/storage/extSdCard/backup/";
Click to expand...
Click to collapse
That first one isn't a typo btw.

CNexus said:
Nope, only zips to be flashed through (stock) recovery need to be signed by Samsung
Click to expand...
Click to collapse
Trying to flash with Odin 3.07, MD5 verifies but getting this error:
<OSM> Enter CS for MD5..
<OSM> Check MD5.. Do not unplug the cable..
<OSM> Please wait..
<OSM> system.img.ext4.tar.md5 is valid.
<OSM> Checking MD5 finished Sucessfully..
<OSM> Leave CS..
<ID:0/005> Added!!
<ID:0/005> Odin v.3 engine (ID:5)..
<ID:0/005> File analysis..
<ID:0/005> SetupConnection..
<OSM> All threads completed. (succeed 0 / failed 1)
<ID:0/005> Removed!!
<ID:0/005> Added!!
<ID:0/005> Odin v.3 engine (ID:5)..
<ID:0/005> File analysis..
<ID:0/005> SetupConnection..
<ID:0/005> Initialzation..
<ID:0/005> Get PIT for mapping..
<ID:0/005> Firmware update start..
<ID:0/005> system.img.ext4
<ID:0/005> NAND Write Start!!
<ID:0/005> FAIL! (Auth)
Click to expand...
Click to collapse
Any idea?

CNexus said:
That first one isn't a typo btw.
Click to expand...
Click to collapse
really? seems like it is, and my script editor was highlighting it too as an error. that bracket never ends {

prisonnet said:
Trying to flash with Odin 3.07, MD5 verifies but getting this error:
Any idea?
Click to expand...
Click to collapse
Hmm thats kinda strange, it should work just fine actually. can you list the files inside the .tar.md5 please?
TRusselo said:
really? seems like it is, and my script editor was highlighting it too as an error. that bracket never ends {
Click to expand...
Click to collapse
At first I though you were wrong but you're actually right, it should be either $VAR OR ${VAR}, despite that the script runs successfully.

I'm curious to know why we can only flash modems (modem.bin and non-hlos.bin) via odin
Why won't the following commands for example work in a shell called in a CWM.zip?
dd if=/sdcard/NON-HLOS.bin of=/dev/block/mmcblk0p1
dd if=/sdcard/modem.bin of=/dev/block/mmcblk0p2
What is causing the restriction for modems to only be able to be flashed through Odin and not CWM?
Has this also got something to do with the fact that you can only successfully flash a modem if entered download mode through a complete power-off, and not via the power menu?

hawkerpaul said:
I'm curious to know why we can only flash modems (modem.bin and non-hlos.bin) via odin
Why won't the following commands for example work in a shell called in a CWM.zip?
dd if=/sdcard/NON-HLOS.bin of=/dev/block/mmcblk0p1
dd if=/sdcard/modem.bin of=/dev/block/mmcblk0p2
What is causing the restriction for modems to only be able to be flashed through Odin and not CWM?
Has this also got something to do with the fact that you can only successfully flash a modem if entered download mode through a complete power-off, and not via the power menu?
Click to expand...
Click to collapse
The thing is no one ever tries to do this. I'm almost 100% sure that this is just possible.
Maybe you cannot directly flash those 2 files, but you can do this without any problems:
Backup modem partition and just flash it on an other device. same amount of blocks, so should be no problem.
dd if=/dev/block/mmcblk0p1 of=/sdcard/NON-HLOS.bin
dd if=/sdcard/NON-HLOS.bin of=/dev/block/mmcblk0p1
but it still forced you to use odin once atleast to flash it
(no confirmed results though)

I agree with you. I just don't see any reason why the device dump commands can't also work for modems. I've just taken it as one of those things that cannot be done via cwm.
I was worried in case I did dump to those partitions it might screw the device taking into consideration it just isn't the done thing to do.
I will write a shell script to be called through cwm to see if it can be done..... just hope it don't bugger my device up!
Edit:
I've just tried the following:
dd if=/dev/block/mmcblk0p2 of=/sdcard/modem.dd.bin
I then opened the downloaded modem.tar file that I have for my current modem (currently I'm on XXUFNBE), extracted modem.bin onto pc, then copied it to /sdcard/modem.bin
Unfortunately, these 2 files differ in a diff command, and if I do an ls -l, they differ quite drastically:
ls -l:
-rw-rw-r-- root sdcard_rw 52354048 2014-03-07 21:13 modem.bin
-rw-rw-r-- root sdcard_rw 54030336 2014-03-07 21:07 modem.dd.bin
Obviously its not even worth attempting to dd this modem.bin file back to /dev, as its not the same as original modem.dd.bin I created.
Either there is a problem with the way modem.bin gets extracted from the .tar file on PC through 7zip, (as 7zip does complain with "no correct record at the end of the archive" when I extract it) or I need to supply dd with different command line parameters.

You have to know that this is totally normal when using dd, the thing with dd is that it dumps the WHOLE partition, so also all zero's (no data) to a file. for example if you dd boot.img you will get a file that is EXACTLY 10mb, since that is the size of the partition. but when flashing it back to the partition it won't cause any problems afaik. I have done it a couple of times.
(To lookup how big the files will turn out, check: 'cat /proc/partitions')
Code:
[email protected]:/ # cat proc/partitions
major minor #blocks name
7 0 4190 loop0
179 0 15388672 mmcblk0
179 1 12772 mmcblk0p1
179 2 52764 mmcblk0p2
179 3 128 mmcblk0p3
179 4 256 mmcblk0p4
179 5 512 mmcblk0p5
179 6 2048 mmcblk0p6
179 7 512 mmcblk0p7
179 8 512 mmcblk0p8
179 9 16896 mmcblk0p9
179 10 13952 mmcblk0p10
179 11 3072 mmcblk0p11
179 12 3072 mmcblk0p12
179 13 780 mmcblk0p13
179 14 780 mmcblk0p14
179 15 780 mmcblk0p15
179 16 2826240 mmcblk0p16
179 17 8192 mmcblk0p17
179 18 2119680 mmcblk0p18
179 19 6144 mmcblk0p19
179 20 10240 mmcblk0p20
179 21 10240 mmcblk0p21
179 22 10240 mmcblk0p22
179 23 6144 mmcblk0p23
179 24 3072 mmcblk0p24
179 25 8 mmcblk0p25
179 26 9216 mmcblk0p26
179 27 512000 mmcblk0p27
179 28 20480 mmcblk0p28
179 29 9728000 mmcblk0p29
254 0 4189 dm-0
sizes are expressed in KiloBytes
Here is my little experiment to prove it to you:
Code:
[email protected] ~ $ [B]adb shell[/B]
[email protected]:/ # [B]dd if=/dev/block/mmcblk0p20 of=/sdcard/boot.img[/B]
20480+0 records in
20480+0 records out
10485760 bytes transferred in 2.283 secs (4592974 bytes/sec)
[email protected]:/ # [B]dd if=/sdcard/boot.img of=/dev/block/mmcblk0p20[/B]
20480+0 records in
20480+0 records out
10485760 bytes transferred in 1.470 secs (7133170 bytes/sec)
[email protected]:/ # [B]reboot[/B]
and my phone just booted as it normally does.
What you could do, but NEVER EVER should do is removing all zeros from the partition file with a hexeditor to get the actual size. but if you will flash back this image you probably screw up your partition as it's an invalid image for that partition.
So long story short, you can NEVER EVER flash modem.bin directly to the partition, but you can flash a partition dump you made earlier to the partition without causing damage (at least to your own device).
It's just a pity the modem does not come in .img format by default.
When using dd better be sure to know what you're doing :good:

broodplank1337 said:
You have to know that this is totally normal when using dd, the thing with dd is that it dumps the WHOLE partition, so also all zero's (no data) to a file. for example if you dd boot.img you will get a file that is EXACTLY 10mb, since that is the size of the partition. but when flashing it back to the partition it won't cause any problems afaik. I have done it a couple of times.
(To lookup how big the files will turn out, check: 'cat /proc/partitions')
Code:
[email protected]:/ # cat proc/partitions
major minor #blocks name
7 0 4190 loop0
179 0 15388672 mmcblk0
179 1 12772 mmcblk0p1
179 2 52764 mmcblk0p2
179 3 128 mmcblk0p3
179 4 256 mmcblk0p4
179 5 512 mmcblk0p5
179 6 2048 mmcblk0p6
179 7 512 mmcblk0p7
179 8 512 mmcblk0p8
179 9 16896 mmcblk0p9
179 10 13952 mmcblk0p10
179 11 3072 mmcblk0p11
179 12 3072 mmcblk0p12
179 13 780 mmcblk0p13
179 14 780 mmcblk0p14
179 15 780 mmcblk0p15
179 16 2826240 mmcblk0p16
179 17 8192 mmcblk0p17
179 18 2119680 mmcblk0p18
179 19 6144 mmcblk0p19
179 20 10240 mmcblk0p20
179 21 10240 mmcblk0p21
179 22 10240 mmcblk0p22
179 23 6144 mmcblk0p23
179 24 3072 mmcblk0p24
179 25 8 mmcblk0p25
179 26 9216 mmcblk0p26
179 27 512000 mmcblk0p27
179 28 20480 mmcblk0p28
179 29 9728000 mmcblk0p29
254 0 4189 dm-0
sizes are expressed in KiloBytes
Here is my little experiment to prove it to you:
Code:
[email protected] ~ $ [B]adb shell[/B]
[email protected]:/ # [B]dd if=/dev/block/mmcblk0p20 of=/sdcard/boot.img[/B]
20480+0 records in
20480+0 records out
10485760 bytes transferred in 2.283 secs (4592974 bytes/sec)
[email protected]:/ # [B]dd if=/sdcard/boot.img of=/dev/block/mmcblk0p20[/B]
20480+0 records in
20480+0 records out
10485760 bytes transferred in 1.470 secs (7133170 bytes/sec)
[email protected]:/ # [B]reboot[/B]
and my phone just booted as it normally does.
What you could do, but NEVER EVER should do is removing all zeros from the partition file with a hexeditor to get the actual size. but if you will flash back this image you probably screw up your partition as it's an invalid image for that partition.
So long story short, you can NEVER EVER flash modem.bin directly to the partition, but you can flash a partition dump you made earlier to the partition without causing damage (at least to your own device).
It's just a pity the modem does not come in .img format by default.
When using dd better be sure to know what you're doing :good:
Click to expand...
Click to collapse
Hey broodplank, your scripts are excellent btw. But I just wanted to let you know flashing modems through recovery does work and there's quite a few ways to do this.
1. assert extract dir "/tmp/modem.bin" then write raw image method
2. run program "/sbin/sh" "script.sh" method
3. run program "dd if=/..... method
4. Use the flash_image binary
You get the picture from the above I hope, 1-3 are updater-script related. I have a Verizon S4 Modem thread where I include zips that flash modems but also the modem.bin files can be extracted from the zips and used in odin.
I regularly hexedit the padded bootloaders to cut the trailing zeroes so the partition registers as signed (I recommend only experienced individuals do this though). When you say the partition would be invalid I take it you mean that unless the individual who is hexediting knows how to correctly do it that it will be invalid.

Surge1223 said:
Hey broodplank, your scripts are excellent btw. But I just wanted to let you know flashing modems through recovery does work and there's quite a few ways to do this.
1. assert extract dir "/tmp/modem.bin" then write raw image method
2. run program "/sbin/sh" "script.sh" method
3. run program "dd if=/..... method
4. Use the flash_image binary
You get the picture from the above I hope, 1-3 are updater-script related. I have a Verizon S4 Modem thread where I include zips that flash modems but also the modem.bin files can be extracted from the zips and used in odin.
I regularly hexedit the padded bootloaders to cut the trailing zeroes so the partition registers as signed (I recommend only experienced individuals do this though). When you say the partition would be invalid I take it you mean that unless the individual who is hexediting knows how to correctly do it that it will be invalid.
Click to expand...
Click to collapse
Thank you. Oh ok, I didn't know that
I actually know those methods, but with the second one what script do you mean, or just a partition flash script in general?
So I downloaded one of your zips and found this.
Code:
assert(package_extract_file("modem.bin", "/tmp/modem.bin"),
write_raw_image("/tmp/modem.bin", "/dev/block/mmcblk0p2"),
delete("/tmp/modem.bin"));
That's amazingly easy! Wow! Never knew this was so easy to do, I thought a special flashing binary would be needed.
Thanks a lot for this tip! It's great
And yes I mean do not ever use hexeditor if you don't know what you're doing :good:

I still can't get a modem flash to work in recovery. (I happen to be using Philz)
I use the Modem tar files in djembey's thread.
I open the modem.tar file, and 7zip says tar error: there is no correct record at the end of archive
It opens regardless, so I extract modem.bin
I then place the modem.bin in a typical cwm-flashable zip file, which includes updater-script as above post, ie:
assert(package_extract_file("modem.bin", "/tmp/modem.bin"),
write_raw_image("/tmp/modem.bin", "/dev/block/mmcblk0p2"),
delete("/tmp/modem.bin"));
However, the script hangs, and I have to long-press the power button in recovery to reboot.
Is the modem.bin incorrect from the original extraction via 7Zip perhaps? (Although the .tar file from which I extracted modem.bin flashes successfully in Odin by the way.)
Any ideas appreciated.

hawkerpaul said:
I still can't get a modem flash to work in recovery. (I happen to be using Philz)
I use the Modem tar files in djembey's thread.
I open the modem.tar file, and 7zip says tar error: there is no correct record at the end of archive
It opens regardless, so I extract modem.bin
I then place the modem.bin in a typical cwm-flashable zip file, which includes updater-script as above post, ie:
assert(package_extract_file("modem.bin", "/tmp/modem.bin"),
write_raw_image("/tmp/modem.bin", "/dev/block/mmcblk0p2"),
delete("/tmp/modem.bin"));
However, the script hangs, and I have to long-press the power button in recovery to reboot.
Is the modem.bin incorrect from the original extraction via 7Zip perhaps? (Although the .tar file from which I extracted modem.bin flashes successfully in Odin by the way.)
Any ideas appreciated.
Click to expand...
Click to collapse
Actually this is kind of a known issue. I believe some have found a work around with Philz. @Bait-Fish what was it that you guys do to flash modems with Philz?

Surge1223 said:
Actually this is kind of a known issue. I believe some have found a work around with Philz. @Bait-Fish what was it that you guys do to flash modems with Philz?
Click to expand...
Click to collapse
I would be extremely interested and appreciative to find this out
:good:
EDIT:
Just tried a flash through TWRP, and no joy, so this is not specific to Philz.

hawkerpaul said:
I would be extremely interested and appreciative to find this out
:good:
EDIT:
Just tried a flash through TWRP, and no joy, so this is not specific to Philz.
Click to expand...
Click to collapse
Im able to flash modems quite easily hmm... can you send me the modem zip package you are trying to flash so I can take a look at it?
P.S. This dev talk forum is finally starting to be useful again!

Related

fakecid help

since i can't put a thread in development i put it here what is this command dd if=/dev/block/mmcblk0p4 of=/sdcard/mmcblk0p4 /dev/block/mmcblk0p4 no such file or directory i don't even no what or where mmcblk0p4 is at help
mininessie said:
since i can't put a thread in development i put it here what is this command dd if=/dev/block/mmcblk0p4 of=/sdcard/mmcblk0p4 /dev/block/mmcblk0p4 no such file or directory i don't even no what or where mmcblk0p4 is at help
Click to expand...
Click to collapse
Are you successfully temp-rooted (and related, are you on the latest OTA? 2.17.605.2)

[Q] How Dump Boot or Recovery [Stock]

hello all
i just trying to make cwm for my brand new SAMSUNG GALAXY STAR G-S5282 but coudnt find any source orsomething like that... its running jelly bean i try to dump boot image but its says
Code:
dump_image boot boot.img
/system/bin/sh: dump_image: not found
ok now something wron it dont have dump_image file in it
partitions of this mobile is
Code:
cat /proc/partitions
major minor #blocks name
179 0 3817472 mmcblk0
179 1 3840 mmcblk0p1
179 2 3840 mmcblk0p2
179 3 5120 mmcblk0p3
179 4 5120 mmcblk0p4
179 5 10240 mmcblk0p5
179 6 10240 mmcblk0p6
179 7 10240 mmcblk0p7
179 8 512 mmcblk0p8
179 9 2048 mmcblk0p9
179 10 2048 mmcblk0p10
179 11 8192 mmcblk0p11
179 12 3840 mmcblk0p12
179 13 3840 mmcblk0p13
179 14 3840 mmcblk0p14
179 15 3840 mmcblk0p15
179 16 256 mmcblk0p16
179 17 256 mmcblk0p17
179 18 256 mmcblk0p18
179 19 10240 mmcblk0p19
179 20 524288 mmcblk0p20
179 21 917504 mmcblk0p21
179 22 131072 mmcblk0p22
179 23 5120 mmcblk0p23
179 24 10240 mmcblk0p24
179 25 2121728 mmcblk0p25
179 26 8 mmcblk0p26
179 27 1024 mmcblk0p27
mounts
Code:
cat /proc/mounts
rootfs / rootfs rw,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1
/dev/block/mmcblk0p21 /system ext4 ro,relatime,
/dev/block/mmcblk0p25 /data ext4 rw,nosuid,node
mit,data=ordered 0 0
/dev/block/mmcblk0p20 /cache ext4 rw,nosuid,nod
bmit,data=ordered 0 0
/dev/block/mmcblk0p19 /efs ext4 rw,nosuid,nodev
commit,data=ordered 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0
/dev/fuse /storage/sdcard0 fuse rw,nosuid,nodev
up_id=1023,default_permissions,allow_other 0 0
now is there any wy to make dump of boot.img or recovery.img for making cwm?
touseefiqbal said:
now is there any wy to make dump of boot.img or recovery.img for making cwm?
Click to expand...
Click to collapse
Yes you can dump both boot.img and recovery.img provided you have root access by using the following commands:
First:
Code:
cd /dev/block/platform
Then list which platform name you have:
Code:
ls
After change into the platform name directory (The following is an example from my Verizon Galaxy S3):
Code:
cd msm_sdcc.1/by-name
Then:
Code:
ls -l
This command will list what partitions are the boot and recovery partitions make sure to note which block number the recovery and boot partitions are. Now that we know what block number the partitions we want are we can dump them:
Code:
cat /dev/block/recovery_partition_block number > /mnt/sdcard/recovery.img
cat /dev/block/boot_partition_block number > /mnt/sdcard/boot.img
You should now have recovery.img and boot.img files located on your sdcard. Let me know if you still have questions .
Sent from my SCH-I535 using xda premium
shimp208 said:
Yes you can dump both boot.img and recovery.img provided you have root access by using the following commands:
First:
Code:
cd /dev/block/platform
Then list which platform name you have:
Code:
ls
After change into the platform name directory (The following is an example from my Verizon Galaxy S3):
Code:
cd msm_sdcc.1/by-name
Then:
Code:
ls -l
This command will list what partitions are the boot and recovery partitions make sure to note which block number the recovery and boot partitions are. Now that we know what block number the partitions we want are we can dump them:
Code:
cat /dev/block/recovery_partition_block number > /mnt/sdcard/recovery.img
cat /dev/block/boot_partition_block number > /mnt/sdcard/boot.img
You should now have recovery.img and boot.img files located on your sdcard. Let me know if you still have questions .
Sent from my SCH-I535 using xda premium
Click to expand...
Click to collapse
sorry i didnt tell you that i dont have root access
I dnt hav root access
Sent from my GT-S5282 using XDA Premium HD app
touseefiqbal said:
sorry i didnt tell you that i dont have root access
Click to expand...
Click to collapse
If you want to root your device I would recommend checking out this thread
http://forum.xda-developers.com/showthread.php?t=2320771 on how to root the Galaxy Star.
Sent from my SCH-I535 using xda premium
As you can see, I can not find where is boot.img in, cuold you pls show me, thank.
shimp208 said:
If you want to root your device I would recommend checking out this thread
http://forum.xda-developers.com/showthread.php?t=2320771 on how to root the Galaxy Star.
Sent from my SCH-I535 using xda premium
Click to expand...
Click to collapse
My divice is rooted
Try to get recovery bro
Sent from my GT-S5282 using XDA Premium HD app
touseefiqbal said:
Try to get recovery bro
Sent from my GT-S5282 using XDA Premium HD app
Click to expand...
Click to collapse
I've get recovery.img already thank your method above, but I want to get boot.img and can not see where.
hi
oldmanhp said:
I've get recovery.img already thank your method above, but I want to get boot.img and can not see where.
Click to expand...
Click to collapse
can you plz share recovery? i will help you to get boot.img
one more thing is it recovery for galaxy star gt-s5282? if yes pl share
ter
oldmanhp said:
I've get recovery.img already thank your method above, but I want to get boot.img and can not see where.
Click to expand...
Click to collapse
install terminal emulator and type
Code:
dump_image boot /sdcard/boot.img
touseefiqbal said:
can you plz share recovery? i will help you to get boot.img
one more thing is it recovery for galaxy star gt-s5282? if yes pl share
Click to expand...
Click to collapse
Here you are, post #48, it is for Galaxy Mega gt-i9152.
http://forum.xda-developers.com/showthread.php?p=44268116#post44268116
oldmanhp said:
I've get recovery.img already thank your method above, but I want to get boot.img and can not see where.
Click to expand...
Click to collapse
To get boot.img I would recommend dumping the partition named KERNEL which from the output you provided is /dev/block/mmcblk0p5 the device's kernel is usually stored on the /boot partition, so from what I can tell /dev/block/mmcblk0p5 appears to be the boot partition that you could then dump to get a boot.img file.
q
shimp208 said:
To get boot.img I would recommend dumping the partition named KERNEL which from the output you provided is /dev/block/mmcblk0p5 the device's kernel is usually stored on the /boot partition, so from what I can tell /dev/block/mmcblk0p5 appears to be the boot partition that you could then dump to get a boot.img file.
Click to expand...
Click to collapse
also if you hav cwm reovery then through recovery go for a backup

[HOWTO] Convert your Optimus G to a Nexus 4 and Back

DISCLAIMER: THIS IS VERY DANGEROUS COMPARED TO A NORMAL ROM FLASH. DO NOT DO THIS IF YOU DON'T KNOW WHAT YOU'RE DOING OTHER THAN FLASHING ROMS.
IF SOMETHING GOES WRONG, YOU HAVE ONLY YOURSELF TO BLAME. YOU HAVE BEEN WARNED.[/B]
To convert to Nexus 4
First off, there are a few issues.
-SDCard doesn't work.
-Capacitive buttons aren't working. No known way to fix it.
First off, lets flash the N4 Rom.
1) Install LGNPST - Use tSilenzio's AutoLGNPST - http://www.oudhitsquad.com/android/LGE/Firmware/Tools/AutoLGNPST-tSilenzio.zip
2) Download the Nexus 4 Image - https://www.androidfilehost.com/?fid=9390248398092765463
3) Rename the extracted .tot file to a .bin file
4) Put the phone in Download mode. Volume Up + Volume Down While inserting USB cable.
5) Open LGNPST and select the phone - Should be Com[Number]
6) In the DLL section, select LGNPST_LS970.dll
7) In the file selection, select the previously renamed Nexus 4 bin file.
8) Start the flashing process and hold your breath.
9) When it hits 67%, your phone should start booting. DO NOT UNPLUG YET.
10) At 85%, an error will occur saying that the phone was unplugged. Ignore it and close LGNPST. The image is fully flashed.
11) Hold Volume Up + Power to put the phone into FASTBOOT mode.
12) Download the recovery from here and place it into your fastboot directory. - http://forum.xda-developers.com/showthread.php?t=2010984
13) Download the following 3 files and place them on the MicroSD card. - http://d-h.st/cFA - http://d-h.st/yUQ - http://d-h.st/0dH
14) While still in fastboot, type "fastboot boot recovery.img" - This will put the phone on the custom recovery. Make sure the SD card is in.
---Here, we're going to fix the partition tables for 16GB of space and replace the backup GPT so that we can't hardbrick from the backup GPT.
15) Run adb shell to get into a root shell in recovery.
16) Copy the modified DD onto the phone
Code:
# cp /external_sd/dd /
# chmod 755 /dd
17) Backup the partition tables incase something goes wrong.
Code:
# /dd if=/dev/block/mmcblk0 of=/external_sd/pgpt8G.img bs=512 count=34
# /dd if=/dev/block/mmcblk0 of=/external_sd/sgpt8G.img bs=512 skip=30777311
18) Unmount the filesystems so that you can overwrite the partition table.
Code:
# umount /data
# umount /cache
19) Make sure nothing is mounted. It should return this (Other than partition size):
Code:
# df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 911.7M 48.0K 911.6M 0% /dev
/dev/block/mmcblk1p1 59.4G 4.8G 54.6G 8% /external_sd
20) Move the partitions to their new locations. This may take a couple minutes.
Code:
# /dd if=/dev/block/mmcblk0 of=/external_sd/DDR bs=512 skip=15267840 count=2015
# /dd if=/external_sd/DDR of=/dev/block/mmcblk0 bs=512 seek=30775296 conv=notrunc
21) Install the new partition tables.
Code:
# /dd if=/external_sd/sgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
# /dd if=/external_sd/pgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
22) Make sure no errors occurred. Run 'parted /dev/block/mmcblk0' and check that it returns the same as the below.
Code:
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) p
p
Model: MMC 016G92 (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.2MB 524kB sbl1
3 68.2MB 68.7MB 524kB sbl2
4 68.7MB 70.8MB 2097kB sbl3
5 70.8MB 71.3MB 524kB tz
6 71.3MB 94.4MB 23.1MB boot
7 94.4MB 117MB 23.1MB recovery
8 117MB 118MB 799kB m9kefs1
9 118MB 119MB 799kB m9kefs2
10 119MB 120MB 799kB m9kefs3
11 120MB 121MB 524kB rpm
12 121MB 121MB 524kB aboot
13 121MB 122MB 524kB sbl2b
14 122MB 124MB 2097kB sbl3b
15 124MB 124MB 524kB abootb
16 124MB 125MB 524kB rpmb
17 125MB 125MB 524kB tzb
18 125MB 126MB 524kB metadata
19 126MB 143MB 16.8MB misc
20 143MB 159MB 16.8MB ext4 persist
21 159MB 1040MB 881MB ext4 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 15.8GB 14.1GB ext4 userdata
24 15.8GB 15.8GB 524kB DDR
25 15.8GB 15.8GB 507kB grow
23) If something different was returned, run the below code to restore the previous partition tables.
Code:
# /dd if=/external_sd/sgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
# /dd if=/external_sd/pgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
24) Exit the shell and type 'adb reboot bootloader' or reboot the phone while holding Volume Up.
25) Check that you're in fastboot mode and exit the following commands - This will fix the filesystem to take up the entire partition.
Code:
fastboot erase userdata
fastboot format userdata
fastboot -w
26) Boot the phone and update as needed. Then, put this on the phone and flash in recovery.
27) You are now working other than the SD card and Capacitive buttons.
Credits:
http://forum.xda-developers.com/showthread.php?t=2117576
http://forum.xda-developers.com/showthread.php?t=2099784
http://forum.xda-developers.com/showthread.php?t=2160124
http://forum.xda-developers.com/showthread.php?t=2146816
To convert from Nexus 4
This assumes that you have read the Convert to section.
1) Wipe the phone. Go into fastboot mode [Vol Up + Power] and execute the following commands. This is to prevent corrupted data partitions.
Code:
fastboot -w
fastboot format system
fastboot format userdata
fastboot format cache
fastboot format data
fastboot erase system
fastboot erase userdata
fastboot erase cache
fastboot erase data
2) LGNPST back to stock. You will do this twice to fix some issues.
To get into download mode, turn the phone off and hold Vol Up + Vol Down while inserting the USB cable.
3) Download these 2 images. Mar. 8, 2013 and Sept. 29, 2012
4) Flash the Mar. 8, 2013 firmware in LGNPST (See above for how to flash firmware in LGNPST. As before, the phone will start booting at 67% and LGNPST will show an error at 85%. Ignore the error and close LGNPST.
5) Restart the phone in download mode and now flash the Sept. 29, 2012 firmware. If you don't, your /SDCARD may be corrupted and you cant root.
6) Root the phone and unlock the bootloader. See here
7) If that doesn't work, try Teenybin.
8) Some partitions are broken. Go into CWM recovery and open an 'adb shell'.
9) Execute the following code. This will backup the broken partitions and wipe them.
Code:
dd if=/dev/block/mmcblk0p15 of=/sdcard/mmcblk0p15.bak
dd if=/dev/block/mmcblk0p16 of=/sdcard/mmcblk0p16.bak
dd if=/dev/block/mmcblk0p19 of=/sdcard/mmcblk0p19.bak
mke2fs -T ext4 /dev/block/mmcblk0p15
mke2fs -T ext4 /dev/block/mmcblk0p16
mke2fs -T ext4 /dev/block/mmcblk0p19
---You should now be back to stock--- LGNPST again if you want 'True Stock'
Let me know if you see anything wrong and please leave nasty comments at the door.
Ok, granted. This is more about recovering from flashing to Nexus 4 than about flashing to it. Basically, DON'T DO IT, as it doesn't seem to be worth it. We have AOSP and Cyanogen, etc.
I just posted this because I bought a phone that was flashed and went through hours of work fixing it.
Please read this before you think about flashing. http://forum.xda-developers.com/showpost.php?p=36735476&postcount=149
Its not worth it so much now but it was great when first released and it doesn't take that long to revert your phone. I went back and fourth like 5 times and my phone is fine. I think there is a low chance of your phone bricking as long as you follow instructions. The conversion is still a good option to have.
Sent from my LG Optimus G using XDA Premium 4 mobile app
Dr0!dFreek said:
Its not worth it so much now but it was great when first released and it doesn't take that long to revert your phone. I went back and fourth like 5 times and my phone is fine. I think there is a low chance of your phone bricking as long as you follow instructions. The conversion is still a good option to have.
Sent from my LG Optimus G using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Yeah, it seems nice to have the ability to do so, which is why I wrote the guide (and to give a single comprehensive guide that works).
It's nice to have a perfectly working KitKat rom the day its released, which is why I converted (When KK was released), but now, it doesn't seem worth it (We have AOSP). If you want MultiRom and franco kernel (Like I did), then its nice to have, but otherwise, most people don't need it.
alastair53 said:
13) Download the following 3 files and place them on the MicroSD card. - http://d-h.st/cFA - http://d-h.st/yUQ - http://d-h.st/0dH
Click to expand...
Click to collapse
Is this part SPYWARE? the 3 files downloads a exe and is detetected as virus or something.

Dump stock rom & build flashable image

For those who wants to know and learn how:
Requirements.
Preparation.
Collecting Information.
Dumping.
Build Up Flashable Image.
Click to expand...
Click to collapse
​
CREDITS
I do not want to take any credit for this as it is not my work, I just have forked it from http://www.freaktab.com.
You can check the original post here
I just have simplified it.
Requirements
Requirements :​
USB Drivers Of your device installed
ADB ( Android Debugging Bridge)
romdump_v82b.zip (Android ROM dumper by Sebastian404)
Micro-USB-cable
microSD-card OR USB-Stick
Newer busybox
Click to expand...
Click to collapse
Code:
[B]* If you don't want to work with microSD-card OR USB-Stick you can use:
ADB push <from-PC-file> <to-android-file>
ADB pull <from-android-file> <to-PC-file>
(don't forget the pathes)
[/B]
Preparations
Preparations​
Setup android
Settings -> [DEVICE] USB -> Enable Connect to PC
Settings -> [PERSONAL] Security -> Enable Unknown Sources
Settings -> [SYSTEM] Developer options -> Enable USB debugging
Click to expand...
Click to collapse
Install USB-Driver
Conect Your device With computer
open device manager
right click on not recognized device
click update driver.
Click to expand...
Click to collapse
Format SD Card
copy romdump form romdump_v82b.zip to the microSD-card
make directory "rompump.out" and "dd.out"
Remove it "secure" from PC
put it into your device
Click to expand...
Click to collapse
Collecting Information
1. Starting shell via ADB
Browse to the folder where adb files are places
E.G. I have My adb files in adb folder in C: drive
Code:
cd\
cd adb
Code:
C:\adb>
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
0123456789ABCDEF device
C:\adb>adb shell
Code:
[email protected]:/ #
=> this seems to be the ideal, because it's root (SU), if you don't have the # you have to try to type su
Confirm the correct user:
[email protected]:/ # id
Code:
uid=0(root) gid=0(root)
OR
[email protected]:/ # echo $USER
Code:
root
You can find your microSD-card under the directory "/mnt"
[email protected]:/ # cd /mnt
[email protected]:/mnt # ls
Code:
asec
external_sd
obb
sdcard
secure
shell
usb_storage
[email protected]:/mnt # cd external_sd
[email protected]:/mnt/external_sd # ls
Code:
LOST.DIR
dd.out
romdump
romdump.out
for the correct busybox release
[email protected]: # cat /proc/cpuinfo
Code:
Processor : ARMv7 Processor rev 0 (v7l)
:
After you have via PC download the newer busybox (I give it the name "busybox-armv7l_1.21.1") and put it to your microSD-card, then you have to copy it to your device
[email protected]:/ # cp /mnt/external_sd/busybox-armv7l_1.21.1 /data/busybox-armv7l_1.21.1
Destination MUST BE "/data/", otherwise it isn't executable...
[email protected]: # cat /proc/mtd
Code:
dev: size erasesize name
mtd0: 00400000 00004000 "misc"
mtd1: 01000000 00004000 "kernel"
mtd2: 01000000 00004000 "boot"
mtd3: 01000000 00004000 "recovery"
mtd4: 18000000 00004000 "backup"
mtd5: 08000000 00004000 "cache"
mtd6: 80000000 00004000 "userdata"
mtd7: 00400000 00004000 "kpanic"
mtd8: 20000000 00004000 "system"
mtd9: 113400000 00004000 "user"
[email protected]: # cat /proc/partitions
Code:
major minor #blocks name
31 0 4096 mtdblock0
31 1 16384 mtdblock1
31 2 16384 mtdblock2
31 3 16384 mtdblock3
31 4 393216 mtdblock4
31 5 131072 mtdblock5
31 6 2097152 mtdblock6
31 7 4096 mtdblock7
31 8 524288 mtdblock8
31 9 4509696 mtdblock9
179 0 3941376 mmcblk0
179 1 3941344 mmcblk0p1
[email protected]:/ # ls -al /dev/block
Code:
brw------- root root 7, 0 2013-10-27 15:39 loop0
brw------- root root 7, 1 2013-10-27 15:39 loop1
brw------- root root 7, 2 2013-10-27 15:39 loop2
brw------- root root 7, 3 2013-10-27 15:39 loop3
brw------- root root 7, 4 2013-10-27 15:39 loop4
brw------- root root 7, 5 2013-10-27 15:39 loop5
brw------- root root 7, 6 2013-10-27 15:39 loop6
brw------- root root 7, 7 2013-10-27 15:39 loop7
brw------- root root 179, 0 2013-10-27 16:29 mmcblk0
brw------- root root 179, 1 2013-10-27 16:29 mmcblk0p1
drwxr-xr-x root root 2013-10-27 15:39 mtd
brw------- root root 31, 0 2013-10-27 15:39 mtdblock0
brw------- root root 31, 1 2013-10-27 15:39 mtdblock1
brw------- root root 31, 2 2013-10-27 15:39 mtdblock2
brw------- root root 31, 3 2013-10-27 15:39 mtdblock3
brw------- root root 31, 4 2013-10-27 15:39 mtdblock4
brw------- root root 31, 5 2013-10-27 15:39 mtdblock5
brw------- root root 31, 6 2013-10-27 15:39 mtdblock6
brw------- root root 31, 7 2013-10-27 15:39 mtdblock7
brw------- root root 31, 8 2013-10-27 15:39 mtdblock8
brw------- root root 31, 9 2013-10-27 15:39 mtdblock9
drwxr-xr-x root root 2013-10-27 15:39 platform
drwx------ root root 2013-10-27 15:39 vold
[email protected]:/ # ls -al /dev/block/mtd/by-name
Code:
lrwxrwxrwx root root 2013-10-27 15:39 backup -> /dev/block/mtdblock4
lrwxrwxrwx root root 2013-10-27 15:39 boot -> /dev/block/mtdblock2
lrwxrwxrwx root root 2013-10-27 15:39 cache -> /dev/block/mtdblock5
lrwxrwxrwx root root 2013-10-27 15:39 kernel -> /dev/block/mtdblock1
lrwxrwxrwx root root 2013-10-27 15:39 kpanic -> /dev/block/mtdblock7
lrwxrwxrwx root root 2013-10-27 15:39 misc -> /dev/block/mtdblock0
lrwxrwxrwx root root 2013-10-27 15:39 recovery -> /dev/block/mtdblock3
lrwxrwxrwx root root 2013-10-27 15:39 system -> /dev/block/mtdblock8
lrwxrwxrwx root root 2013-10-27 15:39 user -> /dev/block/mtdblock9
lrwxrwxrwx root root 2013-10-27 15:39 userdata -> /dev/block/mtdblock6
[email protected]:/dev # /data/busybox-armv7l_1.21.1 blkid
Code:
/dev/block/mmcblk0p1: UUID="04A7-463C"
/dev/block/vold/31:9: UUID="8269-1ED1"
/dev/block/vold/179:1: UUID="04A7-463C"
/dev/block/mtdblock9: UUID="8269-1ED1"
/dev/block/mtdblock8: LABEL="system" UUID="06bc9880-9e07-4dec-ae8d-1e59a1b88921"
/dev/block/mtdblock6: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b"
/dev/block/mtdblock5: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b"
DUMPING
Dumping ROM​
Dumping (at adb shell)
1.) via dd:
dd if=/dev/block/mtdblock0 of=/mnt/external_sd/dd.out/misc.img
Code:
8192+0 records in
8192+0 records out
4194304 bytes transferred in 0.677 secs (6195426 bytes/sec)
dd if=/dev/block/mtdblock1 of=/mnt/external_sd/dd.out/kernel.img
Code:
32768+0 records in
32768+0 records out
16777216 bytes transferred in 1.734 secs (9675441 bytes/sec)
dd if=/dev/block/mtdblock2 of=/mnt/external_sd/dd.out/boot.img
Code:
32768+0 records in
32768+0 records out
16777216 bytes transferred in 2.665 secs (6295390 bytes/sec)
dd if=/dev/block/mtdblock3 of=/mnt/external_sd/dd.out/recovery.img
Code:
32768+0 records in
32768+0 records out
16777216 bytes transferred in 1.340 secs (12520310 bytes/sec)
dd if=/dev/block/mtdblock4 of=/mnt/external_sd/dd.out/backup.img
Code:
786432+0 records in
786432+0 records out
402653184 bytes transferred in 69.198 secs (5818855 bytes/sec)
dd if=/dev/block/mtdblock8 of=/mnt/external_sd/dd.out/system.img
Code:
1048576+0 records in
1048576+0 records out
536870912 bytes transferred in 57.050 secs (9410533 bytes/sec)
/data/busybox-armv7l_1.21.1 ls -ltr /mnt/external_sd/dd.out/
Code:
-rwxrwxr-x 1 1000 1015 4194304 Oct 27 21:09 misc.img
-rwxrwxr-x 1 1000 1015 16777216 Oct 27 21:12 kernel.img
-rwxrwxr-x 1 1000 1015 16777216 Oct 27 21:14 boot.img
-rwxrwxr-x 1 1000 1015 16777216 Oct 27 21:15 recovery.img
-rwxrwxr-x 1 1000 1015 402653184 Oct 27 21:17 backup.img
-rwxrwxr-x 1 1000 1015 536870912 Oct 27 21:27 system.img
?not really need?
Code:
dd if=/dev/block/mtdblock5 of=/mnt/external_sd/dd.out/cache.img
dd if=/dev/block/mtdblock6 of=/mnt/external_sd/dd.out/userdata.img
dd if=/dev/block/mtdblock7 of=/mnt/external_sd/dd.out/kpanic.img
dd if=/dev/block/mtdblock9 of=/mnt/external_sd/dd.out/user.img
2.) via "romdump":
cp /mnt/external_sd/romdump /data/romdump
/data/romdump
Code:
Android ROM dumper v0.82b
(c)2011 Sebastian404
Device : rk31sdk-eng 4.2.2 JDQ39 eng.linking.20130709.184313 test-keys
Creating required files... done.
Opening mtd table... done.
Dumping kernel config... sh: cat: /proc/config.gz: No such file or directory
done.
Dumping boot partition... done.
Dumping recovery partition... done.
Dumping system partition... done.
Creating Checksums... done.
Cleaning up... done.
All done.
ls -al /sdcard/romdump
Code:
-rwxrwxr-x system sdcard_rw 16777216 2013-10-27 22:46 boot.img
-rwxrwxr-x system sdcard_rw 275 2013-10-27 22:48 checksum.md5
-rwxrwxr-x system sdcard_rw 0 2013-10-27 22:46 config.gz
-rwxrwxr-x system sdcard_rw 16777216 2013-10-27 22:46 recovery.img
-rwxrwxr-x system sdcard_rw 1507 2013-10-27 22:46 system.info.gz
-rwxrwxr-x system sdcard_rw 373034496 2013-10-27 22:48 system.tar
cp /sdcard/romdump/boot.img /mnt/external_sd/romdump.out/boot.img
cp /sdcard/romdump/checksum.md5 /mnt/external_sd/romdump.out/checksum.md5
cp /sdcard/romdump/config.gz /mnt/external_sd/romdump.out/config.gz
cp /sdcard/romdump/recovery.img /mnt/external_sd/romdump.out/recovery.img
cp /sdcard/romdump/system.info.gz /mnt/external_sd/romdump.out/system.info.gz
cp /sdcard/romdump/system.tar /mnt/external_sd/romdump.out/system.tar
ls -al /mnt/external_sd/romdump.out
Code:
-rwxrwxr-x system sdcard_rw 16777216 2013-10-27 23:15 boot.img
-rwxrwxr-x system sdcard_rw 275 2013-10-27 23:15 checksum.md5
-rwxrwxr-x system sdcard_rw 0 2013-10-27 23:15 config.gz
-rwxrwxr-x system sdcard_rw 16777216 2013-10-27 23:15 recovery.img
-rwxrwxr-x system sdcard_rw 1507 2013-10-27 23:15 system.info.gz
-rwxrwxr-x system sdcard_rw 373034496 2013-10-27 23:16 system.tar
Build Up Flashable Image
Build Up Flashable Image​
WinHex or any other Hex-Editor who can work with large files
Rk29xx ImageTools V2.1 by wendal (I download it here at 4. (it's without "su" and "Superuser.apk"))
(Alternatively you can use RK3xxx Firmware Tools by SergioPoverony)
First check the "dd.out/backup.img" with a HexEditor to determine whether there is information in it (first 4 characters "RKAF") or only zeros (HEX "FF") what means it is empty...
If there is this information in it, you will perhaps* have the complete ROM in it, which will include the loader and parameter files and you can use "wendal tools" to extract it...
1. Put the "backup.img" into the wendal tools directory and rename it to "wendal.img"
2. Start the "Runme.bat",
2a. Select 1 + return
2b. then any key
2c. and then you have to wait.
Code:
D:\RK3066_IMG_Mod_Tool>lua rk29xx_rom_tools_tnt.lua
RK29xx Image Pack/Unpack Tools
Blog http://wendal.net
Project: https://github.com/wendal/teclast_tools
feedback: [email protected]
Pls input: 1-Unpack 2-Pack 3-Exit
1
Pls copy Image file into this folder,and rename to wendal.img
Notify any errors!
Drücken Sie eine beliebige Taste . . .
Reading file header...
File header: RKFWf
Read loader's offset
Read loader's len
Read update.img's offset
Read update.img's len
Output Loader
offset(0x66) len(0x2F8AE)
Output updata.img
offset(0x2F914) len(0x1973A804)
Unpack updata.img to Temp folder
Check file... OK
------- UNPACK ------
package-file 0x00000800 0x00000241
RK3188Loader(L)_V1.20.bin 0x00001000 0x0002F96E
parameter 0x00031000 0x00000266
Image/misc.img 0x00031800 0x0000C000
Image/kernel.img 0x0003D800 0x00846034
Image/boot.img 0x00884000 0x000FE6F1
Image/recovery.img 0x00982800 0x00B18000
Image/system.img 0x0149A800 0x16E09800
backupimage/backup.img 0x182A4000 0x01495004
update-script 0x19739800 0x000003A5
recover-script 0x1973A000 0x0000010A
Unpack firmware OK!
------ OK ------
Unpack -- All Done
Pls input: 1-Unpack 2-Pack 3-Exit
Amazing work,you should add your name at TWRP which you compiled.
Well,hats off bro.
Steps for MMC based devices
Thanks for the info. Don't know why it hadn't occur to me to use dd for taking the image.
This works great for MTD based devices but does nothing for MMC based devices.
Never fear, I found the answer in an old post from lavero.burgos on repartitioning a Nook tablet.
Turns out if you use the parted from the CM team you can acquire the partition information you need.
Here is a shorthand of the previous instructions as they apply to MMC devices:
Req:
USB Drivers for your device
ADB installed and in your path
Appropriately sized USB cable for your device
microSD card
GNU parted
a rooted device
Prep:
make directory "firmware-img" on SD Card
make directory "tools" on SD Card
copy parted to tools directory on SD Card
Remove SD Card safely from PC
put SD Card into rooted device
Collect Info:
Run the commands below (one per line)
adb shell
su (if not already root user)
cp /mnt/<sd card mount point>/tools/parted /system/bin
cat /proc/partitions
parted /dev/block/mmcblk0
print
make note of the partition number and name for the partitions you wish to dump​
quit
Dumping ROM:
Run dd as defined below each partition you wan to dump, the <partition path> will be /dev/block/mmcblk0p<partition number>.
dd if=<partition path> of=/mnt/<sd card mount point>/firmware-img/<partition name>.img
---------- Post added at 02:36 PM ---------- Previous post was at 02:21 PM ----------
I hope this helps. I'm by no means an expert on this type of thing, so if you have additions or corrections, plz feel free. I've been watching learning and gathering, now I have a chance to give back.
I've gotten this to work on Nook tablet, Atrix HD and gonna test it on my Xoom in the next few days.
I dont know much about the MMC based devices .. As I onLy Have used Mediatek devices so far, btw thanx for the information
When I tried to do cat proc/mtd I got this error
Code:
1|[email protected]:/ # cat /proc/mtd
cat /proc/mtd
sh: cat: /proc/mtd: No such file or directory
1|[email protected]:/ #
i have a question please help me if you can
i didnt find the cat /proc/mtd is working because the mtd is not found in proc so after search i used proc/mount with link
i got the system file only but i didn't got the recovery or boot
i need another way to get it to build CWM
my device is totally new and support for it at all because it is BCM 21663 broadom
i have dual core Arm 7
512 ram
8g storage
1024*600
2 sim 3g tablet
any other CWM may works? or firmware refer to this specs??
ANY EXPERT THERE???
Thank you very much for the post, it was very helpful! It's a good complement to this post:
http://forum.xda-developers.com/showthread.php?t=2450045
modify download directory
Hi. I have a problem with my lenovo A526, whenever I want to download, it says "modify thedownload directory of the ". How can I do that? Can someone help me please? Thank you.
Ruscelle23 said:
Hi. I have a problem with my lenovo A526, whenever I want to download, it says "modify thedownload directory of the ". How can I do that? Can someone help me please? Thank you.
Click to expand...
Click to collapse
Try Using any other browser like opera or UC and choose custom directory before downloading a file. Ruscelle23
hssrgh said:
i have a question please help me if you can
i didnt find the cat /proc/mtd is working because the mtd is not found in proc so after search i used proc/mount with link
i got the system file only but i didn't got the recovery or boot
i need another way to get it to build CWM
my device is totally new and support for it at all because it is BCM 21663 broadom
i have dual core Arm 7
512 ram
8g storage
1024*600
2 sim 3g tablet
any other CWM may works? or firmware refer to this specs??
ANY EXPERT THERE???
Click to expand...
Click to collapse
Use cat /proc/emmc
The original link for romdump doesn't work, so here is an alternative one.
romdump_v82b.zip | by bhiga for Generic Device/Other
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
androidfilehost.com
codenation said:
The original link for romdump doesn't work, so here is an alternative one.
romdump_v82b.zip | by bhiga for Generic Device/Other
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
androidfilehost.com
Click to expand...
Click to collapse
Thanks a lot for that.

[RECOVERY] Moto G6 TWRP (Testers needed)

Uploaded the recovery from the system dump posted here to TWRP builder and Yshalsager built this recovery for it, need testers for it View attachment TWRP-3.2.1-ali-20180612.img.zip
I'll gladly test it. I've been testing a version of my own but had issues with mounting the external sdcard.
EDIT - Quick test and it shows internal storage separate from external (mine showed the same internal for both) however it does not mount the external sd card.
Added a couple of logs. Sorry, it's been a while since I have had a devices I could unlock/etc... Please let me know if you want more.
likemiketoo said:
Uploaded the recovery from the system dump posted here to TWRP builder and Yshalsager built this recovery for it, need testers for it View attachment 4526176
Click to expand...
Click to collapse
TWRP has been using a boot Twrp.img and an TWRP Installer which installs TWRP to the system, if you dont use installer, you must Fastboot TWRP every time...
---------- Post added at 04:43 PM ---------- Previous post was at 04:04 PM ----------
likemiketoo said:
Uploaded the recovery from the system dump posted here to TWRP builder and Yshalsager built this recovery for it, need testers for it View attachment 4526176
Click to expand...
Click to collapse
do you just do a fastboot flash recovery with this or what? instructions are a little vague
Dadud said:
do you just do a fastboot flash recovery with this or what? instructions are a little vague
Click to expand...
Click to collapse
If it were me, I'd use the following:
Code:
fastboot boot twrp.img
That way you can test it without breaking your stock recovery. If it does end up working you can use it to backup your stock boot.img and recovery.img.
kwiksi1ver said:
If it were me, I'd use the following:
Code:
fastboot boot twrp.img
That way you can test it without breaking your stock recovery. If it does end up working you can use it to backup your stock boot.img and recovery.img.
Click to expand...
Click to collapse
i tried flashing it but it gave me an error saying it wasnt signed correctly, ill get back on with that command and grab the stock boot.img and recovery.img (if it works) and throw them up on google drive for anyone who might need them.
Update: not letting me backup, i have secure boot enabled, though and its not asking me for decryption password when i boot twrp like my nexus 6p did.
Dadud said:
Update: not letting me backup, i have secure boot enabled, though and its not asking me for decryption password when i boot twrp like my nexus 6p did.
Click to expand...
Click to collapse
When you've booted into TWRP does ADB work when you're connected to your PC?
kwiksi1ver said:
When you've booted into TWRP does ADB work when you're connected to your PC?
Click to expand...
Click to collapse
yeah, i can run adb shell no problem
Dadud said:
yeah, i can run adb shell no problem
Click to expand...
Click to collapse
from adb shell run
Code:
cd /dev/block/platform/soc/
ls
the ls command will list a partition or two try to cd to them and look for a structure like this:
/dev/block/platform/soc/c0c4000.sdhci/by-name/
the c0c4000.shci will not match, it will be specific to your device model, but once you find that folder you can try to copy the boot and recovery partitions using commands like this:
Code:
dd if=/dev/block/platform/soc/c0c4000.sdhci/by-name/boot of=/external_sd/boot.img
dd if=/dev/block/platform/soc/c0c4000.sdhci/by-name/recovery of=/external_sd/recovery.img
or if you don't have an external SD card try this
Code:
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/boot stockboot.img
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/recovery stockrecovery.img
Again the folder name after the /soc/ in the path will be different for your device so replace that and you can save your stock boot and recovery images. From there we can use those to build a proper TWRP and get root by disabling dm-verity on the boot.img.
kwiksi1ver said:
from adb shell run
Code:
cd /dev/block/platform/soc/
ls
the ls command will list a partition or two try to cd to them and look for a structure like this:
/dev/block/platform/soc/c0c4000.sdhci/by-name/
the c0c4000.shci will not match, it will be specific to your device model, but once you find that folder you can try to copy the boot and recovery partitions using commands like this:
Code:
dd if=/dev/block/platform/soc/c0c4000.sdhci/by-name/boot of=/external_sd/boot.img
dd if=/dev/block/platform/soc/c0c4000.sdhci/by-name/recovery of=/external_sd/recovery.img
or if you don't have an external SD card try this
Code:
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/boot stockboot.img
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/recovery stockrecovery.img
Again the folder name after the /soc/ in the path will be different for your device so replace that and you can save your stock boot and recovery images. From there we can use those to build a proper TWRP and get root by disabling dm-verity on the boot.img.
Click to expand...
Click to collapse
not seeing a c0c4000.shci or similarly named folder, just a lot of mmcblk folders, a by-name and a by-num folder. i see something called boot and recovery in by-name but when i try to adb pull it returns adb: not found
Dadud said:
not seeing a c0c4000.shci or similarly named folder, just a lot of mmcblk folders, a by-name and a by-num folder. i see something called boot and recovery in by-name but when i try to adb pull it returns adb: not found
Click to expand...
Click to collapse
Sorry, I should have been more clear, you can't be in adb shell when you run the adb pull command.
So you'd find the full path of the "by-name" folder and you'd copy the whole path name. Then exit out of adb shell by typing "exit" and you should be back to the command prompt/terminal on your computer.
Then you run the command: (but replace the path of your boot and recovery files with the file structure on your device)
Code:
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/boot stockboot.img
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/recovery stockrecovery.img
Dadud said:
not seeing a c0c4000.shci or similarly named folder, just a lot of mmcblk folders, a by-name and a by-num folder. i see something called boot and recovery in by-name but when i try to adb pull it returns adb: not found
Click to expand...
Click to collapse
Opening command prompt/powershell (windows) or terminal ( linux) and type:
Code:
adb pull /dev/block/platform/soc/by-name/boot boot.img
adb pull /dev/block/platform/soc/by-name/recovery recovery.img
This works fine for me using my twrp and the twrp from the op. This does not work for you?
I have used this to boot into phh-treble and the lineage-phh-treble roms (with the stock kernel) and have gone back to stock (pulled the system.img before this). I have not been successful with Magisk myself.
EDIT- After typing this I just saw kwiksi1ver's reply...
Not that I've needed to but I had more lines in my fstab so I could mount more partitions like vendor (I believe Magisk wanted to mount it?) Included for whatever purposes. external sdcard not working right and I haven't tested out edits since I first tried it.
*** DISCLAIMER *** It's been a long time since I have messed with this stuff so excuse the messy stuff and my lack of knowledge of mounting flags. Also uh..... I'm not responsible for your choices.....
dejello said:
Opening command prompt/powershell (windows) or terminal ( linux) and type:
Code:
adb pull /dev/block/platform/soc/by-name/boot boot.img
adb pull /dev/block/platform/soc/by-name/recovery recovery.img
This works fine for me using my twrp and the twrp from the op. This does not work for you?
I have used this to boot into phh-treble and the lineage-phh-treble roms (with the stock kernel) and have gone back to stock (pulled the system.img before this). I have not been successful with Magisk myself.
EDIT- After typing this I just saw kwiksi1ver's reply...
Not that I've needed to but I had more lines in my fstab so I could mount more partitions like vendor (I believe Magisk wanted to mount it?) Included for whatever purposes. external sdcard not working right and I haven't tested out edits since I first tried it.
*** DISCLAIMER *** It's been a long time since I have messed with this stuff so excuse the messy stuff and my lack of knowledge of mounting flags. Also uh..... I'm not responsible for your choices.....
Click to expand...
Click to collapse
By chance could you also post the stock recovery.img and boot.img as well?
kwiksi1ver said:
By chance could you also post the boot.img as well?
Click to expand...
Click to collapse
I can. It boots but the sdcard is at least shown better on the op link. I took the one posted for the g6 play and swapped a few things with the stock recovery and came up with this. ***Again, I'm not responsible for how you use this and can't say anything is safe (though I have used it plenty). You WILL lose your data any time you want to mess with anything rom related.*** To get it to read the data partition you have to format it (that includes internal storage).
dejello said:
I can. It boots but the sdcard is at least shown better on the op link. I took the one posted for the g6 play and swapped a few things with the stock recovery and came up with this. ***Again, I'm not responsible for how you use this and can't say anything is safe (though I have used it plenty). You WILL lose your data any time you want to mess with anything rom related.*** To get it to read the data partition you have to format it (that includes internal storage).
Click to expand...
Click to collapse
I don't have a G6 myself, I was just trying to kickstart the development on it.
I have a G6 play, I was the one who made the TWRP image for the G6 Play.
dejello said:
Opening command prompt/powershell (windows) or terminal ( linux) and type:
Code:
adb pull /dev/block/platform/soc/by-name/boot boot.img
adb pull /dev/block/platform/soc/by-name/recovery recovery.img
This works fine for me using my twrp and the twrp from the op. This does not work for you?
Click to expand...
Click to collapse
no, it doesnt seem to be working, this is a log my my powershell prompt.
PS C:\Users\dadud\Downloads\TWRP-3.2.1-ali-20180612.img> adb shell
~ #  cd /dev/block/platform/soc/
/dev/block/platform/soc # ls
by-name mmcblk0p16 mmcblk0p25 mmcblk0p34 mmcblk0p43 mmcblk0p52
by-num mmcblk0p17 mmcblk0p26 mmcblk0p35 mmcblk0p44 mmcblk0p53
mmcblk0 mmcblk0p18 mmcblk0p27 mmcblk0p36 mmcblk0p45 mmcblk0p6
mmcblk0p1 mmcblk0p19 mmcblk0p28 mmcblk0p37 mmcblk0p46 mmcblk0p7
mmcblk0p10 mmcblk0p2 mmcblk0p29 mmcblk0p38 mmcblk0p47 mmcblk0p8
mmcblk0p11 mmcblk0p20 mmcblk0p3 mmcblk0p39 mmcblk0p48 mmcblk0p9
mmcblk0p12 mmcblk0p21 mmcblk0p30 mmcblk0p4 mmcblk0p49 mmcblk0rpmb
mmcblk0p13 mmcblk0p22 mmcblk0p31 mmcblk0p40 mmcblk0p5
mmcblk0p14 mmcblk0p23 mmcblk0p32 mmcblk0p41 mmcblk0p50
mmcblk0p15 mmcblk0p24 mmcblk0p33 mmcblk0p42 mmcblk0p51
/dev/block/platform/soc # cd by-name
/dev/block/platform/soc/by-name # ls
DDR cmnlib64 fsg mmi_misc prov syscfg
aboot cmnlib64bak hw modem provbak system
abootbak cmnlibbak keymaster modemst1 recovery tz
apdp devcfg keymasterbak modemst2 rpm tzbak
boot devcfgbak kpan mota rpmbak userdata
cache dpo logo msadp sbl1 utags
carrier dsp logs oem sbl1bak utagsBackup
cid frp metadata padA sp vendor
cmnlib fsc misc persist ssd
/dev/block/platform/soc/by-name # exit
PS C:\Users\dadud\Downloads\TWRP-3.2.1-ali-20180612.img> adb pull /dev/block/platform/soc/by-name/boot stockboot.img
remote object '/dev/block/platform/soc/by-name/boot' not a file or directory
PS C:\Users\dadud\Downloads\TWRP-3.2.1-ali-20180612.img>
(ive got adb/fastboot enabled system wide so itll work out of whatever folder i have open)
Dadud said:
no, it doesnt seem to be working, this is a log my my powershell prompt.
PS C:\Users\dadud\Downloads\TWRP-3.2.1-ali-20180612.img> adb shell
~ # [6n cd /dev/block/platform/soc/
/dev/block/platform/soc # [6nls
by-name mmcblk0p16 mmcblk0p25 mmcblk0p34 mmcblk0p43 mmcblk0p52
by-num mmcblk0p17 mmcblk0p26 mmcblk0p35 mmcblk0p44 mmcblk0p53
mmcblk0 mmcblk0p18 mmcblk0p27 mmcblk0p36 mmcblk0p45 mmcblk0p6
mmcblk0p1 mmcblk0p19 mmcblk0p28 mmcblk0p37 mmcblk0p46 mmcblk0p7
mmcblk0p10 mmcblk0p2 mmcblk0p29 mmcblk0p38 mmcblk0p47 mmcblk0p8
mmcblk0p11 mmcblk0p20 mmcblk0p3 mmcblk0p39 mmcblk0p48 mmcblk0p9
mmcblk0p12 mmcblk0p21 mmcblk0p30 mmcblk0p4 mmcblk0p49 mmcblk0rpmb
mmcblk0p13 mmcblk0p22 mmcblk0p31 mmcblk0p40 mmcblk0p5
mmcblk0p14 mmcblk0p23 mmcblk0p32 mmcblk0p41 mmcblk0p50
mmcblk0p15 mmcblk0p24 mmcblk0p33 mmcblk0p42 mmcblk0p51
/dev/block/platform/soc # [6ncd by-name
/dev/block/platform/soc/by-name # [6nls
DDR cmnlib64 fsg mmi_misc prov syscfg
aboot cmnlib64bak hw modem provbak system
abootbak cmnlibbak keymaster modemst1 recovery tz
apdp devcfg keymasterbak modemst2 rpm tzbak
boot devcfgbak kpan mota rpmbak userdata
cache dpo logo msadp sbl1 utags
carrier dsp logs oem sbl1bak utagsBackup
cid frp metadata padA sp vendor
cmnlib fsc misc persist ssd
/dev/block/platform/soc/by-name # [6nexit
PS C:\Users\dadud\Downloads\TWRP-3.2.1-ali-20180612.img> adb pull /dev/block/platform/soc/by-name/boot stockboot.img
remote object '/dev/block/platform/soc/by-name/boot' not a file or directory
PS C:\Users\dadud\Downloads\TWRP-3.2.1-ali-20180612.img>
(ive got adb/fastboot enabled system wide so itll work out of whatever folder i have open)
Click to expand...
Click to collapse
Okay try this from powershell, it should work.
Code:
adb shell
dd if=/dev/block/platform/soc/by-name/boot of=/tmp/stockboot.img
dd if=/dev/block/platform/soc/by-name/recovery of=/tmp/stockrecovery.img
exit
adb pull /tmp/stockboot.img
adb pull /tmp/stockrecovery.img
kwiksi1ver said:
Okay try this from powershell, it should work.
Code:
adb shell
dd if=/dev/block/platform/soc/by-name/boot of=/tmp/stockboot.img
dd if=/dev/block/platform/soc/by-name/recovery of=/tmp/stockrecovery.img
exit
adb pull /tmp/stockboot.img
adb pull /tmp/stockrecovery.img
Click to expand...
Click to collapse
ended up downloading the new (r40) of ADB instead of the old (r32) and using command line, and had success.. ill edit this post with the google drive links to my boot.img and recovery.img as soon as it uploads (stuck on 512k upload and both are about 22 megs, should be done in 10-15 minutes.)
Edit: Links
https://drive.google.com/open?id=1VWK24zyIl2sGz4H99YrG1G0KdTUmBsG3 <- Boot.img
https://drive.google.com/open?id=1xXEj7vdiikBY5ygZANNeMWwvI1S3DO4H <- Recovery.img
---------- Post added at 01:03 PM ---------- Previous post was at 12:32 PM ----------
Dadud said:
ended up downloading the new (r40) of ADB instead of the old (r32) and using command line, and had success.. ill edit this post with the google drive links to my boot.img and recovery.img as soon as it uploads (stuck on 512k upload and both are about 22 megs, should be done in 10-15 minutes.)
Edit: Links
https://drive.google.com/open?id=1VWK24zyIl2sGz4H99YrG1G0KdTUmBsG3 <- Boot.img
https://drive.google.com/open?id=1xXEj7vdiikBY5ygZANNeMWwvI1S3DO4H <- Recovery.img
Click to expand...
Click to collapse
Say i wanted to flash the pixel experience project treble rom, all i'd have to do is flash the system.img from their download through twrp/fastboot and boot? i've already backed up my original system.img.
edit: attempted, failed. just reboots into bootloader every time i try to start it. reflashing stock system.img
edit: that also failed, along with my twrp backup.
edit 3: unbricked with the firmware found on this forum.
So.... I have tried installing again and ended in bootloops. I just tried installing AOSP phh-treble via fastboot (system.img doesn't need to be signed) and it is booting with the stock unmodified kernel.
Photos.. Also seen this boot logo randomly.. Thought that was interesting..
I am working to see if I can figure out the external sdcard in twrp (as this thread should be about twrp). Figured a booting image might help in that, dunno.

Categories

Resources