[UPDATE 22/08/12] ROM Cooking Guide (One Package) - Galaxy Ace S5830 Android Development

This is how I made ROM, I'll try to write the steps as simple as I can. For advanced users only!
Update 22/08/11:
Revised packaging steps.
Update 13/08/11:
Removed unwanted method for ROM cooking.
Update 04/08/11:
Modified extract and repack ROM guide and added extracting system.rfs guide.
Things you need:
Base firmware
Archiver software (7zip recommended)
Any Linux environment to build ROM or Cygwin
APK Manager to optimize and decompile *.apk files
MagicISO (Optional) if you want to extract system.rfs
And the last thing is... You need enough experience in android world
So, here is the steps to cook a ROM:
Flash your phone with your desired base firmware
Make required modifications
Pull system.rfs from your phone by running this command on adb shell or Terminal Emulator:
Code:
dd if=/dev/stl12 of=/sdcard/system.rfs
Extract any *.tar.md5 files from your base firmware to your working folder with 7zip
Replace the current system.rfs with your modified one
EDIT: Pack your ROM by running this code via terminal or just pack it with 7zip/WinRAR as *.tar
Code:
tar -H ustar -c * >> ROMNAME.tar
change ROMNAME to your desired, well, ROM name.
Here is (yet) useful guide to modify your ROM.
Extract system files on system.rfs to make modding easier:
Extract PDA file (*.tar.md5) files with 7zip
Open system.rfs with MagicISO
To extract it, just drag and drop
NOTE: Never edit your ROM with MagicISO because the file permissions will be ignored, use MagicISO only for extracting files from system.rfs
Deodex, and Zipalign (optimize) your ROM apk files:
Ready to use deodex + root for KPN: http://forum.xda-developers.com/showthread.php?t=1196230
Ready to use deodex + root for KPH and other firmware: http://forum.xda-developers.com/showthread.php?t=1118048
Open APK Manager
To zipalign your apk files, in apk manager folder /place-apk-here-to-batch-optimize put your:
framework-res.apk, twframework-res.apk and all system apk
but not these:
AxT9IME, Calculator, Camera, Email, MMS, Phone, Screen Capture, Settings, Swype, Thinkdroid, Voice search
Choose Choose option 15
Then choose both (zp)
Let it run and done.
Now put back the apk files where they belong in the ROM.
How to put these apk files to my ROM? Copy these files to appropriate locations, such as /system/app to your ROM's /system/app, and etc.
Another handy modification guide:
Unpack and repack boot.img - http://forum.xda-developers.com/showthread.php?t=1173427
Convert firmware filesystem to ext4 - http://forum.xda-developers.com/showthread.php?t=1202049
Overscroll glow for any firmware - http://forum.xda-developers.com/showthread.php?t=1215933"
Give thanks to all dev who made that possible!
If you have more guides to put here, please PM me.

Am I pertamax?
hehe..just kidding.
Nice Info....great share.

I would want the Fla.sh Rom :'(

Thats a gr8 share...Thank you...)

saiftheboss7 said:
I would want the Fla.sh Rom :'(
Click to expand...
Click to collapse
sorry... once again, I'm sorry, I can't continue my ROM

Helpful thread man!
Thanks!

Great job taking your time to make this! Unfortunately, i dont even know the basics but now I know where to check when I do

fla.sh said:
sorry... once again, I'm sorry, I can't continue my ROM
Click to expand...
Click to collapse
Hey!
THX man, nice thread. Very useful!
Just PM to MOD, that they close you previous thread, a bout fla.sh.ROM. Or ppl just waiting it and asking.
CHEERS!

i think the most troublesome problem i encounter is to repack system.rfs. yes it can be mounted in magiciso, but howto repack/compile it back?

an0nym0us_ said:
i think the most troublesome problem i encounter is to repack system.rfs. yes it can be mounted in magiciso, but howto repack/compile it back?
Click to expand...
Click to collapse
Just save it.

didnt work when i just save it. my device got bootloop

an0nym0us_ said:
didnt work when i just save it. my device got bootloop
Click to expand...
Click to collapse
What modification you've added to your ROM? Maybe that modification causing the problem...

fla.sh said:
What modification you've added to your ROM? Maybe that modification causing the problem...
Click to expand...
Click to collapse
As Linux, MagicISO read RFS image as a FAT filesystem. File permissions can not be maintained. A better way but need linux:
1. Mount system.rfs as FAT and mount it to /tmp/rfs
2. Make ext4 image, and mount it to /tmp/system
3. Copy /tmp/rfs contents to /tmp/system
4. Make modification inside /tmp/system
5. Fix file permissions inside /tmp/system
6. Umount both image
7. Make ODIN flashable image, contains system.rfs (now in ext4 format) and CF-Root-S5830 boot and recovery image (for ext4 support)
8. Boot to Windows and flash your new firmware using ODIN.

ketut.kumajaya said:
As Linux, MagicISO read RFS image as a FAT filesystem. File permissions can not be maintained. A better way but need linux:
1. Mount system.rfs as FAT and mount it to /tmp/rfs
2. Make ext4 image, and mount it to /tmp/system
3. Copy /tmp/rfs contents to /tmp/system
4. Make modification inside /tmp/system
5. Fix file permissions inside /tmp/system
6. Umount both image
7. Make ODIN flashable image, contains system.rfs (now in ext4 format) and CF-Root-S5830 boot and recovery image (for ext4 support)
8. Boot to Windows and flash your new firmware using ODIN.
Click to expand...
Click to collapse
I use this command to mount rfs:
Code:
mount -o loop system.rfs /some_dir
Can you share us the command?

now thats really informative. thanks

ROM unpacking and repacking gude has been corrected. Tested by me. If you have any problems, just ask here.
Thanks.

I think you should add the date of update in the title, so that everyone can know about the update...
BTW thanks for this amazing guide...
Love it!!!

After making changes to system.rfs, how to save it as .rfs again?

adiles said:
After making changes to system.rfs, how to save it as .rfs again?
Click to expand...
Click to collapse
Please take look at the first page, it's updated, you know?

After I created md5 file and selected it in odin, it says "invalid image type" and "invalid model binary". How to solve that? After that I continued, skipped these errors and flashed, my phone stopped at boot screen with text "Galaxy ACE....". Plz help me

Related

[Q] Making those NAND System.img files

Howdy all,
Just wondering, how are the system.img files made? I have read that if it's a YAFFS image file, that the maximum filesize cannot exceed 128MB. However, I've seen on some NAND HD2 Android builds, the system.img filesize is >128MB.
My question is, what method are you guys using for making the NAND system.img files to flash within MAGLDR? (ie. is it like a ZIP archive with a .img extension on it)
I'm currently working on a remix of a ROM that I use (a hint is in my Sig), and I know that the update.zip method that was used on "true-Android" devices to change ROMs doesn't apply to our MAGLDR method now.
Cheers and I'm sure you'll see another ROM for the HD2 in the coming weeks!
IcedCube.
IcedCube said:
Howdy all,
Just wondering, how are the system.img files made? I have read that if it's a YAFFS image file, that the maximum filesize cannot exceed 128MB. However, I've seen on some NAND HD2 Android builds, the system.img filesize is >128MB.
My question is, what method are you guys using for making the NAND system.img files to flash within MAGLDR? (ie. is it like a ZIP archive with a .img extension on it)
I'm currently working on a remix of a ROM that I use (a hint is in my Sig), and I know that the update.zip method that was used on "true-Android" devices to change ROMs doesn't apply to our MAGLDR method now.
Cheers and I'm sure you'll see another ROM for the HD2 in the coming weeks!
IcedCube.
Click to expand...
Click to collapse
The system.img is a yaffs2image. Google 'compiled windows unyaffs' use that program to take a peak inside the .img. When you're completely ready to make your own .img your gonna need a linux distro or cygwin w/mkyaff2image compiled. However I recomend compiling the mkfs.yaffs2 command if you are using linux. Alternatively you can place the /system/ directory you are trying to make an image on your SD and run that command in the terminal emulator in Android. It should look like this #mkyaffs2image /sdcard/system/ System.img
Hope that helps.
KillaHurtz said:
The system.img is a yaffs2image. Google 'compiled windows unyaffs' use that program to take a peak inside the .img.
Click to expand...
Click to collapse
Does this give you write abilities so that files can be changed out pre-flash?
dharvey4651 said:
Does this give you write abilities so that files can be changed out pre-flash?
Click to expand...
Click to collapse
I think you have to dump them to a folder, then you can change what you want. Then do the yaffs2 cmd and it will package it back up to .img for flashing...
Chris
noellenchris said:
I think you have to dump them to a folder, then you can change what you want. Then do the yaffs2 cmd and it will package it back up to .img for flashing...
Chris
Click to expand...
Click to collapse
I think that a tutorial is in order. Someone who knows how to extract and replace files in a system.img needs to write a short tutorial on how to do it. - A simple step by step on how to decompile a system.img and re-compile it.
I for one would be extremely grateful because I finally worked out a perfect MMS patch and I'd like to be able to easily modify the builds pre-flash.
dharvey4651 said:
I think that a tutorial is in order. Someone who knows how to extract and replace files in a system.img needs to write a short tutorial on how to do it.
I for one would be extremely grateful because I finally worked out a perfect MMS patch and I'd like to be able to easily modify the builds pre-flash.
Click to expand...
Click to collapse
I have been trying to do that all night. I can unpack them but haven't got around to repacking them. For now all I do is install the build and push the patched file that I have and do a AD hardrest in MAGLDR. MMS 300-1024k and all TMO US app works.
dharvey4651 said:
I think that a tutorial is in order. Someone who knows how to extract and replace files in a system.img needs to write a short tutorial on how to do it. - A simple step by step on how to decompile a system.img and re-compile it.
I for one would be extremely grateful because I finally worked out a perfect MMS patch and I'd like to be able to easily modify the builds pre-flash.
Click to expand...
Click to collapse
yeah, it would be very nice if smb can write some tutorial on modifying system.img files
i have been trying to figure this out too!
IcedCube said:
This is IcedCube, the Developer of GingerHD2, a Android 2.3 ROM for your HD2.
Click to expand...
Click to collapse
Thought I should point out that you could really confuse things by using that name...
http://forum.xda-developers.com/showthread.php?t=871387
That's not actually a Gingerbread build - it's just themed to look like one, but still got the same name
hnamanh said:
I have been trying to do that all night. I can unpack them but haven't got around to repacking them. For now all I do is install the build and push the patched file that I have and do a AD hardrest in MAGLDR. MMS 300-1024k and all TMO US app works.
Click to expand...
Click to collapse
Another option is to connect to ADB or Android Commander before going through the initial setup(when it asks you to choose your language) and change the files then - use the PC to reboot the phone, not the phone's built-in reboot. This should take you right back to the setup screen where this time, should show United States localization.
Still a bit too much work. I'd like to be able to patch the build, flash it, and be good to go.
found this but too educated for me
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
sorry i think this one is normal data img.not sure.
well i did say it was too educated for me
Turorial
KillaHurtz said:
The system.img is a yaffs2image. Google 'compiled windows unyaffs' use that program to take a peak inside the .img. When you're completely ready to make your own .img your gonna need a linux distro or cygwin w/mkyaff2image compiled. However I recomend compiling the mkfs.yaffs2 command if you are using linux. Alternatively you can place the /system/ directory you are trying to make an image on your SD and run that command in the terminal emulator in Android. It should look like this #mkyaffs2image /sdcard/system/ System.img
Hope that helps.
Click to expand...
Click to collapse
Windows
-----------------------------------------------------------------------------
Ok, let's start again. If you are using windows, google the said phrase above and you will find the precompiled utility 'unyaffs'.
Place the System.img you want to extract in a new directory with unyaffs.exe & drag the .img onto unyaffs. A command window will open and start extracting the files in the image to that same folder. You can now explore & edit/pull whatever you need to get things going. Once you have it the way you want copt it to your SD/root/ & make a folder for it with an obvious name like "Project" or "Test". Now to get it back into a bootable .img open Terminal Emulator in Android & enter the following
#mkyaffs2image /sdcard/NAMEofFOLDERuCHOSE/ System.img
**alternatively you can do this in windows itself if u have the utility compiled under cygwin or simular.
Linux
-----------------------------------------------------------------------------
Ok, you will need the unyaffs & mkfs.yaffs2 utilities compiled and working 1st off.
mkyaffs2image works to make the image however it fails upon flash with DFT Android Flasher. So I recomend mkfs.yaffs2 & have included it, you will need to place it in /usr/sbin/. If you have trouble copying it open a terminal and run "gksudo nautilus" then copy to the above mentioned directory.
**Now that those utilities are working let's get to work.
open a terminal and run 'unyaffs /home/yourusername/Desktop/targetdirectory/targetimage.img
copy/edit/pull the files you want. When your ready to build the image you are happy with open a terminal and run 'mkfs.yaffs2 /home/yourusername/Desktop/targetdirectory/ System.img'
Now your ready to flash !
System.img & Boot.img Contents
============================================================
System.img contains the entire root/system/ directory in Android
System/
app
bin
etc
fonts
framework
lib
lost+found
media
usr
xbin
build.prop
dmesg.txt
Boot.img contains
Boot/
initrd.gz
zImage
lost+found
============================================================
Hope that helps guys, It's my first tut on XDA
**EDIT: I included an archive for windows users that has unyaffs2.exe & cygwin1.dll
The Linux archive contains mkfs.yaffs2.x86, once moved to /usr/sbin/ rename to mkfs.yaffs2
The process works exactly the same for Boot.img
you need linux and run command by terminal
put them in /bin
http://www23.zippyshare.com/v/13814384/file.html
then you can yaffs or unyaffs
example
unyaffs /home/rafpigna/folder_with_img_you_wann_unpack/system.img
or
mkyaffs2image /home/rafpigna/folder_with_stuff_you_wanna_pack/ system.img
strange thing...when I open with unyaffs and then close with mkfs.yaffs2 or mkyaffs2image I get init: untracked pid 250 exited (where 250 varies) in a loop :S
some light for me?
michyprima said:
strange thing...when I open with unyaffs and then close with mkfs.yaffs2 or mkyaffs2image I get init: untracked pid 250 exited (where 250 varies) in a loop :S
some light for me?
Click to expand...
Click to collapse
What platform are you using? Have u tried copying your target directory to your sdcard and running the command in android's terminal?
Reguards
KillaHurtz said:
What platform are you using? Have u tried copying your target directory to your sdcard and running the command in android's terminal?
Reguards
Click to expand...
Click to collapse
linux x64.
btw no I didn't, because I want to make a rom (I'm not new to android development but that makes me think that I'm probably stupid )
Everything I do doesn't work.
Already tried something like:
- opened a premade working rom, exchanged just app and framework: no way
- exchanged everything but not bin/xbin/lib: no way
- exchanged just what was different between a stock and a premade leo rom: still no way
mmmh...
yaffs2
There is actually a way to modify files in a yaffs2 image but I've not done it my self yet. I'm 100% sure it's possible cuz everything is possible.... under Linux of course.
You need:
Linux, compiling skills, mounting skills, etc.
Basically for any other filesystems you can mount them as loop devices but not yaffs2. For yaffs2 you actually need a virtual mtd block device. once you have the mtd device you can mount the yaffs image on it.
For details google for: mounting yaffs image
and focus on virtual mtd block device.
michyprima said:
linux x64.
btw no I didn't, because I want to make a rom (I'm not new to android development but that makes me think that I'm probably stupid )
Everything I do doesn't work.
Already tried something like:
- opened a premade working rom, exchanged just app and framework: no way
- exchanged everything but not bin/xbin/lib: no way
- exchanged just what was different between a stock and a premade leo rom: still no way
mmmh...
Click to expand...
Click to collapse
http://www.miui-dev.com/forums/showthread.php?481-Howto-Make-your-own-Android-Build-for-the-HD2
This has a list of files to be pulled. Hope this helps. BTW michy I need help with a kernel, know anyone?
I'm Having a problem using on Linix, when i use the unyaffs trough the terminal it extracts the rom but not the squashed contents, which in the main apps and frame work are at on thoughs roms. I do get a file that says squashed but empty. I tried on cyanogens 6.1 rom and everything extracted fine.but that rom does not have a squashed folder, am i doing something wrong?
1. If i unyaffs System.img and manually remove some programs/aplications then create System.img with yaffs, does it programs will appear in apps and does my rom will be caused a more memory for other programs for installation?
2. Is it possible to unyaffs Boot.img then replace zimage with newest kernel like MDJ or hastarin then yaffs to new Boot.img, After that i suppose then this Android OS will be on new kernel???
3. And... If i remove zimage and initrd.gz from Boot.img, create new Boot.img without these two files and these two files copy to SD card and define that two files in flash.cfg for find on SD. Does it works?
Sorry for bad English.

[Q] Couple of questions about ROM development

Hello!
First of all, thanks to all you repliers!
I'd really like to know a few things creating a ROM:
1. how can I create an update.zip starting from a system.img? (I know how to sign) In case can I simply install the img and then push /system changes, like root or busybox?
2. how can I install busybox manually? Can I create a script which does the job for me (i.e. busybox --install command at first boot then delete the script itself), avoiding me to write loads of symlinks?
3. when I've created an update.zip, is it easy to root the ROM? I mean, just push su and SuperUser.apk? Or I need a particular boot.img?
Thanks
elegos said:
Hello!
First of all, thanks to all you repliers!
I'd really like to know a few things creating a ROM:
1. how can I create an update.zip starting from a system.img? (I know how to sign) In case can I simply install the img and then push /system changes, like root or busybox?
Click to expand...
Click to collapse
Clockwork Recovery won't install system image files for some reason. You'll need to dump the yaffs2 filesystem then zip it up into the update.zip, then use an updater-script to set unix permissions (zip doesn't preserve these). Also, there's no need to sign the update.zip. It's only meaningful to the device's firmware if it is signed by the device's manufacturer.
elegos said:
Hello!
2. how can I install busybox manually? Can I create a script which does the job for me (i.e. busybox --install command at first boot then delete the script itself), avoiding me to write loads of symlinks?
Click to expand...
Click to collapse
Certainly. You can add a script and call it from updater-script during the install.
elegos said:
Hello!
3. when I've created an update.zip, is it easy to root the ROM? I mean, just push su and SuperUser.apk? Or I need a particular boot.img?
Thanks
Click to expand...
Click to collapse
Boot image is irrelevant to a properly rooted system. Just adding SuperUser should be sufficient.
That's cool!
1. as of the system.img, I see there is a system folder too - is that just enought zipping it?
2. may you please tell me how to call a script within an edify updater-script please?
3. thanks
I don't understand. You have a system.img and a system folder? In what? What are you starting from? If you use a zipped system, you WILL need to set unix permissions, symlinks and modes as these are NOT preserved in a zip file.
As far as calling scripts, something like this:
run_program PACKAGE:installbusybox.sh

[Q] How to change the initrd.gz boot image?

Hi guys,
Can anyone explain me how to change the boot image contained in initrd.gz?
Thank you vary much...
erestor6 said:
Hi guys,
Can anyone explain me how to change the boot image contained in initrd.gz?
Thank you vary much...
Click to expand...
Click to collapse
+1 for this, I'm trying to do the exact same thing! Check out this post to create the image in the correct format:
http://forum.xda-developers.com/showthread.php?t=537515
I created a logo.rle image from a 480x800 image (both attached) but don't know how to overwrite the one inside my initrd.gz file. I tried using 7zip but it seems that it is write-protected. If anyone knows how to do this, it would be much appreciated. I've changed all of the other boot screens but just want to change the green HTC logo if I can.
Thanks in advance
gargon01 said:
+1 for this, I'm trying to do the exact same thing! Check out this post to create the image in the correct format:
http://forum.xda-developers.com/showthread.php?t=537515
I created a logo.rle image from a 480x800 image (both attached) but don't know how to overwrite the one inside my initrd.gz file. I tried using 7zip but it seems that it is write-protected. If anyone knows how to do this, it would be much appreciated. I've changed all of the other boot screens but just want to change the green HTC logo if I can.
Thanks in advance
Click to expand...
Click to collapse
thank you very much..but I was arrived at that poit.
In second of me the normal procedure is wrong, there wil be some steps that will be immediate and that we don't know.
help please...
Yeah - now it's working on my HD2!
This method is applicable for firmware, which include the file initrd.gz in zip archive. Many firmwares are distributed as img files, and I have not tried to extract initrd.gz from there, though perhaps it is possible.
The file logo.rle is not the usual rle and programs for creating or convert rle can not create it, also You can not view logo.rle by any usual rle-viewer. I took logo.rle from another firmware, because I could not do it (it can be reached by 7zip from initrd.gz; or copied from root directory after boot by root explorer, if firmware is already installed).
For this process Linux on a PC required - terminal emulator on phone doesn't work correctly! I used Chaox Live CD because I use Windows on my PC.
I put the file initrd.gz (from my firmware) in a folder and the new logo.rle file near this folder. In a Linux terminal I entered to that folder (by command cd) and ran the commands:
gunzip initrd.gz
cpio -i < initrd
cp -f ../logo.rle
rm initrd
find . | cpio -o -H newc | gzip > ../initrd.gz
Than I change the original initrd.gz in the firmware to the one I created.
ps: Not necessarily replace the entire firmware to replace the file initrd.gz. You can replace only a boot partition. To do this, take the original files boot/zImage & META-INF/com/google/android/updater-script from the firmware and add Your own boot/initrd.gz & META-INF/com/google/android/updater-script. Now You can zip it and place the archive to the root of the sdcard. Than enter to MAGLDR-ADrecovery-install zip from sdcard
Archive must contain this 4 files with pathnames:
boot/initrd.gz
boot/zImage
META-INF/com/google/android/update-binary
META-INF/com/google/android/updater-script
file updater-script must containe this commands:
mount("MTD", "boot", "/boot");
package_extract_dir("boot", "/boot");
unmount("/boot");
In my case I use this firmware and logo.rle file from this firmware.
Hope it's will be helpfull!
I'm sorry - english is not my language.
Awesome work, vovchok!
However after reading your sequence of 'nix commands multiple times I have determined that the little white guy doesn't look bad at all.
My momma's boy ain't touching that.
I found this Thread . After reading, I landed here. Now this is where I just got stuck.
I'm using Hyperdroid and there is no initrd.gz. There's just a "boot.img" with ~3mb.
I still would like to change my second boot screen to fit in the boot sequence.
(I already mastered to create my own 1st bootscreen, flashed it, and changed my boot animation, but as said, I got stuck here finding a guide how to change the second boot screen.)
Any ideas?
smeee_again said:
I found this Thread . After reading, I landed here. Now this is where I just got stuck.
I'm using Hyperdroid and there is no initrd.gz. There's just a "boot.img" with ~3mb.
I still would like to change my second boot screen to fit in the boot sequence.
(I already mastered to create my own 1st bootscreen, flashed it, and changed my boot animation, but as said, I got stuck here finding a guide how to change the second boot screen.)
Any ideas?
Click to expand...
Click to collapse
Yeah - it's a lot more complicated to extract the initrd.gz file from a boot.img than it is from a ROM with a boot partition. I spent many hours trying to do it, and failed.
Currently just building a ROM with an edited initrd.gz file inside it. I know that the logo.rle file in the initrd.gz file is the correct image that I want (the stock white HTC screen) but I just don't know if I'm building the ROM with the correct options (using the Android Kitchen).
I'll report back with results, because I tried to do this a couple of months ago and failed, since the ROM required me to flash a separate kernel zip after the main ROM, which replaced initrd.gz, and I couldn't edit the initrd.gz file using the Android Kitchen because it was in a boot.img.
EDIT: Okay, just spent about 2 hours trying to change the damn image, having replaced initrd.gz with what was definitely the right one, and I boot it up and see the black HTC logo.
Alright, I've actually successfully modified the logo.rle file from inside a boot.img, rebuilt the ROM with it, and reflashed it - the image is now in place, and the ROM works great.
So, the steps:
Use dsixda's Android Kitchen to unpack the ROM into a working folder.
Locate the boot.img and copy it to a separate folder.
Follow this tutorial to unpack the boot.img file, then locate the logo.rle inside there (there's no initrd.gz).
Use the tools found here to convert the image that you want to use to an RLE file, and then overwrite the existing RLE file in your working directory where you unpacked the boot.img.
Continuing the tutorial found in the link from step 3, repack your boot.img with the edited logo.rle now inside it.
Head back to your working folder in the Android Kitchen, where the ROM that you want to modify has been unpacked. Replace the boot.img there with the one that you just modified.
Choose option 99 in the kitchen to build a ROM from the working folder, and follow the steps.
Now flash your ROM in CWM! I flashed straight over an existing installation instead of wiping etc., although it did still get rid of all my settings
Hopefully this is helpful to someone. I might post it in a new thread - since I spent so long trying to find this, and finally figured out how to do it for myself.
This helped a lot. Thanks.
ryan1990 said:
This helped a lot. Thanks.
Click to expand...
Click to collapse
No worries. If anyone ever gets stuck or doesn't know what I did for some bit, let me know and I'll see if I can help, because it sucked when I was trying to figure this out for ages and nobody else seemed to know how to do it either.
vovchok said:
Yeah - now it's working on my HD2!
gunzip initrd.gz
cpio -i < initrd
cp -f ../logo.rle
rm initrd
find . | cpio -o -H newc | gzip > ../initrd.gz
Hope it's will be helpfull!
I'm sorry - english is not my language.
Click to expand...
Click to collapse
search for long time, now work fine.
THX bro.
vovchok said:
Yeah - now it's working on my HD2!
This method is applicable for firmware, which include the file initrd.gz in zip archive. Many firmwares are distributed as img files, and I have not tried to extract initrd.gz from there, though perhaps it is possible.
The file logo.rle is not the usual rle and programs for creating or convert rle can not create it, also You can not view logo.rle by any usual rle-viewer. I took logo.rle from another firmware, because I could not do it (it can be reached by 7zip from initrd.gz; or copied from root directory after boot by root explorer, if firmware is already installed).
For this process Linux on a PC required - terminal emulator on phone doesn't work correctly! I used Chaox Live CD because I use Windows on my PC.
I put the file initrd.gz (from my firmware) in a folder and the new logo.rle file near this folder. In a Linux terminal I entered to that folder (by command cd) and ran the commands:
gunzip initrd.gz
cpio -i < initrd
cp -f ../logo.rle
rm initrd
find . | cpio -o -H newc | gzip > ../initrd.gz
Than I change the original initrd.gz in the firmware to the one I created.
ps: Not necessarily replace the entire firmware to replace the file initrd.gz. You can replace only a boot partition. To do this, take the original files boot/zImage & META-INF/com/google/android/updater-script from the firmware and add Your own boot/initrd.gz & META-INF/com/google/android/updater-script. Now You can zip it and place the archive to the root of the sdcard. Than enter to MAGLDR-ADrecovery-install zip from sdcard
Archive must contain this 4 files with pathnames:
boot/initrd.gz
boot/zImage
META-INF/com/google/android/update-binary
META-INF/com/google/android/updater-script
file updater-script must containe this commands:
mount("MTD", "boot", "/boot");
package_extract_dir("boot", "/boot");
unmount("/boot");
In my case I use this firmware and logo.rle file from this firmware.
Hope it's will be helpfull!
I'm sorry - english is not my language.
Click to expand...
Click to collapse
Thz for your help^^
The rom i am using hvn't boot.img.
but i can find initrd.gz and i hv change the logo.rle.
the probllem is how to edit the updater-script only update the initrd.gz?
and is it possible to random boot a few of .rle files ?
Please, make initrd.gz for CM9ight
Oops, not the right thread.

[6045*] [TWRP] custom recovery 2.8.7.0

TWRP 2.8.7.0 custom recovery
thanx to user @Unjustified Dev we have TWRP custom recovery for our phone.
download HERE
So anyone who download the TWRP should send him a dollar for beer or at least thank him!
Of course you do everything on your own!
To test before installation (linux users need sudo before fastboot):
Code:
fastboot -i 0x1bbb boot twrp-2.8.7.0-idol3.img
To install (linux users need sudo before fastboot):
Code:
fastboot -i 0x1bbb flash recovery twrp-2.8.7.0-idol3.img
!BEFORE YOU START, PLEASE READ THIS!
And don´t forget to thank Famewolf for the tutorial, because this could save your phone when something go bad!​
Thanks, tried it. It worked.
I also just installed SU directly, bypassing the previous root thread.
1. Download the .zip package from here: https://download.chainfire.eu/696/SuperSU/UPDATE-SuperSU-v2.46.zip
2. Put it on the root of my SD card.
3. In TWRP click install and find the .zip.
Wonderful. Just a question: is this recovery for Idol 3 4.7 (6039) or 5.5 (6045) ?
Gynoid said:
Wonderful. Just a question: is this recovery for Idol 3 4.7 (6039) or 5.5 (6045) ?
Click to expand...
Click to collapse
It's for 6045. For 4.7 TWRP, see this post: http://forum.xda-developers.com/showpost.php?p=61976520&postcount=18
Thanks!
is it functional for backing up our system in TWRP?
@DallasCZ could you please provide the original link to TWRP. That was a bit unfair to upload it elsewhere as I tend to track the number of downloads.
Sent from my LGMS395 using Tapatalk
gecko702 said:
is it functional for backing up our system in TWRP?
Click to expand...
Click to collapse
Yes although to my knowledge noone has actually done a restore yet. He's fixing some minor bugs and will be releasing a new version at some point.
famewolf said:
Yes although to my knowledge noone has actually done a restore yet. He's fixing some minor bugs and will be releasing a new version at some point.
Click to expand...
Click to collapse
i am in touch with the dev and allready downloading the new build..will be soon on my google drive
Unjustified Dev said:
@DallasCZ could you please provide the original link to TWRP. That was a bit unfair to upload it elsewhere as I tend to track the number of downloads.
Sent from my LGMS395 using Tapatalk
Click to expand...
Click to collapse
sorry, i corrected the link...
Convert TWRP Backup into flashable rom zip
I found these instructions that explain how to take a TWRP backup and turn it into a flashable zip file. This would allow someone to create a "factory" rom pre-rooted to be flashed.
For TWRP Backup
Transfer the TWRP backup from Phone to PC.
You’ll see a file named system.ext4.win which is the System partition backup of your device. Rename it to system.ext4.tar (Changing its extension from .win to .tar)
Extract the system.ext4.tar using an archive software like Winrar or 7zip.
If your TWRP backup is not in compression mode, you will directly get the system folder, else you will get a file named system.ext4, which should be renamed again to system.ext4.tar and extract it to get the system folder.
Take the boot.emmc.win file and rename it to boot.img.
Now collect a META-INF folder from any custom ROM which is made for your device. Make sure you get the correct Meta-Inf folder, else the Zip won’t work and might worsen the condition of your device.
Select the META-INF, System folders and the boot.img and right click your mouse and select add to Archive.
In the Archive settings, choose the extension of the compressed file as Zip (Make sure of this part)
Now you can use this Zip file to flash it on your Custom recovery.
we dont have the meta-inf folder...there is one in the update i got, but i dont know if this id the right one.
and we dont have custom rom to get meta-inf from.
also the main thing is, that i cannot unpack the system win file when renamed to .tar i dunno why (i got latest 7-zip app).
DallasCZ said:
we dont have the meta-inf folder...there is one in the update i got, but i dont know if this id the right one.
and we dont have custom rom to get meta-inf from.
also the main thing is, that i cannot unpack the system win file when renamed to .tar i dunno why (i got latest 7-zip app).
Click to expand...
Click to collapse
What they primarily want is the "update-binary" which is device specific. I don't remember if the update had one....I did take apart an update-supersu.zip and it uses a script as it's update binary...thought about trying to convert that. Theoretically you could take a meta-inf for another device's rom...and use it's meta-inf making sure to replace the update-binary. It also has an installer script that tells it to mount system and data....extract files from the zip and where to put them. I learned a bit when I was trying to make an update.zip to fix my build.prop.
It untar'd fine for me on my linux pc:
[email protected]:/workarea/android/idol3/TWRP/BACKUPS/408adcbe/1970-01-01--22-28-53_LRX22G_release-keys/work > tar -xvf ../system.ext4.win000
tar: Removing leading `/' from member names
/system/app/
/system/app/AntHalService/
/system/app/AntHalService/AntHalService.apk
/system/app/AntHalService/arm64/
/system/app/AntHalService/arm64/AntHalService.odex
/system/app/BasicDreams/
/system/app/BasicDreams/BasicDreams.apk
/system/app/BasicDreams/arm64/
/system/app/BasicDreams/arm64/BasicDreams.odex
/system/app/Bluetooth/
/system/app/Bluetooth/Bluetooth.apk
/system/app/Bluetooth/arm/
/system/app/Bluetooth/arm/Bluetooth.odex
famewolf said:
What they primarily want is the "update-binary" which is device specific. I don't remember if the update had one....I did take apart an update-supersu.zip and it uses a script as it's update binary...thought about trying to convert that. Theoretically you could take a meta-inf for another device's rom...and use it's meta-inf making sure to replace the update-binary. It also has an installer script that tells it to mount system and data....extract files from the zip and where to put them. I learned a bit when I was trying to make an update.zip to fix my build.prop.
It untar'd fine for me on my linux pc:
[email protected]:/workarea/android/idol3/TWRP/BACKUPS/408adcbe/1970-01-01--22-28-53_LRX22G_release-keys/work > tar -xvf ../system.ext4.win000
tar: Removing leading `/' from member names
/system/app/
/system/app/AntHalService/
/system/app/AntHalService/AntHalService.apk
/system/app/AntHalService/arm64/
/system/app/AntHalService/arm64/AntHalService.odex
/system/app/BasicDreams/
/system/app/BasicDreams/BasicDreams.apk
/system/app/BasicDreams/arm64/
/system/app/BasicDreams/arm64/BasicDreams.odex
/system/app/Bluetooth/
/system/app/Bluetooth/Bluetooth.apk
/system/app/Bluetooth/arm/
/system/app/Bluetooth/arm/Bluetooth.odex
Click to expand...
Click to collapse
i allready build some roms for my older device, so i know what it is about.
For the proper rom zip you have to make the updater script with all the simlinks and metadata ...in the latest update there were no simlinks in the updater script...
without them you can brick your phone.
for example simlinks from 4.4.2 Os from zte V5
Code:
symlink("/data/misc/audio/mbhc.bin", "/system/etc/firmware/wcd9306/wcd9306_mbhc.bin");
symlink("/data/misc/audio/wcd9320_anc.bin", "/system/etc/firmware/wcd9306/wcd9306_anc.bin");
symlink("/persist/WCNSS_qcom_cfg.ini", "/system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini");
symlink("/persist/WCNSS_qcom_wlan_nv.bin", "/system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin");
symlink("/system/lib/modules/pronto/pronto_wlan.ko", "/system/lib/modules/wlan.ko");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("libGLESv2.so", "/system/lib/libGLESv3.so");
symlink("mksh", "/system/bin/sh");
this you cannot copy from another device....
Never mind. I installed the second build.
How do I boot into the custom recovery? Is it power up + power button on the Idol 3?
Acreo Aeneas said:
Never mind. I installed the second build.
How do I boot into the custom recovery? Is it power up + power button on the Idol 3?
Click to expand...
Click to collapse
Reboot or power on till you see the alcatel screen pop up....right away hold down up arrow and it should go into recovery.
Thank you so much...been waiting for this....
so now let ROM's start pouring in )))))))
Hmm odd. I had to reflash it. For some reason it didn't take the first time I flashed the second build TWRP to my Idol 3.
What partitions should I backup using TWRP? I'd assume: Boot, System, and Data? Should I include System Image too?
Acreo Aeneas said:
Hmm odd. I had to reflash it. For some reason it didn't take the first time I flash the second build TWRP to my Idol 3.
What partitions should I backup using TWRP? I'd assume: Boot, System, and Data? Should I include System Image too?
Click to expand...
Click to collapse
The default of boot, system and data should be fine for personal use however if you have not yet rooted please read here first! http://forum.xda-developers.com/idol-3/help/want-to-able-to-install-ota-updates-t3163745
So Awesome! best looking twrp Ive seen yet xD. Also, works well too. I havent tested backing up data, but I did a successful restore of the system and boot So far so good!

[GUIDE]How to extract /system from Samsung S7 OTA/FW in Windows without a Phone

This is a complete working guide on how to extract the /system partition from a Samsung S7 FW/OTA package using Windows (This is the same package one might flash to their phone with ODIN.) You can get this FW/OTA package from sites like Samsung-Firmware.org & SamMobile.com. It is very likely this works (or parts of it duct-taped together ) on other Phone models,etc, but I vouch that this guide works on the Samsung S7. Please chime in if it works on other models & brands!
Intro:
I found a LOT of guides similar to this, but couldn't get any to work with the Samsung S7 packages! And there are MANY different versions of the tools I mention below, many not working! So be sure to use the tool versions I post below. Over much time, it was a tiny step with each new attempt until I finally got it...& wanted to share!
Purpose:
Why would anyone want to do this? If you're reading this thread and don't know the answer to that, then I'm confused But I'll answer anyway - What is the purpose of this thread?
You would want to do this because you're a ROM Developer and don't want to have to go through the time & trouble of installing an OTA, then do a dd/cat to get the system image, etc. (With this method you don't even need a phone, just a PC!)
You are using a custom ROM, but want a stock app; for example the custom ROM you're using has the Google Dialer/Phone app builtin, but you prefer the stock Samsung Phone. Doing the steps outlined here will yield a "system" folder in Windows that you can simply navigate to /system/app or /system/priv-app and copy over the apk to your phone and install it! (via ADB or phone File manager app, etc). Obviously not all apks will work. Or maybe you want the libraries from another phone OTA package in order for an apk to work, and so on...
You are just curious what's in the /system partition for an OTA package!
Tools:
7-Zip
LZ4
simg2img: "Clone or download"->Download ZIP
Ext2Explore (Same as Ext2Read)
Guide:
Download FW/OTA (TMB-G930TUVU4CRI2.zip) from SamMobile website (or whereever)
Use 7zip to extract TMB-G930TUVU4CRI2.zip to a folder
Use 7zip to extract AP_G930TUVU4CRI2*.tar.md5 to a folder (ignore "There is no correct record at end of archive" error)
Use lz4 to extract system.img.ext4.lz4 -> system.img.ext4
lz4 system.img.ext4.lz4​
Extract simg2img_win-master.zip -> \simg2img_win-master\
Copy system.img.ext4 to \simg2img_win-master\ folder
Rename system.img.ext4 -> system.img
Use simg2img_win-master to convert system.img -> system.ext4.img
Double-click convert.bat (or run in cmd prmpt) (This will take a few minutes)​
Create new folder to save contents in, eg: "C:\System"
Use ext2explore to mount system.ext4.img: Open ext2explore->File->Open Image->Select system.ext4.img
Click Save icon->Save to your new folder, eg: "C:\System"
Wait for it to extract. Once complete, enjoy!
Links & Useful Resources:
Tmobile Versions: https://support.t-mobile.com/docs/DOC-30276
Search Keywords:
(This section is here so this thread comes up in searches for the many errors I came across while trying to get this to work in both Windows & Linux. That's right! I tried in both OSs and actually got it to work first in Windows... & yet to get it to work in Linux!)
- losetup /dev/loop2 /media/sf_Share/system.img.ext4 ->warning file does not fit into 512-byte sector; the end of the file will be ignored
- mount /dev/loop2 /mnt/mysystem2 -> mount: /mnt/mysystem2: cant read superblock on /dev/loop2
- mount -t ext4 /media/system.img /mnt/mysystem6 -> wrong fs type, bad option, bad superblock on /dev/loop6, missing codepage or helper program, or other error
fsck /media/system.img -> ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open ...
The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate suberblock: ...
Reserved
Just happened to see this thread.
Dropping in the let you know for linux just do this
Code:
simg2img system.img.ext4 system.img
mkdir system
sudo mount -t ext4 system.img system/
Of course all work is done in the current working directory.
You can just copy whatever you want from this mounted loop device of the system.img or whatever.
This is what i do because it seems to be the fastest in terms of work.
Hope it helps. I prefer all android work on linux
kevin71246 said:
Reserved
Click to expand...
Click to collapse
oh man you saved my day thanks man none of the old method worked but this did wonders

Categories

Resources