Hi all.
I'm attempting to make a simple change to the HD2 libs. I need to make a change to BoardConfig.mk, and hence recompile the lib sources.
So, I'm asking one of two things:
1) Could someone who has a build environment already set up make the change, and give me the compiled libs?
2) Could someone point me in the right direction for adapting this repo in order to run on the HD2, and then I'll make the changes myself?
There seems to be a fuzzy gap in terms of compiling Android for the HD2 from source. Hope I haven't missed anything.
Thanks for your time guys,
MrP.
Are you running Linux? Also what version of android are you wanting compiled? Sense, ice, miui, cm7, or gingerbread?? It may be possible to just use the kitchen to break down the rom and then make your changes and just rebuild with kitchen.
Edit. I just saw which report you wanted. Wouldn't rom have to be completely ported over to the hd2?
Sent from my HD2 using xda premium
kylew1212 said:
Are you running Linux? Also what version of android are you wanting compiled? Sense, ice, miui, cm7, or gingerbread?? It may be possible to just use the kitchen to break down the rom and then make your changes and just rebuild with kitchen.
Edit. I just saw which report you wanted. Wouldn't rom have to be completely ported over to the hd2?
Sent from my HD2 using xda premium
Click to expand...
Click to collapse
How do you break down already compiled ROMs ? and what kitchens are available ? yes im on linux
If you're running a linux distro with basic gnu core binutils, then it is a simple process
mkdir ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin -R
PATH=~/bin:$PATH
mkdir ~/android
cd ~/android
repo init -u <root link of the android project you will be building>
Code:
https://android.googlesource.com/platform/manifest is for AOSP
git://github.com/CyanogenMod/android.git is for Cyanogenmod
edit ~/android/android/default.xml to have the device vendor files as you provided in the list
Code:
Device files for cyanogenmod build
https://github.com/cmhtcleo/android_device_htc_leo
Vendor files for cyanogenmod build
https://github.com/cmhtcleo/android_vendor_htc_leo
repo sync -j16
Code:
The command above downloads the code of all the repositories mentioned in the
default.xml we edited earlier to your computer and should take some time.
<Edit/write stuff here>
cd ~/android
./build/envsetup.sh
./brunch <device code name> (ie. passion for nexusone, bravo for desire, leo for hd2)
If you want to just breakdown roms, change some libs from other rom and swap apks, make the rom lighter by deleting unrequired stuff, you need just winzip if you're experienced or "dsixda" android kitchen. (Google it)
Thanks for that advice Rick.
Maybe I should clarify exactly what I want compiled:
I'm not looking to compile to entire Android project for leo. What I essentially want is to make a change to the device files in the BoardConfig.mk, and then only recompile those, producing the hardware libs for the HD2. It doesn't have to be the sources linked, as I haven't been able to find vendor files for leo, however, you've given the link to the cmhtcleo repo. Would you be able to guide me on that?
Sorry to be a pain, but all in a learning process here. Thanks for all the help.
MrP.
MrPadie said:
Thanks for that advice Rick.
Maybe I should clarify exactly what I want compiled:
I'm not looking to compile to entire Android project for leo. What I essentially want is to make a change to the device files in the BoardConfig.mk, and then only recompile those, producing the hardware libs for the HD2. It doesn't have to be the sources linked, as I haven't been able to find vendor files for leo, however, you've given the link to the cmhtcleo repo. Would you be able to guide me on that?
Sorry to be a pain, but all in a learning process here. Thanks for all the help.
MrP.
Click to expand...
Click to collapse
If you use build/envsetup.sh, you can use some of the defined functions to build only a part of the tree. Use the 'mm' or 'mmm' commands to do this.
The 'mm' command makes stuff in the current directory (and sub-directories, I believe). With the 'mmm' command, you specify a directory or list of directories, and it builds those. However i am unsure if mmm has any further complexions or not but it still does require to have the complete android platform source code on your machine.
Rick,
Quick question. When I follow your beginning steps to compile android. I get the following error.
Code:
bash: syntax error near unexpected token `newline'
This is what I typed in :
Code:
[email protected]:~/android$ repo init -u <git://github.com/CyanogenMod/android.git>
Hope you still have your eye on this post.
Actually here is everything i've done in terminal. The reason it says file exists is because I've already tried this like 5 times..
Code:
[email protected]:~/android$ mkdir ~/bin
mkdir: cannot create directory `/home/kyle/bin': File exists
[email protected]:~/android$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 19933 100 19933 0 0 34392 0 --:--:-- --:--:-- --:--:-- 58283
[email protected]:~/android$ chmod a+x ~/bin -R
[email protected]:~/android$ PATH=~/bin:$PATH
[email protected]:~/android$ mkdir ~/android
mkdir: cannot create directory `/home/kyle/android': File exists
[email protected]:~/android$ cd ~/android
[email protected]:~/android$ repo init -u <https://android.googlesource.com/platform/manifest>
bash: syntax error near unexpected token `newline'
[email protected]:~/android$
Thanks,
Kyle
kylew1212 said:
Rick,
Quick question. When I follow your beginning steps to compile android. I get the following error.
Code:
bash: syntax error near unexpected token `newline'
This is what I typed in :
Code:
[email protected]:~/android$ repo init -u <git://github.com/CyanogenMod/android.git>
Hope you still have your eye on this post.
Thanks,
Kyle
Click to expand...
Click to collapse
Remove this "<>" from url.. try this:
Code:
repo init -u git://github.com/CyanogenMod/android.git
My suggestion: use -b gingerbread or -b ics not download all repository.. need more more disk space XD
Namaless said:
Remove this "<>" from url.. try this:
Code:
repo init -u git://github.com/CyanogenMod/android.git
My suggestion: use -b gingerbread or -b ics not download all repository.. need more more disk space XD
Click to expand...
Click to collapse
Thank you !
Question, what does -b mean?
kylew1212 said:
Thank you !
Question, what does -b mean?
Click to expand...
Click to collapse
Use this options for choose "branch" See: repo init --help for more informations or repo --help for complete informations.
Seeyou
Namaless said:
Use this options for choose "branch" See: repo init --help for more informations or repo --help for complete informations.
Seeyou
Click to expand...
Click to collapse
You're great! thanks so much!
When I'm editing the manifest, do I just add the extra repo's at the bottom, or what exactly??
kylew1212 said:
You're great! thanks so much!
When I'm editing the manifest, do I just add the extra repo's at the bottom, or what exactly??
Click to expand...
Click to collapse
No edit manifest but "default.xml" in the "manifests" directory.
I'm noob and not have more experience with compile cm9, but for a moment can help you
Namaless said:
No edit manifest but "default.xml" in the "manifests" directory.
I'm noob and not have more experience with compile cm9, but for a moment can help you
Click to expand...
Click to collapse
Sorry, I knew thats the file to edit, but do I need how do I get it to sync with cmthcleo's files?
You have been very helpful! Thanks
when trying to extract HyperDroid's ROM i get this following error :
Code:
Error: Cannot extract ROM!
Why notttt ????
elesbb said:
when trying to extract HyperDroid's ROM i get this following error :
Code:
Error: Cannot extract ROM!
Why notttt ????
Click to expand...
Click to collapse
What are you using to extract it?
kylew1212 said:
Sorry, I knew thats the file to edit, but do I need how do I get it to sync with cmthcleo's files?
You have been very helpful! Thanks
Click to expand...
Click to collapse
When you edited this file return in your android root directory and run repo sync again
---------- Post added at 02:14 AM ---------- Previous post was at 02:14 AM ----------
elesbb said:
when trying to extract HyperDroid's ROM i get this following error :
Code:
Error: Cannot extract ROM!
Why notttt ????
Click to expand...
Click to collapse
You are offtopic.. -.-''
Namaless said:
When you edited this file return in your android root directory and run repo sync again
---------- Post added at 02:14 AM ---------- Previous post was at 02:14 AM ----------
You are offtopic.. -.-''
Click to expand...
Click to collapse
I don't know what to edit? Do I delete the files within or just add the ones I need to the bottom of the list?
---------- Post added at 07:19 PM ---------- Previous post was at 07:16 PM ----------
elesbb said:
when trying to extract HyperDroid's ROM i get this following error :
Code:
Error: Cannot extract ROM!
Why notttt ????
Click to expand...
Click to collapse
Download the kitchen Here
Extract the kitchen somewhere
Open terminal Ctrl+Alt+T
Cd to wherever you extracted the Kitchen
once inside kitchen folder type ./menu
Then Kitchen Starts
option 1 to break down rom (something to do with working folder I don't remember exact name)
kylew1212 said:
I don't know what to edit? Do I delete the files within or just add the ones I need to the bottom of the list?
---------- Post added at 07:19 PM ---------- Previous post was at 07:16 PM ----------
Download the kitchen Here
Open terminal Ctrl+Alt+T
Cd to Kitchen
type ./menu
Then kitchen starts
option 1 to break down rom
Click to expand...
Click to collapse
That's what I do and I get that error ......, why would you even recommend tthat ? Lol
Sent from my GT-I9100 using Tapatalk
elesbb said:
That's what I do and I get that error ......, why would you even recommend tthat ? Lol
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
Well.. That's how it's done lol... Idk whats wrong, possibly protected somehow? I know that you used to could require a password on zip files..
---------- Post added at 07:24 PM ---------- Previous post was at 07:23 PM ----------
If I can ever figure out all of this, I will write one hell of a guide for it!!
kylew1212 said:
I don't know what to edit? Do I delete the files within or just add the ones I need to the bottom of the list?
Click to expand...
Click to collapse
Add before
Code:
</manifest>
Here are a simple example: https://github.com/Namaless/android/commit/8699b22ac29506c98a0988fc47e68536b9e1edda
Related
the title says it
after many requests here is the guide
most of this is spread around the vogue
forum here and there, i just wanted to bring it all together
goal-seeing lately we have lost some good developers, this is a shot at getting more involvement in vogue/android development
I.SETTING UP YOUR SYSTEM
1. GETTING LINUX you will need to have Linux installed on your computer(dual-boot, vm, whatever). i recommend Ubuntu karmic (9.10) because its pretty new-user friendly. It can be found at http://www.ubuntu.com/
for you windows lovers here is a guide to setting up a ubuntu VM(virtual machine (if you really didnt know ))
2. THINGS/TOOLS YOU WILL NEED download these:
original 8/8/09 ion 1.5 build HERE(we are gonna use the bin-files and the apns-conf.xml, and a few apps)
the latest rootfs.img (find it)
these android tools (included are genext2fs (android version), split_bootimg.pl, and extract_ramdisk.sh)
after downloading, extract the zip to a folder. open a terminal and cd to the dir of the tools. click applications>accesories>terminal and type:
Code:
cd ~/whatever/
sudo rm -rf /bin/genext2fs
#dont type whats after the pound signs
#type in your password
#if you havent set up a su password yet type:
sudo passwd
#then make one, next
sudo cp -r ./whatever/genext2fs /bin/
squashfs-tools (if you have ubuntu 9.10-karmic first you will have to uninstall squashfs-tools 4.0(4.0 WILL NOT NOT NOT NOT NOT WORK) that is installed during the installation of linux ): go to system>administration>synaptic package manager. type squashfs-tools in the quick search, then right click and click mark for complete removal. then hit apply. then download and install this here http://http://ftp.us.debian.org/debian/pool/main/s/squashfs/squashfs-tools_3.3-7_i386.deb
i also strongly recommend downloading the sdk-tools v1.1(adb is almost essential when porting, for debugging purposes) enatefox has it posted on his media fire. (search for it)
3. ORGANIZATION
now that we have what we need. lets get organized.
a.mount points
we are going to use mount points while porting.
terminal:
Code:
sudo mkdir /mnt/rootfs
sudo mkdir /mnt/system
#i also have one for mounting data files
mkdir /mnt/data
b. directories
terminal:
Code:
mkdir ~/Desktop/android
mkdir ~/Desktop/android/ion
mkdir ~/Desktop/android/donut
#you get the point...
now put the ion 8/8/09 build in the ~/Desktop/android/ion folder and rename it system.sqsh then
terminal:
Code:
cd ~/Desktop/android/ion
unsquashfs ./system.sqsh
you should now have a folder called squashfs-root in the ion directory. it contains all the guts from the ion build. feel free to look around in that folder as you should get familiar with the folders and things in there
II PORTING
1. PORTING A HERO ROM(this was in zens how-to-make-a-hero-rom.txt im just adding on to it)
a. Download a rom from the dream/sapphire development forums.
b. Extract what you downloaded to ~/Desktop/android/hero. It is usually an update.zip.
c. Open the extracted folder. Inside you should see a data directory and a system directory.
d. Open the data directory and look for an app or app_s folder.
e. Open those folders and copy the apks to the system/app/ folder. Leave out what you don't need. feel free to add any custom apps. as long as they are from the same sdk number. ie 1.5, 1.6, 2.0.1, 2.1 most are pretty cross-compatible though.
f. Delete system/xbin from the rom your porting and replace it with the one from Ion.
g. Copy ~/Desktop/android/ion/squashfs-root/etc/apns-conf.xml from Ion to ~/Desktop/android/hero/system/etc/
h. Mount the latest rootfs.img
terminal:
Code:
sudo mount ~/whereever/rootfs.img -o loop /mnt/rootfs
i. Copy libaudio.so libaudioflinger.so libcameraservice.so libgps.so from /lib in the mounted rootfs over to system/lib in the rom you are porting*(donut and eclair really dont need this step because those files are in most of the latest rootfs.img's but be sure to check)
j. Edit the system/build.prop or even use the Ion build.prop.*(for donut/eclair you may want to edit the lcd density to 120 or 110 in the build.prop for qvga and 160 for 320x480)
k. Create a blank file in system/ called hero.build*(for eclair/donut create donut.build or eclair.build or eclairhero.build.....etc)
*l. for hero any systems too big to run on nand, here is a script to make a data file. put this in the ~/Desktop/android/hero directory. cut the app folder from ~/Desktop/android/hero/system and paste it to ~/Desktop/android/hero , and rename it too app_s . next run the mkdataimg.sh it should ask for you password in a terminal. type it in and then it should mount the data.img to data-mnt folder in ~/Desktop/android/hero . keep that terminal open copy the app_s folder in to data-mnt. then type y in the terminal to unmount the data.img. next:
terminal:
Code:
cd ~/Desktop/android/hero
ln -s /data/app_s ./system/app
that should make a broken symlink in system
2. Mount it and squash it
ok now that we are done porting lets put it together
terminal:
Code:
cd ~/Desktop/android/hero
genext2fs -d ./system -b 180000 -a system.ext2
sudo mount -o loop ./system.ext2 /mnt/system
sudo mksquashfs /mnt/system system.sqsh
sudo chown $USER ./system.sqsh
#and if you want
rm -rf ./system.ext2
from zenulator:
There are other little tweaks here and there but thats basically it. Now you can roll your own.
Click to expand...
Click to collapse
im gonna clean this up a bit later just wanted to get this out to you guys
nice thanks jamezelle
zen's manup456-based Eclair build contains different libaudio.so & libaudioflinger.so than the rootfs, and Eclair wouldn't boot if I replaced them with the libs from the rootfs. This might be due to the rootfs libs not being updated for Eclair yet (also why voice search/dial doesn't work) but I'm not sure. I don't know if this will be the case for 2.1, just wanted to add that in.
I really appreciate the guide and look forward to hearing more. I've learned a lot from zen as well but a lot of the work the devs do is so hard to follow because it's undocumented.
Do you know why the xbin has to be from Ion? Is it because of our kernel version or the squashfs ver that our kernel contains? I've been wanting to grab some of the tools from the xbin of other builds but have been unsure about compatibility.
Also, for more advanced Android ROM building, I'd like to add a link to zipalign optimization.
polyrhythmic said:
zen's manup456-based Eclair build contains different libaudio.so & libaudioflinger.so than the rootfs, and Eclair wouldn't boot if I replaced them with the libs from the rootfs. This might be due to the rootfs libs not being updated for Eclair yet (also why voice search/dial doesn't work) but I'm not sure. I don't know if this will be the case for 2.1, just wanted to add that in.
I really appreciate the guide and look forward to hearing more. I've learned a lot from zen as well but a lot of the work the devs do is so hard to follow because it's undocumented.
Do you know why the xbin has to be from Ion? Is it because of our kernel version or the squashfs ver that our kernel contains? I've been wanting to grab some of the tools from the xbin of other builds but have been unsure about compatibility.
Also, for more advanced Android ROM building, I'd like to add a link to zipalign optimization.
Click to expand...
Click to collapse
we need to move back to a more standardized comunity rootfs.img. i'm seeing more and more different rootfs.imgs that vary little by little. it is kind of hard to really document all of the development. but i see your point. the xbin(are just eXtended bin files) doesnt have to come from ion. the xbin in ion is actually empty
yes our kernel doesnt support LZMA compression which is what 4.0 uses. more info on it here http://www.squashfs-lzma.org/ i dont know why out kernel has not been updated to support it(you would have to ask DZO), i just know is isnt supported
thanks for the link to zipalign. i usually zipalign my apps. btw most dream and sapphire devs are already zipaligning there apks so we dont have to
I agree, I don't like forking the rootfs but the latest ones don't contain the correct WiFi files & settings for Kaiser. I know our kernel is way behind, I've asked several questions in the kernel thread about it but then the thread goes OT and I've never gotten an answer to most of the questions. Newbie16 has been compiling kernels but we've had trouble finding all the updated source files.
Oh, the PNG optimization in the zipalign thread is useful also, I easily saved 5 MB in the Eclair build.
The 8/8 file is a .img file, not .sqsh. Terminal tells me it can't find a sqash superblock on the file, or something to that extent.
EDIT: also missing a step that seems crucial... re squashing the files to make a .sqsh file to use?
ln -s help. hero nand porting
When ever I'm trying to port a hero build to nand ln -s gives me "operation not permitted" during boot. I used -a during genext2fs. Also data didn't work, even though I have the right apns-conif.xml. any idea? I was trying to port hero revolution (I think thats it ). Thanx
TheKartus said:
The 8/8 file is a .img file, not .sqsh. Terminal tells me it can't find a sqash superblock on the file, or something to that extent.
EDIT: also missing a step that seems crucial... re squashing the files to make a .sqsh file to use?
Click to expand...
Click to collapse
i fixed(add the missing steps) it but i dont have a copy of 8/8 ion personally. any ion system.sqsh build will work. if anyone has one please post it!
TheKartus said:
The 8/8 file is a .img file, not .sqsh. Terminal tells me it can't find a sqash superblock on the file, or something to that extent.
EDIT: also missing a step that seems crucial... re squashing the files to make a .sqsh file to use?
Click to expand...
Click to collapse
jamezelle said:
i fixed(add the missing steps) it but i dont have a copy of 8/8 ion personally. any ion system.sqsh build will work. if anyone has one please post it!
Click to expand...
Click to collapse
i just mounted the system.img and copied all the files to a new folder....that way then u dont have to mount the system.img everytime u are porting a rom
my steps to do that
[email protected]:~# cd Android
[email protected]:~/Android# dir
hi Inferno sensehero13 SenseHERO-v1.4_NoTheme senshero
signed-Hero_Inferno_Final signed-Hero_Inferno_Final.zip
system-2009-08-08.img system-sensehero-20091009.sqsh
TOOLS
ZipAlign.sh
[email protected]:~/Android# mkdir ion
[email protected]:~/Android# mount -o loop system-2009-08-08.img ion
[email protected]:~/Android#
Could someone please define...
Could someone please define rootfs, zIMage and the other parts that go into an Android build? If you're going from say, donut, to eclair, which ones can you reuse? I think I understand that the system.sqsh is what makes a build donut or eclair and actually is the file that has the customizations in it. But, what do the other parts do? If this is the wrong place to post this, mods, please move this. Thanks.
Sally
Hey guys, don't know if anyone else is having this issue or not.
I'm trying to work with the Topaz kernals...I downloaded the XDAndroid 2.1 system.sqsh and was able to unsquashfs it fine on my Vector Linux box...but I want to do the same to the TopazKernal16 system.sqsh (donut) but when I run unsquashfs it makes it to about 70% (highest I got to was 80% on one try) and then stops saying "killed".
any way to remedy this? also, what is the simplest way to "re"squash it?
Thanks!
iceman198 said:
Hey guys, don't know if anyone else is having this issue or not.
I'm trying to work with the Topaz kernals...I downloaded the XDAndroid 2.1 system.sqsh and was able to unsquashfs it fine on my Vector Linux box...but I want to do the same to the TopazKernal16 system.sqsh (donut) but when I run unsquashfs it makes it to about 70% (highest I got to was 80% on one try) and then stops saying "killed".
any way to remedy this? also, what is the simplest way to "re"squash it?
Thanks!
Click to expand...
Click to collapse
You just posted in the wrong forum altogether. This section is for the Vogue, not for the Topaz. Try to ask there on in one of the xdandroid threads. This project is different from xdandroid. Thanks.
egzthunder1 said:
You just posted in the wrong forum altogether. This section is for the Vogue, not for the Topaz. Try to ask there on in one of the xdandroid threads. This project is different from xdandroid. Thanks.
Click to expand...
Click to collapse
Sorry, thanks...
iceman198 said:
Sorry, thanks...
Click to expand...
Click to collapse
No prob
I would be interested in the Android's filesystem breakdown. Just some guide on what exactly is in the system, and then rootfs.img and then the modules. If someone could point me in the right direction, that would be much appreciated!
Thanks!
iceman198 said:
I would be interested in the Android's filesystem breakdown. Just some guide on what exactly is in the system, and then rootfs.img and then the modules. If someone could point me in the right direction, that would be much appreciated!
Thanks!
Click to expand...
Click to collapse
pm dzo, he will probably be able to help you there.
egzthunder1 said:
pm dzo, he will probably be able to help you there.
Click to expand...
Click to collapse
Thanks egzthunder1!
iceman198 said:
Thanks egzthunder1!
Click to expand...
Click to collapse
Not a problem. Good luck!
Ok, in this guide, we'll build our development environment so we can start compiling aurora's kernel (3.0.8) in ubuntu.
NOTES:
- Every command is to be used in the terminal (Applications-Accessories-Terminal).
- There are scripts you can use to automate stuff, I'll post them in the second post on this thread.
- Sorry, I won't guide you on how to install Ubuntu or Android SDK, there are guides on the web all over the place.
1 - First things first, here's what we need:
a) Ubuntu 10.04 LTS x64 (this is recommended by google, it might work in other ubuntu versions, but I didn't tried it). To download it, go to:
http://releases.ubuntu.com/lucid/
And select the 64-bit PC (AMD64) desktop CD version. Your processor must support 64bits (most modern ones support it, else, use the x86 iso, not tested though).
Install ubuntu, you can use dual-boot with windows. I won't post a guide to this, as it's very easy and there are guides all over the net.
b) Install android sdk, to use adb (this is optional, but you really should if you use adb).
Follow this guide:
http://forum.xda-developers.com/showthread.php?t=921169
Note: Eclipse is not needed
c) Install some tools that are needed, like git, compiler stuff etc (this is a single command, copy and paste everythin):
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc abootimg
NOTE: If abootimg doesn't install (It didn't for me, for some reason) go in here, download and install the deb package.
d) Install the toolchain (it's a set of tools used to compile the kernel, I think. This takes a while):
Code:
git clone https://android.googlesource.com/platform/prebuilt
e) Download dzo's kernel from git and set the git branch to "master":
Code:
git clone https://github.com/dzo/kernel_huawei.git
git checkout master
2 - Getting to the fun stuff...
a) First, copy the boot.img attached to this post to your /home/kernel_huawei folder.
b) Set up the environment. Do this, in the terminal (must be done for each compilation session, I'll post scripts in the end, to automate this stuff):
Code:
cd kernel_huawei
export ARCH=arm
export CROSS_COMPILE=/home/username/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
make u8800_defconfig
Note, replace /username/ in the third command with your username.
c) Compile. This takes like 10 minutes, depending on your pc:
Code:
make
TIP - Speedup compilation (thanks to Unrealized)
You can use
Code:
make -jx
to speed up the compilation.
ie, if you have 2 cores, use
Code:
make -j3
for 4
Code:
use -j5
3 - Create the boot.img. If you aren't already in the kernel_huawei folder, do this:
Code:
cd kernel_huawei
Then:
Code:
abootimg -u boot.img -k arch/arm/boot/zImage
After this, the boot.img in your kernel_huawei folder is updated. You can copy that to your phone.
_________________________________________
That's it. In the second post, I'll tell you how to check for latest version, check changelogs and scripts to automate stuff.
If you find any errors, please let me know.
ADDITIONAL STUFF
CHECK FOR UPDATES AND CHANGELOG's
In the terminal:
Code:
cd kernel_huawei
git pull
git log
SCRIPTS
To create a script, create an empty document (no extension), copy the commands and save it. Then right click it, go to "Properties-Permissions" and set it to execute.
To run the script, use the therminal and do:
Code:
cd /path/to/script/file/
./scriptfilename
OR, you can create a shortcut to the script in the panel, for example:
- Right click on the panel and select "Add to panel - Custom application launcher"
- Then, in type, select "Application in terminal"; give it any name, and then browse to the script file.
To run the script just click in the icon in the panel.
a) Automatically download the latest updated files and see what has changed, without compiling:
Code:
cd ~/kernel_huawei
git pull
git log
$SHELL
b) Automatically download the latest updated files, immediately compile and create a new boot.img in the kernel_huawei folder:
Code:
cd ~/kernel_huawei
git pull
export ARCH=arm
export CROSS_COMPILE=/home/username/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
make u8800_defconfig
make
abootimg -u boot.img -k arch/arm/boot/zImage
$SHELL
In this script, you must change the /username/ in the 4th command to your username.
Installing the kernel on the phone
a) Use adb to put the boot.img, (assuming it is on the kernel_huawei folder) in the phone and reboot the phone:
Code:
cd kernel_huawei
adb shell mount -o rw,remount /dev/block/mmcblk0p1 /.cust_backup
adb push boot.img /.cust_backup/image/boot.img
adb shell mount -o ro,remount /dev/block/mmcblk0p1 /.cust_backup
adb reboot
c) Manual installation:
- Copy the updated boot.img to your sdcard.
- Use root explorer (make sure it is set to show hidden files) and copy the boot.img to ./cust_backup/image, replace the original and reboot.
Thank you for this! gonna try it!
whats about pro?
well i dont get any of that... :\
can we use your upload with any rom?
thanks in advance for your replies..
birginioss said:
well i dont get any of that... :\
can we use your upload with any rom?
thanks in advance for your replies..
Click to expand...
Click to collapse
What do you mean? There's no upload here for any ROM... the files here are just for compiling Dzo kernel to use in Aurora... I suggest you ignore this thread if you don't know what this is all about
Sent from my U8800
Matoxas said:
whats about pro?
Click to expand...
Click to collapse
Sorry, this is only for Dzo kernel for Aurora, I know nothing about U8800 pro...
Sent from my U8800
Can you post latest 3.0.8 kernel so we can flash it over cwm. Thx
Sent from my U8800 using Tapatalk 2 Beta-5
boss_y said:
Can you post latest 3.0.8 kernel so we can flash it over cwm. Thx
Sent from my U8800 using Tapatalk 2 Beta-5
Click to expand...
Click to collapse
It's in Aurora's thread, search posts by Dzo, it's 3.0.8 v2...
Sent from my U8800
Thanks
Good Work!
fjsferreira said:
It's in Aurora's thread, search posts by Dzo, it's 3.0.8 v2...
Sent from my U8800
Click to expand...
Click to collapse
so there is a Zip that we can flash?
what are the adventages of this kernel?
Sent from my U8800 using XDA
Great stuff, thanks heaps for this. Finally understand how to compile kernels for this phone now.
levibuko said:
so there is a Zip that we can flash?
what are the adventages of this kernel?
Sent from my U8800 using XDA
Click to expand...
Click to collapse
Yes, Dzo posted the zip already. I suggest you search Aurora's thread and read about what 3,0 kernel does... 1 hint: you'll be amazed
Sent from my U8800
Matoxas said:
whats about pro?
Click to expand...
Click to collapse
just want to explain about the pro version. every kernel needs a defconfig, it's like a configuration while compiling a kernel. but, the pro version have a different defconfig so you must pull it first, the file is /proc/config.gz
about the source, we all know the kernel source of .35 kernel for u8800 and pro version are the same but the defconfig is different. so as fjsferreira said, this source isn't compatible for pro version. unless someone port the 3.0.8 source into the pro version. i don't know how to port the kernel, i just want to tell you what is needed to build a kernel
sorry for my bad english
fjsferreira said:
Yes, Dzo posted the zip already. I suggest you search Aurora's thread and read about what 3,0 kernel does... 1 hint: you'll be amazed
Sent from my U8800
Click to expand...
Click to collapse
i searched for a half hour but didnt find sth....
edit: found the zip
Sent from my U8800 using XDA
levibuko said:
i searched for a half hour but didnt find sth....
edit: found the zip
Sent from my U8800 using XDA
Click to expand...
Click to collapse
Make sure to use v2 with fixed USB storage...
Sent from my U8800
Here, kernel from today, changelog is "Make button backlight even brighter", pretty self explanatory... Again, don't go to aurora thread posting bugs regarding this kernel as it wasn't an "official" dzo release, please...
fjsferreira said:
Here, kernel from today, changelog is "Make button backlight even brighter", pretty self explanatory... Again, don't go to aurora thread posting bugs regarding this kernel as it wasn't an "official" dzo release, please...
Click to expand...
Click to collapse
Should we put this boot.img file while on pink screen.
I read the first page.But i can't see that ,where is the place of boot.img.
Sorry about this silly question
Thank you fjsferreira.
Mr.Moriarty said:
Should we put this boot.img file while on pink screen.
I read the first page.But i can't see that ,where is the place of boot.img.
Sorry about this silly question
Thank you fjsferreira.
Click to expand...
Click to collapse
Yes, if you have usb storage access in pink mode, you can put it in the "image" folder, or you can copy it directly with root explorer to ./cust_backup/image/ and then reboot. If you can't see that folder with root explorer, go to options and make sure it's set to show invisible files. It's in the root of filesystem, where /system/ and /etc/ folders are with all the others
Of course, in both cases, replace the original boot.img.
i have tryed the new kernel "Make button backlight even brighter" and the lights to turn on must change to autobright, but backlight are brighter...
I have created a new thread with a script to build the kernel. Full credit for the script goes to the amazing mapkel. Without him there would be no script.
[Script] Build ICS/JB Kernel
This thread will remain as a Step by Step guide. Either method works fine but the script method is much simpler.
This is an informative guide and I decline responsibility for any damage to your device.
Do not attempt to build this kernel if you are going to complain to devs about issues.
That being said, I designed this so that even those with little knowledge can follow the exact commands and will run into no issues. If you have issues building, post here and I will try to assist you.
The following is a complete tutorial to building the kernel.
Credits:
Kernel Devs: krystianp, lehjr, Epinter, and mmontuori for making this kernel; without them there is no kernel.
Big thanks to benouch for the idea and basic outline of this tutorial.
Another big thanks to zen25205 for help with building the kernel and getting the Linaro Toolchain.
A final big thanks to mchinand for suggesting using "${HOME}" (no need to change for username anymore)
Kernel Kitchen
Thanks to:
quetzalcoatl2435
nlabrad
You need to install Ubuntu 12.04 64bit (Google for instructions)
1. Download linaro.zip (toolchain) from here: http://www.mediafire.com/?ok2paef7uhx2ji8
2. Download kitchen.zip from here: https://mega.co.nz/#!Uc4D0YiD!bs-f4FLWQTu7Q8FQziY0o3GWRPJWGBl-6-Hhm6nta-k
3. Download kernel-working.zip from here: http://www.mediafire.com/?wtavk4yb24x3lj1
4. Download misc.zip from here: http://www.mediafire.com/?q693gipql6a6ty8
If there are any issues with this guide, or if you have any issues building the kernel, post here and I will assist you as best I can.
The following is for Arch Linux Only. Ignore if you are using Ubuntu
Code:
pacman -Syu
pacman -S base-devel
pacman -S git
pacman -S bzip2
pacman -S unzip
Ubuntu Users Start Here
If you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.
Stage 1 (first time only). Go to Stage 2 if you have already built the kernel.
Open a terminal and run the following commands:
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
Code:
sudo apt-get install git
Create a folder named “olympus” in your home directory:
Code:
mkdir ${HOME}/olympus/
Extract the downloaded .zip files to the “olympus” folder (you can use the file manager or the following commands):
Code:
unzip ${HOME}/Downloads/linaro.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/kitchen.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/kernel-working.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/misc.zip -d ${HOME}/olympus/
There should now be 4 folders in ${HOME}/olympus/: “linaro”, “kitchen”, “kernel-working” and “misc”.
In a terminal:
Code:
cd ${HOME}/olympus/
Code:
git clone git://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus.git
Stage 2 (start here if you are building again).
Code:
cd ${HOME}/olympus/android_kernel_motorola_olympus/
Get the latest updates from git:
Code:
git remote update
Now run the following commands to build the kernel:
Code:
export CROSS_COMPILE=${HOME}/olympus/linaro/bin/arm-unknown-linux-gnueabi-
Code:
make clean && make mrproper
Code:
make -j2 ARCH=arm tegra_olympus_defconfig
Code:
make -j2 ARCH=arm
Now start packing the new kernel and modules:
Code:
cp ${HOME}/olympus/android_kernel_motorola_olympus/arch/arm/boot/zImage ${HOME}/olympus/kitchen/kernel-tools/input/
Code:
cp ${HOME}/olympus/misc/CM9/boot.img ${HOME}/olympus/kitchen/kernel-tools/input/
(Replace CM9 with CM10 for CM10)
Code:
cd ${HOME}/olympus/kitchen/kernel-tools/
Code:
./menu
Press Enter Key
Select Option 1
Press Enter Key (again)
Select Option 1 (again)
Type “olympus” and press Enter Key
Press "Ctrl+C"
Code:
cp ${HOME}/olympus/kitchen/kernel-tools/output/bootimg-contents/initrd.img ${HOME}/olympus/kitchen/kernel-tools/input/
Code:
cd ${HOME}/olympus/kitchen/kernel-tools/
Code:
./menu
Press Enter Key
Select Option 1
Press Enter Key (again)
Select Option 3
Type “olympus” and press Enter Key
Press "Ctrl+C"
Run the following commands:
Code:
cp ${HOME}/olympus/kitchen/kernel-tools/output/boot.img ${HOME}/olympus/kernel-working/
Code:
find ${HOME}/olympus/android_kernel_motorola_olympus/drivers/ -name *.ko -exec cp -f {} ${HOME}/olympus/kernel-working/system/lib/modules/ \;
Code:
cd ${HOME}/olympus/kernel-working/
Code:
zip -r new_kernel.zip *
The “new_kernel.zip” file will be located at ${HOME}/olympus/kernel-working/new_kernel.zip
This is a flashable zip that you can flash on top of MROM CM9 and the ROMs that the devs will be releasing.
You will have the latest kernel changes by building it yourself.
Thanks for the tutorial. Just a quick question, why did you include the kernel modules in the kernel-working.zip; aren't they going to be overwritten with the newly compiled ones?
I can do it in debian?
mchinand said:
Thanks for the tutorial. Just a quick question, why did you include the kernel modules in the kernel-working.zip; aren't they going to be overwritten with the newly compiled ones?
Click to expand...
Click to collapse
They were useless. I have reuploaded. New link in OP.
Ufoex said:
I can do it in debian?
Click to expand...
Click to collapse
I have not tested. You can try and report back. If it works I will update the thread.
Usually devs stick to Ubuntu for Android development.
Seeing as Ubuntu is based off Debian, it should work.
atrix4g18 said:
They were useless. I have reuploaded. New link in OP.
Click to expand...
Click to collapse
I think it is better to only include what is necessary in the zips. Not for space/bandwidth reasons (they were small as you said), but more for understanding the process and knowing what's essential to build a flashable kernel.
mchinand said:
I think it is better to only include what is necessary in the zips. Not for space/bandwidth reasons (they were small as you said), but more for understanding the process and knowing what's essential to build a flashable kernel.
Click to expand...
Click to collapse
100 Percent agree. I appreciate the suggestion. As I said the new kernel-working.zip is updated without those files. Check OP.
Thanks
You forgot "sudo apt-get install git".
Oh, and if you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.
quetzalcoatl2435 said:
You forgot "sudo apt-get install git".
Oh, and if you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.
Click to expand...
Click to collapse
Second Post Updated. Thanks. (I don't think anyone will have the apt-get error, but if they do I will let them know).
I got that error on apt-get, which is why I mentioned it.
It was weird, I had to enable local (CD) sources to make apt-get work. It had to read the source list from the CD first before downloading the packages.
It might be a wonky install, though. I just put it here in case anyone faces the same problem.
what?
Does the kernel already includes Linaro?
omg Kristian said he'll look at it, so did he? :crying: Happy:crying:
crazymania56 said:
what?
Does the kernel already includes Linaro?
omg Kristian said he'll look at it, so did he? :crying: Happy:crying:
Click to expand...
Click to collapse
No this is only the Linaro Toolchain used to build the kernel.
Other tutorials would have you download the Android NDK for the toolchains within.. This tutorial uses the Linaro Toolchain instead.
quetzalcoatl2435 said:
I got that error on apt-get, which is why I mentioned it.
Click to expand...
Click to collapse
Added to second post. Thanks. Also made a list of credits in the OP and you are in it.
Hi, i'm trying this in Arch, i looked for the equivalent packages that are needed in ubuntu and seems that Arch has some of them in the arch-devel group of packages and the *-dev packages are included in the non-dev (arch doesn't splits the packages in dev and nondev).
So, i started unziping, and when i'm unzipping the linaro.zip, some files are overwritten, (it asks if i want to overwrite them or not), i chose yes to overwrite.
I'm compiling, so far no problems, i'll update after i finish.
nlabrad said:
Hi, i'm trying this in Arch, i looked for the equivalent packages that are needed in ubuntu and seems that Arch has some of them in the arch-devel group of packages and the *-dev packages are included in the non-dev (arch doesn't splits the packages in dev and nondev).
So, i started unziping, and when i'm unzipping the linaro.zip, some files are overwritten, (it asks if i want to overwrite them or not), i chose yes to overwrite.
I'm compiling, so far no problems, i'll update after i finish.
Click to expand...
Click to collapse
Good to know.
If it works get into the specifics and I can edit the guide or make a second one for Arch. With full credit to you of course.
Im writing this as it compiles
-No errors in make clean && make mproper
-No errors in make mrom_deconfig
The errors must be in the make.
There are a few warnings, unused functions, unused variables, uninitialized variables, i see a few modules being built, but the extension is ".o" not ".ko", for example dhd_something.o
"arch/arm/boot/compressed/head.S: Assembler messages:
arch/arm/boot/compressed/head.S:[num]: Warning: (null) (it appears a like 30 times.
Then i see, for example
"LD [M] drivers/char/hw_random/rng-core.ko" so i guess it was compiled.
Ok nevermind, the find command DOES FIND the files, but i thought that it didn´t because im used to run cp with -v, and i saw no output and i got confused.
ITS OK THEN.
Something else, after running the kitchen, its faster to press CTRL-C instead of closing/opening the terminal.
Plus you have the log of what you've been doing so far.
No current issue, the modules were compiled, i got confused.
I have the kernel zip ready to be tested.
CTRL-C will work in any bash terminal, which is the one that Ubuntu uses.
Instead of closing the terminal, it just ends the current running process (in this case, the kitchen script will end, and you get the prompt ready again).
My english is weak so if you need to change some grammar of this next few lines, feel free to do so:
So far, to compile it in Arch you need to run: (or check if you already have the packages)
pacman -Syu
pacman -S base-devel
pacman -S git
pacman -S bzip2
pacman -S unzip
Then follow the tutorial normally.
Is MROM CM9 = MROM ICS?
nlabrad said:
No current issue, the modules were compiled, i got confused.
I have the kernel zip ready to be tested.
CTRL-C will work in any bash terminal, which is the one that Ubuntu uses.
Instead of closing the terminal, it just ends the current running process (in this case, the kitchen script will end, and you get the prompt ready again).
My english is weak so if you need to change some grammar of this next few lines, feel free to do so:
So far, to compile it in Arch you need to run: (or check if you already have the packages)
pacman -Syu
pacman -S base-devel
pacman -S git
pacman -S bzip2
pacman -S unzip
Then follow the tutorial normally.
Is MROM CM9 = MROM ICS?
Click to expand...
Click to collapse
Updated Second Post. Take a look.
Docker template for building CyanogenMod
Building CyanogenMod requires quite a lot of work. You will need to install a large number of dependencies, and you will need to read through lots of documentation.
Docker is a rather new software to automate the deployment of applications inside a software container.
Here is a Docker container for running an environment which contains everything that is needed to compile CyanogenMod. It will be very easy to install, and it will just work! The Github page contains some further information on how to get started.
NOTE: You will need to install Docker to proceed: https://www.docker.io/gettingstarted/
How to run:
Code:
git clone https://github.com/stucki/docker-cyanogenmod.git
cd docker-cyanogenmod
./run.sh
How to build CyanogenMod for your device:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-13.0
repo sync
source build/envsetup.sh
brunch <device codename> # example: brunch grouper
Download:
Github URL: https://github.com/stucki/docker-cyanogenmod
ChangeLog:
see https://github.com/stucki/docker-cyanogenmod/blob/master/CHANGELOG.md
Questions and Answers:
see http://forum.xda-developers.com/android/help/qa-docker-template-building-cyanogenmod-t3173025
Any feedback is welcome. Enjoy!
michael_ch said:
Docker template for building CyanogenMod
Building CyanogenMod requires quite a lot of work. You will need to install a large number of dependencies, and you will need to read through lots of documentation.
Docker is a rather new software to automate the deployment of applications inside a software container.
Here is a Docker container for running an environment which contains everything that is needed to compile CyanogenMod. It will be very easy to install, and it will just work! The Github page contains some further information on how to get started.
How to build:
Code:
git clone https://github.com/stucki/docker-cyanogenmod.git
cd docker-cyanogenmod
./build.sh
How to run:
Code:
cd docker-cyanogenmod
./run.sh
How to build CyanogenMod for your device:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
repo sync
source build/envsetup.sh
breakfast <device codename> # example: breakfast grouper
brunch <device codename> # example: brunch grouper
Download:
Github URL: https://github.com/stucki/docker-cyanogenmod
ChangeLog:
Code:
2014-02-16
* Initial release
Any feedback is welcome. Enjoy!
Click to expand...
Click to collapse
seems interesting!!!!
Awesome !!! Thanks a lot OP
michael_ch said:
Docker template for building CyanogenMod
Click to expand...
Click to collapse
:good: nice.......
You missed one point though .....
Code:
BUILD_HOST_32bit=1 (Cyanogenmod needs 32 bit binaries to compile)
and you can incorporate this in your code
Code:
RUN apt-get purge openjdk-\* icedtea-\* icedtea6-\*
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update && sudo apt-get install oracle-java6-installer
This installs the correct jdk for cyanogenmodand resolves the incorrect jre errors some people will get..Just my 2 cents!!..
There is scope for expansion, I have a built a similar tool but not getting the time anymore to push new updates..,,,anyways keep up the good work..
Wow. This is superb. ! This will really reduce our most of the work. Thanks op
Dark Wraith said:
:good: nice.......
You missed one point though .....
Code:
BUILD_HOST_32bit=1 (Cyanogenmod needs 32 bit binaries to compile)
Click to expand...
Click to collapse
32bit libraries are installed on the system. Just try it out, I successfully built images for i9100 and grouper without specifying this line...
Dark Wraith said:
and you can incorporate this in your code
Code:
RUN apt-get purge openjdk-\* icedtea-\* icedtea6-\*
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update && sudo apt-get install oracle-java6-installer
Click to expand...
Click to collapse
Again, I don't get those errors. Anyone else encountering these problems?
Dark Wraith said:
This installs the correct jdk for cyanogenmodand resolves the incorrect jre errors some people will get..Just my 2 cents!!..
There is scope for expansion, I have a built a similar tool but not getting the time anymore to push new updates..,,,anyways keep up the good work..
Click to expand...
Click to collapse
Thank you! I will do my best...
I get this error when running
"./build.sh"
./build.sh: 10: ./build.sh: docker: not found
Dasmikko said:
I get this error when running
"./build.sh"
./build.sh: 10: ./build.sh: docker: not found
Click to expand...
Click to collapse
Well. You will need to install Docker, of course, see https://www.docker.io/gettingstarted/#h_installation.
Sorry, I thought it's clear. But I will update the post accordingly...
very interesting. will try
ubuntu 32 bit not works for this???
michael_ch said:
Well. You will need to install Docker, of course, see https://www.docker.io/gettingstarted/#h_installation.
Sorry, I thought it's clear. But I will update the post accordingly...
Click to expand...
Click to collapse
Works now
So does this create a local_manifest.xml(which is needed) for you if you're trying to build for an unsupported device
sent from my JEDI ELITE Note 3
for best xda results, click to enlarge ?
http://img268.imageshack.us/img268/9564/searchitnoob.gif
markbencze said:
So does this create a local_manifest.xml(which is needed) for you if you're trying to build for an unsupported device
Click to expand...
Click to collapse
Nope, the manifest is created by running the "breakfast" command. Check the 1st post for more info.
I have also used this box to successfully build an image for the Motorola Moto G. As this is not part of the CyanogenMod project yet, I had to install the manifest using the steps described on the following Github page: https://github.com/razrqcom-dev-team/android_local_razrqcom
Code:
# see https://github.com/razrqcom-dev-team/android_local_razrqcom
mkdir .repo/local_manifests
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
curl -L -o .repo/local_manifests/msm8226.xml -O -L https://raw.github.com/razrqcom-dev-team/android_local_razrqcom/msm8226-kk/msm8226.xml
curl -L -o .repo/local_manifests/vendor.xml -O -L https://raw.github.com/razrqcom-dev-team/android_local_razrqcom/msm8226-kk/vendor.xml
# after that, sync all repositories
repo sync
# start building falcon (that's the codename for the Moto G)
source build/envsetup.sh
brunch falcon
Kudos for this goes to @dhacker29 and his team!
michael_ch said:
Nope, the manifest is created by running the "breakfast" command. Check the 1st post for more info.
I have also used this box to successfully build an image for the Motorola Moto G. As this is not part of the CyanogenMod project yet, I had to install the manifest using the steps described on the following Github page: https://github.com/razrqcom-dev-team/android_local_razrqcom
Click to expand...
Click to collapse
Ok well maybe I'll give it a whirl then. I was trying to build beanstalk for the n3 and I init the repo referencing the cm repo I already had synced, then sunced repo etc. When I tried breakfast there was no option to choose my device.
So by using this tool and following your directions will it allow me to do so then?
sent from my JEDI ELITE Note 3
for best xda results, click to enlarge ?
http://img268.imageshack.us/img268/9564/searchitnoob.gif
Is this only cyanogenmod restricted or we can use on other ROMs also?
Sent from my GT-I9100 using XDA Premium 4 mobile app
I get permission denied?
safariking said:
I get permission denied?
Click to expand...
Click to collapse
Run with sudo
markbencze said:
So by using this tool and following your directions will it allow me to do so then?
Click to expand...
Click to collapse
This is not a tool, it is just a script which creates a virtual machine with all that is needed for building CyanogenMod.
koolkunz said:
Is this only cyanogenmod restricted or we can use on other ROMs also?
Click to expand...
Click to collapse
Looking at the build requirements for OmniROM, I think it will also work for other ROMs: http://docs.omnirom.org/Setting_Up_A_Compile_Environment
In case that something is missing, just update the Dockerfile and run build.sh to rebuild the image.
michael_ch said:
This is not a tool, it is just a script which creates a virtual machine with all that is needed for building CyanogenMod.
Looking at the build requirements for OmniROM, I think it will also work for other ROMs: http://docs.omnirom.org/Setting_Up_A_Compile_Environment
In case that something is missing, just update the Dockerfile and run build.sh to rebuild the image.
Click to expand...
Click to collapse
OK..thanks...I wanna build omni
Sent from my GT-I9100 using XDA Premium 4 mobile app
I just did a build for grouper, but I can't find the builded file.. Where does it go? and does it output a zip file?
michael_ch said:
Docker template for building CyanogenMod
Building CyanogenMod requires quite a lot of work. You will need to install a large number of dependencies, and you will need to read through lots of documentation.
Docker is a rather new software to automate the deployment of applications inside a software container.
Here is a Docker container for running an environment which contains everything that is needed to compile CyanogenMod. It will be very easy to install, and it will just work! The Github page contains some further information on how to get started.
NOTE: You will need to install Docker to proceed: https://www.docker.io/gettingstarted/
How to build:
Code:
git clone https://github.com/stucki/docker-cyanogenmod.git
cd docker-cyanogenmod
./build.sh
How to run:
Code:
cd docker-cyanogenmod
./run.sh
How to build CyanogenMod for your device:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
repo sync
source build/envsetup.sh
breakfast <device codename> # example: breakfast grouper
brunch <device codename> # example: brunch grouper
Download:
Github URL: https://github.com/stucki/docker-cyanogenmod
ChangeLog:
Code:
2014-02-16
* Initial release
Any feedback is welcome. Enjoy!
Click to expand...
Click to collapse
bro can this be used to make unofficial ports too???
System Requirements
Arch Linux x86-64
Oxygen OS(extracted image or installed)
adb installed and drivers setup
non-root user
sudo setup for your user (you can install packages as root as a workaround)
40GB free storage
4GB+ ram
Required Packages
First off you're gonna want to make sure you're completely up to date and fetch the packages required to build, with the command below.
Code:
#sudo pacman -Syyu gcc-multilib git gnupg flex bison gperf sdl wxgtk squashfs-tools curl ncurses zlib schedtool perl-switch zip unzip libxslt python2-virtualenv bc lib32-zlib lib32-ncurses lib32-readline jdk7-openjdk rsync maven repo
Then you're going to need to fetch some apps from the AUR. First add their GPG key.
Code:
#gpg --keyserver pgp.mit.edu --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
Now you can fetch them with a tool like yaourt or manually install the two packages.
lib32-ncurses5-compat-libs
ncurses5-compat-libs
Code:
#yaourt --aur lib32-ncurses5-compat-libs ncurses5-compat-libs
Setting up build enviroment and syncing
This part will assume you're building in a folder called "android" in your home directory, and requires the above packages to be installed.
Run these commands to install repo in a folder called "bin" in your home directory. Then for a single terminal session set the new "bin" folder as a binary folder in bash.
Code:
#mkdir ~/bin
#export PATH=~/bin:$PATH
#curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
#chmod a+x ~/bin/repo
Make a folder to store and build android, then enter it.
Code:
#mkdir ~/android
#cd ~/android
Setup a virtual python 2.7 enviroment in your "android" folder as repo doesn't work with 3+.
Code:
#virtualenv2 venv
#ln -s /usr/lib/python2.7/* ~/android/venv/lib/python2.7/
#source venv/bin/activate
Now it's time to sync the sourcecode with your python 2.7 and repo setup. The following code will sync CAF android 6.0.1 from oneplus. The "4" can be removed or replaced with any whole number becides zero depending on your connection speed. You may omit the "-c" if you have problems syncing or need more than the defined branches.
Code:
#repo init -u https://github.com/OnePlusOSS/android.git -b oneplus3T/6.0.1
#repo sync -j4 -c
You can also use my repo if you prefer. I'm working on improving the mess oneplus gave us.
Code:
#repo init -u https://github.com/droidman/android.git -b oneplus3T/6.0.1
#repo sync -j4 -c
Compile Your Build
Assuming your in your virtual python 2.7 and followed the first part of the guide, set openjdk 7 as your active java.
Code:
#export JAVA_HOME=/usr/lib/jvm/java-7-openjdk
Fix broken provided glib.
Code:
cp /usr/bin/ld.gold prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/bin/ld
If you're rooted and have adb installed, you may want to fetch your prebuilt files from the latest marshallow Oxygen OS or caf based rom. You may also extract them from a Oxygen OS system image but build will not complete without prebuilts.
Code:
#cp ~/android/.repo/manifests/pull_library.sh ~/android/pull.sh
#sh pull.sh
Intialize the enviroment and select a platform. You may build "msm8996-userdebug" or "msm8996-user".
Code:
#source build/envsetup.sh
#lunch msm8996-userdebug
Time to build! Find the number of threads on your cpu and set 1-2x that as "x". You may also omit "OTAackage" if you prefer to have fastboot/twrp flashable images instead of a zip, (system.img, boot.img, etc).
Code:
#make -jx OTApackage
Your compiled files and flashable zip or images will be located in "~/android/out/target/product/msm8996".
How to rebuild!
Cd into directory, sync repo, and setup enviroment.
Code:
#export PATH=~/bin:$PATH
#export JAVA_HOME=/usr/lib/jvm/java-7-openjdk
#cd ~/android
#source venv/bin/activate
#repo sync -j4 -c
#source build/envsetup.sh
#lunch msm8996-userdebug
Clean the out directory.
Code:
#make clobber
Build. (setup to make a recovery flashable zip with a 8 thread processor.)
Code:
#make -j16 otapackage
Thanks for the clean guide
Very nice and thanks for posting it. If you'd rather use whatever you've got installed on a box or VM (to pick one out of a hat, U16.04) , just google "how to build marshmallow {from your distro}". (where you fill in your distro's name & version (opt)).
For example, initial parts of "this page(see link)" might be good for 16.04 LTS users :: http://forum.xda-developers.com/chef-central/android/guide-how-to-setup-ubuntu-16-04-lts-t3363669
All the commands following the basic setup of development environment in the OP "should" work on any distro, starting with the fetch from git. Also, thanks for your personal github code.
Anyway, good job. Cheers.
I've synced your git version of oneplus' git. The problem I've having and not getting past looks like this: Oops, I guess I lost the clipboard from the VM. It was basically as if it hasn't got the dashd prebuilt or blob or whatever it was looking for. I grabbed the prebuilts via my phone running 3.5.3 which seemed to work fine.
Is your current github code building without trouble for you? I should probably re-sync. Thanks.
hachamacha said:
I've synced your git version of oneplus' git. The problem I've having and not getting past looks like this: Oops, I guess I lost the clipboard from the VM. It was basically as if it hasn't got the dashd prebuilt or blob or whatever it was looking for. I grabbed the prebuilts via my phone running 3.5.3 which seemed to work fine.
Is your current github code building without trouble for you? I should probably re-sync. Thanks.
Click to expand...
Click to collapse
The prebuilt script is currently broken, i manually copied over the files that failed with a file manager. You can also mount a system.img from a compiled oxygenOS, Oneplus Open Source or AOOP as ext4 to manually copy over the files too!
namanjr said:
The prebuilt script is currently broken, i manually copied over the files that failed with a file manager. You can also mount a system.img from a compiled oxygenOS, Oneplus Open Source or AOOP as ext4 to manually copy over the files too!
Click to expand...
Click to collapse
Oh cool. I can do that (the system.img). My question then is "where are the files on in the mounted system.img" and "do they go to "prebuilts" at top level or to "vendor" (which level, since I see vendor repeat two levels down)?
Thanks.
hachamacha said:
Oh cool. I can do that (the system.img). My question then is "where are the files on in the mounted system.img" and "do they go to "prebuilts" at top level or to "vendor" (which level, since I see vendor repeat two levels down)?
Thanks.
Click to expand...
Click to collapse
I just extracted the entire root of the system.img to "SOURCECODE/vendor/oneplus", easier than manually going through to see what files to copy over!
namanjr said:
I just extracted the entire root of the system.img to "SOURCECODE/vendor/oneplus", easier than manually going through to see what files to copy over!
Click to expand...
Click to collapse
Great. Thanks so much for the help. I'll give that a shot next.
---------- Post added at 11:01 AM ---------- Previous post was at 10:25 AM ----------
hachamacha said:
Great. Thanks so much for the help. I'll give that a shot next.
Click to expand...
Click to collapse
OK, that worked. I just had to , for some reason, use the samsung simg2img (sparse to full) util in order to mount it as ext4/loop.
Thanks again.
edit: solved
Now that I can do a make -j {target}, I've got another question:
The target OTApackage (or is it otapackage) doesn't appear to be a valid choice for me. I get a "Target doesn't exist" error if I use make -j{N} otapackage (or OTApackage). I'd like very much to be able to create the install .zip rather than have to collect & bundle all the bits & pieces. I've tried with the original OnePlus .git and your .git as well.
Thanks much.
hachamacha said:
Now that I can do a make -j {target}, I've got another question:
The target OTApackage (or is it otapackage) doesn't appear to be a valid choice for me. I get a "Target doesn't exist" error if I use make -j{N} otapackage (or OTApackage). I'd like very much to be able to create the install .zip rather than have to collect & bundle all the bits & pieces. I've tried with the original OnePlus .git and your .git as well.
Thanks much.
Click to expand...
Click to collapse
Did you setup the enviroment and run lunch? It's all lowercase! Can you post the error it gives?
namanjr said:
Did you setup the enviroment and run lunch? It's all lowercase! Can you post the error it gives?
Click to expand...
Click to collapse
Oh yeah: On the same VM, I can build versions of CM, no troubles. I've got OpenJava 7 JDK and all the right stuff. I ran lunch (It's something like either #25 or 26 on the menu, and no problems with any of that.
After quite awhile, it comes back with the "no rule to build target otapackage (whatever it was)" . I'll run a build right now and get the exact error:
Jeez! Of course, this is the time it picks to just go right past where it usually gets the error. I'm pretty sure I know what happened. I was using it as you'd printed it in the guide ^^, OTApackage, which in a case sensitive system , doesn't mean a thing. I'll post again if it dies 2 hours down the line. I should move this operation to my Linux box with SSD's but it's in use at the moment.
Thanks again.
edit: Lunch output ::
$lunch msm8996-userdebug
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
TARGET_PRODUCT=msm8996
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=kryo
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.4.0-51-generic-x86_64-with-Ubuntu-16.04-xenial
HOST_BUILD_TYPE=release
BUILD_ID=MXB48T
OUT_DIR=out
Click to expand...
Click to collapse
Damn. I just realized you had this covered as well, but I missed it first time around.
My compile finally blew out about 1/2 way through with a libart.so build error, so I did this (before I re-read your guide):
Code:
$ln -s prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/bin/ld /usr/bin/ld.gold
And we're off to the next error! ;
I believe someone has already mentioned a problem with dashd not being found, im getting the "no rule to make target..." error regarding dashd, tried to pull /sbin/dashd but the file doesn't exist. What can I do
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
hamzahrmalik said:
I believe someone has already mentioned a problem with dashd not being found, im getting the "no rule to make target..." error regarding dashd, tried to pull /sbin/dashd but the file doesn't exist. What can I do
Click to expand...
Click to collapse
Did you unpack system.img from 3.5.3 (you can check the disaster recovery thread in q&a here) and then copy the entire contents into $source/vendor/oneplus? Before I had just used a cable and adb enabled in Linux and I died at dashd as well. After I got the system.img prebuilts, it was fine.
Note: My experience:: System.img wasn't mountable as a $mount -t ext4 -o loop ... device , not recognized as that type file, so I found simg2img (For whatever reason, Samsung uses "sparse" image files and apparently so does OP) to modify system.img to a normal non-sparse system.img and then mount -t ext4 -o loop ./system.img /{mountpoint} worked fine and I copied from there to ./vendor/OnePlus/ (however it's spelled , it's the only "oneplus" folder under vendor.
hachamacha said:
Did you unpack system.img from 3.5.3 (you can check the disaster recovery thread in q&a here) and then copy the entire contents into $source/vendor/oneplus? Before I had just used a cable and adb enabled in Linux and I died at dashd as well. After I got the system.img prebuilts, it was fine.
Note: My experience:: System.img wasn't mountable as a $mount -t ext4 -o loop ... device , not recognized as that type file, so I found simg2img (For whatever reason, Samsung uses "sparse" image files and apparently so does OP) to modify system.img to a normal non-sparse system.img and then mount -t ext4 -o loop ./system.img /{mountpoint} worked fine and I copied from there to ./vendor/OnePlus/ (however it's spelled , it's the only "oneplus" folder under vendor.
Click to expand...
Click to collapse
Thanks. Can't find the thread you are referring to, so I just downloaded a 3.5.3 rom zip and I'll see what I can find
Sent from my ONEPLUS A3003 using Tapatalk
hamzahrmalik said:
Thanks. Can't find the thread you are referring to, so I just downloaded a 3.5.3 rom zip and I'll see what I can find
Sent from my ONEPLUS A3003 using Tapatalk
Click to expand...
Click to collapse
Sorry: I couldn't find it for a moment either. Here it is and if you get the .zip file in the thread that the OP user has on a torrent, then you can just unzip and use any of the 3.5.3 .img files. The other .zip files all use the newer .zip style of patching every file from things like system.img.new, etc.
http://forum.xda-developers.com/oneplus-3t/help/oneplus-3t-factory-restore-utility-t3511287
That's the thread.
hachamacha said:
Sorry: I couldn't find it for a moment either. Here it is and if you get the .zip file in the thread that the OP user has on a torrent, then you can just unzip and use any of the 3.5.3 .img files. The other .zip files all use the newer .zip style of patching every file from things like system.img.new, etc.
http://forum.xda-developers.com/oneplus-3t/help/oneplus-3t-factory-restore-utility-t3511287
That's the thread.
Click to expand...
Click to collapse
Finally got that downloaded. How do i mount? I tried mount -t ext4 -o loop ./system.img but that doesnt work. You said something about covnerting to non-sparse, how do i do that?
Thanks
hamzahrmalik said:
Finally got that downloaded. How do i mount? I tried mount -t ext4 -o loop ./system.img but that doesnt work. You said something about covnerting to non-sparse, how do i do that?
Thanks
Click to expand...
Click to collapse
There's a linux util called simg2img (or I think it means (sparse image to full image). Then you can do the mount you just tried above. It fails on the 'sparse' image. I'm not sure why the hell OP is using Samsung's sparse image but maybe it's more common than I know. I just happened upon it and it was installed on my version of Ubuntu from when I was building CMNN.N versions for other phones.
I can upload it if you like (or try). OK: I booted linux and zipped it so unzip simg2img.zip >> /usr/bin (or whatever you're using as an executable path).
hachamacha said:
There's a linux util called simg2img (or I think it means (sparse image to full image). Then you can do the mount you just tried above. It fails on the 'sparse' image. I'm not sure why the hell OP is using Samsung's sparse image but maybe it's more common than I know. I just happened upon it and it was installed on my version of Ubuntu from when I was building CMNN.N versions for other phones.
I can upload it if you like (or try). OK: I booted linux and zipped it so unzip simg2img.zip >> /usr/bin (or whatever you're using as an executable path).
Click to expand...
Click to collapse
Thank you very much, I'll give that a go
Sent from my ONEPLUS A3003 using Tapatalk
I'm curious as to what 'builders' think is the best solution (assuming you have this problem, or this type of problem on other modules) :
Problem:: (can't build libart.so) (sorry, don't have the error anymore but it has to do with ./prebuilts/*/*/.../*/ld not pointing to a version that is in sync with what's going on to the tree.
A solution(s): ln -s /usr/bin/ld.gold ./prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/ld
(why?) - I found this as a workaround in a) the original OP, b) the changesets for the problem in CM jerritt. Also setting env var "WITHOUT_HOST_CLANG=TRUE". I have yet to find a decent answer for why this might be working.
Currently: I can build the thing, but there are ~23 or so occurrences of ./ld in the ./prebuilts tree. Is that really the best solution , changing each of these things to be soft pointers to /usr/bin/ld.gold?
If anyone has a better answer (or a real answer), would love to hear it. Yes, it builds, but the reason this seems so hokey is because if you did, for example, a "make clobber" before a build to clean out the trash, you'd be back at square one. Of course, you could make it part of a script..
edit: gerritt refs: (they are quite "old" so the problems been around in CM for quite awhile. We're just building stock here.
https://review.cyanogenmod.org/#/c/120824/
https://android-review.googlesource.com/#/c/223100/
Click to expand...
Click to collapse
edit2: Return of --version or -v from /usr/bin/ld, ld.gold to see the difference:
Code:
/usr/bin/ld -v
GNU ld (GNU Binutils for Ubuntu) 2.26.1
[email protected]:~/sandbox/op3t$ /usr/bin/ld.gold -v
GNU gold (GNU Binutils for Ubuntu 2.26.1) 1.11
Edit 3: Explanation of ld.gold:
http://llvm.org/docs/GoldPlugin.html
Click to expand...
Click to collapse