[Q]insmod test.ko mTIMA: lkmauth--verification failed -1 - Galaxy S 4 Q&A, Help & Troubleshooting

Hello All,
I'm unable to insert a simple kernel module on my rooted S4 I9505.
below are the errors
Code:
insmod /data/local/tmp/testHello.ko
insmod: init_module '/data/local/tmp/testHello.ko' failed (Exec format error)
and kmsg's are
Code:
<4>[ 2127.554107] TIMA: lkmauth--launch the tzapp to check kernel module; module len is 71334
<4>[ 2127.554168] TIMA: lkmauth -- hdr before kreq is : e337b000
<4>[ 2127.554199] TIMA: lkmauth--send cmd (lkmauth) cmdlen(304:320), rsplen(264:320) id 0x00050000, req (0xE352A000), rsp(0xE352A140), module_start_addr(0xE337B000) module_len 71334
<3>[ 2127.581909] TIMA: lkmauth--verification failed -1
<4>[ 2127.582183] TIMA: MSG=lkm_modified; result (TIMA_RESULT=MSG=lkm_modified;)
<6>[ 2129.417541] [debug_wake_locks]active wake lock msm_otg
Any help or pointers would be of great help
Best Regards
Basha

did u manage to insmod your module? im having same issue on my i9505 stock kernel rooted. it seems to also come up prevention information in the status bar

DipSprayArc said:
did u manage to insmod your module? im having same issue on my i9505 stock kernel rooted. it seems to also come up prevention information in the status bar
Click to expand...
Click to collapse
This means that module format is not same as stock kernel even if you compile your module based on the stock kernel config.
Also for the "Detection information" dialog in status bar you need to tweak as explained in this and/or this thread based on your model
Hit thanks if this helps

Am trying to run a ATH9K_htc driver. I compiled as a module with the kernel but no good same extra version. Is there anyway to do this? Mayb modify kernel to take insmod --forced? Or this may already be set can't remember.
Thanks for solution to detection information. Had been looking
Cheers
---------- Post added at 01:29 AM ---------- Previous post was at 01:24 AM ----------
Also read that they may need some kind of digital signing? ELF?

DipSprayArc said:
Am trying to run a ATH9K_htc driver. I compiled as a module with the kernel but no good same extra version. Is there anyway to do this? Mayb modify kernel to take insmod --forced? Or this may already be set can't remember.
Thanks for solution to detection information. Had been looking
Cheers
---------- Post added at 01:29 AM ---------- Previous post was at 01:24 AM ----------
Also read that they may need some kind of digital signing? ELF?
Click to expand...
Click to collapse
either you add extra version in Makefile like
Code:
VERSION = 3
PATCHLEVEL = 4
SUBLEVEL = 0
EXTRAVERSION =-431985 // this string should match with target kernel version(extra)
Or
try to disable CONFIG_MODVERSIONS check in your kernel config.
HIT Thanks if its helps

Related

[Dev]kexec

Okay, let's get the ball rollin on kexec!
I've taken most of the module from the milestone kexec project. I only did some slight tweaks to get it to compile right.
Attached is a kexec module, the source to said module, a patched kexec-tools, and the bin kexec from said patched kexec-tools.
I built this against one of the OC'd transformer kernels. I cheated a bit and changed the .4 to a .3 in Kconfig for the kernel. Other than that, it should be stock. The bottom of the first post here, http://forum.xda-developers.com/showthread.php?t=1095269 , has the source.
I've only tried booting transformer kernels, as I don't really know much about building kernels. I've gotten 3 responses from them, immediate hang (failing on the OC in them?), power down, and reboot(prolly kernel panic on host kernel).
I'm not 100% sure where to go from here.
kexec-mod.zip has the module and the source I used to compile it.
kexec-tools.zip has kexec tools. I didn't clean it before zipping, so it should have the bins still.
Also, I'm using backtrack to compile and run these, so kexec-tools may fail outside of it.
Edit: Please view THIS POST for the latest kexec-mod.
Nice.... I'm with you in the hopes that someone will pick up the ball and start runnin with this....
great step forward....tnx
yess! finally we are one big step closer
I'd really like to try booting the Iconia's kernel, just to see if kexec works right.
Has anyone managed to get inside the boot.img?
heres perl script to unpack the boot.img
Code:
#!/usr/bin/perl -W
use strict;
use bytes;
use File::Path;
die "did not specify boot img file\n" unless $ARGV[0];
my $bootimgfile = $ARGV[0];
my $slurpvar = $/;
undef $/;
open (BOOTIMGFILE, "$bootimgfile") or die "could not open boot img file: $bootimgfile\n";
my $bootimg = <BOOTIMGFILE>;
close BOOTIMGFILE;
$/ = $slurpvar;
# chop off the header
$bootimg = substr($bootimg,2048);
# we'll check how many ramdisks are embedded in this image
my $numfiles = 0;
# we look for the hex 00 00 00 00 1F 8B because we expect some trailing padding zeroes from the kernel or previous ramdisk, followed by 1F 8B (the gzip magic number)
while ($bootimg =~ m/\x00\x00\x00\x00\x1F\x8B/g) {
$numfiles++;
}
if ($numfiles == 0) {
die "Could not find any embedded ramdisk images. Are you sure this is a full boot image?\n";
} elsif ($numfiles > 1) {
die "Found a secondary file after the ramdisk image. According to the spec (mkbootimg.h) this file can exist, but this script is not designed to deal with this scenario.\n";
}
$bootimg =~ /(.*\x00\x00\x00\x00)(\x1F\x8B.*)/s;
my $kernel = $1;
my $ramdisk = $2;
open (KERNELFILE, ">$ARGV[0]-kernel.gz");
print KERNELFILE $kernel or die;
close KERNELFILE;
open (RAMDISKFILE, ">$ARGV[0]-ramdisk.cpio.gz");
print RAMDISKFILE $ramdisk or die;
close RAMDISKFILE;
print "\nkernel written to $ARGV[0]-kernel.gz\nramdisk written to $ARGV[0]-ramdisk.cpio.gz\n";
if (-e "$ARGV[0]-ramdisk") {
rmtree "$ARGV[0]-ramdisk";
print "\nremoved old directory $ARGV[0]-ramdisk\n";
}
mkdir "$ARGV[0]-ramdisk" or die;
chdir "$ARGV[0]-ramdisk" or die;
system ("gunzip -c ../$ARGV[0]-ramdisk.cpio.gz | cpio -i");
print "\nextracted ramdisk contents to directory $ARGV[0]-ramdisk/\n";
/proc/last_kmsg said:
[ $336.932146] -------%----[ cut here ]------------
[ 36.932255]$WARNINGz at /home/amy_chiU/quuofuild/a500omdrr/androiD/{ernel/driv ers/base/core.c:10 deviae_releaqe+0x70/0x84()
[ 336.932419] Device %(null) does not have a releaseh) functikn, iu is broken a nd must be fiXed.
[ s36.932580] Modules linkEd in: iexec_,oaD bcm4329
[ $3s6.932927] [<c0356ec>] (unwind_backtrace+0x0/1xf0) from [<c0067fac>] (warN_s lowpath_commmn+1p4c/0x¶4)
[ 336.933094] [<c0067fac>] (warn_slowpath]com}on+0x4c/0x64) from [4c0068044>] ( warn_slovpauh_fmt+0x2c/0x1c9
[! 336.¹33262U [|c0068044>] (warn_slowp!th_fmt+0x2c/0x3c) from [<c0!f08âc>] (dev ice_rElease+0x70/0X84)
[ $33v.937434]$[,c01æ08bc>] (device_remease+0x70¯0x84) from [=c01a65dc>] (kobjeC t_reluase+px5c?x70)
[ 33.9s76°u] [<c01a65dc~] (kobject_release+0x5c/0x70) from [<k01a74d4.] (kref_p ut+0x44/0X74)
[ 336.933711] [<C01a54d4>] (kref_pud+0|64/0h74) from [<bf044490>] (device_shuTd own+0x28/0x8c`[kexec_loadU)
[ 336.933887] Y<cf044490>U (device_shuTdown+0x28/0x8c [kexec_loadU- from [<bf04 4458>]!(kernel_resta2t_prepare+1x44/0x54(Skexec_load])
[( 336.934085] [<bf04$48>] (kernel_restert_prepare+0x/0x54 [kexea_load]9 from [< bF043098>] (kernel_kexec+0x38/0x68 [kexec_load])
[ 336.934262] [<"f043098>] (kernel_kexec+0x38/0x68 [kexec_load]) from [<bf0443b 8>] (reboot+0x74/0xd0 [kexec_load])
[ 336.934438] [<bf0443b8>] (reboot+0x75/0xe0([kexec_load]) from [<c0032060>] (r et_fast_syscAll+0x0/0x30)
[ efd tsace 237c2b25b258a813 ]---
[ 336.938148] StaRting new Kurjel
[ 336.938356] Bye!
147 Corrected bytes, 167 unrecoverable blocks
Click to expand...
Click to collapse
Damn kurjels.
But, it seems to be trying to boot it. I've updated my kexec to actually use the files it should use(as in, a kernel source that was made in the last 3 years).
How do you repackage the kernel and the initfs in order to kexec it?
huxflux2003 said:
How do you repackage the kernel and the initfs in order to kexec it?
Click to expand...
Click to collapse
Good question. That's what I was hoping I could get some help with. The kernel is still closed-source(illegally, I might add), so it's going to be difficult to get a new one built, and I can almost guarantee that it's outside of my knowledge.
If anyone can come up with anything for me to try booting, I'm all ears.
heres repack script...
DONT TRY TO FLASH IT BACK INTO THE BOOT PARTITION IT WILL BRICK
Code:
#!/usr/bin/perl -W
use strict;
use Cwd;
my $dir = getcwd;
my $usage = "repack-bootimg.pl <kernel> <ramdisk-directory> <outfile>\n";
die $usage unless $ARGV[0] && $ARGV[1] && $ARGV[2];
chdir $ARGV[1] or die "$ARGV[1] $!";
system ("find . | cpio -o -H newc | gzip > $dir/ramdisk-repack.cpio.gz");
chdir $dir or die "$ARGV[1] $!";;
system ("mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel $ARGV[0] --ramdisk ramdisk-repack.cpio.gz -o $ARGV[2]");
unlink("ramdisk-repack.cpio.gz") or die $!;
print "\nrepacked boot image written at $ARGV[1]-repack.img\n";
thanks thor, but i think that since the bootloader is locked what we need is a zimage with init that can be used with kexec, correct?
huxflux2003 said:
thanks thor, but i think that since the bootloader is locked what we need is a zimage with init that can be used with kexec, correct?
Click to expand...
Click to collapse
yes zimage with init script
thor2002ro said:
yes zimage with init script
Click to expand...
Click to collapse
is this possible?
(noobalarm)
yea, but we need some people who know about this stuff to help.
Ok, here is my kexec sources based on 2.6.36
http://www.mediafire.com/?zdzpaui7dd8d6e9
still didn't manage to boot a kexec'ed kernel. Well, a couple times i got it to reboot to a regular kernel from mmc (did watchdog kill us?) but mostly it just freezes.
take a look here - http://wiki.meego.com/ARM/N900/Install/kexec
you need at least http://wiki.meego.com/images/0003-ARM-5886-1-arm-Fix-cpu_proc_fin-for-proc-v7.S-and-ma.patch to make it work.
Also, note the discussion here - ttp://comments.gmane.org/gmane.linux.ports.arm.kernel/75711
looks like we need a different cache invalidation for SMP (multi-processor cpu).
Anyways, I'm gonna make away with iconia and get myself an ac100 or asus xformer.. Partly due to Acer's hostility, partly because life without keyboard sucks.. My plan now is to write a custom implementation of sth like kexec for tegra (like splboot for xperia) from scratch because debugging kexec is quite annoying without a hardware debugger.. Basically it should be as easy as disabling mmu and dcache, but.. Well, need to lurk through the A9 assembly manual.

[Android] TouchPad Android kernel mini howto

It seems there is little information on the internet regarding how to compile the kernel and how to convert to the correct image format so the boot loader will recognise and how to transfer it over to the touchpad. I ended up spent a few hours and finally figured out. I hope this will be useful for someone. I will try to make it concise as this is mainly aimed for developers.
What you will need
A linux development machine with uboot mkimage tool installed.
Sourcery G++ Lite 2010q1-188 for ARM EABI cross compile tool chain
https://sourcery.mentor.com/sgpp/lite/arm/portal/release1294
Touchpad kernel source
https://github.com/CyanogenMod/hp-kernel-tenderloin
CM7 Alpha 3 image (zip file)
http://goo-inside.me/roms/cmtouchpad/alpha3/update-cm-7.1.0-tenderloin-a3-fullofbugs-signed.zip
Prepare
Download CM7 Alpha 3 image and extract the boot.img to a temporary place.
Download Sourcery G++ Lite and install it. Add the G++ Lite tool chain binaray path to the PATH env variable. Get the kernel source from git hub and extract to local disk and change directory to the kernel source.
Compile the kernel
Still in the kernel source directory run
Code:
make ARCH=arm CROSS_COMPILE=arm-none-eabi- tenderloin_android_defconfig
make ARCH=arm CROSS_COMPILE=arm-none-eabi- uImage
Prepare the initramfs U-boot image
Extract the initramfs from the boot.img saved in temporary folder and convert it to uboot-image format
Code:
dd if=boot.img bs=1 skip=3577748 of=img.gz
mkimage -A arm -O linux -T ramdisk -C none -a 0x60000000 -e 0x60000000 -n "Image" -d ./img.gz arch/arm/boot/uRamdisk
(The dd offset for alpha 2.1 image is 3561152)
Combine the kernel and initramfs into a single U-boot image
Create a combined U-boot image (kernel and initramfs)
Code:
mkimage -A arm -O linux -T multi -a 0x40208000 -e 0x40208000 -C none -n "multi image" -d arch/arm/boot/uImage:arch/arm/boot/uRamdisk uImage.CyanogenMod.new
Transfer it to the device
Boot your touchpad into recovery mode and run
Code:
adb shell mount /dev/block/mmcblk0p13 /boot
adb push uImage.CyanogenMod.new /boot/uImage.CyanogenMod.new
adb shell umount /boot
adb shell reboot
After it reboot you should be able to see a new CyanogenMod.new item from the boot menu.
That's it!
Optimisation
For those who wants to experiment with GCC build options you can update the entry "arch-$(CONFIG_CPU_32v7" in file arch/arm/Makefile and I set mine to
Code:
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -O2 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
Warning
Please be aware you are working on the bleeding edge kernel for touchpad and there is no guarantee that the latest git version will work for you. Please try an earlier version if that's the case.
As of 2011-11-23 you will need the latest kernel source to build kernel for alpha 3. Please do not mix the kernel with an initramfs from a different version, i.e. don't use initramfs extracted from alpha 2.1 and use it with alpha3.
Thanks for this. Last weekend spent a while trying to figure this out.
Sent from my HP Touchpad using Tapatalk
x2. Huge thanks
Thank you soooooo much for this guide. Quick question if you don't mind though.. I am using an mkimage that goes back to my nook kernel days. Is there anything newer out, or would this still be ok,?
Divine_Madcat said:
Thank you soooooo much for this guide. Quick question if you don't mind though.. I am using an mkimage that goes back to my nook kernel days. Is there anything newer out, or would this still be ok,?
Click to expand...
Click to collapse
As long as the mkimage can generate a standard U-boot image it should be fine.
You can always try it yourself. In worst case you have to hard reboot the touchpad by pressing the power button and home button at the same time for more than 10 minutes. As long as you keep the original image files (UImage.*) untouched I don't think you can brick it even if you want to.
S7
I have been trying to compile the kernel for some time now, and was hopeful reading your guide (and this last post) However, still following the steps to merge the ramdisk, i cannot make a booting kernel. I can get it flashed, as i am using the update.zip method, but moboot always gives me a crc error when booting it.
Though, before i totally go nuts, i think i need to try the source forgery toolchain, as i am using the Android ndk r6b...
Divine_Madcat said:
S7
I have been trying to compile the kernel for some time now, and was hopeful reading your guide (and this last post) However, still following the steps to merge the ramdisk, i cannot make a booting kernel. I can get it flashed, as i am using the update.zip method, but moboot always gives me a crc error when booting it.
Though, before i totally go nuts, i think i need to try the source forgery toolchain, as i am using the Android ndk r6b...
Click to expand...
Click to collapse
Could you check the md5sum of the u-boot image crated on disk and the one installed by update.zip file? Do they match? If they do then you probably will need to upgrade your mkimage tool.
s7mx1 said:
Could you check the md5sum of the u-boot image crated on disk and the one installed by update.zip file? Do they match? If they do then you probably will need to upgrade your mkimage tool.
Click to expand...
Click to collapse
I will give it a check; just in case, know where to get a newer mkimage?
Thanks so much for this guide
s7mx1 said:
You can always try it yourself. In worst case you have to hard reboot the touchpad by pressing the power button and home button at the same time for more than 10 minutes.
Click to expand...
Click to collapse
It feels like 10 mins.. doesn't it
WEll, i checked the MD5 sums, and it looks good. So, i guess it is time to try again with the toolchain listed here, and perhaps a new mkimage (if there is a "modern" one i should using, please point me to it...)
edit: Never mind.. in all my looking, i never saw that ubuntu had a nice one waiting for me.... doh
edit2: Woo! After getting the probably correct mkimage, and the CS toolchain, looks like i finally got it to pass the crc check. Now, lets see if it finishes booting. Thanks again for the guide!
Nope.. no boot. I get a dmesg with this:
<3>[ 69.978716] init: untracked pid 224 exited
<6>[ 70.086076] android_usb gadget: high speed config #1: android
<6>[ 70.086209] gadget_event: schedule host_connected
<6>[ 70.096953] max8903b_current_setup: CURRENT_500MA
<6>[ 70.097040] gadget_event: source=bus mA=500 (no change)
<4>[ 70.910953] UDC-CHG (2-2-2): usb_multi_chg_detect (591) : USB host Adaptor
(500mA)!
<6>[ 70.912805] gadget_event: schedule host_disconnected
<6>[ 70.925482] max8903b_current_setup: CURRENT_ZERO
<6>[ 71.164066] android_usb gadget: high speed config #1: android
<6>[ 71.164220] gadget_event: schedule host_connected
<6>[ 71.173640] max8903b_current_setup: CURRENT_500MA
<6>[ 71.178212] gadget_event: source=bus mA=500 (no change)
<6>[ 72.160955] gadget_event: host_connected=1 (no change)
<6>[ 74.142224] request_suspend_state: wakeup (0->0) at 74121495501 (2011-11-1
1 22:49:33.378031648 UTC)
<3>[ 74.143675] init: untracked pid 266 exited
<3>[ 74.155217] init: untracked pid 273 exited
<6>[ 79.285016] request_suspend_state: wakeup (0->0) at 79264287462 (2011-11-1
1 22:49:38.520824942 UTC)
The last three lines repeat alot, with different pid's .
Alrighty.. figured this one out - You cannot use the latest repository commits with the 2.1 alpha build. However, i was able to build commit fd70bb7aae, and it builds and actually boots. Now, i can actually play around and tweak it. Thank you again for the guide, and sorry for the edit spamming.. heh.
myn said:
x2. Huge thanks
Click to expand...
Click to collapse
Myn, do you have a touchpad???!!!? God I hope so!
vinscuzzy said:
Myn, do you have a touchpad???!!!? God I hope so!
Click to expand...
Click to collapse
He does
Sent from my PG86100 using Tapatalk
Divine_Madcat said:
WEll, i checked the MD5 sums, and it looks good. So, i guess it is time to try again with the toolchain listed here, and perhaps a new mkimage (if there is a "modern" one i should using, please point me to it...)
edit: Never mind.. in all my looking, i never saw that ubuntu had a nice one waiting for me.... doh
edit2: Woo! After getting the probably correct mkimage, and the CS toolchain, looks like i finally got it to pass the crc check. Now, lets see if it finishes booting. Thanks again for the guide!
Nope.. no boot. I get a dmesg with this:
<3>[ 69.978716] init: untracked pid 224 exited
<6>[ 70.086076] android_usb gadget: high speed config #1: android
<6>[ 70.086209] gadget_event: schedule host_connected
<6>[ 70.096953] max8903b_current_setup: CURRENT_500MA
<6>[ 70.097040] gadget_event: source=bus mA=500 (no change)
<4>[ 70.910953] UDC-CHG (2-2-2): usb_multi_chg_detect (591) : USB host Adaptor
(500mA)!
<6>[ 70.912805] gadget_event: schedule host_disconnected
<6>[ 70.925482] max8903b_current_setup: CURRENT_ZERO
<6>[ 71.164066] android_usb gadget: high speed config #1: android
<6>[ 71.164220] gadget_event: schedule host_connected
<6>[ 71.173640] max8903b_current_setup: CURRENT_500MA
<6>[ 71.178212] gadget_event: source=bus mA=500 (no change)
<6>[ 72.160955] gadget_event: host_connected=1 (no change)
<6>[ 74.142224] request_suspend_state: wakeup (0->0) at 74121495501 (2011-11-1
1 22:49:33.378031648 UTC)
<3>[ 74.143675] init: untracked pid 266 exited
<3>[ 74.155217] init: untracked pid 273 exited
<6>[ 79.285016] request_suspend_state: wakeup (0->0) at 79264287462 (2011-11-1
1 22:49:38.520824942 UTC)
The last three lines repeat alot, with different pid's .
Alrighty.. figured this one out - You cannot use the latest repository commits with the 2.1 alpha build. However, i was able to build commit fd70bb7aae, and it builds and actually boots. Now, i can actually play around and tweak it. Thank you again for the guide, and sorry for the edit spamming.. heh.
Click to expand...
Click to collapse
That's because dalingrin has updated the default configuration to use the HIGHMEM which seems to kill all the apps. The latest git actually works if you disable all the HIGHMEM related stuff.
decalex said:
Thanks so much for this guide
It feels like 10 mins.. doesn't it
Click to expand...
Click to collapse
Absolutely
I just hope there is a rest button as the touchscreen occasionally will not respond at all after wake up and I have to reboot to webos and then reboot back to get the touchscreen back.
Great guide and I got the kernel all built, but how do you change the kernel arguments for booting? e.g. where does moboot get its whole root=/dev/ram0 ro fb...stuff, and how does the CyanogenMod kernel know where to look for the rootfs partition?
crimsonredmk said:
Great guide and I got the kernel all built, but how do you change the kernel arguments for booting? e.g. where does moboot get its whole root=/dev/ram0 ro fb...stuff, and how does the CyanogenMod kernel know where to look for the rootfs partition?
Click to expand...
Click to collapse
The root parameter (root=/dev/ram0) that passed to kernel is not useful to you. The root / is mere extracted initramfs in memory. I assume you are looking for system, data partitions etc. With TP we have LVM partitions which you can do really fancy stuff with. The actual mount device and mount point is defined (hard coded) in file init.tenderloin.rc which you can find in the initramfs (i.e. the img.gz which is a gzipped cpio file). You can extract all the contents out from img.gz and modify init.tenderloin.rc to suit your need and then create an updated initramfs file to go with the kernel.
Since Android (at least CM7 on TP) does not use pivot_root any changes made to the initramfs will appear automatically when you boot up the device.
You can google if you are not sure how to work with initramfs file.

[Q] Compiling FTDI Kernel Module Fails

To start: Yes, I have searched the forums for similar items. There are no helpful responses. Hopefully this extra info helps.
Phone: HTC Evo 4G
OS: Cyanogenmod 7.1.0 Supersonic
Kernel Info: 2.6.37.6-cyanogenmod-01509-g8913be8
Background: I need to speak with serial devices via the USB port. The specific device I want to send data is an FTDI device. I am successfully communicating with the device via my Linux-based desktop. The challenge is porting my code to Android.
Here we go.
I started here: http://android.serverbox.ch/?p=285
To get the development environment and kernel for my phone I followed this:
http://wiki.cyanogenmod.com/index.php?title=Building_Kernel_from_source
When compiling my kernel I ran into a problem with the environment variables defined in the tutorial. I replaced CCOMPILE with CROSS_COMPILE and pointed it to my Code Sourcery install:
export CROSS_COMPILE=/home/LINUX_USER/Hardware/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-
I updated my kernel configuration (according to the FTDI tutorial) and tried to build the kernel and FTDI kernel module. My first attempt to "make" the kernel didn't work. I found this:
http://forum.xda-developers.com/archive/index.php/t-932190.html
Which provided me with a flag to get make to run:
# make EXTRA_AFLAGS=-mfpu=neon
The FTDI kernel module built successfully and I pushed the module to the SD card and tried to install module:
# /home/LINUX_USER/Hardware/android/android-sdk-linux/platform-tools/adb push drivers/usb/serial/ftdi_sio.ko /sdcard/
# insmod /sdcard/ftdi_sio.ko
insmod: init_module '/sdcard/ftdi_sio.ko' failed (Exec format error)
Since it didn't work I checked dmesg
# dmesg shows this:
[snip]
<3>[20821.873504] ftdi_sio: version magic '2.6.37.6-cyanogenmod-g996b70e preempt mod_unload ARMv7 ' should be '2.6.37.6-cyanogenmod-01509-g8913be8 preempt mod_unload ARMv7 '
I validated the kernel version on my phone and looked for a fix:
# uname -a
Linux localhost 2.6.37.6-cyanogenmod-01509-g8913be8 #1 PREEMPT Wed Jul 27 21:34:30 EDT 2011 armv7l GNU/Linux
The following tutorial provided me with instructions on how to address this issue:
http://glandium.org/blog/?p=2214
I changed the subversion number for the kernel by updating .scmversion to contain the following data:
-01509-g8913be8
After recompiling I tried to load the FTDI module again and got the following messages:
# insmod ftdi_sio.ko
insmod: init_module 'ftdi_sio.ko' failed (No such file or directory)
# dmesg | tail -15
<6>[58392.044647] batt: batt power_supply_changed: battery at 58389757684756 (2011-11-16 17:35:59.423392893 UTC)
<4>[58392.053100] at 58389762414981 (2011-11-16 17:35:59.413322092 UTC)
<4>[58413.600006] ftdi_sio: Unknown symbol usb_register_driver (err 0)
<4>[58413.602172] ftdi_sio: Unknown symbol usb_serial_handle_sysrq_char (err 0)
<4>[58413.604858] ftdi_sio: Unknown symbol usb_serial_disconnect (err 0)
<4>[58413.607910] ftdi_sio: Unknown symbol usb_serial_generic_open (err 0)
<4>[58413.610290] ftdi_sio: Unknown symbol usb_serial_generic_close (err 0)
<4>[58413.612609] ftdi_sio: Unknown symbol usb_control_msg (err 0)
<4>[58413.615142] ftdi_sio: Unknown symbol usb_deregister (err 0)
<4>[58413.617340] ftdi_sio: Unknown symbol usb_serial_generic_unthrottle (err 0)
<4>[58413.619262] ftdi_sio: Unknown symbol usb_serial_handle_break (err 0)
<4>[58413.622161] ftdi_sio: Unknown symbol usb_serial_generic_throttle (err 0)
<4>[58413.622955] ftdi_sio: Unknown symbol usb_serial_probe (err 0)
<4>[58413.624511] ftdi_sio: Unknown symbol usb_serial_register (err 0)
<4>[58413.630371] ftdi_sio: Unknown symbol usb_serial_deregister (err 0)
Since this failed I tried other compilers as well with the same results.
export CROSS_COMPILE=/home/LINUX_USER/Hardware/android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
export CROSS_COMPILE=/home/LINUX_USER/Hardware/android/cyanogenmod/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
I need help understanding what I should try next.
Thank you,
cutaway
If you still haven't gotten it running I posted a kernel on the cyanogenmod site with these modules in /system/lib/modules.
Load usbcore.ko, usbserial.ko, then ftdi_sio.ko
Unfortunately I don't have any devices to test, so let me know if it works.
sbradymobile said:
If you still haven't gotten it running I posted a kernel on the cyanogenmod site with these modules in /system/lib/modules.
Load usbcore.ko, usbserial.ko, then ftdi_sio.ko
Unfortunately I don't have any devices to test, so let me know if it works.
Click to expand...
Click to collapse
Link please. I have looked but I cannot locate it.
Thank you,
cutaway
http://db.tt/JQVbCGQS
sbradymobile said:
Load usbcore.ko, usbserial.ko, then ftdi_sio.ko
Unfortunately I don't have any devices to test, so let me know if it works.
Click to expand...
Click to collapse
Okay, I tried but it failed for the reason I thought it would. The .scmversion extensions don't match the kernel I have. I am not going to load the whole kernel as I don't want to trouble shoot the whole system or worry about other issues.
I appreciate your effort.
I need somebody to help me understand why I can successfully build a kernel module with my kernel's .config but it does not have the proper symbols to run the module. I would have thought it would fail to compile. /me sighs
You need host mode for this to work, so the main issue is you have to strip out msm_hsusb and gadget code that is built in to the kernel. This means you need a new kernel image for this to work as there is no module to unload.
The kernel I posted earlier will not work because msm_hsusb is still registered on boot, preventing the ehci-hcd module from loading.
You can try this one if you like http://db.tt/0s7xRlYW; I was able to get ehci-hcd to load, but the dmesg output shows an irq problem.
It is the most recent CM7 kernel.
sbradymobile said:
You need host mode for this to work, so the main issue is you have to strip out msm_hsusb and gadget code that is built in to the kernel. This means you need a new kernel image for this to work as there is no module to unload.
The kernel I posted earlier will not work because msm_hsusb is still registered on boot, preventing the ehci-hcd module from loading.
You can try this one if you like link was here; I was able to get ehci-hcd to load, but the dmesg output shows an irq problem.
It is the most recent CM7 kernel.
Click to expand...
Click to collapse
Was you succeded to bring FTDI up and running?

[Q] [L7] [DEV] V20a Kernel Build problems

So, i tried to compile V20a kernel and i get this errors:
Code:
CC drivers/power/lge_pm_sysfs.o
drivers/power/lge_pm_sysfs.c:25:38: fatal error: ../../kernel/power/power.h: No such file or directory
compilation terminated.
make[2]: *** [drivers/power/lge_pm_sysfs.o] Error 1
make[1]: *** [drivers/power] Error 2
make[1]: *** Waiting for unfinished jobs....
Code:
LD drivers/net/built-in.o
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....
CC net/netfilter/xt_length.o
Anyone tried to compile? How can i solve this error?
i managed to compile it but it doesn't boot . logcat not available.
Please, can you give me some ideea as i am not a developer. I will flash now my original boot img
hmmm is bad
Hint
Hello,
I also discovered that the way the kernel should be compiled according to the readme file is impossible. It does mention a defconfig file that is not available.
However, it is possible to get the config file of an existing kernel, because it is compiled in in the kernel:
Use the following steps, when your PC is connected to your phone with an working v20a kernel:
$adb pull /proc/config.gz
$gunzip config.gz
$mv config YOURKERNELROOT/arch/arm/configs/u2_my_defconfig
$cd YOURKERNELROOT
$make youroptions u2_my_defconfig
de-wolff said:
Hello,
I also discovered that the way the kernel should be compiled according to the readme file is impossible. It does mention a defconfig file that is not available.
However, it is possible to get the config file of an existing kernel, because it is compiled in in the kernel:
Use the following steps, when your PC is connected to your phone with an working v20a kernel:
$adb pull /proc/config.gz
$gunzip config.gz
$mv config YOURKERNELROOT/arch/arm/configs/u2_my_defconfig
$cd YOURKERNELROOT
$make youroptions u2_my_defconfig
Click to expand...
Click to collapse
I built it using my phones defconfig and removed this from makefile "drivers/power/lge_pm_sysfs.o". The build was successful but it doesn't boot. I will start working on it today.
Update: IT BOOTS!
I wasn't packing it correctly:
These are the lines to pack it:
./mkbootimg --kernel zImage --ramdisk boot.img-ramdisk.gz --cmdline androidboot.hardware=u0 --base 0x00200000 --pagesize 4096 -o boot.img
Click to expand...
Click to collapse
kernel version is:
Linux version 3.4.0-perf ([email protected]) (gcc version 4.6.2 20111004 (prerelease) (Linaro GCC 4.6-2011.10) ) #2 PREEMPT Wed Apr 17 23:22:22 EEST 2013
Click to expand...
Click to collapse
i will start patching tomorrow or later because i have to figure out how to OC and how to git
tudorsirb said:
So, i tried to compile V20a kernel and i get this errors:
Code:
CC drivers/power/lge_pm_sysfs.o
drivers/power/lge_pm_sysfs.c:25:38: fatal error: ../../kernel/power/power.h: No such file or directory
compilation terminated.
make[2]: *** [drivers/power/lge_pm_sysfs.o] Error 1
make[1]: *** [drivers/power] Error 2
make[1]: *** Waiting for unfinished jobs....
Code:
LD drivers/net/built-in.o
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....
CC net/netfilter/xt_length.o
Anyone tried to compile? How can i solve this error?
Click to expand...
Click to collapse
open lge_pm_sysfs.c and set power.h file to the correct path.
moon61 said:
open lge_pm_sysfs.c and set power.h file to the correct path.
Click to expand...
Click to collapse
i fixed that error, the kernel build and boots from stock sources. Now i'm trying to figure out what to do with the modules as wireless doesn't work, how to apply patches and how to overclock because i can't find freqs in acpuclock. Any sugestions?
How to modify kernel
Once you are able to make a working kerrnel, it is quite easy to modify it.
After you did make a working kernel, you can do from the commandline in the kernel root:
Make [crosscompile options] menuconfig.
Now you can change all kernel options, using a menu.
You have to install ncurses-dev, before you can do a make menuconfig
Once you are ready using the menuconfig, a new config file is created, with the name ,config ([dot]config). Beware that this is a hidden file in linux!. You can rename it and move it to your config dir.
Of course, most of the options are hardware related, and you do not want to change them, but the options you want to change, you can find all in the menu, together with a brief explanation of their usage,
(Excuses for my bad english, it is not my primary language)
de-wolff said:
Once you are able to make a working kerrnel, it is quite easy to modify it.
After you did make a working kernel, you can do from the commandline in the kernel root:
Make [crosscompile options] menuconfig.
Now you can change all kernel options, using a menu.
You have to install ncurses-dev, before you can do a make menuconfig
Once you are ready using the menuconfig, a new config file is created, with the name ,config ([dot]config). Beware that this is a hidden file in linux!. You can rename it and move it to your config dir.
Of course, most of the options are hardware related, and you do not want to change them, but the options you want to change, you can find all in the menu, together with a brief explanation of their usage,
(Excuses for my bad english, it is not my primary language)
Click to expand...
Click to collapse
Thanks, this will be useful after i apply some upstream changes. I know about menuconfig but i haven't got the tine to check it out. Right now i'm trying to overclock this kernel and i keep getting compile errors (took some code from l5). Will come back with info. If you can help me these days PM me with a gtalk ID.
tudorsirb said:
i fixed that error, the kernel build and boots from stock sources. Now i'm trying to figure out what to do with the modules as wireless doesn't work, how to apply patches and how to overclock because i can't find freqs in acpuclock. Any sugestions?
Click to expand...
Click to collapse
Yes I have a problem with wifi too, even I used new compiled modules. Did you fix it?
Sent from my LG-P705 using Tapatalk 2
moon61 said:
Yes I have a problem with wifi too, even I used new compiled modules. Did you fix it?
Sent from my LG-P705 using Tapatalk 2
Click to expand...
Click to collapse
I didn't fix it. I will look into it later (i'm at work ATM).
Logcat is:
Code:
need to unregister
04-22 11:28:19.010 E/WifiStateMachine( 449): Couldn't get getWiFiOffloadingIfaceIface :
04-22 11:28:19.010 E/WifiStateMachine( 449): useWiFiOffloading() : false
04-22 11:28:19.010 E/WifiStateMachine( 449): CONFIG_LGE_WLAN_PATH : true
04-22 11:28:19.010 D/WifiStateMachine( 449): setWifiState: enabling
04-22 11:28:19.010 I/WifiServiceExt( 449): WIFI_STATE_CHANGED_ACTION [2]
04-22 11:28:19.020 D/QuickSettingsReceiverStation( 514): Received: android.net.wifi.WIFI_STATE_CHANGED
04-22 11:28:19.030 E/WifiHW ( 449): nv_cmd_remote status 0
04-22 11:28:19.030 E/WifiHW ( 449): nv_cmd_remote status 0
04-22 11:28:19.030 E/WifiHW ( 449): Modem MAC address: a8 16 b2 93 c8 f6
04-22 11:28:19.030 E/WifiHW ( 449): Set wifi mac address a8 16 b2 93 c8 f6
04-22 11:28:19.030 E/WifiUtil( 449): U0 : CONFIG_LGE_WLAN_U0_JB_PATCH
04-22 11:28:19.030 I/ONCRPC ( 449): Setup RPC Call for task 4049f920
04-22 11:28:19.030 I/ONCRPC ( 449): oncrpc_xdr_call_msg_start: Prog: 3000000e, Ver: 00090001, Proc: 00000009
04-22 11:28:19.030 I/ONCRPC ( 449): xdr_std_msg_send_call: Sent Xid: a68, Prog: 3000000e, Ver: 00090001, Proc: 00000009
04-22 11:28:19.030 I/ONCRPC ( 449): xdr_std_msg_send_call: Received Reply Xid: a68, Prog: 3000000e, Ver: 00090001, Proc: 00000009
04-22 11:28:19.090 E/WifiStateMachine( 449): Failed to load driver!
04-22 11:28:19.090 E/WifiStateMachine( 449): Couldn't get getWiFiOffloadingIfaceIface :
04-22 11:28:19.090 E/WifiStateMachine( 449): useWiFiOffloading() : false
04-22 11:28:19.090 E/WifiStateMachine( 449): CONFIG_LGE_WLAN_PATH : true
04-22 11:28:19.090 D/WifiStateMachine( 449): setWifiState: unknown state
04-22 11:28:19.090 I/WifiServiceExt( 449): WIFI_STATE_CHANGED_ACTION [4]
04-22 11:28:19.090 E/WifiServiceExt( 449): WifiManager.WIFI_STATE_UNKNOWN
04-22 11:28:19.090 D/QuickSettingsReceiverStation( 514): Received: android.net.wifi.WIFI_STATE_CHANGED
Any news about how to fix wifi problem?
Sent from my LG-P705 using Tapatalk 2
any news??
Ok, i think i had find where the problem is. I change the cfg80211 value in the config file to "m". And know wifi work fine.
This is the kernel link
http://db.tt/lfJeyFeY
The kernel also o/c able too
Thanx to @tudorsirb :thumbup: and sorry for my bad english.
Sent from my LG-P705 using Tapatalk 2
moon61 said:
Ok, i think i had find where the problem is. I change the cfg80211 value in the config file to "m". And know wifi work fine.
This is the kernel link
http://db.tt/lfJeyFeY
The kernel also o/c able too
Thanx to @tudorsirb :thumbup: and sorry for my bad english.
Sent from my LG-P705 using Tapatalk 2
Click to expand...
Click to collapse
Did you use pll2 or pll4 for oc? If you use pll4 there's no difference in performance when using the phone becuase our phone does not OC that way.
Your OC code hould look like this:
Code:
{ 1, 1200000, [B]ACPU_PLL_2, 2, 0, [/B]150000, 3, 7, 200000 },
I learned it the hard way . Check out github for more references.

Problem in Loading kernel module

I have successfully compiled stock kernel from samsung sources for my galaxy S5 G900H on kali linux.
I am trying to compile some modules. For that I have starred these ::
Code:
[*] Enable loadable module support
[CENTER] [*] Forced module loading [/CENTER]
[CENTER] [*] Module unloading [/CENTER]
[CENTER] [*] Forced module unloading [/CENTER]
I have rooted my phone and set selinux permissive mode. But trying to load these modules gives Exec format errors .
Code:
/system/bin/insmod asix.ko
insmod: failed to load asix.ko: Exec format error
In dmesg, it is showing ::
Code:
[ 5378.629376] [c3] TIMA: lkmauth--launch the tl to check kernel module; module len is 279631
[ 5378.630154] [c3] TIMA: lkmauth--cannot open mobicore session from kernel. 15
[ 5378.630296] [c3] TIMA: lkmauth--unable to load kernel module; module len is 279631.
After hours of searching , I found the culprit, it was samsung TIMA. So I just deselected "Enable TIMA" under "System Type" in kernel config. Now the modules load successfully.

Categories

Resources