Perhaps a dumb question, but my brain is hurting from all the learning here:
I have modified my phone as I want it, including rooted deodexed stock eb01, swapping .apks, running all the mods through cwm, removing apps,etc. (I guess I themed it the hard way).
Question: Can I create a .tar file from the device while it is running, basically a 'snapshot' of the system exactly as it is ? That way I can odin to current setup if I dork up my phone.
my apologies if this is a stupid question
Sent from my SCH-I500 using XDA App
THAT IS TOTALLY NOT A STUPID QUESTION...I actually believe its a great idea right now.
Well, the long answer is, you shell into the phone and make images of the various sectors of the phone, name them properly, and heimdall them. If you use odin, take an extra step to tar it together.
Here its a guide for doing that on a continuum:
http://androidforums.com/continuum-all-things-root/263953-how-make-custom-odin-images.html
Note it glosses over dividing out the kernel binaries and RAMdisk, mentioned in the more comprehensive guide for the Behold:
http://androidforums.com/behold-2-all-things-root/54424-creating-custom-roms- odin.html
I haven't seen anyone post a cute little listing of the actual partitions and cutoffs specific to the fascinate, but I haven't looked very hard either.
UPDATE #2: (it is L: bml7, not bm17 & not bmI7)
So theoretically it's really simple (from an adb shell):
dd if=/dev/block/bml7 of=/sdcard/zImage bs=4096
dd if=/dev/block/stl9 of=/sdcard/factoryfs.rfs bs=4096
dd if=/dev/block/stl10 of=/sdcard/dbdata.rfs bs=4096
dd if=/dev/block/stl11 of=/sdcard/cache.rfs bs=4096(copy zImage and factoryfs.rfs to your local computer)
tar -H ustar -c zImage factoryfs.rfs dbdata.rfs cache.rfs > odinTAR.tarThese two commands append an md5 checksum to your package, and then rename the file. This finishes the process.
md5sum -t odinTAR.tar >> odinTAR.tar
mv odinTAR.tar odin_package.tar.md5NOTE: I did not include the modem, but you can flash that separately. This tar includes your personal data, so consider this before distributing any file you make this way. I haven't tested these instructions myself in any way.
Short answer:
Backup (everything but kernel) with nandroid and use that to restore. So long as you have a happy recovery setup, that is the path of least effort.
Swyped w/ XDA App. A clean tie attracts the soup of the day.
thanks for the response; certainly more involved than just a " create .tar" option somewhere. (Though that would be cool to develop for CWM or something)
Looks like some more learning for me. Always appreciate the info.
The next time there is a worthwhile update from VZW, I'd like to put together a not-stock, stripped-down-as-possible (small file) odin tar that is just enough to be a launchpad for flashing ROMs on whatever the next official modem is. So I'm doing my reading ahead of time.
Actually this looks like a great "What is where" link:
http://forum.xda-developers.com/showthread.php?t=850359
To paraphrase the link I posted above:
These are found in /dev/block. BML stands for Block Management Layer. STL is Sector Translation Layer. RFS is Samsung's Robust File System.
bml7 zImage (kernel)
stl9 factoryfs.rfs (system)
modem:
bml12 modem.bin
personal data:
stl10 dbdata.rfs
stl11 cache.rfs
other:
stl6 param.lfs
bml2 pit.pit
bml3 efs.rfs
NEVER:
bml1 boot.bin
bml4 Sbl.bin
unknown:
bml8 recovery.bin
You may use dd (and apparertly cat) to copy these partitions to your SD card:
adb shell su -c "dd if=/dev/block/bml7 of=/sdcard/zImage bs=4096"
adb shell cat /dev/block/stl9 > /sdcard/factoryfs.rfs
You may reflash them individually with heimdall, or tar to flash as a group in Odin.
Related
Hello.
I have several troubles with my phone (adb not working, phone don't remeber usb connection mode after reboot, etc). And I cannot fix them with simple flashing. I want to try to fix them by writing data from fully working phone.
For this I need all partitions from I9001 except /system, /data, /boot, /recovery, /cache., /sdcard
Does anyone can share /dev/block/mmcblk0p1 - /dev/block/mmcblk0p27 except mmcblk0p8, mmcblk0p13, mmcblk0p15, mmcblk0p16, mmcblk0p17?
You could make parition images with
Code:
dd if=/dev/block/mmcblk0p1 of=/sdcard/1
dd if=/dev/block/mmcblk0p2 of=/sdcard/2
...
dd if=/dev/block/mmcblk0p27 of=/sdcard/27
I know it risky but I really need it.
this should do the tick
Code:
adb shell
su
mount -o remount rw /system
dd if=/dev/block/mmcblk0p12 of=/sdcard/persist.img bs=4096
dd if=/dev/block/mmcblk0p13 of=/sdcard/recovery.img bs=4096
dd if=/dev/block/mmcblk0p18 of=/sdcard/preload.img.ext4 bs=4096
dd if=/dev/block/mmcblk0p27 of=/sdcard/efs.img.ext4 bs=4096
o btw now I see that you need the working files, you could extract them from the odin one package and push em directly to your phone
broodplank1337 said:
o btw now I see that you need the working files, you could extract them from the odin one package and push em directly to your phone
Click to expand...
Click to collapse
But there is only
Code:
adsp.mbn
amss.mbn
boot.img
cache.img.ext4
recovery.img
system.img.ext4
I tried to flash other versions and this don't help.
Shtsh said:
But there is only
Code:
adsp.mbn
amss.mbn
boot.img
cache.img.ext4
recovery.img
system.img.ext4
I tried to flash other versions and this don't help.
Click to expand...
Click to collapse
Then i recommend you to boot in recovery (CWM) and format all partitions, then put phone in download mode and flash xxkps/xxkpu
broodplank1337 said:
Then i recommend you to boot in recovery (CWM) and format all partitions, then put phone in download mode and flash xxkps/xxkpu
Click to expand...
Click to collapse
I'm tried this Didn't help.
Those ODIN stock roms usually have modem binaries. I don't know if it is a good idea to dd different boot loaders to your phone. I would not do it in any case. Your phone is not that old. Reflash stock and claim warranty if it behaves badly.
Hi,
I unrooted and ran the 4.5.141 update. I'm now on Android OS 2.3.6. I am now trying to follow the directions to re-root from here: http://www.android-advice.com/2012/root-the-motorola-atrix-4g-running-4-5-141/
However, when I get to the step where I run the command:
Code:
cp /preinstall/su /system/bin/
I get the error "cp: write error: No space left on device" which I thought was very odd....so, I ran the command
Code:
df /system/bin
and the output I see is:
Code:
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/block/mmcblk0p12
326071 326068 3 100% /system
Is this possible? How do I get su back on to /system/bin?
How can it be that the /system partition is full? Is there a way to resize it, if that's the case?
Please help!!!
did you do step 6 before step 4
check this out THIS
Obviously, otherwise it won't work. My problem is that /system has no free space. How is that possible?
quordandis said:
Obviously, otherwise it won't work.
Click to expand...
Click to collapse
a simple 'yes', without 'tude, would have sufficed.
Ok, here's what I had to do to make this work. First, you have to check if you have Superuser.apk saved in /system/app. If you do, delete it (you'll reinstall this later).
Since I also wanted to install the latest version of Swype, first, rename /system/lib/libSwypeCore.so to /system/lib/libSwypeCore.so.bak
Then, cp /system/app/Swype.apk /sdcard/Swype.apk.bak
After you've copied the stock Swype to the sdcard, then rm /system/app/Swype.apk
This should provide you with enough room on /system to cp /preinstall/su /system/bin/su
The rest should follow accordingly.
-Q
Use this guide at your own risk.
Here is a short guide to use Heimdall on a linux console (Non a Graphical Interface) to back your phone to stock.
I assume you have Heimdall already installed.
1. Download stock files to flash (see link below under STOCK Files)
2. Put the phone in downloading mode (press 1 + power button)
3. Plug the phone to the computer.
4. Check if the phone is detected using this command:
Code:
heimdall detect
If device is detected you'll see a console message like this:
Code:
Device Detected
If not see below under DETECT DEVICE.
5. Use this command to flash files. You must run this command from the folder where the stock files are:
Code:
heimdall flash --repartition --cache cache.rfs --factoryfs factoryfs.rfs --modem modem.bin --param param.lfs --recovery recovery.bin --kernel zImage --pit SPH-D700.pit --data datafs.rfs
If everithing is done without errors your phone will be rebooted and you'll see the stock rom working on it .
Thanks.
STOCK Files:
You can find some packages in this nubecoder post: http://forum.xda-developers.com/showthread.php?t=1584346
You have to rename the files name in the console code above to match with the files in the package downloaded if necessary.
DEVICE DETECT
I use Archlinux and I didn't nothing to enable this, it works by default.
UBUNTU:
This text is copied from http://developer.android.com/guide/developing/device.html
If you're developing on Ubuntu Linux, you need to add a udev rules file that contains a USB configuration for each type of device you want to use for development. In the rules file, each device manufacturer is identified by a unique vendor ID, as specified by the ATTR{idVendor} property. To set up device detection on Ubuntu Linux:
Log in as root and create this file: /etc/udev/rules.d/51-android.rules.
Use this format to add each vendor to the file:
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
NOTE: 04e8 is Samsung id Vendor.
After this open a linux console and use this command as root:
Code:
chmod a+r /etc/udev/rules.d/51-android.rules
Thanks.
Hi dude,
I have my SGS2 soft bricked and I'm trying to recover it. I've already opened a post here.
Fed up with Odin errors I've decided to try Heimdall.
However, it fails when I try to flash a kernel and I think that my partitions system is damaged.
Find attached my heimdall print-pit result, System partition is missing.
Hope you can help me.
Regards,
Mario.
Usage for GT-P6200
In your example you use:
heimdall flash --repartition --cache cache.rfs --factoryfs factoryfs.rfs --modem modem.bin --param param.lfs --recovery recovery.bin --kernel zImage --pit SPH-D700.pit --data datafs.rfs
I have a Samsung Galaxy Tab Plus GT-P6200 which will not format /data thus I would like to use the --repartition option however my files provided are a little different being:
boot.bin
cache.img
factoryfs.img
hidden.img
modem.bin
param.lfs
recovery.img
Sbl.bin
zImage
How would I go about building the command string for this ?
As for the pit file I have this and will place it in the same folder
Hi XDA!
I managed to bebloat and odex some extra system apps on my Stock Touchwiz ROM, and wanted to make a backup in case something goes wrong again. I tried to follow this guide: http://forum.xda-developers.com/showthread.php?t=2277127, however, Odin always throws an error 'MD5 hash value is invalid'. I suspect there is something wrong with my image, as the developer that started that thread said his packages worked perfectly. I used the make_ext4fs binary from this link: http://web.djodjo.org/dwn.php?ff=211260&a=download/android/tools/x86_linux/ext4tools:make_ext4fs, and copied it to my device. Is the binary supposed to be for Android? Somehow when I used other images(boot.img, for example) using the same method to package into an Odin flashable, Odin do not give the error. I have managed to create a working package of the system.img.ext4 before, but could not remember how I did it. Can someone point out what I did wrong?
This is what I did to dump the system.img.ext4(it's only 2400M because I have debloated the ROM, is this the problem?):
Code:
su
make_ext4fs -s -l 2400M -a system /storage/extSdCard/system.img.ext4 /system
This is what I did to create the Odin package:
Code:
tar -H ustar -c boot.img recovery.img system.img.ext4 > test.tar
md5sum -t test.tar >> test.tar
mv test.tar test.tar.md5
I also tried this when creating Odin package:
Code:
tar -c boot.img recovery.img system.img.ext4 > test.tar
md5sum -t test.tar >> test.tar
mv test.tar test.tar.md5
But both doesn't work. I realized when I only include boot.img or recovery.img or both(without system.img.ext4) and package these files the package passes Odin's MD5 check. Does anyone know what is the issue? Thank you very much!
Create custom Odin-flashable packages
Hello guys, today I show you how to create custom Odin-flashable packages.
The basic guide that I always used for any Samsung Android device comes from here.
First of all, this is an explanation of basic partitions which we can use to make a Odin package, what they are and filenames:
System: is the partition where the ROM is installed, stock filename is system.img.md5
[*]Cache: is the partition where temporary data is stored, like ART/dalvik cache of system apps, in stock (Samsung) ROM contains CSC too. Stock filename is cache.img.md5
[*]Data: is the partition where user's data, apps and Android settings are stored, stock filename is userdata.img.md5
[*]Hidden: is the /preload partition where the stock ROM has some other system apps, unneeded/useless on custom ROMs. Stock filename is hidden.img.md5
[*]Kernel: is the partition that, as name says, contains kernel. Stock filename is kernel.bin.md5
[*]Modem: is the partition that contains baseband firmware. Stock filename is modem.bin.md5
[*]ModemFS: is the partition that contains baseband firmware data. Stock filename is modemfs.img.md5
[*]IPL: another baseband's partition. Stock filename is ipl.bin.md5
Instead of *.md5 extension, you can use *.img as well!! For example, system.img, cache.img...
Note for Kernel: sometimes Odin has problems while flashing this device if you use boot.img instead of kernel.bin!!
I tried the same on my S4 and boot.img doesn't cause any issue, since in the firmware its kernel is called boot.img instead of kernel.bin.md5 as Galaxy S Advance!
Basic commands to make a Odin package on a Linux distro or on Windows through Cygwin are these:
Code:
tar -H ustar -c "INSERT .IMG OR .MD5 FILE/S HERE" > package_name.tar
md5sum -t package_name.tar >> package_name.tar
mv package_name.tar package_name.tar.md5
We want to make a flashable kernel:
Code:
tar -H ustar -c kernel.bin.md5 > kernel.tar
md5sum -t kernel.tar >> kernel.tar
mv kernel.tar kernel.tar.md5
We want to make a flashable modem (baseband FW) package:
Code:
tar -H ustar -c modem.bin.md5 modemfs.img (where available, also ipl.bin.md5) > modem.tar
md5sum -t modem.tar >> modem.tar
mv modem.tar modem.tar.md5
You can make any kind of package. Kernel, system... There's no limit!
Dump your current ROM
If you want to backup your current ROM in a Odin package to share or to be restored later.
You can backup with or without user data, apps and Android settings, let's see how!
Things needed:
Brain
Fingers
Rooted device
Terminal Emulator app
USB cable or MicroSD adapter
Dump ROM without personal data/apps/settings:
Do this in Terminal Emulator
Code:
su (to enable superuser)
dd if=/dev/block/mmcblk0p3 of=/storage/[COLOR="Red"]sdcard1[/COLOR]/system.img bs=4096
dd if=/dev/block/mmcblk0p15 of=/storage/[COLOR="Red"]sdcard1[/COLOR]/kernel.bin bs=4096
# This backups into MicroSD card, if you want to backup to internal storage, change [COLOR="Red"]sdcard1[/COLOR] with [COLOR="Red"]sdcard0[/COLOR]
# If you are dumping a stock or stock-based ROM (that uses /preload), add also:
dd if=/dev/block/mmcblk0p9 of=/storage/[COLOR="Red"]sdcard1[/COLOR]/hidden.img bs=4096
Dump ROM with personal data/apps/settings:
Do this in Terminal Emulator
Code:
su (to enable superuser)
dd if=/dev/block/mmcblk0p3 of=/storage/[COLOR="Red"]sdcard1[/COLOR]/system.img bs=4096
dd if=/dev/block/mmcblk0p4 of=/storage/[COLOR="Red"]sdcard1[/COLOR]/cache.img bs=4096
dd if=/dev/block/mmcblk0p5 of=/storage/[COLOR="Red"]sdcard1[/COLOR]/userdata.img bs=4096
dd if=/dev/block/mmcblk0p15 of=/storage/[COLOR="Red"]sdcard1[/COLOR]/kernel.bin bs=4096
# This backups into MicroSD card, if you want to backup to internal storage, change [COLOR="Red"]sdcard1[/COLOR] with [COLOR="Red"]sdcard0[/COLOR]
# If you are dumping a stock or stock-based ROM (that uses /preload), add also:
dd if=/dev/block/mmcblk0p9 of=/storage/[COLOR="Red"]sdcard1[/COLOR]/hidden.img bs=4096
Now transfer dumped files on PC.
Create Odin ROM package without personal data/apps/settings:
Code:
tar -H ustar -c system.img [COLOR="Red"]*hidden.img*[/COLOR] kernel.bin > package_name.tar
md5sum -t package_name.tar >> package_name.tar
mv package_name.tar package_name.tar.md5
*Only on stock/stock-based ROM
Create Odin ROM package with personal data/apps/settings:
Code:
tar -H ustar -c system.img cache.img userdata.img [COLOR="Red"]*hidden.img*[/COLOR] kernel.bin > package_name.tar
md5sum -t package_name.tar >> package_name.tar
mv package_name.tar package_name.tar.md5
That's all guys!!
If you have any question or trouble, feel free to ask
First....... Thank you so much i was just searching for something like that.
You made my day bro
I think that the sdcard1 should change to extSdCard? , that's the correct path for stock based ROM only i guess
LATEST EDIT: I tried to make a Harshjelly odin package, everything is fine until i start to flash it, it says NAND write failed @AntaresOne, any idea why?
[email protected] said:
I think that the sdcard1 should change to extSdCard? , that's the correct path for stock based ROM only i guess
LATEST EDIT: I tried to make a Harshjelly odin package, everything is fine until i start to flash it, it says NAND write failed @AntaresOne, any idea why?
Click to expand...
Click to collapse
Have you used kernel.bin.md5 as kernel?
AntaresOne said:
Have you used kernel.bin.md5 as kernel?
Click to expand...
Click to collapse
No, I just pull the kernel from the device which is the stock kernel, so in this case meaning that I should get cocore kernel which is already in .md5 extension?
[email protected] said:
No, I just pull the kernel from the device which is the stock kernel, so in this case meaning that I should get cocore kernel which is already in .md5 extension?
Click to expand...
Click to collapse
Yeah, CoCore is ok. I suggest to try some times with single components, in this way you can take confidence with the system