DroidX source posted! tun.ko should be possible now - Droid X Android Development

Sources are here:
opensource.motorola.com/sf/frs/do/viewRelease/projects.droidx/frs.droidx_source.shado_x3_1_13_5_10
Hopefully I'll get some time to work on tun.ko for openvpn or vpnc.
But if someone beats me to it, please post it here.
Jeb

Downloading the source and pre-req's now. Will work on the tun.ko when I get back from dinner if no one else has it done.

Droid X source code! What!? Does this mean a bright future could be ahead for us?
XDA App = Pwnage

jebc4 said:
Sources are here:
opensource.motorola.com/sf/frs/do/viewRelease/projects.droidx/frs.droidx_source.shado_x3_1_13_5_10
Hopefully I'll get some time to work on tun.ko for openvpn or vpnc.
But if someone beats me to it, please post it here.
Jeb
Click to expand...
Click to collapse
What exactly is this?

drew630 said:
Downloading the source and pre-req's now. Will work on the tun.ko when I get back from dinner if no one else has it done.
Click to expand...
Click to collapse
Good luck to you and all for any work on this sweet phone. You rock!
Sent from my DROIDX using XDA App

Hi Drew,
Did you have any luck with tun.ko?
Thanks & all the best!

You can click in the bottom right of that that link and download all the files in one zip. SHADO_X3_1.13.5.10.zip is around 275MB.
I have unzipped that, then untarred all the individual archives.
According to the README, you need some files from source.android.com, but their link doesn't work, so that will take some more digging. (maybe I missed something...)
It appears to be the complete build process. I was just hoping to jump in and get a tun.ko modules compiled, but I still can't find the kernel config (I was just quickly looking around).
Anyway, bottom line is that I will have to get up to speed on the android build process, not just the cross compiled kernel process. This will take me some more time.
If anyone gets one before me, please post.
Thanks, Jeb

Anyone had any luck yet?
Sent from my DROIDX using XDA App

hmmm... I think that you should be able to compile the kernel with the default config options, but just enable the tun/tap module... I don't think that the module would really depend too heavily on any of the other config options?

I have compiled the module multiple times with multiple config files but none work. I get a exec failed error which is presumably because i compiled for the wrong architecture.
I have tried all the omap3 configs i found and the defconfig with no luck. I am away today but will look at it again tomorrow.
Sent from my DROIDX using XDA App

I'm no droid expert but it looks like according to the droid readme file you want ARM arch, but the compiler that youo should be using is arm-eabi-gcc (comes from the prebuilt tools from android) - in the Makefile set CROSS_COMPILE to /path/to/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- (or whatever the path to the file is on your build environment)
All the best,

Okay, after a bunch of hours I finally got it compiled
The 'exec format error' that you were probably seeing is not because it was compiled for the wrong architecture. I originally compiled the kernel modules with the default .config file that 'make menuconfig' generated.
When I tried to load it, I got the 'exec format error'. 'dmesg' showed:
<3>[46706.378570] tun: version magic '2.6.29 mod_unload modversions ARMv5 ' should be '2.6.29 preempt mod_unload ARMv7 '
So, that gave me a big hint - after a few hours of customizing I finally got the .config file to a version that will properly compile and load the openvpn module.
I'm attaching the .config file (config.zip) and tun.ko file (tun.ko.zip)
*NOTE* - I have not tested the kernel module yet, so I have no idea if it works. Even if it does work, the .config file is the default one that I manipulated so that the tun module would compile. You probably don't want to use the .config file as it may not match all of the hardware and configs of the droid x. If someone has the actual droid x .config file used by motorola then that would be very helpful.
*update* - the attacked files *do not work*. The working version is available at http://forum.xda-developers.com/showthread.php?p=7417520

Hmm... it looks like tun.ko does compile and install, but is not working properly
# lsmod
tun 11392 0 - Live 0xbf00c000
sec 4808 0 - Live 0xbf000000
# cat /dev/net/tun
/dev/net/tun: No such device
#
The response should be 'cat: /dev/net/tun: File descriptor in bad state'
If we only had the .config file from motorola this would be a lot easier.

mab2 said:
Hmm... it looks like tun.ko does compile and install, but is not working properly
# lsmod
tun 11392 0 - Live 0xbf00c000
sec 4808 0 - Live 0xbf000000
# cat /dev/net/tun
/dev/net/tun: No such device
#
The response should be 'cat: /dev/net/tun: File descriptor in bad state'
If we only had the .config file from motorola this would be a lot easier.
Click to expand...
Click to collapse
I'll post on Motodev board for the running .config (they should have left it in the running kernel at /prog/config.gz ...)
Anyway, thanks trying -- could you post any tips on getting a dev env setup?
I've been using linux for years, but this is my first android setup.

jebc4 said:
I'll post on Motodev board for the running .config (they should have left it in the running kernel at /prog/config.gz ...)
Anyway, thanks trying -- could you post any tips on getting a dev env setup?
I've been using linux for years, but this is my first android setup.
Click to expand...
Click to collapse
I'm in the same boat as you - android newbie, linux veteran.
I started out by getting the whole android environment - http://source.android.com/source/download.html - and ran 'repo init -u git://android.git.kernel.org/platform/manifest.git' - all of that was just so I could get the prebuilt directory with the arm-eabi- files that will be used below.
Then I just downloaded the entire project from opensource.motorola.com - extracted it all, went into the kernel directory and hacked away at the .config file from there.
To compile the kernel I ran:
CROSS_COMPILE=/home/MY_USERNAME/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make -j 4 kernel
CROSS_COMPILE=/home/MY_USERNAME/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make modules
I spent a few hours with it - playing around with environment variables and modifying some Makefiles so I may have left out a small thing or two

It looks like running 'make mapphone_defconfig' created a functioning .config file and I used that to generate tun.ko.
I've posted the files at http://forum.xda-developers.com/showthread.php?p=7417520

Attachments removed as per OP's request.

mab2 said:
I'm no droid expert but it looks like according to the droid readme file you want ARM arch, but the compiler that youo should be using is arm-eabi-gcc (comes from the prebuilt tools from android) - in the Makefile set CROSS_COMPILE to /path/to/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- (or whatever the path to the file is on your build environment)
All the best,
Click to expand...
Click to collapse
Thanks but I already got that, been compiling kernels for other Android devices for a while...

drew630 said:
Thanks but I already got that, been compiling kernels for other Android devices for a while...
Click to expand...
Click to collapse
didn't know that - no harm intended
All the best,

mab2 said:
Okay, after a bunch of hours I finally got it compiled
The 'exec format error' that you were probably seeing is not because it was compiled for the wrong architecture. I originally compiled the kernel modules with the default .config file that 'make menuconfig' generated.
When I tried to load it, I got the 'exec format error'. 'dmesg' showed:
<3>[46706.378570] tun: version magic '2.6.29 mod_unload modversions ARMv5 ' should be '2.6.29 preempt mod_unload ARMv7 '
So, that gave me a big hint - after a few hours of customizing I finally got the .config file to a version that will properly compile and load the openvpn module.
I'm attaching the .config file (config.zip) and tun.ko file (tun.ko.zip)
*NOTE* - I have not tested the kernel module yet, so I have no idea if it works. Even if it does work, the .config file is the default one that I manipulated so that the tun module would compile. You probably don't want to use the .config file as it may not match all of the hardware and configs of the droid x. If someone has the actual droid x .config file used by motorola then that would be very helpful.
*update* - the attacked files *do not work*. The working version is available at http://forum.xda-developers.com/showthread.php?p=7417520
Click to expand...
Click to collapse
i'm having a similar issue, how did you fix this ARMvX Version problem when compiling a module? Thanks in advance!

Related

Compatible cifs.ko

Can some one compile or point me to a cifs.ko that is compatible with the incredible. The ones I can find do not seem to be. Thanks in advance.
Interesting
http://linux.die.net/man/8/mount.cifs Not that I can help but if anyone wanted a quick reference.
Alot of the roms for other phones have it but its not compatible with out kernel. Is there a guide how to compile kernels? I made a couple in linux that worked. long ago..
here ya go...what app are you using to browse CIFS shares? I haven't tested this module, but just compiled it now.
Forgive me as I haven't actually tried this, but here is the 10,000 foot view:
At a minimum, you will need a linux system, with a gcc-arm cross compiler set up. I believe the android-sdk provides one. The version used by current kernels is gcc-4.4.4.
Then you will need the sources of the kernel you are running. The hydra kernel git tree is here: http://github.com/ejhart/Hydra-kernels.git , and the stock kernel sources are here: http://member.america.htc.com/download/RomCode/Source_and_Binaries/incrediblec_cc1c2268.tar.bz2
The hydra git tree doesn't seem to have a a working .config included, but this isn't so important if you are only building and installing kernel modules. From there, you'll need to configure the kernel in cross compiler mode, add the modules you want, and you will need to make sure the version magic string is identical to the kernel you are using. From there run make, and once the compile is finished, find the .ko 's you want, and push them to the /system/modules folder where you can insmod them.
Edit: You can use the .config from /proc/config.gz, didn't see it in there before.
mattwood2000 said:
here ya go...what app are you using to browse CIFS shares? I haven't tested this module, but just compiled it now.
Click to expand...
Click to collapse
I got one from another user but thanks do you still want me to try it? I mounted my share in a directory on the SDCARD so i can browse it with any file manager. I think any app that scans the sd card will also scan my server with about 8TB so that is a minor issue.
kernel compile guide
A guide for compiling kernels can be found here :
http://code.google.com/p/android-serialport-api/wiki/Htc
I not a techie and a newbie at any android development.
Since the guide is more or less a a set of instructions with no theory.
Got it to run, but not sure what I was doing.
Any assistance in provide either cifs.ko for the HTC Aria w/ kernel version :
liberty-2.6.29-21f066a6 or instructions on how to compile the module would be greatly
appreciated.
BTW - there an app on the store for automating the CIFS mount (CIFSManager
Regards,
-d
veli69 said:
I got one from another user but thanks do you still want me to try it? I mounted my share in a directory on the SDCARD so i can browse it with any file manager. I think any app that scans the sd card will also scan my server with about 8TB so that is a minor issue.
Click to expand...
Click to collapse
Could you please post the cifs.ko file that you have that works. Thanks.
OOMatter said:
Could you please post the cifs.ko file that you have that works.
Click to expand...
Click to collapse
Note that the post you quote was from before the 2.2 OTA, and hence that cifs.ko would be incompatible with the current kernel.
elborak said:
Note that the post you quote was from before the 2.2 OTA, and hence that cifs.ko would be incompatible with the current kernel.
Click to expand...
Click to collapse
Thanks for pointing that out. So does anyone have a compatible cifs.ko for the current DINC kernel?
OOMatter said:
Thanks for pointing that out. So does anyone have a compatible cifs.ko for the current DINC kernel?
Click to expand...
Click to collapse
I do. Check my blog. http://adrynalyne.us
Sent from my ADR6300 using XDA App
veli69 said:
Alot of the roms for other phones have it but its not compatible with out kernel. Is there a guide how to compile kernels? I made a couple in linux that worked. long ago..
Click to expand...
Click to collapse
http://marakana.com/forums/android/examples/111.html
GOOOOOOOOOOOOOOOOOOOOOOOOOOOGLE!!!!!!!!! YEAH!
Thats all fine and dandy except our source isn't on any git.
developer.htc.com
philips w732 vermagic '3.0.13 preempt mod_unload armv7' working cifs.ko and md4.ko modules
narod.ru/disk/63766749001.47b679339538b050028c3c7d87506dd2/md4.ko.html
narod.ru/disk/63743140001.693272f3661d5aac547ecc760f04db05/cifs.ko.html

[DEV] Loadable Modules for Gingersense Incredible [Updated 9/18 - Support for OTA]

HTC released gingerbread via OTA but they did not support additional modules. This thread has flashable zips for both the leaked kernel and the one from the "OTA".
Added flashable modules to attachments that are flashable in recovery.
I have created a zip of some of the more useful modules for our device:
Code:
cpufreq_conservative.ko
cpufreq_smartass.ko (thanks Chad for the help here)
ext4.ko
jbd2.ko (necessary for me to load ext4)
tun.ko
perflock_disable.ko (I actually compiled this one a little different but confirmed it would load and not get the exec format error)
Update: Smartass is working now with assistance from chad in resolving those errors. Decided to not worry about interactive for now.
Further information:
If you don't use the CWM flashable zip you will need to load perflock_disable a special way as it needs to be called with a special parameter to make it work correctly. Try adding below to a script. Credit to Calkulin for the script.
Code:
if [ -e /system/lib/modules/perflock_disable.ko ]; then
insmod /system/lib/modules/perflock_disable.ko
if [ $? -eq 0 ]; then
echo "Perflock DISABLED"
else
addr=`awk '$3 == "perflock_notifier_call" { print "0x"$1; }' /proc/kallsyms`
if [ -n "$addr" ]; then
insmod /system/lib/modules/perflock_disable.ko "perflock_notifier_call_addr=$addr"
if [ $? -eq 0 ]; then
echo "Perflock DISABLED"
else
echo "ERROR!!! Perflock could NOT be DISABLED"
fi
fi
fi
fi
Credits:
Conap (for BootManager and helping me test ext4 on an SD ROM)
XDA (for teaching me so much about Android)
HTC (for the kernel source)
Chad0989 (for assistance in getting smartass CPU governor working)
Coolbho3000 (perflock_disable)
Calkulin for the module load script
anyone else who inspired me (apologize if I forgot)
I have attached a zip file to this. If you are not a dev you can still use the modules here but some basic ADB/terminal knowledge would be needed. The modules are open for testing though.
Attached zip files and CWM-flashable zip files for both OTA and leak-based ROMs.
inc_modules.zip - Just the loadable modules.
inc_modules_ota.zip - just the loadable modules - OTA-based ROMS (August leak)
inc_modules_ota_091811.zip - just the loadable modules - OTA-based ROMS (actual OTA from September)
inc_modules_CWM_flashable.zip - flashable zip that will also autoload modules at boot.
inc_modules_ota_CWM_flashable.zip - flashable zip that will also autoload modules at boot - OTA-based ROMS (August leak)
inc_modules_ota_091811_CWM_flashable.zip - flashable zip that will also autoload modules at boot - OTA-based ROMS (Actual OTA from September)
I'm glad some one took this up I had been wondering the same thing since HTC opened the dev section. I had found another site that had a more extensive write up on how to build kernels but I'm not very fluent in linux and was a little intimidated at trying. At least I now know that it can be done. Maybe we can get Chad to try and port it over?
Awesome. A ray of hope.
Good job Tiny! I know someone was just asking for a tun.ko module and now I can't remember who it was. Hopefully they see your post.
jermaine151 said:
Good job Tiny! I know someone was just asking for a tun.ko module and now I can't remember who it was. Hopefully they see your post.
Click to expand...
Click to collapse
Thanks!
I'm trying to add more existing modules but my compiler treats warnings as errors so it won't build. Chad, if you see this post, any advice here?
tiny4579 said:
Thanks!
I'm trying to add more existing modules but my compiler treats warnings as errors so it won't build. Chad, if you see this post, any advice here?
Click to expand...
Click to collapse
--prefix
Sent from my ADR6300 using XDA App
hightech316 said:
--prefix
Sent from my ADR6300 using XDA App
Click to expand...
Click to collapse
I actually got them to build but they won't load still. I will play around with it more.
This is awesome. I was hoping for a tun.ko module! Now, do I just grab these and drop then in system/lib/modules and they should just work? Or are there steps I need to take to make them work? (I am honestly only concerned with the tun.ko)
oh wow this is incredible great job tiny!!! and the reason you probably cant get those other governors to work is because htc released an uncomplete source
jskolm said:
This is awesome. I was hoping for a tun.ko module! Now, do I just grab these and drop then in system/lib/modules and they should just work? Or are there steps I need to take to make them work? (I am honestly only concerned with the tun.ko)
Click to expand...
Click to collapse
Just drop in the ones you want and run insmod /system/lib/modules/tun.ko for tun.ko. You will have to do it at boot each time or get the dev to write an init.d script to load it.
tiny4579 said:
Just drop in the ones you want and run insmod /system/lib/modules/tun.ko for tun.ko. You will have to do it at boot each time or get the dev to write an init.d script to load it.
Click to expand...
Click to collapse
would i need to make one for every module?
JoelZ9614 said:
would i need to make one for every module?
Click to expand...
Click to collapse
Joel,
No, just one script should work. I believe Synergy ROM already has the init.d script for some of them. See 00cpufreq_modules in /system/etc/init.d
All,
Updated OP with latest zip file. If you have downloaded previously, redownload to get the latest.
would it be likes this?
http://www.multiupload.com/J9WTSA4VWF
JoelZ9614 said:
would it be likes this?
http://www.multiupload.com/J9WTSA4VWF
Click to expand...
Click to collapse
The first line should be:
Code:
#!/system/bin/sh
and it needs to have execute permissions or it won't execute. Also make sure to save it in UNIX format. I would also add the smartass module as it is quite popular. To test type lsmod from adb or terminal after boot. Hope this helps.
tiny4579 said:
The first line should be:
Code:
#!/system/bin/sh
and it needs to have execute permissions or it won't execute. Also make sure to save it in UNIX format. I would also add the smartass module as it is quite popular. To test type lsmod from adb or terminal after boot. Hope this helps.
Click to expand...
Click to collapse
eeh im not good with init.d scripts lol
ok i think i got it would it be like this?
Code:
#!/system/bin/sh
/system/bin/insmod /system/lib/modules/tun.ko
Every shell script should contain
#!/system/bin/sh
Sent from my ADR6300 using XDA App
JoelZ9614 said:
ok i think i got it would it be like this?
Code:
#!/system/bin/sh
/system/bin/insmod /system/lib/modules/tun.ko
Click to expand...
Click to collapse
Exactly!
Then just make a line for each module.
EDIT: Though you could just write it like this:
Code:
#!/system/bin/sh
insmod /system/lib/modules/tun.ko
Though to be safe and to make sure you are running that particular insmod command you can leave it the way you have it.
ok done its in my rom RLS3 Thanks Tiny Great work
JoelZ9614 said:
ok done its in my rom RLS3 Thanks Tiny Great work
Click to expand...
Click to collapse
No prob! It's been a good project for me.

[Q] [KERNEL] ARMv6 vs ARMv7 cross-compile question / tun.ko for LG Revo

hello all -- ive mostly been a lurker (been too busy), but i finally found some time to try and get the ipsec vpn working on my stock-but-rooted LG Revo. despite some ardent googling, i couldn't find a working tun.ko that would work with vpc/VPN Connections. so i decided to compile my own.
i figure since there's certainly nothing in the LG Revo boards here specific to compiling tun.ko for the LG Revo, i'd start this thread and document my steps along the way. i figure other board users can use for reference etc. hope it's ok mods/admins!
the short version/TL;DR:
i have compiled my own tun.ko for my stock/rooted LG Revolution. i have the correct kernel version (etc) but am stuck because i dont seem to be able to compile ARMv7, only ARMv6. this is the error i receive when i try to insmod:
Code:
tun: version magic '2.6.32.9-perf preempt mod_unload ARMv6 ' should be '2.6.32.9-perf preempt mod_unload ARMv7 '
basically i need to compile it for ARMv7 not ARMv6. i don't know how.
the long version, aka the steps i took:
starting in a nice clean folder, download the linux kernel src specific to the version of the kernel on my rooted stock LG Revo. i obtained this earlier (you can check via Settings -> About Phone -> Kernel version. if you have a stock (rooted or not) LG Revolution it will be: 2.6.32.9-perf.
Code:
$ mkdir -p $HOME/tmp/lgrevosrc
$ export LGREVOSRC=$HOME/tmp/lgrevosrc
$ cd $LGREVOSRC
$ wget -q http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.9.tar.bz2
$ wget -q http://dl.google.com/android/android-sdk_r10-linux_x86.tgz
$ wget -q http://dl.google.com/android/ndk/android-ndk-r5b-linux-x86.tar.bz2
$ tar xjf linux-2.6.32.9.tar.bz2
$ tar xzf android-sdk_r10-linux_x86.tgz
$ tar xjf android-ndk-r5b-linux-x86.tar.bz2
earlier, i copied the config file for the kernel specific to my LG Revo by using Root Explorer and copying the /proc/config.gz file. i now copy this into my linux kernel src tree, being sure to gzunzip it first and to copy it to the src folder as ".config", not "config".
Code:
$ cd $LGREVOSRC/linux-2.6.32.9
$ gzip -d ~rickt/tmp/from_my_lgrevo/config.gz
$ cp ~rickt/tmp/from_my_lgrevo/config .config
now we have to edit the .config file and add the tun module so it will be compiled. i added the following line to the .config file:
Code:
CONFIG_TUN=m
now, we compile the modules, being sure to set the environment variables for the architecture we NEED, not the one we're compiling on:
Code:
$ export ARCH=arm
$ export CROSS_COMPILE=arm-eabi-
$ export PATH=$PATH:$LGREVOSRC/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin
$ make modules
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
HOSTCC scripts/kconfig/conf.o
< snipped, for brevity >
LD [M] net/sched/cls_flow.ko
CC net/sched/sch_dsmark.mod.o
LD [M] net/sched/sch_dsmark.ko
$
let make sure the tun.ko module was compiled, and we'll see what type of arch it was compiled for:
Code:
$ find . -name tun.ko
./drivers/net/tun.ko
$ ls -l ./drivers/net/tun.ko
-rw-r--r-- 1 root root 190705 Aug 19 06:35 ./drivers/net/tun.ko
$ file ./drivers/net/tun.ko
./drivers/net/tun.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
$ strings ./drivers/net/tun.ko | grep -i arm
vermagic=2.6.32.9-perf preempt mod_unload ARMv6
BOOM! note the ARMv6. this is important, because when i try to insert the module into the kernel on my android (after copying it over, obviously) i get:
Code:
# insmod tun.ko
insmod: init_module 'tun.ko' failed (Exec format error)
ok, so i start nosing around in the logs to see what i can see, and i see:
Code:
<3>[122130.240509] tun: version magic '2.6.32.9-perf preempt mod_unload ARMv6 ' should be '2.6.32.9-perf preempt mod_unload ARMv7 '
so... i guess this was a long and drawn-out way of saying that i have a great desire to have a tun.ko for our beloved LG Revolution, but i'm not sure how to have gcc on a linux box cross-compile for ARMv7, not ARMv6.
anyone? bueller?
I work quite a bit with cross-compilers in my day job, but I haven't tried to use any of the pre-packaged ones in the Android SDK(s).. however, until I have time to play with them, the ARMv6 versus 7 probably relates to these 2 variables:
$ export ARCH=arm
$ export CROSS_COMPILE=arm-eabi-
Also, gcc has -march and -mtune params that can sometimes be used to select specific CPUs and/or sub-architectures within a main CPU family.. if someone (e.g. LG) gave out an SDK for the Revo specifically, their gcc would probably already be "spec'ed" to march and mtune for the specific CPU..so maybe the generic Android ARM gcc cross-compiler defaults to ARMv6.
I may have time to poke into this later, but it probably won't be today..
- Phil
I've been informed that GCC cannot output ARMv7. I think licensed developer tools are needed. Can anyone confirm this?
RMT.
GCC4.3 added ARMv7 support. This discussion seems to confirm the various details:
I think in GCC 4.3 is where you get ARMv7 architecture support, (see
http://gcc.gnu.org/gcc-4.3/changes.html), which is EABI and at GCC 4.4
you have "EABI-compatible profiling interface for EABI targets." (again see
http://gcc.gnu.org/gcc-4.4/changes.html).
So I've chosen to work on 4.4 just to be sure, and it also supports Cortex-A9, as
well as VFPv3 (yeah!).
Click to expand...
Click to collapse
Full discussion here:
http://freebsd.1045724.n5.nabble.com/ARMv7-EABI-Cross-Compiler-tp4201510p4201523.html
Depending on who is providing the cross-compiler you are trying to use, they may either be using something prior to gcc4.3, or, they are providing a compiler which has not been enabled with the ARMv7 target. You could try using Kegel's cross-tool with a recent gcc (4.4 or 4.5) to build your own ARMv7 cross-compiler, but not sure how deep you want to go with this!
- Phil
I haven't been able to get a working tun.ko for this either. I've having trouble compiling my own. Could you post the adapter you're working with?
I just saw a verizon update come down, but kernel is 2.6.32.9-perf [email protected] #1.
Bumping this ol' thread hoping that progress has been made or someone knows about a thread I missed. Trying (hoping) to get OpenVPN going with my Revo so I'm hoping there's a tun.ko available.
I successfully compiled a tun.ko for mine using the "crossdev" package on gentoo. Just setting ARCH=arm CROSS_COMPILE=arm-eabi- did the trick for me.
I believe older verions of gcc were not yet capable of producing ARMv7.
gcc 4.5.3 certainly is. I would try upgrading to that if possible and that ought to work.
I'd be happy to share my tun.ko with anyone that wants it as well...
Slightly unrelated, I also found that loading the module (insmod tun.ko) did not cause the /dev/net/tun node to be created for some reason...
a simple
Code:
mkdir /dev/net
mknod /dev/net/tun c 10 200
as root, and AFTER loading the module resolves that problem, at least until the next reboot. I haven't figured out how to get it to run a script at boot yet to automate it.
If anyone wants the tun.ko let me know and I'll upload it somewhere.
Bait-Fish said:
Bumping this ol' thread hoping that progress has been made or someone knows about a thread I missed. Trying (hoping) to get OpenVPN going with my Revo so I'm hoping there's a tun.ko available.
Click to expand...
Click to collapse
Blitz includes tun.ko
Sent from my VS910 4G using xda premium
nasaiya said:
I'd be happy to share my tun.ko with anyone that wants it as well...
Click to expand...
Click to collapse
Thanks you very much for the offer. I am a total noob as far as compiling goes!
mtmichaelson said:
Blitz includes tun.ko
Click to expand...
Click to collapse
Damn sweet! I never needed it before so that went right over my head previously. Can I simply extract it or would I have to be on BK? (which I'm not)
Sent from my VS910 4G using Tapatalk
I believe you need to install ClockWorkMod to flash blitz onto your phone. You can backup first and try it out safely with CWM. Just follow the instructions in the thread it's easy.
Here's my tun.ko for anyone that wants it. I found "openvpn installer" and "openvpn settings" apps perfect for my needs (only issue is I still have to manually add the device node -- even with blitzkrieg, but it's no big deal)
http://www.box.com/s/a50pnexofiej4in7s5h7
Bait-Fish said:
Thanks you very much for the offer. I am a total noob as far as compiling goes!
Damn sweet! I never needed it before so that went right over my head previously. Can I simply extract it or would I have to be on BK? (which I'm not)
Sent from my VS910 4G using Tapatalk
Click to expand...
Click to collapse
You could try pulling it from the blitz zip and dropping it in your /system/lib/modules and see if it works!
Sent from my VS910 4G using xda premium
Cool, thanks. I'll attempt the 'easy' way first.
Sent from my VS910 4G using Tapatalk

[HOWTO] Building from sources [Kernel only for now]

Hello everyone.
This guide will help you in building a kernel from source for your Nexus 4
Later, when 4.2 hits AOSP, i'll add a guide for building that too
You will need a computer running Linux / OSX to build the kernel, natively, or via a VM.
This guide assumes you’re running any Linux distro.
Getting a toolchain:
You need a toolchain to build the kernel.
The preferred one is Google’s toolchain, the same they use to build AOSP.
In a terminal, type:
Code:
git clone [url]https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/[/url]
export PATH=$PATH:$(pwd)/arm-linux-androideabi-4.6/bin
export CROSS_COMPILE=arm-linux-androideabi-
TIp: paste the export statements in your ~/.bashrc to have them exported each login.
Getting the kernel source:
The kernel source for Nexus devices is available from Google’s servers.
Nexus 4 : https://android.googlesource.com/kernel/msm
Github Mirror: https://github.com/android/kernel_msm
Open the terminal, and type the below commands to get the kernel source on your computer.
Code:
mkdir -p android/kernel
cd android/kernel
For Nexus 4, we get the msm kernel sources.
Code:
git clone [url]https://android.googlesource.com/kernel/msm[/url]
Next, we change our directory to the newly fetched source.
Type
Code:
cd msm
Figuring out what to build:
Now, we need to figure out which revision to build.
You need to be exactly sure about this, otherwise there are chances that the compiled kernel won’t work.
The commit to build upon can be found by a few ways.
To get the kernel sources matching the device tree, type the below in the device tree.
Code:
git log kernel
Next, type the below in the kernel tree
Code:
git checkout <commit>
The commit of the version running of the current review units is 7a47627, which is same as branch android-msm-mako-3.4-jb-mr1-fr .
Compiling:
Name of defconfig: mako_defconfig
cd to the directory of the kernel source, then type the below in a terminal.
Code:
export ARCH=arm
export SUBARCH=arm
Code:
make <name_of_defconfig>
make
The kernel image will be ready at arch/arm/boot/zImage
To flash it, you need to make it into a boot.img, more on that later, when we have more sources.
1) what is the branch "android-msm-mako-3.4-jb-mr1-fr" for?
2) what does mr1 mean? sounds like milestone/alpha/beta. Maybe it's not final? Last commit is 2 weeks ago.
3) great guide
m11kkaa said:
1) what is the branch "android-msm-mako-3.4-jb-mr1-fr" for?
2) what does mr1 mean? sounds like milestone/alpha/beta. Maybe it's not final? Last commit is 2 weeks ago.
3) great guide
Click to expand...
Click to collapse
mr1 could stand for "Milestone Release 1", it might not be final.
That being said, you should never checkout a branch directly for compiling a kernel, but the commit directly.
cdesai said:
...You need a toolchain to build the kernel. The preferred one is Google’s toolchain, the same they use to build AOSP.
Click to expand...
Click to collapse
Could you also use linaro to compile the kernel? I believe it's a toolchain anyway, but I'm not too sure on it's benefits or compatibility...
nice didn't realize kernel source was already available- can't wait to test this zImage and start testing changes noticed they left out kernel compression makes for a big zimage
randomblame said:
nice didn't realize kernel source was already available- can't wait to test this zImage and start testing changes noticed they left out kernel compression makes for a big zimage
Click to expand...
Click to collapse
Are you planning on developing for the N4?
Loved your work on the DHD
espionage724 said:
Could you also use linaro to compile the kernel? I believe it's a toolchain anyway, but I'm not too sure on it's benefits or compatibility...
Click to expand...
Click to collapse
Linaro isn't a toolchain, but they do make toolchains.
Yes, you can use it to compile the kernel, though it may not compile at all with it, or not work well - your mileage may vary.
randomblame said:
nice didn't realize kernel source was already available- can't wait to test this zImage and start testing changes noticed they left out kernel compression makes for a big zimage
Click to expand...
Click to collapse
Nope, LZO compression is enabled by default
cdesai said:
Linaro isn't a toolchain, but they do make toolchains.
Yes, you can use it to compile the kernel, though it may not compile at all with it, or not work well - your mileage may vary.
Click to expand...
Click to collapse
Linaro has proven to increase android performance up 30 - 100% not sure if that is with -O3 optimizations or not. That is all I use on my kernels
Sucks this phone is not coming to Sprint, might be time to change carriers...
randomblame said:
nice didn't realize kernel source was already available- can't wait to test this zImage and start testing changes noticed they left out kernel compression makes for a big zimage
Click to expand...
Click to collapse
-mvectorize-with-neon-quad ---> I use this in my makefile for cflags and drops the zImage size from 5.0mb to 4.4mb.
cdesai said:
Linaro isn't a toolchain, but they do make toolchains.
Yes, you can use it to compile the kernel, though it may not compile at all with it, or not work well - your mileage may vary.
Nope, LZO compression is enabled by default
Click to expand...
Click to collapse
ah I didn't see it - 6+mb still pretty big from what I'm used to at least
I'm going through the mind numbing process of bringing in mainline patches and squashing them all together. I'm up to 3.4.1 ... woot where's the hang me emoticon lol
*finally got smart and cloned mainline and reset the head back to each sublevel and merged into my local n4 source
got it all the way up to date with mainline 3.4.18
Thanks cdesai. I didn't think anything was out yet!!
randomblame said:
ah I didn't see it - 6+mb still pretty big from what I'm used to at least
I'm going through the mind numbing process of bringing in mainline patches and squashing them all together. I'm up to 3.4.1 ... woot where's the hang me emoticon lol
*finally got smart and cloned mainline and reset the head back to each sublevel and merged into my local n4 source
got it all the way up to date with mainline 3.4.18
Click to expand...
Click to collapse
Yea, it's big, but partitions on new devices are big as well.
y u no use git to merge
Just add korg as a remote, fetch, merge.
Each version is tagged, so you can do that incrementally too.
Also, kernel.org hosts patches as well, if you prefer that way.
snowman77 said:
Thanks cdesai. I didn't think anything was out yet!!
Click to expand...
Click to collapse
Google <3
I got it straightened out so it's up to date with mainline and I think I've got overclocking up to 1.89ghz ready lots of more fun to be had but damn I'm just teasing myself till tuesday/whenever the thing comes in the mail. hard to test anything without hardware.
I may need a tip. I have followed your guide - which I find great and simple - but I'm having a problem with the arm binaries when I launch the make command after checking out the remotes/origin/android-msm-mako-3.4-jb-mr1-fr and executed make mako_defconfig:
Code:
/bin/sh: 1: arm-linux-androideabi-ld: not found
I have cloned the toolchain and msm repos, and added to the PATH environment var the location of the bin directory. I can reach arm-linux-androideabi-ld from the command line, but no luck executing it:
Code:
[email protected]:~/android/kernel/msm$ /home/echedey/android/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-ld
bash: /home/echedey/android/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-ld: No such file or directory
And it is there with execution rights:
Code:
[email protected]:~/android/kernel/msm$ ll /home/echedey/android/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-ld
-rwxrwxr-x 1 echedey echedey 3145332 Nov 10 16:32 /home/echedey/android/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-ld*
My repos are in these paths:
Code:
/home/echedey/android/arm-linux-androideabi-4.6
/home/echedey/android/kernel
And my $PATH is:
Code:
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/echedey/android/arm-linux-androideabi-4.6/bi
Am I missing anything?
josjator said:
I may need a tip. I have followed your guide - which I find great and simple - but I'm having a problem with the arm binaries when I launch the make command after checking out the remotes/origin/android-msm-mako-3.4-jb-mr1-fr and executed make mako_defconfig:
Code:
/bin/sh: 1: arm-linux-androideabi-ld: not found
I have cloned the toolchain and msm repos, and added to the PATH environment var the location of the bin directory. I can reach arm-linux-androideabi-ld from the command line, but no luck executing it:
Code:
[email protected]:~/android/kernel/msm$ /home/echedey/android/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-ld
bash: /home/echedey/android/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-ld: No such file or directory
And it is there with execution rights:
Code:
[email protected]:~/android/kernel/msm$ ll /home/echedey/android/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-ld
-rwxrwxr-x 1 echedey echedey 3145332 Nov 10 16:32 /home/echedey/android/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-ld*
My repos are in these paths:
Code:
/home/echedey/android/arm-linux-androideabi-4.6
/home/echedey/android/kernel
And my $PATH is:
Code:
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/echedey/android/arm-linux-androideabi-4.6/bi
Am I missing anything?
Click to expand...
Click to collapse
You path has a "n" missing from bin at the end.
You could type arm- and try to use tab-completion to see if it's accessible, then the same thing with full path (~/android/arm-linux-androideabi-4.6)
cdesai said:
You path has a "n" missing from bin at the end.
You could type arm- and try to use tab-completion to see if it's accessible, then the same thing with full path (~/android/arm-linux-androideabi-4.6)
Click to expand...
Click to collapse
Sorry, the missing 'n' came from the c&p. I can actually see the file by tabing it from any path but after the auto completing it tells this weird thing:
Code:
[email protected]:~$ arm-linux-androideabi-ld
bash: /home/echedey/android/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-ld: No such file or directory
I'm a experienced *nix user but I don't get this. The repos are correctly cloned and all files under bin has exec rights. I'm running ubuntu 12.10. Maybe a problem with the shell? I should try any other environment, but that would be like killing flies with missiles. Thanks for your help.
Do you definitely have the appropriate executable at
'/home/echedey/android/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-ld'?
Can you do an ls -lF of that directory?
Perhaps the arm-linux-androideabi-ld file there is actually just a symlink which has lost its target.
@josjator Yeah, seems I have the same problem as you. I'm also using Ubuntu 12.10 with a bash shell. I think it may be a recursive make/shell issue thing (sorry, I'm not too hot on make files). Will keep plugging away to see if I can resolve the problem.
The device trees have hit AOSP
https://android.googlesource.com/device/lge/mako/
dsana123 said:
@josjator Yeah, seems I have the same problem as you. I'm also using Ubuntu 12.10 with a bash shell. I think it may be a recursive make/shell issue thing (sorry, I'm not too hot on make files). Will keep plugging away to see if I can resolve the problem.
Click to expand...
Click to collapse
@josjator: Using the 4.7 toolchain sorted me out (at least it's building now and past the initial problem).
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7
Click to expand...
Click to collapse
The objdump and ld binaries are much happier now.
BTW, I did download the 4.6 toolchain again (just in case there was some problem in the initial git clone), but I still encountered objdump and ld problems.
Works like a champ on Ubuntu 12.10 exactly as outlined in the OP. Thanks!
Code:
[email protected]:~/Documents/AOSP/kernel/msm$ ls -l arch/arm/boot/zImage
-rwxrwxr-x 1 android android 6314888 Nov 16 23:45 arch/arm/boot/zImage
[email protected]:~/Documents/AOSP/kernel/msm$ uname -a
Linux ubuntu 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
[email protected]:~/Documents/AOSP/kernel/msm$ arm-linux-androideabi-gcc -v
[...]
gcc version 4.6.x-google 20120106 (prerelease) (GCC)

Compiling frandom module for kernel 2.6.32.9

hi.
i would like to get some information about how to compile frandom module for my kernel.
here is the wiki... https://github.com/pier11/kernel_hu...-packing-the-kernel-into-a-flashable-boot.img
and git https://github.com/pier11/kernel_huawei_u8220
so which command i should use ? (i ve been told ---> CONFIG_*=m)
and when ?
i have the frandom kernel module tarball. dl it here= http://billauer.co.il/frandom.html
do i have to extract it? in which directory?
thank you very much...
desalesouche said:
hi.
i would like to get some information about how to compile frandom module for my kernel.
here is the wiki... https://github.com/pier11/kernel_hu...-packing-the-kernel-into-a-flashable-boot.img
and git https://github.com/pier11/kernel_huawei_u8220
so which command i should use ? (i ve been told ---> CONFIG_*=m)
and when ?
i have the frandom kernel module tarball. dl it here= http://billauer.co.il/frandom.html
do i have to extract it? in which directory?
thank you very much...
Click to expand...
Click to collapse
as there is no teachers(for the moment) in that "university", i had to "harass" some regonized people from xda...(sorry for that)
and they kindly try to help me...
i had this kind of answer which i could do : i think that the following is to build the module included in the kernel..
Download Makefile, Kconfig, and frandom.c and put all three in your downloaded kernel source (drivers/char directory) overwriting any existing file.
this part is done...
but how to do that ? add FRANDOM=m to the kernel .config file ? and where is located that file?
2 minutes of googling suggests you take a look at these:
http://forum.xda-developers.com/showthread.php?t=1236576
http://yatsec.blogspot.co.uk/2011/01/guide-to-compiling-custom-kernel.html
pulser_g2 said:
2 minutes of googling suggests you take a look at these:
http://forum.xda-developers.com/showthread.php?t=1236576
http://yatsec.blogspot.co.uk/2011/01/guide-to-compiling-custom-kernel.html
Click to expand...
Click to collapse
i have been googling far much more than 2 minutes and i already found these threads...but couldn't manage...
by egg with this one ...which contains error... http://yatsec.blogspot.co.uk/2011/01...om-kernel.html
PREPARING YOUR KERNEL SOURCE
First we must retrieve and copy the kernel config from our device.
Code:
$ cd /path/to/android-sdk/tools ----->ok
$ ./adk pull /proc/config.gz ----->not good! you have to make first $ adb devices in terminal....then $ adb pull /proc/config.gz
$ gunzip ./config.gz ----->ok
$ cp config /path/to/kernel/.config not working! ----> cp: cannot create regular file /path/to/kernel/.config : No such file or directory....
so what to do now?
how to solve this please? i will keep on googling to try to find out solution...any help is welcome
thank you
when i will finish my little project , i think that other people would benefit from that... i might make a how to .
for information ,i have been setting ubuntu 12.10 64 bits from this thread ---->http://soupdawg.wordpress.com/2012/...-for-building-android-jellybean-all-variants/
new link : http://nathanpfry.com/2014/02/07/how-to-prepare-ubuntu-14-04-lts-trusty-tahr-to-compile-android-roms
Re: [Q] Compiling frandom module for kernel 2.6.32.9
desalesouche said:
i have been googling far much more than 2 minutes and i already found these threads...but couldn't manage...
by egg with this one ...which contains error... http://yatsec.blogspot.co.uk/2011/01...om-kernel.html
PREPARING YOUR KERNEL SOURCE
First we must retrieve and copy the kernel config from our device.
Code:
$ cd /path/to/android-sdk/tools ----->ok
$ ./adk pull /proc/config.gz ----->not good! you have to make first $ adb devices in terminal....then $ adb pull /proc/config.gz
$ gunzip ./config.gz ----->ok
$ cp config /path/to/kernel/.config not working! ----> cp: cannot create regular file /path/to/kernel/.config : No such file or directory....
so what to do now?
how to solve this please? i will keep on googling to try to find out solution...any help is welcome
thank you
when i will finish my little project , i think that other people would benefit from that... i might make a how to .
for information ,i have been setting ubuntu 12.10 64 bits from this thread ---->http://soupdawg.wordpress.com/2012/...-for-building-android-jellybean-all-variants/
Click to expand...
Click to collapse
That's because you are meant to put in the path to your kernel, rather than literally /path/to/kernel...
@OP
I know you sent me a PM, but it's better if I reply here.
THIS is what did it for me. Of course my goal wasn't achieved as the extraversion bit was wrong. The X8 is a tricky device.
And make sure to go through the whole thread first.
And also try to use the arm-eabi toolchain from CM as that one throws the least errors.
sgt. meow
hi all. i manage to compile the module thanks to Blechd0se http://forum.xda-developers.com/member.php?u=4855459 i will soon edit the working how to kindly provided by him.
i thank all people who have been providing help and advices... and XDA
here are the change provided by bledchOse to be able to compile the frandom module for my kernel. and little how to
1---> https://github.com/pier11/kernel_hu...-packing-the-kernel-into-a-flashable-boot.img
2---> https://github.com/desalesouche/kernel_huawei_u8220
make the change in kernel before to build it ( change are in green)
3---> https://github.com/desalesouche/jordan-kernel/commit/52e4f2d00b2ea11e3643adb4c4235bdda7a87b5b
4---> Originally Posted by Blechd0se
" change CONFIG_FRANDOM=y to CONFIG_FRANDOM=m, it make you a nice and shiny *.ko file.
And if you already compiled your kernel its inside the kernel, no need to compile another module which does exactly the same and you can instead push your kernel to your device "
5 build the kernel and or module and finish to follow explanation of link 1...
you will find the frandom .ko under drivers/char/frandom/ where your kernel is located... copy it under system/lib/modules/ in your rom zip.
you will need a script to make it load:be activated at boot
Et voilà!!!
It's funny because it is true.....
pulser_g2 said:
2 minutes of googling suggests you take a look at these:
http://forum.xda-developers.com/showthread.php?t=1236576
http://yatsec.blogspot.co.uk/2011/01/guide-to-compiling-custom-kernel.html
Click to expand...
Click to collapse
Had been researching kernel mods came across frandom, googled "frandom module".... Your post was number 2 result.... your first link was my answer.... I win! 5 seconds googling!!! Thank you sir!

Categories

Resources