[ROM] How to combine root filesystem, kernel in android - Android Software/Hacking General [Developers Only]

Hi all,
I am trying compile and build custom ROM from android source for nexus s.
In the custom ROM for example crespo.zip we have three files inside
*META-INF
*system
*boot.img
I have compiled a android from source , but i don't known which files are needed in "out" directory to make a zip file. i googled and found tools to extract boot.img file and repack it . I don't known what are the steps to follow to create a META-INF folder.
i already rooted my phone and able to install custom ROM .zip downloaded from cynogenmod.
But how to built our own custom ROM
Can anyone give the steps to follow after compiling android from source
Regards
Sivakumar

Related

[Q] How to pack zImage binary kernel in CWM zip for TF101

Hi, i'm trying to flash my custom kernel with CWM recovery. I've seen some zip to update TF's kernel that use a kernelblob but i didn't realized how to create this binary file.
I've compiled kernel from source code from AsusTek files (Eee Pad Kernel Code for Android 3.2 OS (V8.6.5.7)) and i have zImage and modules (.ko).
Someone know how can i pack this things to flash my kernel with CWM?
Coniglioz said:
Hi, i'm trying to flash my custom kernel with CWM recovery. I've seen some zip to update TF's kernel that use a kernelblob but i didn't realized how to create this binary file.
I've compiled kernel from source code from AsusTek files (Eee Pad Kernel Code for Android 3.2 OS (V8.6.5.7)) and i have zImage and modules (.ko).
Someone know how can i pack this things to flash my kernel with CWM?
Click to expand...
Click to collapse
Just to create a CWM compatible kernel zip , it's a combination of the things below:
1) Fetch one of the many kernel zip files like from Roach or Clemsyn that are in the development forum to use as a template. Unzip it somewhere in a clean folder and you'll just be replacing modules & zImage (or whatever it is called, almost certainly *blob* something) then next step.
2) Most of what you need to create the insecure boot image is in here:
http://forum.xda-developers.com/showthread.php?t=1193737
3) Most of what you need to create the new blob is in here:
http://forum.xda-developers.com/showthread.php?t=1068548&highlight=blobpack
4) Now move your new modules from your freshly built custom kernel (do a $find {kerneldir} -iname '*.ko' ). Copy them over /system/lib/modules/* in the unzipped template zip from 1) and get rid of any that you didn't create yourself as well.
4.5) copy the blobpack'd file you created from zImage to whatever it was called in the unzipped zip template (say, boot.img to blob or kernelblob or whatever it was called so the script in the zip works).
5) zip the entire contents making sure you're starting at the right base directory into a new customized zip file. That's it you're done. If it doesn't work you might just have created a bum kernel.
Theory of this in a nutshell. There is no way to do the anykernel.zip method because the tf101 will only accept a blob on those encoded partitions so you have to get the blob and boot tools and use them and since all of the kernel zipfiles use it, you've got easy templates.
I'm not mentioning CWM in here because you would just have to create a bigger blob which is I think covered in any thread you search out that has 'blobpack' in it, like Rayman's. The catch-22 of doing recovery + kernel in one blob is that you have no way to boot the thing should things go haywire, unless you're just talking about CWM and it's kernel.
Good luck -
Hashi
Thanks, I blobbed my custom zImage.
I used this zip update as template: http://forum.xda-developers.com/showthread.php?t=1226717
I'll post this kernel with raw hid input support after testing all the functionalities!

[Resolved] [Q] AOSP ICS Porting to Samsung Galaxy Tab2 10.1(GT-5100) Please Help!

Hello everyone,
I am newbie Android ROM development. Nowadays I try to port a specific custom ROM(a special ROM for my company) for Galaxy Tab2 10.1 (GT-P5100). But there is a point that I cannot figure out.
First of all I downloaded android ICS source code and apply my company's module patch to this source. Then I found device and vendor tree for my GT-5100 device and put it my source tree. Finally I built Samsung GT-P5100 kernel and put output file to correct place. At the end of these operations, I compiled all device tree successfully, now I have out/target/product/p5100 file which contains boot.img, system.img, userdata.img etc.(I attached an image file). Everything is fine untill this point. Normally in fastboot mode, I use "fastboot flashall -w" command and img files are automatically flashed to device. But GT-P5100 does not support fastboot mode.Question is this: How can I flash these img files(out/target/product/p5100 file) to the device? I searched lots of threads but cannot find a solution. I also tried to create a ROM which includes system file, boot.img and META-INF file. However it is not worked. Because create a META-INF file is very complicated and I have to find a quick flash option.
I need your helps.
Thanks,
------------------------------------------------------
Edit:
Finally I found solution. Just nedded to use command : make -j4 otapackage and then I get the ROM package to flash this AOSP.

[Q] How to make a rom from kernel.tar.gz file

Man I was trying to make a rom from source and I came across my kernel.tar.gz and ics.tar.gz file for my tc 88xx cpu
so how can I use those files to make a rom
Please help me man thanks in advance
karan1038 said:
Man I was trying to make a rom from source and I came across my kernel.tar.gz and ics.tar.gz file for my tc 88xx cpu
so how can I use those files to make a rom
Please help me man thanks in advance
Click to expand...
Click to collapse
To build a custom ROM extract the source code from the ics.tar.gz file (I would recommend using a program like 7-Zip). Once you have done that take the System folder that should be in the source code you extracted, create a new folder called MyROM, and put the source code for the System folder in the MyROM folder. Next extract the boot.img file for your ROM by extracting the boot partition of your stock ROM, and place it in the MyROM folder. Third, take a working META-INF folder that contains the standard Android update-binary, and a working updater script for your device, and place the META-INF folder in the MyROM folder. Once you have the System folder, Boot.img file, and META-INF folder in the MyROM folder, use 7-Zip to create a zip file containing the MyROM folder. After this flash the .zip file you created in recovery and you should have a custom. First off, for building a custom kernel if you extract the kernel source from the kernel.tar.gz file using 7-Zip, there should be a read-me or other type of documentation describing how to compile the kernel source code you downloaded. If there isn't any documentation I recommend taking a look at this guide on building your first kernel. While these are just a general outline of what you have to do, if you have any questions feel free to ask .
Re: [SOLVED] How to make a rom from kernel.tar.gz file
Shimp208
Man i can upload ics.tar.gz and kernel.tar.gz can you please help me to make an android rom
karan1038 said:
Shimp208
Man i can upload ics.tar.gz and kernel.tar.gz can you please help me to make an android rom
Click to expand...
Click to collapse
If you send me the links I will be happy to help you out and I'll try my best to assist you as best I can.
shimp208 said:
To build a custom ROM extract the source code from the ics.tar.gz file (I would recommend using a program like 7-Zip). Once you have done that take the System folder that should be in the source code you extracted, create a new folder called MyROM, and put the source code for the System folder in the MyROM folder. Next extract the boot.img file for your ROM by extracting the boot partition of your stock ROM, and place it in the MyROM folder. Third, take a working META-INF folder that contains the standard Android update-binary, and a working updater script for your device, and place the META-INF folder in the MyROM folder. Once you have the System folder, Boot.img file, and META-INF folder in the MyROM folder, use 7-Zip to create a zip file containing the MyROM folder. After this flash the .zip file you created in recovery and you should have a custom. First off, for building a custom kernel if you extract the kernel source from the kernel.tar.gz file using 7-Zip, there should be a read-me or other type of documentation describing how to compile the kernel source code you downloaded. If there isn't any documentation I recommend taking a look at this guide on building your first kernel. While these are just a general outline of what you have to do, if you have any questions feel free to ask .
Click to expand...
Click to collapse
Amazing!!!!
camy rock said:
Amazing!!!!
Click to expand...
Click to collapse
I should clarify that the source does not always include the /system folder sometimes companies will provide this and other times they won't. The other way to get the /system folder is to use adb and pull the system folder with a command similar to:
Code:
adb pull /system
Also this is just one example of a procedure that could be used to build a custom ROM from the stock ROM that originally ships with the phone. The procedure for building Cyanogenmod for example or another AOSP based ROM would be very different.
shimp208 said:
To build a custom ROM extract the source code from the ics.tar.gz file (I would recommend using a program like 7-Zip). Once you have done that take the System folder that should be in the source code you extracted, create a new folder called MyROM, and put the source code for the System folder in the MyROM folder. Next extract the boot.img file for your ROM by extracting the boot partition of your stock ROM, and place it in the MyROM folder. Third, take a working META-INF folder that contains the standard Android update-binary, and a working updater script for your device, and place the META-INF folder in the MyROM folder. Once you have the System folder, Boot.img file, and META-INF folder in the MyROM folder, use 7-Zip to create a zip file containing the MyROM folder. After this flash the .zip file you created in recovery and you should have a custom. First off, for building a custom kernel if you extract the kernel source from the kernel.tar.gz file using 7-Zip, there should be a read-me or other type of documentation describing how to compile the kernel source code you downloaded. If there isn't any documentation I recommend taking a look at this guide on building your first kernel. While these are just a general outline of what you have to do, if you have any questions feel free to ask .
Click to expand...
Click to collapse
what if the kernel source code doesnt have a system folder?
Got the same issue with alcatel pop 4 5051d
shimp208 said:
To build a custom ROM extract the source code from the ics.tar.gz file (I would recommend using a program like 7-Zip). Once you have done that take the System folder that should be in the source code you extracted, create a new folder called MyROM, and put the source code for the System folder in the MyROM folder. Next extract the boot.img file for your ROM by extracting the boot partition of your stock ROM, and place it in the MyROM folder. Third, take a working META-INF folder that contains the standard Android update-binary, and a working updater script for your device, and place the META-INF folder in the MyROM folder. Once you have the System folder, Boot.img file, and META-INF folder in the MyROM folder, use 7-Zip to create a zip file containing the MyROM folder. After this flash the .zip file you created in recovery and you should have a custom. First off, for building a custom kernel if you extract the kernel source from the kernel.tar.gz file using 7-Zip, there should be a read-me or other type of documentation describing how to compile the kernel source code you downloaded. If there isn't any documentation I recommend taking a look at this guide on building your first kernel. While these are just a general outline of what you have to do, if you have any questions feel free to ask .
Click to expand...
Click to collapse
So glad to see this thread. Mine is an alcatel pop 4 5051d. After extracting, i saw a .com file of about 650mb in size. Please, what do i do from here? d file: https://drive.google.com/uc?export=download&confirm=zM0d&id=0Byi69Jpw2ZDtcTFBX0FzMXBkajg

How to port roms to your mtk with android device

HOW TO PORT ROMS TO YOUR MTK WITH ANDROID DEVICE
Most of us have always wanted to use custom roms but there just no custom roms for our devices so we just use different app launchers and uninstall some bloatware to make our stock rom feel good.
Rom porting makes it possible to use a custom rom on your mtk device provided in this tutorial they have the same chipset (example: mtk 6582 ported to mtk6582).
THINGS NEEDED :
1. B1 archiver / ES FILE EXPLORER
2. Root Browser.
4. A rooted device is also needed but not much important if you have CWM INSTALLED WITHOUT ROOT.
PROCEDURE :
1. Make a backup of your current rom, preferably CWM backup. You can either use MTK DROID TOOLS or ROM MANAGER...
The location of the backup will be at clockwork/backup/"date and time of the backup ". This is very important since we will need stuff from the back up and we will also use the backup to recover the phone should the ported rom give any problems.
2. At this point I presume you have already downloaded the apps needed and the custom rom you want to use which is in a zip format( this was not important but I had to bring it up cause I know zombies could be reading this.
3. Now extract the custom Rom with Root Browser. if you extracted with Root Browser then the location will be "speedsoftware/extracted/"folder with the name of the custom rom "".
4. Now open Root Browser and open the folders side by side "custom rom which will be ported at one side and other side will be used for searching for the location of the things needed for the custom rom.
5. Delete the following from the Custom rom:
Boot.img
logo.bin (You do this only when you like the Your current logo.bin)
system/vendor
system/usr
system/lib/hw
system/lib/modules
system/lib/libncurses.so
system/etc/firmware
system/etc/vold.fstab
system/etc/vold.fstab.nand
system/etc/bluetooth
6. Now that you have deleted them from the custom rom replace them. You will find the boot.img at clockworkmod/back/"folder with date and time"/boot.img. The rest of the files and folders will br located in the Root /system. Just copy and paste
7. Now at the custom Rom panel go back to where you find the "META-INF" folder,open /google/android will now long press on "updater script" and tap on open with then select text editor.
8. Check The mount & format point check something like this mmcblk0p. A number is always written after the "P" replace the number of your BASE to PORT.
9. Check multi select in B1 archiver Select ( do not archive the folder the files are in but the individual files in the folder containing the extracts)
10. Compress to ZIP file wait till the process finished. Now boot to recovery and flash your ROM
Good luck in porting Your Rom... I have used this method to port 5 roms including AROMA ROMS. and I have never ported a Rom with a pc before
MAYBE U NEED TO EXTRACT THE BOOT IMG TOO IF THIS DIDNT WORKED
DO IT AS FOLLOWS
Requirements:
-- BusyBox (cpio, gunzip and gzip is mandatory)
-- /System Write Permissions (Does not need to be a modified kernel)
-- Terminal Emulator
-- ES File Explorer (or similar)
-- Hex Editor (or use of DD)
-- Open up your android terminal emulator.
-- Now go ahead and pull your boot.img from your device (or use another one if you wish)
-- Open up your boot.img with the Hex Editor and look for: ANDROID!. Remove everything before it so that the ANDROID! header is the first to be read then save it over top of the boot.img. NOTE: This is only required if you are using a stock boot.img.
OR USE THIS IF U DIDNT UNDERSTOOD THIS
Hello Everyone, I’ll show you how to Unpack and Repack your Phone’s Boot.img & Tweak Karnel. Lets start.
Make a new folder named “boot edit” in cache/
image
Pull your boot.img in this folder
image
Now open ApkTool. Long press on “cache“, click on Get Access Permission.
image
Open cache folder and do same with boot edit. Give ApkTool access permission
image
Open boot edit, click on boot.img select Expack(MT65xx), press ok
image
It will unpack your boot.img.
image
Now open file manager & go to cache/boot edit/. You wil find your unpacked boot.
image
Now edit/modify the files or tweak karnel.
Again open ApkTool. Goto cache/boot edit click on ramdisk select repack-mt65xx.
image
It will repack your boot.
image
You will find an img file named new.img
image
This file is your Tweaked/edited/custom boot.img!!
Flash it via Recovery or Flashify & Enjoy..
FOR DETAILED AND STEP WISE GUIDE WITH SCREEN SHOTS SEE HERE
Mod Edit: link removed
XDA:DevDB Information
HOW TO PORT ROMS TO YOUR MTK WITH ANDROID DEVICE, ROM for all devices (see above for details)
Contributors
manhar2108, manhar2108, 2108kick
Source Code: Mod Edit: link removed
ROM OS Version: 5.1.x Lollipop
ROM Kernel: Linux 3.4.x
Based On: all
Version Information
Status: Stable
Created 2015-08-16
Last Updated 2015-08-16
HIT THANKS IF I HELPED U
Good guide..
Especially for noobs....
Darshan601 said:
Good guide..
Especially for noobs....
Click to expand...
Click to collapse
i too am a noob so i tried and made this guide
how bout porting 5.1 rom to 4.4.2 stock?
what should I consider?
aside from tweaking kernel
manhar2108 said:
i too am a noob so i tried and made this guide
Click to expand...
Click to collapse
Yeah....Even I am a noob
gunzgunz said:
how bout porting 5.1 rom to 4.4.2 stock?
what should I consider?
aside from tweaking kernel
Click to expand...
Click to collapse
just replace all these files and use stock kernal to port them
good luck
Sir i tried your guide in porting rom. Mt6582 tp mt6582 chipset roms.. But after replacing those files you mentioned and when i flashed it to my phone, it was tuck in boot screen and keep on restarting. How am I going to fix this?
Thread closed. Pay per click links are not allowed on XDA.
Darth
Forum Moderator

[guide]port nougat roms for snapdragon devices

HELLO GUYS AND GALS WE HAVE NOW NOUGAT IN OUR HANDS GETTING PRETTY STABLE BUT THERE ARE PEOPLE WILLING TO PORT NOUGAT TO THEIR PHONES SO HERE I AM WITH A GUIDE THAT I MADE MYSELF WITH HELP OF @mshoaib7 TO PORT NOUGAT ROMS FOR LENOVO A6000 THIS GUIDE CAN BE USED FOR OTHER SNAPDRAGON DEVICES
LETS START
BASICS---
YOU CAN ONLY USE 7.0 AS BASE FOR 7.0 ROMS AND 7.1.1 AS BASE FOR 7.1.1 ROMS
YOU NEED TO HAVE ATLEAST ONE FULLY FUNCTIONAL NOUGAT ROM THAT YOU CAN USE AS BASE
THE PROCESSOR OF BOTH THE PHONES SHOULD BE SAME
SAME GOES WITH GPU AND SCREEN SIZE
THE ROM OF YOUR PHONE IS CALLED BASE ROM
THE ROM THAT YOU WANT FROM OTHER PHONE TO YOUR PHONE IS CALLED PORT ROM
ITS HARD TO MAKE IT NOOBFRIENDLY:silly::silly::silly::silly:
REQS---
1] AUTO TOOL UNPACK REPACK TO EXTRACT SYSTEM.NEW.DAT FROM HERE
https://forum.xda-developers.com/general/general/tool-auto-tool-unpack-repack-rom-t3278393
2] WINDOWS PC
3]NOTEPAD++
4]TIME AND PATIENCE
LETS START NOW---
1] EXTRACT YOUR BASE ROM AND PORT ROM TO DIFFERENT FOLDERS
2]YOU MAY GET SYSTEM.NEW.DAT IN BOTH ROMS IF YOU GET THAT USE AUTO TOOL TO EXTRACT THEM
3]NOW GO TO PORT ROM FOLDER AND DELETE META-INF, FILE CONTEXTS, RECOVERY, SUPERSU OR ANY OTHER FOLDERS PRESENT
DONT DELETE BOOT.IMG AND SYSTEM FOLDER
4] COPY META-INF AND RECOVERY FOLDER FROM BASE TO PORT ROM AT THE SAME LOCATION FROM WHERE YOU DELETED THEM
5] OPEN SYSTEM FOLDERS IN BOTH ROMS
6]DELETE BIN, ETC, TTS, ADDON.D, USR, XBIN AND recovery-from-boot.p FROM PORT ROMS FOLDER
COPY THE ABOVE FOLDERS AND FILES FROM BASE TO PORT ROM AFTER DELETING IN PORT ROMS FOLDER
7]OPEN LIB FOLDERS IN BOTH ROMS AND COPY AND REPLACE /DRM
/HW, /SOUNDFX FOLDERS FROM BASE TO PORT
8] COPY THE FOLLOWING LIB FILES FROM BASE TO PORT LIB FOLDER
LIBGLES*, LIBMM*, LIBHARDWARELEGACY, LIBRIL, LIBRILUTILS, libwcnss_qmi, LIBCAMERA*
9] NOW OPEN /VENDORS/LIB IN BOTH ROM FOLDERS AND REPLACE FROM BASE TO PORT ALL THE FILES NAMED WITH
libacutator*, libchromatix*, libmmcamera*, libril*,liboemcamera, libimscamera
10]NOW RENAME BUILD.PROP OF PORT ROM TO SOMETHING ELSE AND COPY YOUR BASE BUILD.PROP IN SYSTEM FOLDER OF PORT ROM AND OPEN BOTH OF THEM AND REPLACE THE ROMS NAME, ITS VERSION AND STUFF FROM PORT TO BASE BUILD.PROP AND SAVE IT AND DELETE THE PORT BUILD.PROP
NOW THE BOOTIMG PART----
USE THIS TO EXTRACT BOOTIMG---
http://www.mediafire.com/download/815a86r7ay5dh8r/bootimg.zip
EXTRACT THE ABOVE ZIP AND CUT AND MOVE YOUR PORT BOOTIMG TO THIS FOLDER
NOW IN this folder press SHIFT+RIGHT CLICK AND SELECT OPEN COMMAND WINDOWS HERE AND TYPE IN CMD-
bootimg.exe --unpack-bootimg boot.img
your port BOOTIMG WILL BE EXTRACTED NOW DELETE EVERTHING EXCEPT BOOTIMG.EXE AND INITRD FOLDER
NOW RENAME THIS INITRD FOLDER TO "PORT BOOTIMG"
SIMILARLY EXTRACT YOUR BASE BOOTIMG BUT DONT DELETE ANYTHING THIS TIME NOW GO TO THE PORT BOOTIMG FOLDER AND CUT init.environ.rc AND PASTE IT IN INITRD FOLDER OF BASE BOOTIMG
AFTER REPLACING THAT FILE RUN THIS COMMAND
bootimg.exe --repack-bootimg
YOU WILL GET BOOT-NEW.IMG
CUT IT AND PASTE IT IN YOUR PORT ROMS FOLDER AND RENAME IT TO boot.img
NOW SELECT ALL THE FOLDERS IN PORT ROMS FOLDER
INCLUDING META-INF, SYSTEM, BOOT.IMG, FILECONTEXTS, AND OTHER FOLDERS IF PRESENT AND ZIP IT AND FLASH IT VIA TWRP
NOTE---YOUR BASE ROM SHOULD NOT BE COMPRESSED IN FORM OF SYSTEM.NEW.DAT OR YOU WILL HAVE TO CREATE A NEW UPDATER-SCRIPT
I AM SURE THIS GUIDE WILL WORK FOR SD410, SD210 DEVICES
COMMENT IF YOU FACE ANY PROBLEMS
IT WAS A LONG GUIDE:silly:
ENJOY
it is good but it will create ril bug.
Replace all the files that I have mentioned
They are bug fixers
The Hard Gamer said:
Replace all the files that I have mentioned
They are bug fixers
Click to expand...
Click to collapse
Great for ones who want to learn porting.
Sent from my Lenovo A6000 using XDA-Developers Legacy app
Thanks a lot brother. I got some question .
1. Can I take any A6000/+ Nougat ROM as base ?
2. Most of the ROMs available for A6000 doesn't come with system.new.dat file. So we don't need to extract anything ?
3. But if port ROM has system.new.dat file then we have to extract it first ?
shivdroid said:
Thanks a lot brother. I got some question .
1. Can I take any A6000/+ Nougat ROM as base ?
2. Most of the ROMs available for A6000 doesn't come with system.new.dat file. So we don't need to extract anything ?
3. But if port ROM has system.new.dat file then we have to extract it first ?
Click to expand...
Click to collapse
YYou can port ROMs for A6000 from redmi 2
2.no need to extract for a6000
3.port has to be extracted

Categories

Resources