I know there's another thread about this, but that was kind of outdated, so I decided to do another one. Here we goo~
Requirements :-
Ubuntu 11.10 64bit (this is what I'm using, I won't make a guide for others)
Decent Internet connection
At least 50GB of hard disc space
4GBs of ram
Dual Core processor
and patience.
First off, we need to download and install some stuff.. Type in each line one by one.
Code:
sudo -i
add-apt-repository ppa:ferramroberto/java
apt-get update
apt-get install sun-java6-jdk sun-java6-jre sun-java6-plugin
apt-get install python
apt get install git-core
Now that your Java is downloaded, we need to get some extra files.
Code:
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
Note that liv32readline5-dev might not be available anymore, if that's the case, remove that from the code, run it and run an extra line after you've done the one on top
Code:
apt-get install lib32readline-gplv2-dev
then this
Code:
ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
Now we get to setup directories for your source and repo !
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
If you noticed, everytime you start your ubuntu you need to type in "PATH=~/bin:$PATH" again before you can repo. To fix this :
Code:
sudo gedit ~/.bashrc
then add in
Code:
export = PATH=~/bin:$PATH"
Now we make a directory for your source, you can use any name you want, in this case I'm using CMSOURCE (this IS case sensitive, btw.)
Code:
mkdir CMSOURCE
cd CMSOURCE
Now we can initialize repo
Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics
If you want Jelly Bean
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean-stable
then
Code:
repo sync
or
Code:
repo sync -j1
or
Code:
repo sync -j16
I suggest only to try the -j1 and -j16 ONLY IF there is problem by using the normal repo sync. Honestly I don't know what this does but from my experience, j1 is slower but apparently more stable. j16 is faster but chances of corrupting is higher. but I've only ran this once so I'm not really sure. Don't take my word on this.
This WILL take awhile, go watch a movie, feed your pet, skydive, drink coffee, drink beer or something.
After that's done, you need to get some files for your Cyanogen build, eg Rom Manager. Without these files it wont compile correctly.
Code:
cd CMSOURCE/vendor/cm
./get-prebuilts
Now we've got to get some files from the phone, but I'm using the one from google, rather than extracting from the phone.
http://code.google.com/android/nexus/drivers.html
Go there, click Maguro , download the files, extract it anywhere, and run it inside a terminal. (just drag the file into the terminal, press enter and choose run. follow the instructions on screen. you need all of them. )
ALRIGHTY! If you've done all these steps without any problem, it's time to compile!
Code:
cd
cd CMSOURCE
source build/envsetup.sh
brunch
and choose your device
This takes about 3 and a half hours on my friends alienware m15x.
On my desktop it takes about 1 and a half hour. Just over night it to be safe.
Before re-compiling, clean your work folder first.
Code:
make clobber
To update your sources,
Code:
repo sync
I'm new at this compiling thing, so if anything is wrong please tell. I just wrote this to help if someone is running into problems like I did.
optional/old/useless
we need to add a line to specify where our kernel is before we can build, so do this.
Code:
sudo -i
nautilus
go to
CMSOURCE/device/samsung/maguro
Open BoardConfig.mk
add
Code:
TARGET_KERNEL_CONFIG := cyanogenmod_maguro_defconfig
TARGET_PREBUILT_KERNEL := device/samsung/tuna/kernel
save, close.
Cherry Picking
WILL UPDATE.
Do you then use this for you're own personal use or do you upload this to a server so others can download it as a nightly?
Sent from my Galaxy Nexus using Tapatalk 2 Beta-5
SupWiz17 said:
Do you then use this for you're own personal use or do you upload this to a server so others can download it as a nightly?
Sent from my Galaxy Nexus using Tapatalk 2 Beta-5
Click to expand...
Click to collapse
Right now I'm using it myself first. I'm planning on making a rom but that's a long time from now. I can upload it to a server but I don't have one. Not gonna buy one just to upload
Anyways there's someone compiling and uploading builds already. Check out this link
JunyuT. said:
Right now I'm using it myself first. I'm planning on making a rom but that's a long time from now. I can upload it to a server but I don't have one. Not gonna buy one just to upload
Anyways there's someone compiling and uploading builds already. Check out this link
Click to expand...
Click to collapse
I got it now. I'm going to give this a try and will let you know how it goes. This is really cool how you can build your own operating system for your phone.
Sent from my Galaxy Nexus using Tapatalk 2 Beta-5
Although I really like the fact that more guides appear, I recently wrote one myself (and it really isn't outdated at all ): http://forum.xda-developers.com/showthread.php?t=1566224
Edit:
also, read my guide. There are some differences. For instance, when you use the brunch command, you shouldn't have to use the make command. And, if you use the make command, you can change the number behind j. That'll make your build go faster. And last, in the future you don't have to specify your kernel, there will be a commit soon that fixes this issue.
mbroeders said:
Although I really like the fact that more guides appear, I recently wrote one myself (and it really isn't outdated at all ): http://forum.xda-developers.com/showthread.php?t=1566224
Edit:
also, read my guide. There are some differences. For instance, when you use the brunch command, you shouldn't have to use the make command. And, if you use the make command, you can change the number behind j. That'll make your build go faster. And last, in the future you don't have to specify your kernel, there will be a commit soon that fixes this issue.
Click to expand...
Click to collapse
ah yeah! My bad. I constantly change from brunch to lunch so sometimes I get mixed up. Thanks for the heads up Guide is fixed.
I used your guide, but I got stuck at the kernel part. Couldn't find a fix for it and no one updated their guide and that's why I wrote mine. This is what I meant by outdated
Nice guide I will definitely use both of these as I try to compile cm9.
Sent from my Galaxy Nexus using Tapatalk 2 Beta-5
JunyuT. said:
ah yeah! My bad. I constantly change from brunch to lunch so sometimes I get mixed up. Thanks for the heads up Guide is fixed.
I used your guide, but I got stuck at the kernel part. Couldn't find a fix for it and no one updated their guide and that's why I wrote mine. This is what I meant by outdated
Click to expand...
Click to collapse
No worries, great effort Hopefully the kernel part will be fixed soon.
Edit:
Just checked, adding kernel to boardconfig is def not necessary anymore (http://review.cyanogenmod.com/#/c/14792/)
mbroeders said:
No worries, great effort Hopefully the kernel part will be fixed soon.
Edit:
Just checked, adding kernel to boardconfig is def not necessary anymore (http://review.cyanogenmod.com/#/c/14792/)
Click to expand...
Click to collapse
Just checked, yeap its not necessary anymore! But they seem to recommend it though..
Sent from my Galaxy Nexus using xda premium
when i compile this i get a warning
Code:
build/core/tasks/kernel.mk:26: ***************************************************************
build/core/tasks/kernel.mk:27: * Using prebuilt kernel binary instead of source *
build/core/tasks/kernel.mk:28: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED *
build/core/tasks/kernel.mk:29: * Please configure your device to download the kernel *
build/core/tasks/kernel.mk:30: * source repository to kernel/samsung/tuna
build/core/tasks/kernel.mk:31: * See http://wiki.cyanogenmod.com/wiki/Integrated_kernel_building
build/core/tasks/kernel.mk:32: * for more information *
build/core/tasks/kernel.mk:33: ***************************************************************
do i need to download the kernel repo on top of the ics one? it compiles through though but i get an awful greenish tint and the camera is not working. any hints on how to integrate the real kernel would be appreciated. i read the wiki page and its says "The minimal requirement is that the kernel's source tree for that device be present at kernel/vendor-name/device-name." but that to me is cryptic, as i have little experience.
and two questions,
1. can i specify how many threads i'd like to use to compile with brunch? it justs starts to build and it does for hoouuurrrsss. i tried lunch and i could call make -jN afterwards, but it created odex files which i dont want.
2. any tipps on how to use the emulator? i call it but the window stays blank. i got it to work once with a lunch 1 full-eng build but then i get some weird looking interface without launcher. is it even possible to emulate a nexus with software buttons and all? this would be perfect as i intent to make some changes to the code.
the rom i made with these tipps be found here, if anyone wanna help or team up, that would be super!
thanks so much for this helpful post!
molesarecoming said:
when i compile this i get a warning
Code:
build/core/tasks/kernel.mk:26: ***************************************************************
build/core/tasks/kernel.mk:27: * Using prebuilt kernel binary instead of source *
build/core/tasks/kernel.mk:28: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED *
build/core/tasks/kernel.mk:29: * Please configure your device to download the kernel *
build/core/tasks/kernel.mk:30: * source repository to kernel/samsung/tuna
build/core/tasks/kernel.mk:31: * See http://wiki.cyanogenmod.com/wiki/Integrated_kernel_building
build/core/tasks/kernel.mk:32: * for more information *
build/core/tasks/kernel.mk:33: ***************************************************************
do i need to download the kernel repo on top of the ics one? it compiles through though but i get an awful greenish tint and the camera is not working. any hints on how to integrate the real kernel would be appreciated. i read the wiki page and its says "The minimal requirement is that the kernel's source tree for that device be present at kernel/vendor-name/device-name." but that to me is cryptic, as i have little experience.
and two questions,
1. can i specify how many threads i'd like to use to compile with brunch? it justs starts to build and it does for hoouuurrrsss. i tried lunch and i could call make -jN afterwards, but it created odex files which i dont want.
2. any tipps on how to use the emulator? i call it but the window stays blank. i got it to work once with a lunch 1 full-eng build but then i get some weird looking interface without launcher. is it even possible to emulate a nexus with software buttons and all? this would be perfect as i intent to make some changes to the code.
the rom i made with these tipps be found here, if anyone wanna help or team up, that would be super!
thanks so much for this helpful post!
Click to expand...
Click to collapse
Team up? Sure! You have a PM about this
The camera is not working due to wrong sources. I don't know why CM hasn't fixed this or this is faulty on my part, but I fixed it and forgot to update the guide. Basically you need props from koush. Here's the link
Code:
https://github.com/koush/proprietary_vendor_samsung
https://github.com/koush/proprietary_vendor_imgtec
What I did was just download it as a zip and paste it in the directory, I know this isn't the correct way but I have no idea how to merge them together.
I don't know about the kernel though, will experiment more
Finally got it going last night. Im still working on getting a successful run but thanks for the great guide.
---------- Post added at 02:08 PM ---------- Previous post was at 01:19 PM ----------
I keep getting the same error as its building. I have tried it three times now and get the same error every time. Does anyone have a fix for this?
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/mark/CM9/kernel/samsung/tuna'
make: *** [TARGET_KERNEL_BINARIES] Error 2
make: *** Waiting for unfinished jobs....
SupWiz17 said:
Finally got it going last night. Im still working on getting a successful run but thanks for the great guide.
---------- Post added at 02:08 PM ---------- Previous post was at 01:19 PM ----------
I keep getting the same error as its building. I have tried it three times now and get the same error every time. Does anyone have a fix for this?
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/mark/CM9/kernel/samsung/tuna'
make: *** [TARGET_KERNEL_BINARIES] Error 2
make: *** Waiting for unfinished jobs....
Click to expand...
Click to collapse
Did you add the pre built kernel line? Anyways give me some time. I just upgraded to 12.04 and it ****ed everything up. Now I've got to do everything over again.
Sent from my Galaxy Nexus using xda premium
JunyuT. said:
Did you add the pre built kernel line? Anyways give me some time. I just upgraded to 12.04 and it ****ed everything up. Now I've got to do everything over again.
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
I added the pre built kernel today to try something new but now I get
***
*** Can't find default configuration "arch/arm/configs/cyanogenmod_maguro_defconfig"!
***
make[3]: *** [cyanogenmod_maguro_defconfig] Error 1
make[2]: *** [cyanogenmod_maguro_defconfig] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/mark/CM9/kernel/samsung/tuna'
make: *** [/home/mark/CM9/out/target/product/maguro/obj/KERNEL_OBJ/.config] Error 2
make: *** Waiting for unfinished jobs....
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
I feel like Im missing some drivers or something important like that but I have followed a few different guides now and cant get it to work. I stayed with 11.10 for that reason I couldnt get java to work lol
---------- Post added at 09:14 PM ---------- Previous post was at 09:09 PM ----------
I have been reading about needing an older version of gcc to compile with 11.10. I notice that is not in your guide but in others. Is that part of the reason I am not able to compile properly?
SupWiz17 said:
I added the pre built kernel today to try something new but now I get
***
*** Can't find default configuration "arch/arm/configs/cyanogenmod_maguro_defconfig"!
***
make[3]: *** [cyanogenmod_maguro_defconfig] Error 1
make[2]: *** [cyanogenmod_maguro_defconfig] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/mark/CM9/kernel/samsung/tuna'
make: *** [/home/mark/CM9/out/target/product/maguro/obj/KERNEL_OBJ/.config] Error 2
make: *** Waiting for unfinished jobs....
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
I feel like Im missing some drivers or something important like that but I have followed a few different guides now and cant get it to work. I stayed with 11.10 for that reason I couldnt get java to work lol
---------- Post added at 09:14 PM ---------- Previous post was at 09:09 PM ----------
I have been reading about needing an older version of gcc to compile with 11.10. I notice that is not in your guide but in others. Is that part of the reason I am not able to compile properly?
Click to expand...
Click to collapse
I doubt it, I just did a full format and recompiled everything with this guide.
Did you install 12.04 or 11.10? So you dont install any other programs then what is in your guide? From what I am reading I am having a problem with having the right compiler for some reason. I will re format though and try it again and see if that makes any sort of difference.
---------- Post added at 10:48 PM ---------- Previous post was at 10:41 PM ----------
If I tried the way you get the files from the phone by downloading the three files and running them in terminal and tried the way I read it in another thread but running a script could that be the cause for it not being able to compile properly? Does it make sense that they could be interfering with eachother?
---------- Post added at 10:52 PM ---------- Previous post was at 10:48 PM ----------
I tried one last time before the reformat just to see and got new errors I was never getting before. I am just going to start all over and see what happens.
*** Can't find default configuration "arch/arm/configs/cyanogenmod_maguro_defconfig"!
***
target thumb C: libc_common <= bionic/libc/netbsd/net/getservent.c
target thumb C: libc_common <= bionic/libc/netbsd/net/base64.c
bionic/libc/netbsd/net/getnameinfo.c: In function 'android_gethostbyaddr_proxy':
bionic/libc/netbsd/net/getnameinfo.c:186: warning: passing argument 3 of 'inet_ntop' from incompatible pointer type
bionic/libc/include/arpa/inet.h:45: note: expected 'char *' but argument is of type 'char (*)[46]'
bionic/libc/netbsd/net/getaddrinfo.c: In function 'android_getaddrinfo_proxy':
bionic/libc/netbsd/net/getaddrinfo.c:455: warning: dereferencing type-punned pointer might break strict-aliasing rules
bionic/libc/netbsd/net/getaddrinfo.c:455: warning: dereferencing type-punned pointer might break strict-aliasing rules
target thumb C: libc_common <= bionic/libc/netbsd/net/getservbyport.c
make[3]: *** [cyanogenmod_maguro_defconfig] Error 1
make[2]: *** [cyanogenmod_maguro_defconfig] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/mark/CM9/kernel/samsung/tuna'
make: *** [/home/mark/CM9/out/target/product/maguro/obj/KERNEL_OBJ/.config] Error 2
make: *** Waiting for unfinished jobs....
SupWiz17 said:
Did you install 12.04 or 11.10? So you dont install any other programs then what is in your guide? From what I am reading I am having a problem with having the right compiler for some reason. I will re format though and try it again and see if that makes any sort of difference.
---------- Post added at 10:48 PM ---------- Previous post was at 10:41 PM ----------
If I tried the way you get the files from the phone by downloading the three files and running them in terminal and tried the way I read it in another thread but running a script could that be the cause for it not being able to compile properly? Does it make sense that they could be interfering with eachother?
---------- Post added at 10:52 PM ---------- Previous post was at 10:48 PM ----------
I tried one last time before the reformat just to see and got new errors I was never getting before. I am just going to start all over and see what happens.
*** Can't find default configuration "arch/arm/configs/cyanogenmod_maguro_defconfig"!
***
target thumb C: libc_common <= bionic/libc/netbsd/net/getservent.c
target thumb C: libc_common <= bionic/libc/netbsd/net/base64.c
bionic/libc/netbsd/net/getnameinfo.c: In function 'android_gethostbyaddr_proxy':
bionic/libc/netbsd/net/getnameinfo.c:186: warning: passing argument 3 of 'inet_ntop' from incompatible pointer type
bionic/libc/include/arpa/inet.h:45: note: expected 'char *' but argument is of type 'char (*)[46]'
bionic/libc/netbsd/net/getaddrinfo.c: In function 'android_getaddrinfo_proxy':
bionic/libc/netbsd/net/getaddrinfo.c:455: warning: dereferencing type-punned pointer might break strict-aliasing rules
bionic/libc/netbsd/net/getaddrinfo.c:455: warning: dereferencing type-punned pointer might break strict-aliasing rules
target thumb C: libc_common <= bionic/libc/netbsd/net/getservbyport.c
make[3]: *** [cyanogenmod_maguro_defconfig] Error 1
make[2]: *** [cyanogenmod_maguro_defconfig] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/mark/CM9/kernel/samsung/tuna'
make: *** [/home/mark/CM9/out/target/product/maguro/obj/KERNEL_OBJ/.config] Error 2
make: *** Waiting for unfinished jobs....
Click to expand...
Click to collapse
11.10 and 12.04, but I prefer 11.10. Easier. you need a lot of extra work with 12.04.
Nope, clean ubuntu.
Nope, shouldn't. Even if it does, it should compile properly but things might not work.
I compiled with the prop files from google and my camera, youtube and some other stuff wouldn't work. but it compiled nicely, all I had to do to fix it was get the prop files from koush and recompiled and everything worked.
Have you tried cleaning the build directory before rebuilding? Old broken projects might be the cause.
Code:
make clobber
I did a full reformat and was able to compile a successful .zip. The only program I had to add was schedtool. I used the files from google like you did and it compiled but I have not flashed it yet. I will and if it doesnt work I will use the script from the other thread and hopefully will have the same success that you did. Thanks again for the great guide.
Thank you very much for your guide!
After a little bit of problems because of Ubuntu 12 (installing jdk etc) I finally got it to compile - let's see if it finishes without errors
Abomb said:
Thank you very much for your guide!
After a little bit of problems because of Ubuntu 12 (installing jdk etc) I finally got it to compile - let's see if it finishes without errors
Click to expand...
Click to collapse
Haha! I never got to compiling. It said I have Java7 and I needed 6..
Sent from my Galaxy Nexus using xda premium
Related
So... I download the kernel source from HTC (http://developer.htc.com) and I found this blog that got me started on compiling it...
http://blog.coralic.nl/2009/10/25/how-to-compile-the-htc-hero-kernel/comment-page-1/#comment-42
Well, at first attempt, I got an error that make couldn't find the rule to make projector.o. Well, I went through the .config and changed that option to No...
Then, it gets all the way to where it looks like it's going to make vmlinux1 and it errors out with the message "arm-eabi-ld: no machine record defined .... make: *** [.tmp_vmlinux1] Error 1"
Has anybody successfully compiled the source yet?
jmanley69 said:
So... I download the kernel source from HTC (http://developer.htc.com) and I found this blog that got me started on compiling it...
http://blog.coralic.nl/2009/10/25/how-to-compile-the-htc-hero-kernel/comment-page-1/#comment-42
Well, at first attempt, I got an error that make couldn't find the rule to make projector.o. Well, I went through the .config and changed that option to No...
Then, it gets all the way to where it looks like it's going to make vmlinux1 and it errors out with the message "arm-eabi-ld: no machine record defined .... make: *** [.tmp_vmlinux1] Error 1"
Has anybody successfully compiled the source yet?
Click to expand...
Click to collapse
Try "make msm7200a_defconfig" before compiling, do not pull config.gz.
Lox_Dev said:
Try "make msm7200a_defconfig" before compiling, do not pull config.gz.
Click to expand...
Click to collapse
That was a very good starting point...
It all comes down to these two lines
On the config from my phone it says
Code:
# CONFIG_ARCH_MSM7200A is not set
CONFIG_ARCH_MSM75010A=y
on msm7200a_defconfig, it has
Code:
CONFIG_ARCH_MSM7200A=y
# CONFIG_ARCH_MSM75010A is not set
Also, msm7200a_defconfig has these two extra lines that don't exist at all in my config
Code:
CONFIG_MACH_SAPPHIRE=y
CONFIG_MACH_HERO=y
That wouldn't be too big a problem, but my config has
Code:
# CONFIG MSM_AMSS_SUPPORT_256MB_EBI1 is not set
and msm7200a_defconfig has
Code:
CONFIG_MSM_AMSS_SUPPORT_256MB_EBI1=y
and without that set, SAPPHIRE.o won't compile because an integer is long instead of unsigned....
Any idea how I can figure out the correct file to fix for the CONFIG_ARCH_MSM75010A? I looked in /arch/arm/Makefile, and it says ARCH_MSM7XXXX points to msm, and I look in /arch/arm/msm/Makefile, and don't see anything referencing either MSM7200A or MSM75010A, but 7200A has to be someplace
Standard config pulled from running 1.5 should compile just fine.
Done it countless times myself.
What version of the toolchain are you running?
packetlss said:
Standard config pulled from running 1.5 should compile just fine.
Done it countless times myself.
What version of the toolchain are you running?
Click to expand...
Click to collapse
/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
Just tried it myself with the same toolchain:
Code:
[email protected]:~/android/kernel/kernel_hero$ [B]cp config-gsm-stock .config[/B]
[email protected]:~/android/kernel/kernel_hero$ [B]CROSS_COMPILE=~/android/src/aosp/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make[/B]
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
...
<lots of muck removed>
....
SYSMAP System.map
SYSMAP .tmp_System.map
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
GZIP arch/arm/boot/compressed/piggy.gz
AS arch/arm/boot/compressed/piggy.o
CC arch/arm/boot/compressed/misc.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 0 modules
[email protected]:~/android/kernel/kernel_hero$ [B]ls -al arch/arm/boot/zImage[/B]
-rwxr-xr-x 1 mange mange 1648748 2009-12-05 02:13 arch/arm/boot/zImage
[email protected]:~/android/kernel/kernel_hero$
The error your getting is usually due to a incomplete machine specification for the linker.
Try and checkout the prebuilt stuff again from AOSP, it's possibly corrupted.
Mine is master branch, synced yesterday.
I have gotten every thing to work except the routing issue which is weird because I had it working fine and everything so I don't know. You need to make sure that you have root and that you have busy box installed and set up correctly install in
Install busybox in /system/xbin
openvpn install /system/xbin/openvpn
/sdcard/openvpn goes the client config files what ever they are for your cisco or watchgaurd vpn .vpn or.ovpn file
make sure the tun.ko is in /system/lib/modules
I don't have time to make a complete walk through I will answer any questions though as soon as I get a chance because its pissed me off when I was doing this when people just stopped helping me.
I want to thank satash for the help he isnt on this forum but he was a big help with seting up the devolopment envioment when this post kept getting moved around for stupid reasons.
CODE
adb pull /proc/config.gz .
gunzip config.gz
mv config .config
* Copy the config file .config file to the kernel root folder -
CODE
cp .config ~/android/glacier-2.6.32-g52a2a81/
* CD to kernel source folder -
CODE
cd ~/android/glacier-2.6.32-g52a2a81/
gedit .config
* Edit the .config file to include tun.ko as module -
CODE
# CONFIG_TUN in not included
to
CODE
CONFIG_TUN=m
* Launch adb shell from the Android SDK folder and run uname -
CODE
cd ~/android/android-sdk-linux_86/tools
sudo ./adb shell
# cat /proc/version
Linux version 2.6.32.21-g899d047 ([email protected]) (gcc version 4.4.0 (GCC) ) #1 PREEMPT Tue Oct 26 16:10:01 CST 2010
* CD to kernel source folder and edit the Makefile -
CODE
cd ~/android/glacier-2.6.32-g52a2a81/
gedit Makefile
* Modify the following line to correspond with the kernel version -
CODE
EXTRAVERSION =
to
CODE
EXTRAVERSION = .21-g899d047
* Set Environment Variables -
CODE
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/android/android-ndk-r5/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/
* Now, make sure you can run arm-eabi-gcc from your Command Line
* Perform make modules from the kernel source folder -
CODE
cd ~/android/glacier-2.6.32-g52a2a81/
make modules
* That's all, you should be able to find the tun.ko under ~/android/glacier-2.6.32-g52a2a81/drivers/net/ in theory
Zimage
http://www.megaupload.com/?d=FPGVD4I5 You dont need to flash this this is only if you want to test and see if I was able to build it in to the kernal tun.ko still has to be in the modules folder
Tun.ko
http://www.megaupload.com/?d=4HUYDY9G
Ok install Gscript
and load these scripts in to them
tunup this will load the tun.ko module
http://www.megaupload.com/?d=0NUMNWNS
Here is the routing fix well thats supposed to work that isnt right now so if anyone has an Idea on how to fix this script please let me know.
#! /bin/bash
ip rule del from all lookup gprs
ip rule del from all lookup wifi
P.S make sure your APN is internet3.voicestream.com or you will just get pissed off and never figure it out lol.
also when I do the g++ -o hello.o hello.cpp i get
dlaf[email protected]:~/Documents/Android1/glacier-2.6.32-g52a2a81$ g++ -o hello.o hello.cpp
g++: hello.cpp: No such file or directory
g++: no input files
Please post discussions in general section.
Whosdaman said:
Please post discussions in general section.
Click to expand...
Click to collapse
I could be wrong, but this is directly related to development...
slhpss said:
I could be wrong, but this is directly related to development...
Click to expand...
Click to collapse
Yes, bu there is no actually files being developed. If there was something like try this file and it fixes something, then yes it's development
Well the point of this thread is that once i get a respose and figure it out I was going put a link to the compiled tun.ko in this thread
No one??? come on I would think this would be a standard developer question
probably would be better if this was in the development section... you might get a few more responses..
Check your path.
try adding CROSS_COMPILE=/absolute_path_to_arm_compiler/bin/arm-eabi-
before your make command (i.e.)
CROSS_COMPILE=/home/me/android/ndk/bin/arm-eabi- make
Whosdaman followed XDA policy with regards to Development sections. Once you have compiled code ready to go, we can either move this thread back or you can create a new thread.
that didnt work for me and Actually i accedently ended up nukeing my ubuntu install so I am installing it again ill let you know how it goes second time around
Help
[email protected]:~/android/glacier-2.6.32-g52a2a81$ CROSS_COMPILE=~/android/android-ndk-r4/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/ make
make: /home/dlafortune/android/android-ndk-r4/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/gcc: Command not found
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CC kernel/bounds.s
/bin/sh: /home/dlafortune/android/android-ndk-r4/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
[email protected]:~/android/glacier-2.6.32-g52a2a81$ CROSS_COMPILE=~/android/android-ndk-r4/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/ make modules
make: /home/dlafortune/android/android-ndk-r4/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/gcc: Command not found
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CC kernel/bounds.s
/bin/sh: /home/dlafortune/android/android-ndk-r4/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
[email protected]:~/android/glacier-2.6.32-g52a2a81$
Im still not getting this somthing is messed up anyone kknow whats up???
hmm
did you make sure to set all the variables?Another thing that works is rebooting the PC.
I have run in to some problems setting up the gcc enviroment if someone could help me out .
[email protected]:~$ export ARCH=arm
[email protected]:~$ export CROSS_COMPILE=arm-eabi-
[email protected]:~$ export PATH=$PATH:~/android/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/
[email protected]:~$ cd '/home/dlafortune/android/glacier-2.6.32-g52a2a81'
[email protected]:~/android/glacier-2.6.32-g52a2a81$ make modules
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CC kernel/bounds.s
arm-eabi-gcc: error trying to exec 'cc1': execvp: No such file or directory
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
[email protected]:~/android/glacier-2.6.32-g52a2a81$
Im starting to feel really stupid i set the environment variables and it doesnt work same error every time i dont get it. I tried to find your post but I couldnt find it Im sorry im really trying to figure this out its kicking my ass. any ideas???
I have tried to set the path as a absolute path as well.
I'm working on compiling this myself. Getting my environment setup right now.
but shouldn't it be EXTRAVERSION= .21-g899d047
(in your original compiled tun.ko)
Seems that would be the obvious point of failure based on what I know and based on the error I'm getting when I insmod your compiled tun.ko
I should know more in a couple of hours.
Question, what is this? Just curious
It is needed for using OpenVPN
rogabean said:
It is needed for using OpenVPN
Click to expand...
Click to collapse
Thanks, appreciate it
Ok may not get to test compile tonight. Taking me a little longer than I thought to get setup. I just switched to a new install of Snow leopard.
I dont think so cause I got it all working I had it working except wifi then I redid it to get wifi working and now im haveing problems with Open vpn FATAL:ifconfig faild to exicute external command. No but I had it working and I logged in to my watchgaurd vpn over lunch today I was so dam happy now I can't Get the dam thing to work I have more notes and guides and scripts you have Pm me if anyone has problems Also I recompiled both of those So ill have to repost them tomorow so ill let you know if I get it 100% tonight
Now that the code is out, let's start hacking the Xoom.
These instructions are for Linux 64-bit Ubuntu 11.10 / Mint 12, with latest updates.
follow directions on source.android.com to set up your environment
then move to next page to set up the repo and download the code
make sure you use Sun/Oracle Java Development Kit 1.6.x. It WILL NOT work with OpenJDK, which comes with Ubuntu 11.10/Mint 12. (best is remove OpenJDK to avoid hard to track errors)
downloading the code takes ages (a good 2h even with a good connection) and requires at least 2GB of hard disk space. But for compilation, I'd recommend to have 20GB at least.
download proprietary drivers at: http://tinyurl.com/6rfu8rn
extract the drivers from Broadcom and NVidia, this will gives you 2 .sh files
just run these 2 .sh files and copy the created vendor/ directory into the root of your Google code repo.
There are 2 kinds of Xoom
Xoom Verizon LTE, codename stingray
Xoom wifi, codename wingray
Make some corrections in the code for GCC 4.6
external/mesa3d/src/glsl/linker.cpp: l.70 add: #include <cstddef>
To build the code:
. ./build/envsetup.sh
lunch full_stingray-userdebug or full_wingray-userdebug
make -j5
This can take 2h to compile on an average machine like my MacBook Pro with 8GB RAM (very important to have more than 4GB!!!), or even more. And having a quad-core machine (or even more cores), really saves you tons of time!
Once compilation is done, it's time to flash:
go to out/target/product/wingray (or stingray)
put your Xoom in fastboot mode: power off, then volume down + power on
fastboot erase cache
fastboot erase userdata
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot reboot
Note: you don't need to flash recovery.img, you should instead flash ClockworkMod recovery (http://download.clockworkmod.com/recoveries/recovery-clockwork-4.0.0.4-stingray.img)
And voila, you have a Xoom with WiFi working and all goodies from AOSP. This means no Google apps like Market...
To install Google Apps:
download this zip file [http://www.mediafire.com/?1l4ravroiwt4ybw[/url]
unzip it and go inside the folder
boot your device normally
rm system/app/Nfc*
adb push system /system
adb reboot
There are some errors with exchange service but Market, GMail, Maps work correctly. From there, go update your apps from Market
Enjoy!
Update 1: Android 4.0.1 issues back in 4.0.3?
Some people noted some compilation errors I didn't get on 4.0.3 but on 4.0.1. Here are solutions for 4.0.1 (emulator) that may work for you:
build/core/combo/HOST_linux-x86.mk:61 HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
build/core/combo/javac.mk:15 COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -source 1.5 -Xmaxerrs 9999999
frameworks/base/libs/util/Android.mk: 63 LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
libcore/luni/src/main/java/java/lang/Enum.java: 128 return ordinal - o.ordinal ();
external/gtest/include/gtest/internal/gtest-param-util.h:40 #include <cstddef> (after #include <vector>)
How much space just to tinker with ICS/gingerbread?
I have a 1.5 mbps DSL connection and 200gb would take me 8 day/24 hour of downloading and I cant do that.
Kippui said:
How much space just to tinker with ICS/gingerbread?
I have a 1.5 mbps DSL connection and 200gb would take me 8 day/24 hour of downloading and I cant do that.
Click to expand...
Click to collapse
I do my building in a VM and the virtual disk image that has ubuntu and AOSP has grown to 45 GB after a compile.
Also, question for OP... why don't we see people using "make -j otapackage" to create CWM compatible ROMs? Just make sure it doesn't have a recovery in it (or it will torch your existing recovery). I torched my recovery the first time I did it, but I think I fixed it (haven't reflashed to find out).
It builds just fine with 3 GB of RAM in my VM here. Takes around 1 hour for me, with 6 CPU threads assigned to the VM, and using -j6. I just wish I could make sure it doesn't waste time compiling the various demos and tests.
I'm also using ccache to speed up (re)building. Google has instructions on how to set it up (it's really easy). Copied from their page (http://source.android.com/source/initializing.html):
You can optionally tell the build to use the ccache compilation tool. Ccache acts as a compiler cache that can be used to speed-up rebuilds. This works very well if you do "make clean" often, or if you frequently switch between different build products.
Put the following in your .bashrc or equivalent.
export USE_CCACHE=1
By default the cache will be stored in ~/.ccache. If your home directory is on NFS or some other non-local filesystem, you will want to specify the directory in your .bashrc as well.
export CCACHE_DIR=<path-to-your-cache-directory>
The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code.
prebuilt/linux-x86/ccache/ccache -M 50G
This setting is stored in the CCACHE_DIR and is persistent.
Click to expand...
Click to collapse
I have it set to only 10 GB here, but if you intend to do a lot of rebuilding, 20-40 GB might be a better idea.
The full AOSP tree + out directory takes 24G on my machine using du -sh.
The OTA package is 90MB, including the recovery, which you probably want to remove.
Indeed, I forgot to mention using USE_CCACHE, it really speeds up your builds. Make sure your cache dir is the top of your AOSP tree, it's even better.
Hi,
Huge thanks for those usefull instructions.
Just a hint for Gentoo builders (and maybe others distrib), if you're having this error after the "lunch" command :
Code:
AOSP> lunch full_wingray-userdebug
build/core/config.mk:268: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com. Stop.
** Don't have a product spec for: 'full_wingray'
** Do you have the right repo manifest?
just export env ANDROID_JAVA_HOME with full jdk path :
Code:
export ANDROID_JAVA_HOME=/opt/sun-jdk-1.6.0.29/
winglord said:
There are 2 kinds of Xoom
Xoom Verizon LTE, codename stingray
Xoom wifi, codename wingray
Click to expand...
Click to collapse
There's three kinds of Xoom, the GSM MZ601 as well (Moto's codename everest). This is not supported by Google, but hopefully the hardware is close enough to stingray that the port shouldn't be overly difficult. At worst, the port to everest might have issues with vendor_ril?
please post your finished from.
Sent from my Full Android on Wingray using Tapatalk
Does someone know if there is a way to run builded images into the sdk emulator ?
Not sure what I am doing wrong:
Code:
/ICS_SOURCE# make -j4 otapackage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.3
TARGET_PRODUCT=full_wingray
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IML74K
============================================
build/core/main.mk:324: implicitly installing apns-conf_sdk.xml
No private recovery resources for TARGET_DEVICE wingray
host C++: llvm-rs-cc <= frameworks/compile/slang/llvm-rs-cc.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_ast_replace.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_context.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/llvm-rs-cc.o] Error 1
make: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_ast_replace.o] Error 1
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_context.o] Error 1
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs.o] Error 1
[email protected]:~/ICS_SOURCE#
Im using this guide as it has more details: http://www.freeyourandroid.com/guide/compile-ics
Any guidance someone could offer would be great.
Are you in ubuntu 11.10? I was having issues also. Check out this site...
http://www.android-dev.ro/2011/12/13/building-android-4-0-on-ubuntu-11-10/
aceman118 said:
Are you in ubuntu 11.10? I was having issues also. Check out this site...
http://www.android-dev.ro/2011/12/13/building-android-4-0-on-ubuntu-11-10/
Click to expand...
Click to collapse
Thanks, I am useing 11.10 so ill read through this and try again.
EDIT: got my first build completed! Thanks
you can use wingray or stingray on everest. Of course, if you use wingray on everest, you won't have phone app and other phone only features.
aceman118 said:
Are you in ubuntu 11.10? I was having issues also. Check out this site...
http://www.android-dev.ro/2011/12/13/building-android-4-0-on-ubuntu-11-10/
Click to expand...
Click to collapse
I'm using Ubuntu 11.10 64bit and GCC 4.6.
Keep in mind to add '#include <cstddef>' in headers where you have compile errors like indexOf() not found.
popokrew said:
Not sure what I am doing wrong:
Code:
/ICS_SOURCE# make -j4 otapackage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.3
TARGET_PRODUCT=full_wingray
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IML74K
============================================
build/core/main.mk:324: implicitly installing apns-conf_sdk.xml
No private recovery resources for TARGET_DEVICE wingray
host C++: llvm-rs-cc <= frameworks/compile/slang/llvm-rs-cc.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_ast_replace.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_context.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/llvm-rs-cc.o] Error 1
make: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_ast_replace.o] Error 1
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_context.o] Error 1
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs.o] Error 1
[email protected]:~/ICS_SOURCE#
Im using this guide as it has more details: http://www.freeyourandroid.com/guide/compile-ics
Any guidance someone could offer would be great.
Click to expand...
Click to collapse
You are not doing anything wrong, this is a GCC 4.6 restriction.
Weird I didn't see it with ics 4.0.3 but with 4.0.1 before.
Here is what you need to do for 4.0.1:
build/core/combo/HOST_linux-x86.mk:61 HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
build/core/combo/javac.mk:15 COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -source 1.5 -Xmaxerrs 9999999
frameworks/base/libs/util/Android.mk: 63 LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
libcore/luni/src/main/java/java/lang/Enum.java: 128 return ordinal - o.ordinal ();
external/gtest/include/gtest/internal/gtest-param-util.h:40 #include <cstddef> (after #include <vector>)
winglord said:
You are not doing anything wrong, this is a GCC 4.6 restriction.
Weird I didn't see it with ics 4.0.3 but with 4.0.1 before.
Here is what you need to do for 4.0.1:
build/core/combo/HOST_linux-x86.mk:61 HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
build/core/combo/javac.mk:15 COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -source 1.5 -Xmaxerrs 9999999
frameworks/base/libs/util/Android.mk: 63 LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
libcore/luni/src/main/java/java/lang/Enum.java: 128 return ordinal - o.ordinal ();
external/gtest/include/gtest/internal/gtest-param-util.h:40 #include <cstddef> (after #include <vector>)
Click to expand...
Click to collapse
winglord, I was able to get it to build with the guide aceman posted. I believe its because of the modified make: make CC=gcc-4.4 CXX=g++-4.4
Where would I find a log for the entire build? A lot of stuff scrolls by while building.
Now I just need to get the recovery image out (guessing just delete it out of the ota .zip?) and try it out. My Xoom isnt with me right now.
AlEsC said:
Does someone know if there is a way to run builded images into the sdk emulator ?
Click to expand...
Click to collapse
When running lunch you have to chose one of the emulator builds (full_eng if my memory's right). You can't run a build compiled for a specific device.
RMerlin said:
When running lunch you have to chose one of the emulator builds (full_eng if my memory's right). You can't run a build compiled for a specific device.
Click to expand...
Click to collapse
Thanks
This means I'll have to rebuild all !!
Another question, I've made a successfully build, then I've made some modification in the sources, so I've deleted all *.img thinking that "make" will rebuild them... but "make" only rebuild "system.img", "ramdisk.img" and "userdata.img".
Is there a "make boot" or something like that ? (real question is how do I rebuild my boot.img )
Thanks
winglord said:
I'm using Ubuntu 11.10 64bit and GCC 4.6.
Keep in mind to add '#include <cstddef>' in headers where you have compile errors like indexOf() not found.
Click to expand...
Click to collapse
I tried that and it didn't seem to work for me. Once I used GCC 4.4 it worked. I couldn't tell you why, though.
So I finally got a build up and running - is there something special that has to be done with the vendor binaries? I know I have seen this in other builds too but the kernel is still showing 2.x and the camera, mic and gps are not working. Is that because work needs to be done to the kernel before it is 100% with ICS? This is my first time messing with an android build so forgive me if this is a dumb question.
AlEsC said:
Thanks
This means I'll have to rebuild all !!
Another question, I've made a successfully build, then I've made some modification in the sources, so I've deleted all *.img thinking that "make" will rebuild them... but "make" only rebuild "system.img", "ramdisk.img" and "userdata.img".
Is there a "make boot" or something like that ? (real question is how do I rebuild my boot.img )
Thanks
Click to expand...
Click to collapse
Make is usually smart enough to know when something you changed will not result in a different output. It is possible that the changes you made would result in an identical boot.img, therefore it is not rebuilding it.
Trying to compile kernel from sources. I now the process, and I do it not the first time - I have kernel on my desktop linux compiled from source ...
okay. the question is ... about errors from "make" (I changed locale to EN)
[[email protected] KangBanged-7x30]$ LANG=en_GB.UTF-8 ARCH=arm CROSS_COMPILE=$CCOMPILER make -j3
File "/home/melky/KERNEL/KangBanged-7x30/scripts/gcc-wrapper.py", line 76
print "error, forbidden warning:", m.group(2)
^
SyntaxError: invalid syntax
CHK include/linux/version.h
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
File "/home/melky/KERNEL/KangBanged-7x30/scripts/gcc-wrapper.py", line 76
print "error, forbidden warning:", m.group(2)
^
SyntaxError: invalid syntax
make[2]: *** [scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs....
HOSTCC scripts/kallsyms
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
Click to expand...
Click to collapse
What I'm doing wrong?
About config and other ...
.config I got from phone via "adb pull /proc/config.gz".
about $CCOMPILER variable :
[[email protected] KangBanged-7x30]$ echo $CCOMPILER
/usr/bin/arm-none-eabi-
[[email protected] KangBanged-7x30]$ whereis arm-none-eabi-gcc
arm-none-eabi-gcc: /usr/bin/arm-none-eabi-gcc
Click to expand...
Click to collapse
kernel source from KangBangKreations.
LOL
LOL! In Archlinux python is linked to python3. Just linked /usr/bin/python to /usr/bin/python2.7 and everything is going fine.
P.S. Sorry for doublepost.
coloured_chalk said:
LOL! In Archlinux python is linked to python3. Just linked /usr/bin/python to /usr/bin/python2.7 and everything is going fine.
P.S. Sorry for doublepost.
Click to expand...
Click to collapse
I've been trying for HOURS to get the toolchain to work just to figure out it was ARCH LINUX. First time trying to build a kernel as well. You have saved me all the time in the world. I never would have figured this out.
Thank you,
Jake
thank you so much! i also would have never considered thinking in this direction..
but now im stuck on the correct linking command.
i tried ln -s /usr/bin/python /usr/bin/python2.7
and i tried exchanging the two paths.. none of them succeeded and im confused now.. could you pls help me?
sorry for this stupid question, i know this could not work, but i cant help myself finding the correct solution..
Inf.Lagranty said:
thank you so much! i also would have never considered thinking in this direction..
but now im stuck on the correct linking command.
i tried ln -s /usr/bin/python /usr/bin/python2.7
and i tried exchanging the two paths.. none of them succeeded and im confused now.. could you pls help me?
sorry for this stupid question, i know this could not work, but i cant help myself finding the correct solution..
Click to expand...
Click to collapse
I followed the tutorial from archwiki, works fine
Code:
mkdir ~/bin
ln -s /usr/bin/python2 ~/bin/python
ln -s /usr/bin/python2-config ~/bin/python-config
export PATH=~/bin:$PATH
Help Please how to compiling kernel from source
thejakehemmerle said:
I've been trying for HOURS to get the toolchain to work just to figure out it was ARCH LINUX. First time trying to build a kernel as well. You have saved me all the time in the world. I never would have figured this out.
Thank you,
Jake
Click to expand...
Click to collapse
i was try to compiling kernel from source but i got error where i am wrong
error log uploaded
Hello guys!
Because the GT-i9001 (Galaxy S Plus) has a Kernel Building Tutorial, I decided to make one for the i8150 as these 2 devices are very similar.
This tutorial is based on this one by our Recognized Contributor, Xistance: /showthread.php?t=1966751. So all the credit goes to him!
First of all, you will need Ubuntu(it may work on other distros too, but Ubuntu is the most easy one to set up) these versions were tested:
14.04 - (this is were I build ROM's and Kernels)
13.10
12.10
12.04
10.04
Ok, so lets get started!
PART 1 - Installing Required Programs, Packages and Toolchains:
Android SDK
Download the SDK here: http://developer.android.com/sdk/index.html
Extract the SDK and place it in your home directory.
I rename the SDK to android-sdk to make it easier to navigate to.
Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.
Add these lines at the bottom of the file(Change path according to your SDK dir):
Code:
# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin
Install required packages:
Open the Terminal and type:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 lib32ncurses5-dev x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Getting the Toolchain:
Open the terminal and type
Code:
mkdir android && cd android
mkdir kernel && cd kernel
Now clone this repo by DooMLoRD, these are precompiled toolchains, essential for compiling: (You can use any other linaro toolchains you want)
Code:
git clone git://github.com/DooMLoRD/android_prebuilt_toolchains.git toolchains
Make sure you have the toolchain folder in the Android folder as well as in the Kernel folder.
PART 2 - Getting the source, and making modifications:
Now we need to git clone the kernel source, this time I will use arco's github source:
Code:
cd android/kernel
git clone git://github.com/arco/samsung-kernel-msm7x30 -b ics-2.6
After -b you must specify the branch you want to clone, in this example, I used the ICS 2.6 branch.
After the repo is cloned you can modify/add features to kernel.
Examples in the second post.
PART 3 - Building the Kernel:
cd to your kernel directory:
Code:
cd android/kernel/samsung-kernel-msm7x30
Ok, now we need to set our target architecture and set the path to the toolchain we would like to use.
In this example, I will use the 4.6.2 toolchain downloaded above:
Code:
export ARCH=arm
export CROSS_COMPILE=~/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
Now we need to load our configuration file, also, setting the board we would like to use, in this case, it is Ancora Board:
Code:
make ancora_defconfig
Than, we need to load menuconfing in order to apply the changes we made to the kernel (Governors, I/O schedulers, OC and so on)
Code:
make menuconfig
*Activating CPU Governors can be made under "CPU Power Management" Tab
*Activating I/O Schedulers can be made under "Enable block layer" tab
*OC can be activated under "System Type" tab
Now, the building will start after this command:
Code:
make -jx
x(max number of jobs per core)= number of CPU cores + 1 (for a QuadCore CPU there will be make -j5)
The building should take 5 to 10 minutes depending on your CPU.
PART 4 - Exporting the zImage and the modules
If the kernel compiled successfully you should see something like: zImage is ready.
Now, we need to export the zImage and the compiled modules into a folder:
Code:
A. Open a terminal
B. Change to your root kernel directory
C. Type "mkdir ../_output"
D. Type "cp arch/arm/boot/zImage ../_output/zImage"
E. Type "find . -name "*.ko" -exec cp {} ../_output \;"
Credits for this goes to Recognized Developer Hacre
PART 5 - Making the boot.img
Ok, this part is optional and it depends on your knowledge level.
The most easiest way to make the boot.img is using dsixda's Android Kitchen.
I recommend using this version from GT-i9001 forum as it is the same as for i8150: /showthread.php?t=1399468.
For this example, we built a zImage based on arco's sources for 2.6 kernel so we will need his ROM base.
Download the kitchen, and put the ROM (flashable ZIP) into the "original-update" folder.
Then, open up the kitchen (menu.sh) and press 1 (Set up working folder from ROM).
Choose your ROM and then press enter. After this we would like to go to 0 - Advanced Options and then 12 - Tools For Boot.img.
Here we need to press w to extract the content of the boot.img from the working directory.
Than, replace the zImage from BOOT-EXTRACTED with your zImage.
Also, you can put the compiled modules (.ko) inside /lib/modules in the RAMDISK folder
Now go back to the terminal and press b to build back your boot.img (which will be located in working folder)
PART 6 - Flashing the boot.img and Making Flashable ZIP
The compiled boot.img can be flashed to the device using adb like this: (If you don't know what adb is or how to use it, please search on Google/XDA for tutorials)
Code:
adb push boot.img /sdcard/boot.img
adb shell
su
dd if=/sdcard/boot.img of=/dev/block/mmcblk0p8
reboot
Commands explained:
adb push = it pushes the compiled boot.img to the internal sd card of the phone.
dd if = READ FROM FILE
dd of = WRITE TO FILE
mmcblk0p8 = the partition where the Kernel Image goes.
After that, we need to manually push the modules into /system/lib/modules on our phone. This can be done through adb like this:
Code:
adb push dhd.ko system/lib/modules/dhd.ko
This example is for dhd.ko module, which is required for WiFi.
For flashable ZIP, take one from another kernel and replace the boot.img.
Credits:
Xistance
broodplank
Hacre
DooMLoRD
Madridii (for helping to test the kernel on Galaxy W)
hotheabilly (for helping to test the kernel on Galaxy W)
Adding Governors, I/O schedulers and more.
This one great tut by broodplank should explain everything about Governors and I/O Schedulers in very tiny details: http://xda-university.com/as-a-developer/adding-features-to-your-kernel
Don't forget to activate every feature you added, in makeconfig menu, before building the kernel
Reserved - Just in case
Woow
My nickname is mentioned in the firsh post..
Thank you for this guide
We need guide on windows os
Sent from my GT-I8150 using xda premium
Madridii said:
Woow
My nickname is mentioned in the firsh post..
Thank you for this guide
We need guide on windows os
Sent from my GT-I8150 using xda premium
Click to expand...
Click to collapse
Well, I don't own this device and you tested my compiled kernel and confirmed that it works, so you deserve credit...
I never actually builded anything on Windows OS, Cygwin is required for that, and that is a program I'm not yet familiarized with.
Sent from my GT-I9001 using xda app-developers app
Madridii said:
Woow
My nickname is mentioned in the firsh post..
Thank you for this guide
We need guide on windows os
Sent from my GT-I8150 using xda premium
Click to expand...
Click to collapse
The easiest way is to just dual boot Ubuntu or Mint. Well, if you can't really do that you can use a VM to build it as well.
Anyway, great job on the tutorial educk!
Xistance said:
The easiest way is to just dual boot Ubuntu or Mint. Well, if you can't really do that you can use a VM to build it as well.
Anyway, great job on the tutorial educk!
Click to expand...
Click to collapse
Thank you!
But if it wasn't for you, broodplank, diablo, skywalker01 and many other great devs on our forum who helped me, I would have never found out these awesome things.
Your tutorial was like a starting point for me, it opened my way into the Android World, it was my first step into "development".
I hope I can help other people with this guide, just like you helped me with yours!
Sent from my GT-I9001 using xda app-developers app
First time i tried to make my kernel, I had errors because i didn't have some packages. (Was using Ubuntu 12.10)
Add that you need 12.04 LTS to Successfully build it After installed the LTS version, you could update it to 12.10.....The packages will still be there
Thank you guys
I will try to learn about Ubuntu to have 10% of your experience..
Thank you again
Sent from my GT-I8150 using xda premium
i guess SDK is not needed if you are building kernel. i build it without having sdk on my ubuntu
and for the make -j options it's easier to use -j26. use -j1 to debug any compile error
very useful guide :good:
Sent from my GT-I8150
hadidjapri said:
i guess SDK is not needed if you are building kernel. i build it without having sdk on my ubuntu
and for the make -j options it's easier to use -j26. use -j1 to debug any compile error
very useful guide :good:
Sent from my GT-I8150
Click to expand...
Click to collapse
Yeah, you don't need the SDK. I included it in my guide because I find it very useful to have.
About the -j options, I sometimes use -j150 and sometimes -j8. Why? Because sometimes I feel like using my PC while building. Also, don't ask for my specs, for kernel building it doesn't matter.
Woah my name on the OP thanks educk!
Sent from my GT-P1000 using Tapatalk 2
hadidjapri said:
i guess SDK is not needed if you are building kernel. i build it without having sdk on my ubuntu
and for the make -j options it's easier to use -j26. use -j1 to debug any compile error
very useful guide :good:
Sent from my GT-I8150
Click to expand...
Click to collapse
Yes, you are right! SDK is not needed for the kernel building, I added it because it is required for ADB.
Update: I added a method of flashing the boot.img and my github commit where I added CPU Governors (SmartAss v2, Smoothass, InteractiveX and more) and I/O Schedulers (SIO and VR). More updates soon.
Regards,
Erik
Sent from my GT-I9001 using xda app-developers app
Hello all
I am trying to compile arco's sources but ı have problem.
when ı entry make -j2
make -j2
make: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: command not found
scripts/kconfig/conf --silentoldconfig Kconfig
make: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: command not found
CHK include/linux/version.h
/home/batur/android/kernel/samsung-kernel-msm7x30/scripts/gcc-version.sh: satır 25: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: No such file or directory
/home/batur/android/kernel/samsung-kernel-msm7x30/scripts/gcc-version.sh: satır 26: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: No such file or directory
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' güncel
CC scripts/mod/empty.o
/bin/sh: 1: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: not found
CC kernel/bounds.s
make[2]: *** [scripts/mod/empty.o] error 127
/bin/sh: 1: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: not found
make[1]: make[1]: *** [kernel/bounds.s] error 127
*** [scripts/mod] error 2
make: *** [prepare0] error 2
make: *** Waiting for unfinished jobs ....
make: *** [scripts] error 2
[email protected]:~/android/kernel/samsung-kernel-msm7x30$
Thanks
Sorry for my bad english
Batur97 said:
Hello all
I am trying to compile arco's sources but ı have problem.
when ı entry make -j2
make -j2
make: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: command not found
scripts/kconfig/conf --silentoldconfig Kconfig
make: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: command not found
CHK include/linux/version.h
/home/batur/android/kernel/samsung-kernel-msm7x30/scripts/gcc-version.sh: satır 25: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: No such file or directory
/home/batur/android/kernel/samsung-kernel-msm7x30/scripts/gcc-version.sh: satır 26: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: No such file or directory
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' güncel
CC scripts/mod/empty.o
/bin/sh: 1: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: not found
CC kernel/bounds.s
make[2]: *** [scripts/mod/empty.o] error 127
/bin/sh: 1: /home/batur/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-gcc: not found
make[1]: make[1]: *** [kernel/bounds.s] error 127
*** [scripts/mod] error 2
make: *** [prepare0] error 2
make: *** Waiting for unfinished jobs ....
make: *** [scripts] error 2
[email protected]:~/android/kernel/samsung-kernel-msm7x30$
Thanks
Sorry for my bad english
Click to expand...
Click to collapse
try:
Code:
export ARCH=arm
export CROSS_COMPILE=~/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
make ancora_defconfig
before make -j2...
also, make sure the path /android/kernel/toolchains/arm-eabi-linaro-4.6.2 exists and you have you'r toolchain in there...
This guide may be useful, but what about Fedora/RPM-based users?
Debian-based users can use the usual method (Educk has made a guide for install it, just check your repo if they have it) but for Fedora user? Maybe this method will work. I was a user of Fedora but since Debian wheezy (although it is RC1, unstable) I moved on.
Maybe this method for RPM-based (Fedora, Red Hat, CentOS, openSUSE)
Code:
$ su
# yum install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 lib32ncurses5-dev x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
# ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
This maybe useful, but if you RPM-based users didn't find those packages, then maybe Google is your best partner.
R: [Guide] Build your own Kernel for Galaxy W
How can I add UV in the kernel?
Sent from my GT-I8150 using xda app-developers app
lorenzo82 said:
How can I add UV in the kernel?
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
You can modify it from the arch/arm/mach-msm/acpuclock-7x30.c file.
Is this core 'make -jx' x for telephone or pc because my pc is per of 2 core but my phone is 1 core
thanks for your helping
Batur97 said:
Is this core 'make -jx' x for telephone or pc because my pc is per of 2 core but my phone is 1 core
thanks for your helping
Click to expand...
Click to collapse
PC of course.