[Q] Kernel Module Compiling Versioning.. - Android Q&A, Help & Troubleshooting

I need help guys, I'm really new to this kernel compiling thing (I'm not really even a software engineer..) But anyway, so I have this mini wireless keyboard + mouse I'm trying to get to work on my MK802 II (Allwinner A10). From plugging the wireless dongle into my linux machine, I did an lsmod and determined the drivers to be hid-ortek.ko. And this driver happens to be absent on the MK802 II.
I set up my ubuntu with android sdk and ndk and all the other prereqs from thousands of other sites from googling.
Then I git cloned the Allwinner A10 kernel source from : https://github.com/amery/linux-allwinner and checked out the lichee 3.0.8+ to match the kernel version on my MK802 II.
So then I started off with:
Code:
make ARCH=arm sun4i_defconfig
make ARCH=arm menuconfig
And then I selected Ortek keyboard drivers from the UI and marked it as 'm'.
Because apparently Module.symver is only generated if you do a complete kernel build.. so I did
Code:
make ARCH=arm CROSS_COMPILE=~/Downloads/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- all
And Module.symver is created after this step.
But I looked in the ./drivers/hid folder to see if hid-ortek.ko was compiled and apparently not
so then I did:
Code:
make ARCH=arm CROSS_COMPILE=~/Downloads/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- M=./drivers/hid modules
And my "hid-ortek.ko" was still not created. The output from this was:
Code:
Building modules, stage 2.
MODPOST 0 modules
So I googled up tutorials and created a Makefile that looked like this:
Code:
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 8
EXTRAVERSION =
obj-m += hid-ortek.o
KDIR=~/Documents/linux-allwinner
PWD := $(pwd)
default:
make -C $(KDIR) ARCH=arm CROSS_COMPILE=~/Downloads/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- SUBDIRS=$(PWD) modules
clean:
make -C $(KDIR) ARCH=arm CROSS_COMPILE=~/Downloads/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- SUBDIRS=$(PWD) clean
and did a make, that did the trick and hid-ortek.ko was created
So I did the adb push into my MK802 (into /system/vendor/modules folder) and tried insmod it.. but I kept getting
Code:
insmod: init_module 'hid-ortek.ko' failed (Exec format error)
and dmesg tells me that there is "no symbol version for module_layout". Which according to googling around means that Module.symver wasn't generated so I have to do a full build, but I did and I saw Module.symver generated in my kernel source directory. I did a modinfo on the compiled hid-ortek.ko and it shows
Code:
3.0.8+ preempt mod_unload modversions ARMv7
Which should be right. I did a modinfo on the other modules already loaded on the device and shows the exact same thing.
What am I doing wrong here? Please help.
Thanks!

chen_tso said:
I need help guys, I'm really new to this kernel compiling thing (I'm not really even a software engineer..) But anyway, so I have this mini wireless keyboard + mouse I'm trying to get to work on my MK802 II (Allwinner A10). From plugging the wireless dongle into my linux machine, I did an lsmod and determined the drivers to be hid-ortek.ko. And this driver happens to be absent on the MK802 II.
I set up my ubuntu with android sdk and ndk and all the other prereqs from thousands of other sites from googling.
Then I git cloned the Allwinner A10 kernel source from : https://github.com/amery/linux-allwinner and checked out the lichee 3.0.8+ to match the kernel version on my MK802 II.
So then I started off with:
Code:
make ARCH=arm sun4i_defconfig
make ARCH=arm menuconfig
And then I selected Ortek keyboard drivers from the UI and marked it as 'm'.
Because apparently Module.symver is only generated if you do a complete kernel build.. so I did
Code:
make ARCH=arm CROSS_COMPILE=~/Downloads/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- all
And Module.symver is created after this step.
But I looked in the ./drivers/hid folder to see if hid-ortek.ko was compiled and apparently not
so then I did:
Code:
make ARCH=arm CROSS_COMPILE=~/Downloads/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- M=./drivers/hid modules
And my "hid-ortek.ko" was still not created. The output from this was:
Code:
Building modules, stage 2.
MODPOST 0 modules
So I googled up tutorials and created a Makefile that looked like this:
Code:
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 8
EXTRAVERSION =
obj-m += hid-ortek.o
KDIR=~/Documents/linux-allwinner
PWD := $(pwd)
default:
make -C $(KDIR) ARCH=arm CROSS_COMPILE=~/Downloads/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- SUBDIRS=$(PWD) modules
clean:
make -C $(KDIR) ARCH=arm CROSS_COMPILE=~/Downloads/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- SUBDIRS=$(PWD) clean
and did a make, that did the trick and hid-ortek.ko was created
So I did the adb push into my MK802 (into /system/vendor/modules folder) and tried insmod it.. but I kept getting
Code:
insmod: init_module 'hid-ortek.ko' failed (Exec format error)
and dmesg tells me that there is "no symbol version for module_layout". Which according to googling around means that Module.symver wasn't generated so I have to do a full build, but I did and I saw Module.symver generated in my kernel source directory. I did a modinfo on the compiled hid-ortek.ko and it shows
Code:
3.0.8+ preempt mod_unload modversions ARMv7
Which should be right. I did a modinfo on the other modules already loaded on the device and shows the exact same thing.
What am I doing wrong here? Please help.
Thanks!
Click to expand...
Click to collapse
Did you change the kernel itself ?

'no symbol version for module_layout'
Hello, I have the exact same issue (but using kernel "2.6.36-android+")
did you find a solution?

Im also in the same boat guys...
mat23452345 said:
Hello, I have the exact same issue (but using kernel "2.6.36-android+")
did you find a solution?
Click to expand...
Click to collapse
Im buiding kernel for goodix touch drivers as im currently modding a LY-F1 JB ROM which uses a focaltouch touchscreen. but a full build is not enabling the modules and gives a exec error. Maybe it has something to do with ur extra version variable. change EXTRAVERSION = to "EXTRAVERSION =+" and do a build and tell me what happens. Im out so cant really test it.

cybermate123 said:
change EXTRAVERSION = to "EXTRAVERSION =+" and do a build and tell me what happens.
Click to expand...
Click to collapse
Thanks for the reply, but that tablet has crashed and gone now. I will bear that in mind for the future...

Related

Can't Compile wlan.ko

I hate to clutter the dev section, but this is definitely a development question. I'm trying to build my own kernel, which I got the kernel built, but I can't get a working wlan.ko to build. I have one that builds every time in *kernel source path*/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko but it won't enable wifi when I push it to /system/lib/modules as bcm4329.ko. I think its because for some reason it's compiling a driver for a Texas Instruments chip like the one in the Droid, instread of the Broadcom chip in the Nexus.
I've checked in *kernel source dir*/drivers/net/wireless/bcm4329/ where everything says it should be for this chip, but it never compiles there. Any ideas? I'm using pretty much the stock config from Cyanogens Nexus kernel, and the only things I've changed in source are a HUGE audio boost, OC with a slight undervolt of my own, and pershoot's board-mahimahi.h tweaks for added RAM.
Here is my build script
Code:
#!/bin/sh
export KERNEL_DIR=/home/geniusdog/geniusdogkern/cm-kernel
export TOOLCHAIN=/home/geniusdog/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
cd $KERNEL_DIR
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN MODULES_INSTALL=~/Desktop/modules
echo ---Finished building kernel!
cd ~/Desktop/nexuskernel
mv $KERNEL_DIR/arch/arm/boot/zImage zImage
mv $KERNEL_DIR/drivers/net/wireless/bcm4329/wlan.ko ~/Desktop/nexuskernel/wlan_bcm.ko
mv ~/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko ~/Desktop/nexuskernel/wlan_ti.ko
echo --- Finished copying!
Also, I'm not a moron, I have it set to copy both of the wlan files over just in case they show up, which they never do. I can browse the the directory where the broadcom one should be and its still not there, even if I have it set to move it. Whenever I compile everything compiles fine but once it gets to the wlan module I get:
Code:
*more compiling messages up here*
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 2 modules
ERROR: "init_mm" [drivers/net/wireless/tiwlan1251/wlan.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
Then compiling stops. I still have my kernel zimage but no working wlan file.
Please help
run a full make:
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN
then run make again with modules_install as your last argument after INSTALL_MOD_PATH:
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN INSTALL_MOD_PATH=~/Desktop/modules/ modules_install
your CROSS_COMPILE definition should have arm-eabi- (for example) at the end.
make sure:
CONFIG_WIRELESS=y
CONFIG_BCM4329=m
Thanks pershoot! Worked like a charm with that!

[HOWTO] Build custom kernel, libraries and applications on your own

For building own custom stuff for my Gen8 Device I set up an Ubuntu 10.10 32bit Virtual Machine, so everything in here refers to it, may be different on other linux system.
[disclaimer]This is only a HowTo, if you brick your android device with some custom kernels or other stuff, don't blame me! I'm not responsible for anything you do![/disclaimer]
Notice: ** = you only have to do this step once
Prerequisites for Ubuntu 10.10 32 Bit: **
Code:
# sudo apt-get install git-core flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl automake autoconf libtool gettext texinfo libmpfr1ldbl
Prepare environment: **
Code:
# mkdir -pv $HOME/{archos,bin}
# echo export ARCHOS=\$HOME/archos >> ~/.bashrc
# echo export PATH=\$HOME/bin:\$PATH >> ~/.bashrc
# cd $HOME/archos
# wget -Oavos_env.tgz http://archos-gen8-dvb.googlecode.com/files/avos_env_20110415.tgz
# tar xzf avos_env.tgz
# install -m755 cross $HOME/bin/
# rm -f cross avos_env.tgz
RESTART CONSOLE OR REBOOT COMPUTER!
Toolchain: **
Code:
# cd $ARCHOS
# make all
Configure kernel:
Code:
# cd $ARCHOS
# make kernel-config
Restore kernel config:
Code:
# cd $ARCHOS
# make kernel-reset
Build kernel:
Code:
# cd $ARCHOS
# make kernel-build
CrossCompile: (this is just an example for if you want to build some linux libraries or tools)
Code:
# echo $ARCHOS
# cd ..xyz../..zyx../
# cross make
I followed your instructions, and I got all the way to the end, but when I did 'make kernel-build' it ended with this:
drivers/built-in.o: In function `archos_dpm_suspend':
/home/zyntax/archos/gen8-gpl-froyo/linux/drivers/usb/storage/archos_hdd.c:261: undefined reference to `usbsata_power'
make[3]: *** [.tmp_vmlinux1] Error 1
make[2]: *** [sub-make] Error 2
make[2]: Leaving directory `/home/zyntax/archos/gen8-gpl-froyo/linux'
make[1]: *** [/home/zyntax/archos/gen8-gpl-froyo/buildroot//linux/arch/arm/boot/zImage] Error 2
make[1]: Leaving directory `/home/zyntax/archos/gen8-gpl-froyo/buildroot'
make: *** [kernel-build] Error 2
[email protected]:~/archos$
This is on a fresh install of Ubuntu 10.10 32-bit in Virtualbox. I installed it, updated the OS, then started your steps. Not sure if this is normal and I'm holding off on the last step. I did do one extra step: in 'make kernal-config' I deselected all the Archos boards under System Type except for the A101IT since that's what I have.
jbradshw said:
This is on a fresh install of Ubuntu 10.10 32-bit in Virtualbox. I installed it, updated the OS, then started your steps. Not sure if this is normal and I'm holding off on the last step. I did do one extra step: in 'make kernal-config' I deselected all the Archos boards under System Type except for the A101IT since that's what I have.
Click to expand...
Click to collapse
can you please try again without modifying kernel config?
Did that, now I get this:
CC [M] drivers/usb/musb/omap2430.o
/home/zyntax/archos/gen8-gpl-froyo/linux/drivers/usb/musb/omap2430.c:221: warning: 'omap_phy_read' defined but not used
LD [M] drivers/usb/musb/musb_hdrc.o
LD drivers/built-in.o
make[2]: *** [sub-make] Error 2
make[2]: Leaving directory `/home/zyntax/archos/gen8-gpl-froyo/linux'
make[1]: *** [/home/zyntax/archos/gen8-gpl-froyo/buildroot//linux/arch/arm/boot/zImage] Error 2
make[1]: Leaving directory `/home/zyntax/archos/gen8-gpl-froyo/buildroot'
make: *** [kernel-build] Error 2
I don't believe I changed anything besides what I mentioned earlier. Is there anyway to get back a default kernel-config?
hehe, I thought you should try with default kernel-config
I added a section for restoring kernel config in the start posting :
chulri said:
[*]Restore kernel config:
Code:
# cd $ARCHOS
# tar xzf gen8-gpl-froyo.tgz gen8-gpl-froyo/linux/linux.config
Click to expand...
Click to collapse
Well I did poke around in the config, but as far as I remember I only removed those extra archos systems. I'll restore the default and run it again later tonight.
Thanks.
jbradshw said:
Well I did poke around in the config, but as far as I remember I only removed those extra archos systems. I'll restore the default and run it again later tonight.
Click to expand...
Click to collapse
You can't remove other devices (like A32, A101 etc) from Linux kernel config because Archos made bad dependencies for different parts of the kernel and even 70S requires some USB kernel code, it's only compiled when you choose A101 - so either you clean it up manually, or you are required to leave checked other archos devices :/
Thanks for this howto, this is gonna be useful for me, should be a sticky.
OK the make kernel-build worked without errors. Now I'm just questioning the command 'cd ..xyz../..zyx../' I don't have any files or directories called that, and running that reports the same. Can I just skip that and do the make cross?
@jbradshw that's just a sample if someone wants to crosscompile something (e.g. some linux library or application like linuxtv-dvb-apps or w_scan)
you don't have to do everything mentioned in the howto. it's a HowTo not a HaveTo
Ahh OK. So I guess I'm done then. I haven't installed the SDE on my Archos yet, but what's the final 'thing' that came out of this procedure that I'll be placing on the tablet?
Also I don't have an microSD card yet, and I know there was talk of putting stuff on there - can this be done using just the internal memory (8 GB for me)?
you have to install the SDE to install a custom kernel. follow this guide: http://forum.xda-developers.com/showthread.php?p=10157349#post10157349
Yeah I saw that guide, my question is where is the zImage and initramfs.cpio.gz that I assume was part of the compiling I just did? And also if a microSD card is needed for any of this?
no microsd is needed
initramfs.cpio.gz can be extracted from current installation ( /dev/mmcblk0p1 -> init ), read this: http://forum.xda-developers.com/showthread.php?t=880321&page=5
zImage is compiled at this location: $ARCHOS/gen8-gpl-froyo/buildroot/linux/arch/arm/boot/zImage
Shouldn't it be
Code:
cross make kernel-build
?
Here I have to use cross, which makes sense to find gcc arm binaries.
No you don't. In case of building stuff which comes with the gen8-gpl-froyo.tgz (e.g. kernel) the env vars are set up by the supplied makefiles
chulri said:
No you don't. In case of building stuff which comes with the gen8-gpl-froyo.tgz (e.g. kernel) the env vars are set up by the supplied makefiles
Click to expand...
Click to collapse
If I don't use cross, here is what I get:
[email protected]:~/archos$ make kernel-build
make -C gen8-gpl-froyo/linux mrproper
make[1]: arm-linux-gcc: Command not found
make[1]: Entering directory `/home/ubuntu/archos/gen8-gpl-froyo/linux'
make[3]: arm-linux-gcc: Command not found
But using cross it compiled fine, though I followed carefully your directions !
Apparently I was too frightened by the error messages, since it does work in the end
Thank you very much, hope some good things come from this !
Cheers !
desiresush said:
Apparently I was too frightened by the error messages, since it does work in the end
Click to expand...
Click to collapse
Yeah it's just an annoying bug, it doesn't hurt because "mrproper" only cleans the build directory and doesn't need compiler at all
2.6.29 kernel for Froyo?
Does anybody know, why Archos releases the SDK with a 2.6.29 kernel?
Shouldn't 2.2 Froyo be a 2.6.32 kernel?

[HOWTO] Compile modules for stock kernels

I couldn't figure out how to compile a module for stock kernel - I kept getting the following in dmesg:
Code:
<module>: disagrees about version of symbol module_layout
I sent a message to Samsung Open Source Release Center on Friday and received a very helpful response yesterday. Basically, c1_rev02_defconfig contains some debug options that are not set in the actual kernel. These are the options that should not be set in the config:
Code:
CONFIG_DEBUG_PREEMPT
CONFIG_DEBUG_RT_MUTEXES
CONFIG_DEBUG_SPINLOCK
CONFIG_DEBUG_MUTEXES
CONFIG_PROFILING
CONFIG_PERF_EVENTS
CONFIG_PERF_COUNTERS
CONFIG_LATENCYTOP
CONFIG_FTRACE
You can use the attached script to modify all these values (the script was also supplied by Samsung, although it was syntactically incorrect and a couple of modifications were necessary to make it work). I have included a copy of the c1_rev02_defconfig with these modifications.
Using this config, I was finally able to compile modules that can actually be loaded on the device
Kudos to Samsung for sending me this information.
Nice info I guess that will help out the people who had issues with kernel modules on stock ROMs...
jps1974 said:
Kudos to Samsung for sending me this information.
Click to expand...
Click to collapse
No, that is the stuff they should put on their server. Makes you wonder what else they haven't released. Every time they make modifications to the GPL open source code (eg. kernel) and release a new version, they must release the code, and the exact same files they used to build it.
Thanks
That was the info I missed. I have successfully compiled cifs for kf1.
Sent from my GT-I9100 using XDA App
You know guys if there is a basic tutorial available online?.
Thank you!
Hi, I am new to compile modules for android (new to compile kernel anyway)
thanks for your info and config, I am now able to compile modules.
I had a problem on the compiled modules tho, wonder can anyone please point me some direction?
when I insmod the ko, dmesg gives me:
xyz.ko : no symbol version for module_layout
Any hint?
more info, I am compiling like:
I am aiming on compiling to for stock ROM, uname -r > 2.6.35.7-I9100XWKDD-CL161513
- I read, and follow base on http://forum.xda-developers.com/showthread.php?t=1113191
- kernel source from: SHW-M250L kernel source from OSRC, https://opensource.samsung.com/
- .config file of this post, select my wanted modules using make menuconfig
- then make ARCH=arm CROSS_COMPILE=__MYPATH__/bin/arm-none-eabi- modules
Thanks!
Hi,
I'm using insecure kernel :
Code:
#uname -r
2.6.35.7-I9100XWKE2-CL187606
I cross compiled modules using your config file but each time I'm trying to insmod it, I have: failed (Exec format error)
and busybox insmod gives me a invalid module format error
I use the commands :
Code:
make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- menuconfig
make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- modules
So I don't really know where I'm wrong here
alx5962 said:
Hi,
I'm using insecure kernel :
Code:
#uname -r
2.6.35.7-I9100XWKE2-CL187606
I cross compiled modules using your config file but each time I'm trying to insmod it, I have: failed (Exec format error)
and busybox insmod gives me a invalid module format error
I use the commands :
Code:
make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- menuconfig
make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- modules
So I don't really know where I'm wrong here
Click to expand...
Click to collapse
can you do a dmesg here?
I "think" I am on a same boat as you are on the error tho.....
I didn't checked dmesg, shame on me !
so the error is :
joydev: no symbol version for module_layout
I used your config file, do I need to fix config each time I update with menuconfig ?
alx5962 said:
I didn't checked dmesg, shame on me !
so the error is :
joydev: no symbol version for module_layout
I used your config file, do I need to fix config each time I update with menuconfig ?
Click to expand...
Click to collapse
dmesg is good to read, we are both compiling the same module (joydev)
the config file is not from me, is from jps1974.
no I don't think you need to fix unless you uses the build_kernel.sh unmod, since it cp the defconfig everytime, still I face the same problem...
Instead of SHW-M250L kernel source from OSRC, I just did a quick change to GT-I9100_HK_Opensource.zip
A little bit different on the package, but still the same work flow and results...
.config file:
cp ~/sgs2/9100i_hk/arch/arm/configs/c1_rev02_defconfig ~/sgs2/9100i_hk/kernel/.config
./fix_config.sh
make ARCH=arm CROSS_COMPILE=[PATH_TO_G++LITE_BIN] modules
compile without problem, but no luck, insmod still report:
insmod: init_module '/lib/modules/joydev.ko' failed (Exec format error)
dmesg | grep joy report:
joydev: no symbol version for module_layout
Any help, any directions?
Thanks in advance!!!
I used the european I9100 source from the samsung site and the config file from the opening post when I successfully compiled my modules.
Sent from my GT-I9100 using XDA App
richyy74 said:
I used the european I9100 source from the samsung site and the config file from the opening post when I successfully compiled my modules.
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
YES SIR, will do try this src next!!!!!
richyy74 would u mind share with us which kernel are you at on your phone?
and which version of toolchain u are using on the compile?
Thanks.
A bit of update, just try with GT-I9100_Opensource.zip, nope, still no luck........
I start to think would that be problem of toolchain (which in the readme of the zip from Samsung, they are using 2009q3 while I am using the current 2011 build), or it is possible problem because my/our unsecure kernel (2.6.35.7-I9100XWKDD-CL161513)...
update: Roll back on 2009q3, nope, no luck.............
I can only thinks that it is due to the kernel I am using.............
I compiled for ke7 and kf1 cifs, slow-work and cpu governor modules.
I used the 2009 gnu/linux toolchain from codesourcery /it ends with 67 something/
I never succeded with the version mentioned in the readme.
Sent from my GT-I9100 using XDA App
richyy74 said:
I compiled for ke7 and kf1 cifs, slow-work and cpu governor modules.
I used the 2009 gnu/linux toolchain from codesourcery /it ends with 67 something/
I never succeded with the version mentioned in the readme.
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
Thanks for your direction, will do more test after my "should have slept" 5 hours session.... which end up in data center instead of bed...
utp said:
Thanks for your direction, will do more test after my "should have slept" 5 hours session.... which end up in data center instead of bed...
Click to expand...
Click to collapse
The "exec format error" means that you compiled it for the wrong architecture.
To see which arch the kernel module was compiled for, use the "file" command (found on any Linux computer but not present on the phone itself).
The file command is an extremely useful function for identifying files.
So, at a terminal, type:
Code:
file -k /user/home/output/example.ko
It should output information on the file, which will clarify whether it was statically built, which architecture, etc. Examples:
Dynamically linked executable:
Code:
"ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped"
Statically linked executable:
Code:
"ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped"
Object file:
Code:
"ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped"
Most importantly, if it doesn't say 32bit ARM, it will not work.
So the module I cross-compiled gives me :
joydev.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped.
So it was correctly compiled, I may need to try another toolchain.
Using Sourcery G++ Lite 2009q3-68 for ARM EABI toolchain, still have the issue.
So as I use an insecure kernel, I may need to ask the author what compiler he used for it.

OpenVpn on samsung Galaxy S WI-FI G70 (yp-G70CB)

Hi i have samsung YP-G70
i have been into kernel modules few days but without luck, i need help with compiling TUN.KO
Linux localhost 2.6.35.7-G70XWKP2-CL580645 #2 PREEMPT
Fri Sep 16 11:44:47 KST 20
11 armv7l GNU/Linux
at least i need 2.6.35.7 SDK for yp-g70
i tryied one from opensource.samsung but its for different kernel
I downloaded the kernel source tarball from opensource.samsung.com yesterday and it is the same version as you list above (YP-G70-WW_GB_Opensource.zip).
What version are you seeing?
Also what does "uname -r" give you on the device, as that extra stuff tacked on the end of the kernel version may cause you problems when you create a new kernel + modules (otoh it may not), in which case you'll need to afair modify the kernel Makefile to tack the extra characters on so the module and kernel versions match.
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 35
EXTRAVERSION = .7
NAME =Yokohama
this is original makefile
uname -r gives me
2.6.35.7-G70XWKP2-CL580645
then this is how it will looks like ?
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 35
EXTRAVERSION = .7-G70XWKP2-CL580645
NAME =Yokohama
sorry for stupid question but i'm destroyed from compiling again and again modules 2 day in a row
Yes exactly.
Presumably you''ve also run "make menuconfig" (after either adjusting the Makefile's ARCH and CROSSCOMPILER variables in the file, or by passing them on the command line along with the make command) to enable tun and make sure that anything it requires is also enabled?
Once you've done that I'd expect you're ready to go. If you get kernel oopses then we can work out what's wrong from there.
my step-by-step
i downloaded arm-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
downloaded YP-G70-WW_GB_Opensource.zip
exported paths and stuff
then vi Makefile
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 35
EXTRAVERSION = .7-G70XWKP2-CL580645
NAME = Yokohama
then make menuconfig
selected tun as module
then make modules
downloaded tun.ko, tun.o to tab
insmod tun.ko
and at this step tab show me an error
insmod: init_module 'tun.ko' failed (Exec format error)
insmod: init_module 'tun.o' failed (Exec format error)
insmod tun.ko
insmod: init_module 'tun.ko' failed (Exec format error)
# uname -r
uname -r
2.6.35.7-G70XWKP2-CL580645
Are you sure that's the right cross-compiler version, because I think you need an older version... (check the README in the kernel source tarball for the exact version.)
hmm then this is what i need
1. Visit codesourcery, download and install Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI.
but on their site, they have only new release
can you help me with this ?
ok i found exatly that version mentioned in README
but now make modules give me error
/bin/sh: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: No such file or directory
make[1]: *** [kernel/bounds.s] Error 1
hmm it looks like its because in .../bin/ there is only arm-none-eabi-gcc
ok i found line in Makefile and edited it to
CROSS_COMPILE ?= /opt/toolchains/arm-2009q3/bin/arm-none-eabi-
now ist completed
i now going to test it on tab
Fluffinko said:
ok i found line in Makefile and edited it to
CROSS_COMPILE ?= /opt/toolchains/arm-2009q3/bin/arm-none-eabi-
now ist completed
i now going to test it on tab
Click to expand...
Click to collapse
same error
insmod tun.ko
insmod: init_module 'tun.ko' failed (Exec format error)
i give up 0:08 , i tried diferent crosscompiler , many setting but without luck, i hope that some of you can help me.
after i succcessfully compile tun.ko i post it here for you guys
See what dmesg says about the module not loading.
Are you sure you need to compile the module? I've just looked at menuconfig for the device and it seems to have TUN/TAP enabled (built-in rather than a module)
I'm using the YP-G70-WW_GB_Kernel source and the venturi_eur_defconfig config as specified in the kernel source README.
lardman said:
See what dmesg says about the module not loading.
Are you sure you need to compile the module? I've just looked at menuconfig for the device and it seems to have TUN/TAP enabled (built-in rather than a module)
I'm using the YP-G70-WW_GB_Kernel source and the venturi_eur_defconfig config as specified in the kernel source README.
Click to expand...
Click to collapse
in dmesg there is no error
i see in /dev/ there is tun & dun device
but how to use it with open vpn ?
maybe related to another problem, i tryed on tab
INSMOD (module that is loaded) and it gave me same problem,
i think this can be related to busybox, i tried different versions but it will show me same error message, is there any other way to load module ?
OPENVPN
yes i have right, busybox is problem with modprobe and stuff i have found workaround
after 10h testing and reading manuals....
VPN.sh
------------------------------------------------------------
su -c "PATH=/system/xbin:$PATH" - #path for ifconfig
su -c "mkdir /dev/net" - #fixing tunctl problems
su -c "ln -s /dev/tun /dev/net/tun" - #linking tunctl for new location
su -c "tunctl" - # create tap0 device
su -c "ifconfig tap0 192.168.1.222" - # set manual IP for tap0 device
su -c "openvpn /sdcard/openvpn/config/FlamcoNet.ovpn" - # openvpn config
------------------------------------------------------------
there is problem with open vpn, it have problem assigning DHCP ip address to tap0
i don't know why

Problems finding/compiling kernel images for Gen9

Hello, does anyone have a working .config file to compile a kernel that will work on the Archos Gen9 or any links to information specific to what is needed for our devices?
I have tried compiling the kernel from the ICS source on ubuntu 11.10 but I am unable to get it to boot and had to work around many errors just to get it to create the zImage.
sirduke989 said:
Hello, does anyone have a working .config file to compile a kernel that will work on the Archos Gen9 or any links to information specific to what is needed for our devices?
I have tried compiling the kernel from the ICS source on ubuntu 11.10 but I am unable to get it to boot and had to work around many errors just to get it to create the zImage.
Click to expand...
Click to collapse
I know where you can found what you want, you gonna filp out, i'm sure of it
in the root folder of the linux-ics kernel is a file called linux.config, now get things compiled and GOOD LUCK
How set environment for build kernel ICS !
sirduke989 said:
Hello, does anyone have a working .config file to compile a kernel that will work on the Archos Gen9 or any links to information specific to what is needed for our devices?
I have tried compiling the kernel from the ICS source on ubuntu 11.10 but I am unable to get it to boot and had to work around many errors just to get it to create the zImage.
Click to expand...
Click to collapse
HI!
First you need to update your environment ( Ubuntu 11.10) with all the neccessary .lib
- sudo apt-get install gnupg flex bison gperf build-essential zip curl zliblg-dev libc6-dev libncurses5-dev x11proto-dev libx11-dev libreadline-dev libgl1-mesa-dev tofrodos python-markdown libxml2-utils xsltproc gettext make info libsdl-dev libxgtk2.6-dev automake
- download your toolchain => http://forum.xda-developers.com/showthread.php?t=1328027
- copy linux.config into /arch/arm/configs/archos_defconfig
For build zImage :
cd into kernel source directory ...
- export ARCH=arm
- export CROSS_COMPILE=/your directory/arm-archos/usr/bin/arm-linux-uclibcgnueabi-
- make ARCH=arm archos_defconfig
- make -j2
**************That's all *******
.....if you not get errors - you should find zImage into /arch/arm/boot/zImage
Thanks for the info, it appears that my problems may be coming from using an outdated toolchain. Basically I am trying to compile an updated kernel that I can run Ubuntu on but so far my kernel does not even boot to the boot menu that I created or the one in the Ubuntu thread that is using fbmenu.
surdu_petru said:
...
- download your toolchain => http://forum.xda-developers.com/showthread.php?t=1328027
- copy linux.config into /arch/arm/configs/archos_defconfig
For build zImage :
cd into kernel source directory ...
- export ARCH=arm
- export CROSS_COMPILE=/your directory/arm-archos/usr/bin/arm-linux-uclibcgnueabi-
- make ARCH=arm archos_defconfig
- make -j2
**************That's all *******
.....if you not get errors - you should find zImage into /arch/arm/boot/zImage
Click to expand...
Click to collapse
I do not know why it will be a huge size of the compiled kernel modules?
Any idea?
szanalmas said:
I do not know why it will be a huge size of the compiled kernel modules?
Any idea?
Click to expand...
Click to collapse
The kernel modules contain some extra symbol information by default.
You may use the strip command to get rid of those.
Search the kernel Makefile for the command, i'm not sure of the function call right now...
Anyway it doesn't matter in the end, because the modules have the same size when they got loaded to RAM.
BTW, if you use my toolchain, you better unpack it in /opt.
There are some hard coded path's in some of the libraries.
If the toolchain is placed somewhere else you might run into trouble.
See this as well... http://forum.xda-developers.com/showpost.php?p=19134490&postcount=8
If someone needs a 64Bit toolchain built please tell me.
Best regards,
scholbert
scholbert said:
The kernel modules contain some extra symbol information by default.
You may use the strip command to get rid of those.
Best regards,
scholbert
Click to expand...
Click to collapse
Yes, thanks, strip working. strip -g -S -d -x -X *.ko and Hawaii!
Hi!
Thanks to the short information on #3 I was able to compile a kernel image of my own. I was curious to see if we can use another toolchain
like the one from Linaro which uses an 4.7 gcc (it has no specific tweaks for archos device like the toolchain from scholbert, I think).
After some modifications of the kernel (thanks google search!!) it compiles and a zImage was generated...which doesn't booted at all (black screen) :-(
Then a hint came up on planet linaro : "Kernel not booting with Linaro GCC?". I tried it yesterday and it boots
--> Don't expect huge speed improvements (if there any). I get very similar results at the quadrant benchmark compared to the kernel provided by surdu_petru.
My patches to the kernel are located at the patch.txt file.
PS: I would like to try out the android-toolchain 4.7 (ICS), which is also provided by linaro.
It compiles, but at the final linker step a
"DIV usage mismatch between arch/arm/boot/compressed/misc.o and output"
is thrown. Maybe we have to wait once the patch is merged into binutils release - any help on this issue?
UPDATE: DIV usage mismatch solution
I found out, that the linker gold produces problems on my kernel build. So I changed the build process to use the bfd linker which compiles the kernel successfully.
Load the android build toolchain:
Code:
wget --no-check-certificate https://android-build.linaro.org/jenkins/view/Toolchain/job/linaro-android_toolchain-4.7-bzr/lastSuccessfulBuild/artifact/build/out/android-toolchain-eabi-4.7-daily-linux-x86.tar.bz2
Extract it:
Code:
tar xfj android-toolchain-eabi-4.7-daily-linux-x86.tar.bz2
Go into that directory and replace ld which points to ld.gold with that binary of ld.bfd:
Code:
cd android-toolchain-eabi
find . -name "*gold"
cp ./bin/arm-linux-androideabi-ld.bfd ./bin/arm-linux-androideabi-ld
cp ./bin/arm-eabi-ld.bfd ./bin/arm-eabi-ld
cp ./arm-eabi/bin/ld.bfd ./arm-eabi/bin/ld
cp ./arm-linux-androideabi/bin/ld.bfd ./arm-linux-androideabi/bin/ld
Then perform a build as normal.

Categories

Resources