TUN.KO for the my touch 4g (here it is with links) updated 12/24/10 - myTouch 4G Android Development

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

Related

Help needed compiling the kernel

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.

[Sprint] Kernel Development - OC

Okay I've been reading and reading and finally got all the tools to build a kernel from the source that Samsung had on their site for DJ30. Since these are very identical to the other galaxy s devices they should overclock decently. Will report with more progress later.
-------------------------
Status - Downloaded source and repo and building configuration to make kernel.
Sent from my SPH-P100 using XDA App
Interested in your development... my Sprint Tab arrives tomorrow, decided to give it a 30 day try before I try the Nook Color.
Doesn't appear to be a lot of development yet, hoping to see that change.
One question, is the Zroot method still the preferred method to rooting the device?
I used superoneclick 1.5.5
Sent from my SPH-P100 using XDA App
------------------------------------------------------------
Trying to compile a test kernel to make sure everything is going to work correctly and running into this crazy error if any of the dev's can chime in please do I already installed all the repo's and linked them.
[email protected]:~/.Tab_Kernel_sources/Kernel$ make ARCH=arm CROSS_COMPILE=../home/max/GalaxyTab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
make: ../home/max/GalaxyTab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/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/max/GalaxyTab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
seems like you're missing (a part of) the gcc compiler... the part to compile for ARM it would seem...
maxjivi05 said:
I used superoneclick 1.5.5
Sent from my SPH-P100 using XDA App
------------------------------------------------------------
Trying to compile a test kernel to make sure everything is going to work correctly and running into this crazy error if any of the dev's can chime in please do I already installed all the repo's and linked them.
[email protected]:~/.Tab_Kernel_sources/Kernel$ make ARCH=arm CROSS_COMPILE=../home/max/GalaxyTab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
make: ../home/max/GalaxyTab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/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/max/GalaxyTab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
Click to expand...
Click to collapse
Made it a bit farther, got that error fixed had to install lsb along with a few other things now I'm sitting on this error. Any and all help is greatly appreciated! We can get this working!
------------------------------------
[email protected]:~/.Tab_Kernel_sources/Kernel$ make
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
GEN include/linux/bounds.h
CC arch/arm/kernel/asm-offsets.s
GEN include/asm/asm-offsets.h
CALL scripts/checksyscalls.sh
HOSTCC scripts/genksyms/genksyms.o
SHIPPED scripts/genksyms/lex.c
SHIPPED scripts/genksyms/parse.h
SHIPPED scripts/genksyms/keywords.c
HOSTCC scripts/genksyms/lex.o
SHIPPED scripts/genksyms/parse.c
HOSTCC scripts/genksyms/parse.o
HOSTLD scripts/genksyms/genksyms
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/modpost.o
scripts/mod/modpost.c: In function ‘get_markers’:
scripts/mod/modpost.c:1562: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result
scripts/mod/modpost.c: In function ‘add_marker’:
scripts/mod/modpost.c:1982: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/kallsyms
scripts/kallsyms.c: In function ‘read_symbol’:
scripts/kallsyms.c:112: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
HOSTCC scripts/conmakehash
CC init/main.o
In file included from init/main.c:85:
include/linux/kernel_sec_common.h:7:22: error: mach/map.h: No such file or directory
include/linux/kernel_sec_common.h:8:29: error: mach/regs-clock.h: No such file or directory
make[1]: *** [init/main.o] Error 1
make: *** [init] Error 2
[email protected]:~/.Tab_Kernel_sources/Kernel$ make ARCH=arm CROSS_COMPILE=../home/max/GalaxyTab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
make: ../home/max/GalaxyTab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/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/max/GalaxyTab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
I'm not a dev, but I sure can test on my sprint tablet
I have a Linux blade at home, what are the tools necessary to compile from source, and what repo are you using for the sprint tab drivers and such?
Simple solution here is that you are missing GCC or have an incorrect version installed. I wrote a how to compile thread in the Streak section a few months bak ill dig it up and post it here.
try
apt-get install build-essential
Already installed build essential.
Sent from my SPH-P100 using XDA App
The readme file tells you where to get the compiler from, decompress it to /opt/toolchain.
And this thread has pretty good explanations on how to build the kernel http://forum.xda-developers.com/showthread.php?t=837170
A little farther int he process of getting this sucker compiled... Got this error now... *I forgot how much of a pain it was to go through setting things up perfectly! lol.. any and all help is greatly appreciated!
-------------------------------------
make[1]: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found
cp: cannot stat `/home/max/.Tab_Kernel_sources/Kernel/modules.order': No such file or directory
make[1]: *** [_modinst_] Error 1
make: *** [sub-make] Error 2
[email protected]:~/.Tab_Kernel_sources/Kernel$
This is the most disappointing thread ever.
maxjivi05 said:
A little farther int he process of getting this sucker compiled... Got this error now... *I forgot how much of a pain it was to go through setting things up perfectly! lol.. any and all help is greatly appreciated!
-------------------------------------
make[1]: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found
cp: cannot stat `/home/max/.Tab_Kernel_sources/Kernel/modules.order': No such file or directory
make[1]: *** [_modinst_] Error 1
make: *** [sub-make] Error 2
[email protected]:~/.Tab_Kernel_sources/Kernel$
Click to expand...
Click to collapse
It's pretty obvious from that line that it can't find that particular binary in your toolchain directory...
I followed the instructions in the readme file and compiled the kernel already, it was extremely simple. You ran the build_kernel.sh file right... after editing it?
Yes I did and its been 5 years since I've done anything with Linux so its a rather learning curve to get anything done. With lack of development on tab thought it would be a good place to start. I've done normal kernel build before but nothing for a phone and it wasn't rather hard either it was just a few commands and everything was already in the right directories
Sent from my SPH-P100 using XDA App
FYI I grabbed the kernel source and cross toolchain, installed the toolchain to /opt (on my desktop Linux box) added the toolchain's bin directory to the start of $PATH, edited the (iirc - am posting from a Windows box) build.sh script and the kernel built fine first time.
I need to set the path to the raminitfs file in .config and then try again and make sure it boots ok
Anyway just a post to say that it must be your setup. I see you have installed the toolchain to /home/max/GalaxyTab/prebuilt/linux-x86/toolchain/ and in your latest post there's the following error: make[1]: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found
So there's obviously a path problem there. I also see you're using a plain "make" command without setting the ARCH env var.
I'd recommend giving the build.sh script a go (after editing the toolchain path), as it sets up all the env vars, etc., for you automatically.
okay, I was missing a file went I was doing my repo sync... which didn't make sense but i got it worked out... finally able to compile going to apply the patches and recompile and will repo, but thanks for the people who did help figure out the issue...
maxjivi05 said:
With lack of development on tab
Click to expand...
Click to collapse
HUH?
10 characters
Does anyone have an untouched sprint kernel pulled from a device? I rooted mine and it's seeminly impossible to pull the initrd out of it.
jstigall said:
Does anyone have an untouched sprint kernel pulled from a device? I rooted mine and it's seeminly impossible to pull the initrd out of it.
Click to expand...
Click to collapse
Nevermind, I got it... I have a booting Sprint kernel that works great.
Do you have a link to the patches you want to include, I may be able to get the CPU frequency adjustments you want to make built.
jstigall said:
Nevermind, I got it... I have a booting Sprint kernel that works great.
Do you have a link to the patches you want to include, I may be able to get the CPU frequency adjustments you want to make built.
Click to expand...
Click to collapse
Currently there are 2 files that tell the kernel the freq to run at, and 3 spots at the bottom of each that need changed. Located in /ARM/ARCH/OMAP something I need to get more info when I get home I'll edit this post and let you know but there is a file called cpu24xx.c and cpu34xx.c, I was going to compile a working kernel with those files edited to run 1200MHz to test and see if that would work if that didn't work there were some patches made on the other galaxy s devices I have links to thanks to SetiroN for providing, which they are a little different then the files for the galaxy source but I'll post it when I get home and have time!

[Guide] Compiling CyanogenMod 9/10 for Galaxy Nexus (GSM)

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

[QUESTION] about kernel compilation

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

Can't compile Galaxy Note 3 Kernel

I am kinda new to kernel development. I need to rebuild the kernel I'm using ((http://forum.xda-developers.com/showthread.php?t=2480353) Compulsion Kernel) with loadable module support. I have also tried other kernels. I also tried using the "-i" flag on make, but the errors kept getting worse, until the whole compilation output was errors...
I keep getting errors from the console output. For example:
Code:
net/bluetooth/hci_conn.c: In function 'hci_le_ltk_reply':
net/bluetooth/hci_conn.c:406:28: warning: argument to 'sizeof' in 'memcpy' call is the same pointer type '__u8 *' as the destination; expected '__u8' or an explicit length [-Wsizeof-pointer-memaccess]
error, forbidden warning: hci_conn.c:406
make[2]: [net/bluetooth/hci_conn.o] Error 1
-Wsizeof-pointer-memaccess errors pop up very often.
There are also file not found errors:
Code:
arm-eabi-ld: error: cannot open net/bluetooth/hci_conn.o: No such file or directory
make[2]: [net/bluetooth/bluetooth.o] Error 1
LD net/bluetooth/built-in.o
arm-eabi-ld: error: cannot open net/bluetooth/bluetooth.o: No such file or directory
make[2]: [net/bluetooth/built-in.o] Error 1
CC net/bridge/br_input.o
Heres another example:
Code:
CC net/bridge/br_ioctl.o
arch/arm/mach-msm/board-8974-sec.c:569:13: warning: 'modem_power_off' defined but not used [-Wunused-function]
error, forbidden warning: board-8974-sec.c:569
make[1]: [arch/arm/mach-msm/board-8974-sec.o] Error 1
LD arch/arm/mach-msm/built-in.o
CC drivers/gpu/ion/ion_cma_heap.o
arm-eabi-ld: error: cannot open arch/arm/mach-msm/bam_dmux.o: No such file or directory
arm-eabi-ld: error: cannot open arch/arm/mach-msm/board-8974-sec.o: No such file or directory
System information:
I attached my .config file. It is the default from the Compulsion kernel.
Compile commands (in order):
Code:
export VARIANT_DEFCONFIG=msm8974_sec_defconfig ##I added this because it wont generate .config if this variable is empty...
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=/home/julian/android-toolchain-eabi/bin/arm-eabi-
git pull
make clean
make msm8974_sec_defconfig
make -j4
Operating system: Fresh install of Linux Mint 16 (Petra)
Build-related packages I installed with apt: git-core, gnupg, flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev, build-essential, zip, curl, libncurses5-dev, zlib1g-dev, ia32-libs, lib32z1-dev, lib32ncurses5-dev, gcc-multilib, g++-multilib, and Adb
Toolchain:
Tried linaro, the android NDK from Google's website, and various other toolchains. Same error.
Output of "echo $PATH"
Code:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/julian/android-toolchain-eabi/bin:/home/julian/androidkernel/N900T_Kernel
I think thats all the needed information
Thank you!
Your command for the configuration is incomplete. You need to type a command for the other files as well. Type this command "make msm8974_sec_defconfig VARIANT_DEFCONFIG=msm8974_sec_hltetmo_defconfig DEBUG_DEFCONFIG= SELINUX_DEFCONFIG=selinux_defconfig SELINUX_LOG_DEFCONFIG=selinux_log_defconfig TIMA_DEFCONFIG=tima_defconfig".
djintrigue808 said:
Your command for the configuration is incomplete. You need to type a command for the other files as well. Type this command "make msm8974_sec_defconfig VARIANT_DEFCONFIG=msm8974_sec_hltetmo_defconfig DEBUG_DEFCONFIG= SELINUX_DEFCONFIG=selinux_defconfig SELINUX_LOG_DEFCONFIG=selinux_log_defconfig TIMA_DEFCONFIG=tima_defconfig".
Click to expand...
Click to collapse
Still can't compile
No more file not found errors, but still getting:
Code:
arch/arm/mach-msm/bam_dmux.c: In function 'show_waketime':
arch/arm/mach-msm/bam_dmux.c:2440:29: warning: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
error, forbidden warning: bam_dmux.c:2440
make[1]: *** [arch/arm/mach-msm/bam_dmux.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
make: *** Waiting for unfinished jobs....
My compile script (easier then entering commands...)
#!/bin/bash
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
if [[ "$PATH" == *"/home/julian/android-toolchain-eabi/bin"* ]]; then
echo "PATH Contains toolchain"
else
export PATH=$PATH:/home/julian/android-toolchain-eabi/bin
echo "Toolchain added to PATH!"
fi
git pull
make clean -j4
echo "Building config..."
sleep 2
make msm8974_sec_defconfig VARIANT_DEFCONFIG=msm8974_sec_hltetmo_defconfig DEBUG_DEFCONFIG= SELINUX_DEFCONFIG=selinux_defconfig SELINUX_LOG_DEFCONFIG=selinux_log_defconfig TIMA_DEFCONFIG=tima_defconfig -j4
sleep 1
read -p "Customize config? (Y/N): " yesno
if [ "$yesno" == "Y" ]; then
make menuconfig -j4
make -j4
else
make -j4
fi
Thank you!
Julian90090 said:
Still can't compile
No more file not found errors, but still getting:
Code:
arch/arm/mach-msm/bam_dmux.c: In function 'show_waketime':
arch/arm/mach-msm/bam_dmux.c:2440:29: warning: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
error, forbidden warning: bam_dmux.c:2440
make[1]: *** [arch/arm/mach-msm/bam_dmux.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
make: *** Waiting for unfinished jobs....
My compile script (easier then entering commands...)
#!/bin/bash
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
if [[ "$PATH" == *"/home/julian/android-toolchain-eabi/bin"* ]]; then
echo "PATH Contains toolchain"
else
export PATH=$PATH:/home/julian/android-toolchain-eabi/bin
echo "Toolchain added to PATH!"
fi
git pull
make clean -j4
echo "Building config..."
sleep 2
make msm8974_sec_defconfig VARIANT_DEFCONFIG=msm8974_sec_hltetmo_defconfig DEBUG_DEFCONFIG= SELINUX_DEFCONFIG=selinux_defconfig SELINUX_LOG_DEFCONFIG=selinux_log_defconfig TIMA_DEFCONFIG=tima_defconfig -j4
sleep 1
read -p "Customize config? (Y/N): " yesno
if [ "$yesno" == "Y" ]; then
make menuconfig -j4
make -j4
else
make -j4
fi
Thank you!
Click to expand...
Click to collapse
Ok so I was messing around and decided to fix the -Wsizeof-pointer-memaccess errors. I opened bam_dmux.c and changed the line
Code:
return snprintf(buf, sizeof(buf), "%u\n", wakelock_timeout);
to
Code:
return snprintf(buf, (int)sizeof(buf), "%u\n", wakelock_timeout);
The kernel compiles now, but when I flash it to my device (mkbootimg), I get a ODIN message saying regular boot failed...
MORE UPDATES:
Tried flashing plain zImage in tar with ODIN, got a "unsupport dev_type" error on the device.
I fixed all the compile errors. I changed cross compilers to arm linux gnueabihf 4.7. There is still the task of getting the kernel on the device though... Thanks in advance!
EDIT AGAIN: Still can't get it to boot. Tried compiling stock kernel, leankernel, and Saber kernel. All same result after packing zImage and flashing with flashable zip...
Using repack-zImage.sh, I get a "gunzip result is oscillating between 'too small' and 'too large' at size: 7836575 7836576 7836577 7836578" error. There are no compile errors with any of the kernels. I attached my "finished" stock kernel flashable zip (doesn't work). I heard something about a mismatch between gzip and lzop... *feeling determined*
Any ideas?
EDIT:
Compile warnings about swp{b} although swp emulation is enabled in config. I still can't figure out how to get the zImage to work correctly on my device. I swapped the zImage out of the Saber kernel install zip boot.img and put my own in, flashed with TWRP, device doesn't boot until I go back and install the original kernel.
Julian90090 said:
Still can't compile
No more file not found errors, but still getting:
Code:
arch/arm/mach-msm/bam_dmux.c: In function 'show_waketime':
arch/arm/mach-msm/bam_dmux.c:2440:29: warning: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
error, forbidden warning: bam_dmux.c:2440
make[1]: *** [arch/arm/mach-msm/bam_dmux.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
make: *** Waiting for unfinished jobs....
My compile script (easier then entering commands...)
#!/bin/bash
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
if [[ "$PATH" == *"/home/julian/android-toolchain-eabi/bin"* ]]; then
echo "PATH Contains toolchain"
else
export PATH=$PATH:/home/julian/android-toolchain-eabi/bin
echo "Toolchain added to PATH!"
fi
git pull
make clean -j4
echo "Building config..."
sleep 2
make msm8974_sec_defconfig VARIANT_DEFCONFIG=msm8974_sec_hltetmo_defconfig DEBUG_DEFCONFIG= SELINUX_DEFCONFIG=selinux_defconfig SELINUX_LOG_DEFCONFIG=selinux_log_defconfig TIMA_DEFCONFIG=tima_defconfig -j4
sleep 1
read -p "Customize config? (Y/N): " yesno
if [ "$yesno" == "Y" ]; then
make menuconfig -j4
make -j4
else
make -j4
fi
Thank you!
Click to expand...
Click to collapse
Please ignore if irrelevant or ignorant. I'm in my infancy and still grasping the basics.
My environment is quite different than yours, on a Mac and using a Sprint note 3, but I came across this thread with the same compiler error using the 4.8 tools in the NDK. If I use 4.6 gcc I make it pretty far into the compilation process before error (failing @net/netfilter/xt_TCPMSS.c). However, using 4.8 gave me the same error as you:
Code:
arch/arm/mach-msm/bam_dmux.c: In function 'show_waketime':
arch/arm/mach-msm/bam_dmux.c:2440:29: warning: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
error, forbidden warning: bam_dmux.c:2440
make[1]: *** [arch/arm/mach-msm/bam_dmux.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
Here's the layout of my toolchains folder and my broken build file (looks like yours)
Code:
z:toolchains anon$ pwd
/Volumes/android/ndk/toolchains
z:toolchains anon$ ls arm-linux-androideabi-4.*/prebuilt/darwin-x86_64/arm-linux-androideabi/bin
arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/arm-linux-androideabi/bin:
ar c++ gcc ld.bfd ld.mcld objcopy ranlib
as g++ ld ld.gold nm objdump strip
arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/arm-linux-androideabi/bin:
ar c++ gcc ld.bfd ld.mcld objcopy ranlib
as g++ ld ld.gold nm objdump strip
Broken Make file edit:
Code:
CROSS_COMPILE ?= /Volumes/android/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-
Change to 4.6 for new compile error:
Code:
CROSS_COMPILE ?= /Volumes/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-
Made is a helluva lot father in the compilation process, but still won't compile correctly.
Code:
net/netfilter/xt_TCPMSS.c:50:8: warning: 'struct xt_tcpmss_info' declared inside parameter list [enabled by default]
error, forbidden warning: xt_TCPMSS.c:50
make[2]: *** [net/netfilter/xt_TCPMSS.o] Error 1
make[1]: *** [net/netfilter] Error 2
make: *** [net] Error 2
Got my NDK from here:
Code:
http://dl.google.com/android/ndk/android-ndk-r9c-darwin-x86_64.tar.bz2
I don't, yet, understand the differences between the versions. Not sure if this will be helpful, samsungs open source community page sure isn't very friendly.
Julian90090 said:
Ok so I was messing around and decided to fix the -Wsizeof-pointer-memaccess errors. I opened bam_dmux.c and changed the line
Code:
return snprintf(buf, sizeof(buf), "%u\n", wakelock_timeout);
to
Code:
return snprintf(buf, (int)sizeof(buf), "%u\n", wakelock_timeout);
The kernel compiles now, but when I flash it to my device (mkbootimg), I get a ODIN message saying regular boot failed...
MORE UPDATES:
Tried flashing plain zImage in tar with ODIN, got a "unsupport dev_type" error on the device.
I fixed all the compile errors. I changed cross compilers to arm linux gnueabihf 4.7. There is still the task of getting the kernel on the device though... Thanks in advance!
EDIT AGAIN: Still can't get it to boot. Tried compiling stock kernel, leankernel, and Saber kernel. All same result after packing zImage and flashing with flashable zip...
Using repack-zImage.sh, I get a "gunzip result is oscillating between 'too small' and 'too large' at size: 7836575 7836576 7836577 7836578" error. There are no compile errors with any of the kernels. I attached my "finished" stock kernel flashable zip (doesn't work). I heard something about a mismatch between gzip and lzop... *feeling determined*
Click to expand...
Click to collapse
I dunno if it is still relevant to you, but in your code change this
Code:
return snprintf(buf, sizeof(buf), "%u\n", wakelock_timeout);
to this
Code:
return snprintf(buf, sizeof([COLOR="Red"]*[/COLOR]buf), "%u\n", wakelock_timeout);
Do that for all the files you get error in.
This error is because the toolchain you are using is higher version than GCC 4.8.*
Use any lower GCC version toolchain and those changes are not needed.
If you want the newer cross compiler, You need to make the cnanges. I hope this helps...
Cheers!!!
daxgirl said:
I dunno if it is still relevant to you, but in your code change this
Code:
return snprintf(buf, sizeof(buf), "%u\n", wakelock_timeout);
to this
Code:
return snprintf(buf, sizeof([COLOR="Red"]*[/COLOR]buf), "%u\n", wakelock_timeout);
Do that for all the files you get error in.
This error is because the toolchain you are using is higher version than GCC 4.8.*
Use any lower GCC version toolchain and those changes are not needed.
If you want the newer cross compiler, You need to make the cnanges. I hope this helps...
Cheers!!!
Click to expand...
Click to collapse
I did the same thing; i.e. I added (int) to the line also. The compiler seems to be ok with it, but I have not installed it on a device yet. I actually see a number of these errors. Do you think there should be another fix for it perhaps? Did you findout anything else about this? I appreciate a reply.
sansari123 said:
I did the same thing; i.e. I added (int) to the line also. The compiler seems to be ok with it, but I have not installed it on a device yet. I actually see a number of these errors. Do you think there should be another fix for it perhaps? Did you findout anything else about this? I appreciate a reply.
Click to expand...
Click to collapse
Yeah there is another fix. You add flags to your makefile for the cross cimpiler to basically accept those. Since they are not errors. Than you can use any chain. I managed to compile on sabermod 4.10 a kernel for s5, which was giving me the same trouble. Once I upload my sources I will send you a link to the repo so you can tweak your makefile accordingly ?
Sent from my SM-G900F using Tapatalk
Thanks. The latest message I get is the following:
Code:
drivers/cpufreq/cpufreq_interactive.c: In function 'show_target_loads':
drivers/cpufreq/cpufreq_interactive.c:813:6: warning: operation on 'ret' may be undefined [-Wsequence-point]
error, forbidden warning: cpufreq_interactive.c:813
make[2]: *** [drivers/cpufreq/cpufreq_interactive.o] Error 1
make[1]: *** [drivers/cpufreq] Error 2
make: *** [drivers] Error 2
But this one is a warning also. I guess there is a flag for ignoring warning(s)? I'll wait to hear back from you.
daxgirl said:
Yeah there is another fix. You add flags to your makefile for the cross cimpiler to basically accept those. Since they are not errors. Than you can use any chain. I managed to compile on sabermod 4.10 a kernel for s5, which was giving me the same trouble. Once I upload my sources I will send you a link to the repo so you can tweak your makefile accordingly ?
Sent from my SM-G900F using Tapatalk
Click to expand...
Click to collapse
@daxgirl - I like to learn how to modify the flags. Did you find out which flags to modify by reading the Makefile documentation? I would really appreciate it if you tell me how I can learn which flags to modify and do it myself vs. copy your Makefile.

Categories

Resources