[Q] Modifying Samsung factoryfs.img - Android Q&A, Help & Troubleshooting

---------------------------------------------------------------------------------
I posted this in the hacking section by mistake. I hope to get some help by posting this in the correct Q&A section.
I have a Samsung Galaxy Player 70 Plus (YP-GB70D) which is sold in Korea only (got it secondhand from ebay). I cannot find any development of this player (or the Korean development team is not willing to share), particularly on installation of CWM. I would at least like to have this rooted. I did manage to find copies of the OEM firmware in TAR format.
I read about dsixda's Android Kitchen. I installed Virtualbox on my Windows 7 machine to run ubuntu 12. I successfully installed Kitchen and used it to modify my TAR firmware. I know that this player is not on the list supported by Kitchen, but the modification process seemed to complete smoothly.
I notice that the modified firmware is in ZIP format suitable for flashing with CWM (as I said there is no CWM for this player). I renamed this to "update.zip" and tried Samsung's 3e recovery, but it rejected it saying "verification fails".
Further research shows that I can unpack the factoryfs.img in the TAR firmware, and manually add su / superuser into the system folders, then repack it back into factoryfs.img and then the TAR firmware, and use ODIN or Heimdall to flash it to the player. I have also successfully installed EXT4_UTILS on ubuntu and used it to unpack the factoryfs.img into an ext4 image, and mounted the unpacked image using this command:
Code:
sudo mount -o loop output.img tempdir
Unfortunately, the mounted image only allows you to see the content of the image, and you cannot add / delete / change anything inside. I tried modifying the permission of the folder of the mounted image, but no luck.
When I look at the output from Kitchen and the mounted image, I notice they have all the identical system folders and files (except su and superuser added in the Kitchen output). Therefore, I copied the "system" folder from Kitchen output and repacked it into factoryfs.img with EXT4_UTILS, and replaced the original factoryfs.img of the OEM firmware with the modified version (I repacked the TAR using 7zip).
Unfortunately, when I flashed the modified TAR with ODIN (which detected the player without problem), it said "failed" and aborted. When I used Heimdall (which detected the player without problem), it gave me a "usblib error -12" message and aborted. I have tried unsintalling the "Samsung USB driver for mobile phone" and reinstalling the Heimdall driver from zadig.exe, but no luck.
My questions are:
(1) Is there a way to make the mounted ext4 image of the EXT4_UTILS read/writable, so that I can modify the content and add su / superuser to "bin"?
(2) Does ODIN check whether the firmware is original (OEM) or custom, and reject custom firmware? If not, why would my method of replacing the "/system" folder of the original factoryfs.img with that from the Ktichen output fail?
Thanks for helping a noob out.

As I said I used Kitchen to generate a CWM-flashable zip of the rooted version of the original firmware. I repeated the experiment, this time replacing both factoryfs.img (made from repacking the modified /system from Kitchen output using EXT4_UTILS tool) and zImage (instead of just the factoryfs.img) of the original firmware with those from the Kitchen output, then repacking the whole thing into TAR.
This time ODIN worked and completed the flashing of the customized TAR and the player rebooted into recovery for update. Unfortunately, it failed with some red error messages (too fast for me to read through before the player rebooted again).

I notice in Download Mode, the "custom firmware count = yes (1)". I wonder if this is the reason why I cannot flash anything other than official firmware, because the Samsung recovery is blocking unofficial flashing from ODIN and also Heimdall (therefore the "libusb error -12").
I found three versions of the official firmware, one of which is rooted and flashable with ODIN. I wonder how someone can sneak su into the firmware and repackage it to an official Samsung firmware?

Related

[Q] Cooking with Samsung Firmware

Hello:
I'm attempting to create a custom rom for my Samsung Galaxy S Vibrant. I've downloaded a firmware for my phone (UGJK3), but I've run into a small problem: Samsung doesn't seem to use the default "system.img, boot.img, etc" file structure, and instead uses various factoryfs.rfs, zImage, etc files.
I'm unable to cook my rom using the HTC android kitchen due to this problem: I'm required to have the *.IMG files in order to cook it.
I've mounted the .RFS files in linux, but it has gotten me no closer.
This problem is probably quite easy to fix, I'm just unsure where to start.
Any help is appreciated,
thanks.
It seems like other folks are making flashable zips. I just grabbed one and it's setup very similar to ours, although it appears that the kernel is done differently.
http://forum.xda-developers.com/forumdisplay.php?f=711
Existence. said:
Hello:
I'm attempting to create a custom rom for my Samsung Galaxy S Vibrant. I've downloaded a firmware for my phone (UGJK3), but I've run into a small problem: Samsung doesn't seem to use the default "system.img, boot.img, etc" file structure, and instead uses various factoryfs.rfs, zImage, etc files.
I'm unable to cook my rom using the HTC android kitchen due to this problem: I'm required to have the *.IMG files in order to cook it.
I've mounted the .RFS files in linux, but it has gotten me no closer.
This problem is probably quite easy to fix, I'm just unsure where to start.
Any help is appreciated,
thanks.
Click to expand...
Click to collapse
gnarlyc said:
It seems like other folks are making flashable zips. I just grabbed one and it's setup very similar to ours, although it appears that the kernel is done differently.
http://forum.xda-developers.com/forumdisplay.php?f=711
Click to expand...
Click to collapse
Yeah, I've noticed that, however I'd prefer to work with a kernal and ROM that is stock; that is, hasn't been modified at all. I was able to import a custom ROM into the kitchen that has already been modified (namely Doc's rom), but I view this as a learning experience, and would ideally like to de-odex, zipalign, remove bloatware, etc etc myself.
I'd imagine there would be a veary easy way to change this .tar file to a flashable zip, however I'm at a loss on how to do this.
If someone created a flashable, stock, UGJK3 rom, that would be different, and I'd be able to work with that.
Existence. said:
Yeah, I've noticed that, however I'd prefer to work with a kernal and ROM that is stock; that is, hasn't been modified at all. I was able to import a custom ROM into the kitchen that has already been modified (namely Doc's rom), but I view this as a learning experience, and would ideally like to de-odex, zipalign, remove bloatware, etc etc myself.
I'd imagine there would be a veary easy way to change this .tar file to a flashable zip, however I'm at a loss on how to do this.
If someone created a flashable, stock, UGJK3 rom, that would be different, and I'd be able to work with that.
Click to expand...
Click to collapse
Sure. I like to start with as close to stock or source if possible too. I'm just wondering if there's a how-to in the Vibrant forum or if those folks might know better than those of us who don't have Vibrants. I recently tried helping a friend to root his Vibrant and it was different enough for me to get lost.. .
gnarlyc said:
Sure. I like to start with as close to stock or source if possible too. I'm just wondering if there's a how-to in the Vibrant forum or if those folks might know better than those of us who don't have Vibrants. I recently tried helping a friend to root his Vibrant and it was different enough for me to get lost.. .
Click to expand...
Click to collapse
Yeah, I've already posted a thread in the Galaxy I9000 Q&A section of the forum, but to no avail (not the Vibrant section, as the T-Mobile US-variant differs from my Bell-based Vibrant). I was thinking, what if I install the UGJK3 stock rom on my phone, take a nandroid backup, then use the .IMG files in that backup in the kitchen?
Eh, it's worth a try. I'll see how it goes.
Existence. said:
Yeah, I've already posted a thread in the Galaxy I9000 Q&A section of the forum, but to no avail (not the Vibrant section, as the T-Mobile US-variant differs from my Bell-based Vibrant). I was thinking, what if I install the UGJK3 stock rom on my phone, take a nandroid backup, then use the .IMG files in that backup in the kitchen?
Eh, it's worth a try. I'll see how it goes.
Click to expand...
Click to collapse
okay so was there anything to report because i am on this trek myself at the moment and am looking for any pockets of air as i feel i am drowning in the ocean of dead ends!
Okay, I'm feeling kind today, so here goes:
SAMSUNG ODIN ROMS – Applies to Galaxy S and all derivatives (Vibrant, Captivate, etc)
For anyone unaware, ODIN is the Samsung equivalent of HTC’s RUU. Both are full ROMs containing the images, and both can only be installed via Windows. The ODIN ROMs can be used to restore a semi-bricked phone, that won’t boot to recovery or into the full OS, as all that is needed is Download mode. Download mode is simply accessed by unplugging the phone from the USB cable, holding the volume buttons and plugging in!
BEFORE YOU START, YOU WILL NEED:
- Windows & Relevant ODIN drivers (note – if you’re on 64 bit, you will need to disable signature enforcement on boot before ODIN will work)
- A Linux installation (possibly OS-X, but I haven’t written this guide for that)
So... Working on ODIN roms is a little different to typical ROM ‘cooking’ (I hate that term by the way... cooking can be applied to winzip warriors.. what we're doing here is a tad more technical).
1. First, flash the base ROM using ODIN. Be sure it is a pre-rooted version, or at least root it yourself after.
2. Install an FTP server app to the phone, and connect to it via your computer. It can be done using file managers and shell commands, but will take you ages.
3. Mount system as read write:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
4. Once you’ve found the issues/things you'd like to change, make the changes directly on the phone itself using FTP/filemanager/shell commands
Add custom boot, build.prop, sounds, fonts, whatever you want (SEE NOTES).
5. Once you’re happy with the build, it’s time to dump the necessary partitions to build the ODIN rom.
To do this, you will need to install a terminal emulator or use adb shell, and ensure the ROM has root access & SU. Let’s work on the assumption that if you’re reading this, you know roughly what you’re doing.
In terminal, type the following commands to dump the /system partition, cache (not necessary), zImage (kernel) and modem.bin (radio) to the INTERNAL SD Card:
su
dd if=/dev/block/stl9 of=/sdcard/factoryfs.rfs bs=4096
dd if=/dev/block/stl11 of=/sdcard/cache.rfs bs=4096
dd if=/dev/block/bml7 of=/sdcard/zImage bs=4096
dd if=/dev/block/bml12 of=/sdcard/modem.bin bs=4096
6. You’ll need to boot into your Linux machine/VM. The next step is to create the tarball of the dumped partitions. Do this by typing the following command into the Linux terminal:
tar -H ustar -c factoryfs.rfs cache.rfs modem.bin zImage > gals.tar
OPTIONAL:
7. Next, md5 it up, as ODIN can check the md5 before writing the image. Do this with the following command:
md5sum –t gals.tar >> gals.tar
mv gals.tar gals.tar.md5
8. Contratulations! That’s your ODIN flashable ROM.
9. You will need a PIT file in ODIN to flash this ROM. This can be obtained by Googling for it, or by asking me... or if you need to know how to make you’re own, it’s a piece of piss, just dump it in the same way as above.
su
dd if=/dev/block/bml2 of=/sdcard/FILENAME.pit bs=4096
More congratulations: you can now do the job of Samsung.
PS - please, oh please, can we stop calling it cooking?
You said:
nprussell said:
Add custom boot, build.prop, sounds, fonts, whatever you want (SEE NOTES).
Click to expand...
Click to collapse
Any chance you have a link to said notes? I would like to read further if they exist.
nprussel: How would you go about creating a CWM flashable version instead of Odin?
Edit: Found this guide, but it's geared towards creating an update.zip for specific purposes instead of for a full rom. Its there a way to automatically generate the update-script for a full stock rom? Maybe just by doing a nandroid backup like the OP suggested?
http://www.londatiga.net/it/how-to-create-android-update-zip-package
nprussell said:
Okay, I'm feeling kind today, so here goes:
SAMSUNG ODIN ROMS – Applies to Galaxy S and all derivatives (Vibrant, Captivate, etc)
For anyone unaware, ODIN is the Samsung equivalent of HTC’s RUU. Both are full ROMs containing the images, and both can only be installed via Windows. The ODIN ROMs can be used to restore a semi-bricked phone, that won’t boot to recovery or into the full OS, as all that is needed is Download mode. Download mode is simply accessed by unplugging the phone from the USB cable, holding the volume buttons and plugging in!
BEFORE YOU START, YOU WILL NEED:
- Windows & Relevant ODIN drivers (note – if you’re on 64 bit, you will need to disable signature enforcement on boot before ODIN will work)
- A Linux installation (possibly OS-X, but I haven’t written this guide for that)
So... Working on ODIN roms is a little different to typical ROM ‘cooking’ (I hate that term by the way... cooking can be applied to winzip warriors.. what we're doing here is a tad more technical).
1. First, flash the base ROM using ODIN. Be sure it is a pre-rooted version, or at least root it yourself after.
2. Install an FTP server app to the phone, and connect to it via your computer. It can be done using file managers and shell commands, but will take you ages.
3. Mount system as read write:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
4. Once you’ve found the issues/things you'd like to change, make the changes directly on the phone itself using FTP/filemanager/shell commands
Add custom boot, build.prop, sounds, fonts, whatever you want (SEE NOTES).
5. Once you’re happy with the build, it’s time to dump the necessary partitions to build the ODIN rom.
To do this, you will need to install a terminal emulator or use adb shell, and ensure the ROM has root access & SU. Let’s work on the assumption that if you’re reading this, you know roughly what you’re doing.
In terminal, type the following commands to dump the /system partition, cache (not necessary), zImage (kernel) and modem.bin (radio) to the INTERNAL SD Card:
su
dd if=/dev/block/stl9 of=/sdcard/factoryfs.rfs bs=4096
dd if=/dev/block/stl11 of=/sdcard/cache.rfs bs=4096
dd if=/dev/block/bml7 of=/sdcard/zImage bs=4096
dd if=/dev/block/bml12 of=/sdcard/modem.bin bs=4096
6. You’ll need to boot into your Linux machine/VM. The next step is to create the tarball of the dumped partitions. Do this by typing the following command into the Linux terminal:
tar -H ustar -c factoryfs.rfs cache.rfs modem.bin zImage > gals.tar
OPTIONAL:
7. Next, md5 it up, as ODIN can check the md5 before writing the image. Do this with the following command:
md5sum –t gals.tar >> gals.tar
mv gals.tar gals.tar.md5
8. Contratulations! That’s your ODIN flashable ROM.
9. You will need a PIT file in ODIN to flash this ROM. This can be obtained by Googling for it, or by asking me... or if you need to know how to make you’re own, it’s a piece of piss, just dump it in the same way as above.
su
dd if=/dev/block/bml2 of=/sdcard/FILENAME.pit bs=4096
More congratulations: you can now do the job of Samsung.
PS - please, oh please, can we stop calling it cooking?
Click to expand...
Click to collapse
Ok, so I'm trying to create a Factory Odin Flash for the Samsung Galaxy S Showcase.. (brother of the fascinate and Mesmerize)...
I've followed your instructions (step 5-9) to a T, using a Rooted Showcase...
But it fails..
Here the start of the Thread
This is the post of the guy that tested it HERE
Guys ANY info you can help me with this would be GREATLY appreciated, because as of now we have no way to get back to stock!!!
I'm trying to create an Odin Flash now using MY files. I'm on a deodexed PicknPack Rom/Voodoo Kernel. There's several people that have messed up phones and are simply trying to get on our network, so I'm hoping I can atleast help them with that..
Thanks in advance,
elijahblake
nprussell said:
Okay, I'm feeling kind today, so here goes:
SAMSUNG ODIN ROMS – Applies to Galaxy S and all derivatives (Vibrant, Captivate, etc)
For anyone unaware, ODIN is the Samsung equivalent of HTC’s RUU. Both are full ROMs containing the images, and both can only be installed via Windows. The ODIN ROMs can be used to restore a semi-bricked phone, that won’t boot to recovery or into the full OS, as all that is needed is Download mode. Download mode is simply accessed by unplugging the phone from the USB cable, holding the volume buttons and plugging in!
BEFORE YOU START, YOU WILL NEED:
- Windows & Relevant ODIN drivers (note – if you’re on 64 bit, you will need to disable signature enforcement on boot before ODIN will work)
- A Linux installation (possibly OS-X, but I haven’t written this guide for that)
Click to expand...
Click to collapse
Windows is not needed to flash ODIN packages. You can use an alternate open-source software called Heimdall, which is considered by many to be more stable than ODIN. Heimdall is available for Linux, MacOS, and yes even Windows. There is also a GUI, compiled for those platforms (except Linux 32-bit, have to do it yourself or use command-line. 64bit Linux has a compiled version of GUI available)
I have only needed Heimdall once so, but it was easy to use the command-line text from the example given-- I guess maybe I'll learn more complex bits as I soft-brick more times ;-)
The main difference seems to be that you uncompress the ROM archive first, but maybe they will add support for opening the archives (tar files) within Heimdall.
William
Linux FTW! (the others parts could prob be done on Windows somehow, but as our phones run Linux, everything needed is there or easier to install)
Is there a way to port an HTC rom to the vibrant or say the Galaxy Tab (preferred)?
There is a flavour of the Android Kitchen made for the Galaxy S, if you're lazy and/or need some hand-holding: ;-)
It's by RMGeren but still in a beta stage:
https://github.com/dsixda/Android-Kitchen/tree/galaxy_s
Just click on the "Downloads" link on the top right part of the page.
@nprussel: Thanks for that detailed guide!

Need proper 4.0US Full ROM

I know this has been posted but since it was long ago and *nobody replied*, here it is:
There are no FULL rom for the 4.0US. Of course you can use the bootloaders from the international version and the factory image that has been posted here, but both don't go without issues. The only stock image we have is the kernel from package2.3.5.
So to fix those issues, I am asking if one of you with stock rom could be so kind as to post a factory.rfs file and (this is including everybody) the other files (sbl, param, boot etc)
I don't think it matters if it is rooted or not (factory.rfs), I am looking at something that is *fully* functional. I'll provide you with tutorials, just ask for it
Thank you!
I'll be happy to post it but where do I look for the files so I can post it. And fyi I am running root stock atm
Sent from my YP-G70 using xda premium
Ben456 said:
I know this has been posted but since it was long ago and *nobody replied*, here it is:
There are no FULL rom for the 4.0US. Of course you can use the bootloaders from the international version and the factory image that has been posted here, but both don't go without issues. The only stock image we have is the kernel from package2.3.5.
So to fix those issues, I am asking if one of you with stock rom could be so kind as to post a factory.rfs file and (this is including everybody) the other files (sbl, param, boot etc)
I don't think it matters if it is rooted or not (factory.rfs), I am looking at something that is *fully* functional. I'll provide you with tutorials, just ask for it
Thank you!
Click to expand...
Click to collapse
You have a US YP-G1 no? You can make a dump of your partitions to make a recovery solution!
Ok, first, I was wrong, you have to be rooted. Then, either from adb from your computer or from a terminal emulator in your device, you have to type:
dd if=/dev/block/stl9 of=/sdcard/factoryfs.rfs bs=4096
No personal data is on this backup. This file can be flashed with heimdall so you can stop there or if you have linux, you can make a tar+md5 file to flash wth odin:
tar -H ustar -c factoryfs.rfs > package_name.tar
md5sum -t package_name.tar >> package_name.tar
mv package_name.tar package_name.tar.md5
if you don't have linux, just post factoryfs.rfs and i'll make it to a tar file.
Note: There may be other ways to do a an image without being rooted, I'll check if you are not rooted.
A HUGE THANKS!!
You have a US YP-G1 no? You can make a dump of your partitions to make a recovery solution!
Click to expand...
Click to collapse
No I can't since I have flashed my device with package2.3.5.tar that was posted here some time ago, which is the only working image we have to date, but there are some issues with this. I also can't post my boot loaders since I have flashed them with the international version. They work, but I can't enter recovery mode or download mode without a jig or access to an adb shell. All those flashes were made in the process of unbricking my device.
Hi Ben,
I had made a backup of my ROM before trying to install Steve's kernel. I used the same 'dd' command you mention in your instructions. The kernel install went OK, but when I ran CWM backup, I got into a boot loop and had to restore to the package_us2.3.5.tar.md5 that's been circulated around. This was a few weeks ago.
I've tried using the steps to run tar and md5sum on two separate Linux installs using my backup and have created what appears to be a valid .tar.md5 file, according to ODIN. But when I try to flash the .tar.md5 file, it passes MD5 checksum OK, ODIN reports NAND write start, but then fails immediately and I'm left with having to reflash package_us2.3.5.tar.md5 to get it to work again. Looking at my factory.rfs binary and comparing it to the factory.rfs in package_us2.3.5.tar.md5 seems to indicate that it's mostly similar, but there are binary differences. Headers look similar though.
So I'm not sure what I've done wrong in either (a) creating the backup image, or (b) creating the .tar.md5 file, or (c) flashing the .tar.md5 file. But the net result is that it won't flash successfully. So I don't think sharing my factory.rfs as it is will help you.
Here are some tips that my help troubleshoot issues.
1. The MD5 sum part is not neccessary, you can just put the factoryfs.rfs in a tarball and flash it.
2. You can loop mount a factoryfs.rfs in linux by creating an empty dir and running "mount -o loop -t auto factoryfs.rfs empty_dir"
3. It should be possible to reverse the dd command to restore the partition. ie "dd if=/sdcard/factoryfs.rfs of=/dev/block/stl9 bs=4096" (if I were going to do this I would use adb in recovery mode and root is required )
4. If you have a CWM backup, you should be able to to pull files out of the backup if you need to restore files manually. Files should be located on external sdcard in "clockworkmod/backup/"somedatestuff"/system.rfs.tar
It seems to me that what Ben456 wrote up there should have worked. Hope this helps.
I just learned how to dump my factoryfs.rfs file. This is dumped from my brand new Samsung Galaxy Player 4.0 (YP-G1CWY/XAA) right after I opened it from the box. It should be 100% clean.
I uploaded it here. Let me know if it works.
http://www.sendspace.com/file/6fzfdg
Here is the recovery rom I just uploaded. I really hope this works.
http://www.sendspace.com/file/1y2ogi
I created a thread for it here.

[Q] Flashing Stock Rom with Heimdall 1.3.2 on a Macbook 10.6.8

I'm trying to change the stock firmware on my unlocked unrooted international S3: I9300 to an official Samsung ROM downloaded from sammobile. The file I downloaded is called I9300XXDLJ4_I9300OXADLJ4_BTU. It's the UK unbranded firmware. The current firmware is on the phone is:
AP: I9300XXBLH3
CP: I9300XXLH1
CSC: I9300OPSBLH3
I have unzipped the file downloaded from Sammobile, which then gave me a tar.md5 file. So I change the file to just .tar, then unzipped that file. Inside that file I have:
boot.img
cache.img
hidden.img
modem.img
recovery.img
system.img
I then tried to use this tutorial on youtube called: How to Use Heimdall on Mac OSX to Install Kernels and ROMs!
When I open Heimdall on my MacBook, I plug my phone in (in download mode) and go to utilities, detect device, which it does. Then I save the PIT file on my desktop. I then go to the flash tab and browse for the PIT file, load that. Then when I go to add the files I don't have any files listed above called zimage or factoryfs etc, but also the Heimdell options doesn't have anything called kernal or the other ones anyway. My options in the partition name drop down box are:
Bootloader
Userdata
OTA
Hidden
System
Cache
Radio
Recovery
Boot
Param
EFS
BOTA1
BOTA0
MD5HDR
TZSW
The video says to match the files, but mine seems to have different names for things.
I have searched and read many forum posts on here and other sites. Can anyone tell me what I am doing wrong with either the unzipping or with Heimdall?
Thanks
Samsung hate apple....thats probably your problem
Sent from my GT-I9300 using xda premium
Thanks, but I only have access to a Mac. I did try my work computer, but it won't let me install any programs like Odin and drivers without Admin privileges.

Packaging an Odin ROM for size and consistancy

Hey guys.. Odin3 version3 and higher has gz support. I've been working with this for a bit and tonight I found that Odin will accept tar.md5.gz files. This is important for GNote2 users as the stock ROM is 1.2Gigs! You can get an extra 10-40% compression and 100% gaurantee that the files arrive to your users computer in the condition that you packaged them using this method. I have not found a guide on using the gz format so I thought I would write one up.
You will need:
A Linux computer
Your rom (we will call it MyROM)
How to package for Odin on Windows
I will cover packing into a single file, adding an MD5, and compressing the file down. For the purposes of this, we are working with "MyROM". You will want to call your ROM whatever you like. Just make sure to add version information to the file name so users don't get confused. Also note, the name MUST be consistent throughout the process. If you change the name, Odin can fail.
Another good tip is to put a model number in the name so there is no confusion as to what device your Odin package goes to. Several users, myself included, have 20+ Odin packages on their computer.
So first you want to turn the ROM into a single tar file and then make sure changes are written to the disk.
Code:
tar -H ustar -c boot.img hidden.img modem.bin param.bin recovery.img system.img tz.img sboot.bin>./MyROM.tar;sync;
Next we want to add an MD5 to the file so Odin can check its consistancy.
Code:
md5sum MyROM.tar >> MyROM.tar;
Now we will change it into a tar.md5 file so Odin knows it has an MD5 attached to it.
Code:
mv MyROM.tar MyROM.tar.md5; sync;
Finally we will compress it with GZip. GZip is the only compression method supported by Odin.
Code:
gzip MyROM.tar.md5 -c -v > MyROM.tar.md5.gz;
You will now have a file called MyROM.tar.md5.gz.
Conclusion
The first time the file is flashed, Odin will uncompress it into MyROM.tar.md5, then check its consistancy, then flash the file. Using this method you will be transferring the smallest file possible and adding integrity checks.
notes
Note to Verizon GNote2 users: Stay away from using Odin after IROM unlock as flashing a package intended for another device will perma-lock your device into another carrier's bootloaders. Especially stay away from GS3 as the displays are not compatible.
good ****! this is def useful
Awesome news! Any test results with the older versions? If not one click solutions may not benefit.. but servers and users will by cutting the downloads even more!
Sent from my SPH-L900 using Tapatalk 2
Windows OS
How can I do it on a Windows computer?
MAQ7 said:
How can I do it on a Windows computer?
Click to expand...
Click to collapse
Install Virtual Box and a Linux distribution. I haven't seen any tools for Windows that work properly to make tar archives that work with Odin.
cygwin.
Mine all work
imnuts said:
Install Virtual Box and a Linux distribution. I haven't seen any tools for Windows that work properly to make tar archives that work with Odin.
Click to expand...
Click to collapse
adrynalyne said:
cygwin.
Mine all work
Click to expand...
Click to collapse
I managed to make tar on Windows using cygwin :good:.
Thank you
Interesting adam, I always compressed the whole odin package into a rar file (same effect but one step extra). Also I made an article about odin a while ago:
http://broodplank.net/?p=496
Btw, did you know that you can put cwm backups (ext4.tar) inside an odin package? It's the first odin image I ever saw, filled with a CWM backup, and yes it works XD
But it's not an 1:1 copy of course, Also I wonder how nandroid backups actually store their permissions, I mean dd is a 1:1 dump, which is logical, cwm has the updater-script. but the nandroid backups which are actually just tar files packed with the contents, how do they store it?
Last thing, Odin packages can be a last resort fix, believe me, many users reported that flashing my rom broodROM_RC5.tar.md5 (which contains about 13 files, you can imagine how many partitions it includes) fixed their phone when nothing else worked.
So thank you Samsung for leaking your tool, A world with Samsung Kies only would be a very sad "softbricky" world
broodplank1337 said:
But it's not an 1:1 copy of course, Also I wonder how nandroid backups actually store their permissions, I mean dd is a 1:1 dump, which is logical, cwm has the updater-script. but the nandroid backups which are actually just tar files packed with the contents, how do they store it?
Click to expand...
Click to collapse
TAR files preserve file permissions.
I still like making a 7z out of the final .tar.md5 file.
The info in OP is great to know as it does save a step for the end user but I'd rather them take a couple steps to vet out the incompetent ones. Could prevent a brick
mrRobinson said:
I still like making a 7z out of the final .tar.md5 file.
The info in OP is great to know as it does save a step for the end user but I'd rather them take a couple steps to vet out the incompetent ones. Could prevent a brick
Click to expand...
Click to collapse
Only on the Verizon Galaxy Note. All others are IROM locked. The IROM lock prevents flashing of an improper SBOOT. An unlocked VZWGNote 2 can flash any SBOOT.
Other than this specific case, adding third party tools other than ZIP compression means your user must download special tools.
Extra files?
If I were to pack an extra README.txt file into the tar before prepping it for Odin, would Odin then ignore it during the flash? Obviously there's no entry for what to do with an extraneous text file in the pit, so hopefully Odin would just disregard it.
I happened to find out today that heimdall has support for "Heimdall Firmware Packages." You can read and write them from the heimdall frontend (the 1.3 FE binary is forward compatible with my source built 1.4 heimdall). What's interesting, is that the format is almost identical to odin's format. It is still packaged in a tar file, and it contains the same system.img, boot.bin, recovery.bin etc. files you'd find in the Odin tar. By default it's format is Package.tar.gz. The only significant difference is the addition of a firmware.xml file that identifies the proper partition for each image file, as well as the target platform, the author, and other details like that.
So I got curious. I took a Package.tar.gz file generated by heimdall, and repackaged it as a Package.tar.MD5.gz file. Heimdall has no problem reading this! So the upshot is, Odin now handles the .gz, so as long as Odin isn't bothered by an extra firmware.xml file inside the tar, the same format would be compatible with either tool.
PS> Don't flame me about flash counters or bricked phones. I do understand that Odin/Heimdall are only particularly relevant for returning a phone to stock, but that's still a very important functionality and it would be great to have a unified format.

Boot.img or system.img unpack / repack, different size, odin fails, no boot

Well, as the title sugests, I've tried to root my phone (Samsung Galaxy J1 SM-J100MU) and failed. Since no twrp or any other custom recovery is made for my specific model, I tried the method that involves mounting the android systems and modifying the famous build.prop, or putting su binaries inside the /system folder.
I ran an unpack script from ubuntu to decompress the boot file, and simg2img to be able to mount /system following some guides I've found, and made use of mkbootimg to repack it and flash it.
The thing is that the phone won't boot because the modified boot image size differs from the original. The system also differs but Odin won't even flash it and I'll have to reflash the stock rom.
Any ideas about what it can happen? I get no apparently errors during the process of unpacking/repacking the images so I don't know. The only thing I can think of is that the unpack script says something like "There's an extra file in ramdisk; though this file can exist, the script is not made for this type of ramdisk", so I edited the script in order to skip this warning, and everything else went well. The bootimg got unpacked and then the ramdisk and then I modified default.prop.
Well, that's it, I hope you can understand and give me some help in order to proceed.
Thank you in advance.

Categories

Resources