Building Kernel Modules for Droid2 - Droid 2 Android Development

I'm trying to figure out how to build kernel modules that will work with the Droid2. I want to get FUSE support working, and need to build the fuse module to make this happen.
I got this working on a Nexus One by using the msm source from git and the config file already on the phone. I just built with the module enabled, copied the module to /system/lib/modules, and ran insmod.
However, I'm interested in getting this to work on the Droid2. I downloaded the DroidX kernel source from Motorola's Open Source Site:
https://opensource.motorola.com/sf/go/projects.droidx/frs.droidx_source_froyo
Since there is no config file for the Droid 2, I configured with:
make sholes_defconfig
I was then able to enable fuse support in the config, and build.
While I was building, I hit a number of implicit declaration errors, and had to comment out/remove things from various source files. None of these should be related to fuse.
I got the module (fuse.ko) to build, but when I tried to insmod it, I got the dreaded exec format error, which indicates it wasn't built for the correct architecture. I would guess that Droid2 and DroidX kernel modules aren't cross-compatible.
Does anyone have working instructions for getting kernel modules to build successfully on the Droid2? I know that the Droid Overclock uses a kernel module (and the modules for Droid2 and DroidX are different), so someone must have been successful already.
Thanks for any help or suggestions.

JRummy is the creator of one of the OC apps, not sure if he actually made the kernel, but you can hit him up on Twitter @Jrummy

I managed to get this working. All that I needed to do was to run:
ARCH=arm CROSS_COMPILE=arm-eabi- make mapphone_defconfig
After this, I manually edited the .config file to enable FUSE support (although you can also do this with make menuconfig)
Then, I ran:
ARCH=arm CROSS_COMPILE=arm-eabi- make
This built the kernel and module with no errors. I was able to successfully push the module (fuse.ko) to /system/lib/modules/ and to run insmod.
I suppose that the modules for the Droid 2 and the Droid X are in fact binary compatible (correct me if this is wrong).

So how is it that we can overclock now? Dont you have to make a new kernel or do you somehow edit the stock one?
Sent from my Motorola Droid 2 with Fission 2.3.1 and ThirdEye Black theme.

orkillakilla said:
So how is it that we can overclock now? Dont you have to make a new kernel or do you somehow edit the stock one?
Sent from my Motorola Droid 2 with Fission 2.3.1 and ThirdEye Black theme.
Click to expand...
Click to collapse
A kernel module was added so that we could Overclock we still have the same stock kernel (as 2.3.20 (D2) that is)

Ah. So I take it with the efuse it would be hard/impossible to make an entirely new kernel then.
Sent from my Motorola Droid 2 with Fission 2.3.1 and ThirdEye Black theme.

eFuse prevents you from replacing the kernel with a new one. The only way to replace the kernel would be to crack eFuse.
In my case, I would rather install a module than an entirely new kernel, so this approach works fine for me.

I mean I'm prefectly fine with installing a module. I was just curious as to what efuse prevents us from doing. I'm sure sometime, somehow someone will crach efuse. You guys are brilliant with that kind of stuff.

orkillakilla said:
I'm sure sometime, somehow someone will crach efuse. You guys are brilliant with that kind of stuff.
Click to expand...
Click to collapse
Thanks for that cheering words. Completely new to Android I start with a locked down device... how wonderful is that...
If Motorola continues to efuse their devices it was my last. Hopefully somebody is a able to get a workaround =)

Phoible,
Did you happen to build an ext2.ko module when you compiled the kernel and built your fuse.ko module. I've been meaning to build one I just haven't gotten around to it.
Sent from my DROID2 using XDA App

Phoible said:
I managed to get this working. All that I needed to do was to run:
ARCH=arm CROSS_COMPILE=arm-eabi- make mapphone_defconfig
After this, I manually edited the .config file to enable FUSE support (although you can also do this with make menuconfig)
Then, I ran:
ARCH=arm CROSS_COMPILE=arm-eabi- make
This built the kernel and module with no errors. I was able to successfully push the module (fuse.ko) to /system/lib/modules/ and to run insmod.
I suppose that the modules for the Droid 2 and the Droid X are in fact binary compatible (correct me if this is wrong).
Click to expand...
Click to collapse
Interesting. I wonder if this would work for the tun.ko module as well. Or is the Droid 2 Global source the same as the Droid 2? I haven't gotten a clear answer on that...

Has anyone tried working on a loopback module for the droid 2 or dx yet or have any interest in getting this started?

Has anyone tried this on the global? Would like to get some kernel action on my Droid 2 Global...
Sent from my Rooted Droid 2 Global

dtmorgwsu said:
Phoible,
Did you happen to build an ext2.ko module when you compiled the kernel and built your fuse.ko module. I've been meaning to build one I just haven't gotten around to it.
Sent from my DROID2 using XDA App
Click to expand...
Click to collapse
Nope. But I'm sure that you can build it, and just about any kernel module you might want, in pretty much the same way...

Master Turkey said:
Has anyone tried this on the global? Would like to get some kernel action on my Droid 2 Global...
Sent from my Rooted Droid 2 Global
Click to expand...
Click to collapse
It should work on the Droid 2 Global and Droid Pro, although I haven't tried. But considering that the source was for the Droid X, and worked on the Droid 2, it should work on all 36x0 Droids.
Even though you can build a new kernel, you can't install it, because the bootloader is still locked. You are only going to be able to install the modules you build against the kernel...

Hmmm. Everytime I've tried to build the kernel and modules I get the exec error. Did you do anything different, other than what you stated?
Thanks
Sent from my DROID2 using XDA App

Is there a module I can download and try to apply? Or do I have to build myself? Im a little new to all this...
Sent from my Rooted Droid 2 Global

I just finished building a handful of kernel modules from the Moto DX kernel source, but don't know if they work or not...
(I have to get up for work in 4 hrs. )
If any one wants to test them, I posted them here and at:
http://www.droidforums.net/forum/droid-x-hacks/101967-droid-x-ubuntu-partition.html#post1184972
The zip includes the following files:
cryptoloop.ko ext2.ko ext4.ko fuse.ko loop.ko tun.ko
EDIT:
I just tried loading the loop.ko and I am getting the "Exec format error"...
Any ideas where I went wrong compiling these?
I installed them using the following method from a terminal emulator:
Code:
$ su
# cd /sdcard/xScope/Downloads (change to where you downloaded/extracted the files)
# mount -o rw,remount -t ext3 /dev/block/mcblk1p21 /system
# cp loop.ko /system/lib/modules/loop.ko
# chmod 644 /system/lib/modules/loop.ko
# insmod /system/lib/modules/loop.ko
# mount -o ro,remount -t ext3 /dev/block/mcblk1p21 /system
EDIT2:
I found a few possible solutions, but I'm at work... I'll check on it when I get home:
http://forum.xda-developers.com/showthread.php?t=444338
http://forum.xda-developers.com/showthread.php?t=738408&page=2
http://forum.xda-developers.com/showthread.php?p=7417520
..the last link has "working" tun.ko and .config
More info on installing the tun.ko on the DX is found in the comments here: http://code.google.com/p/get-a-robot-vpnc/wiki/LoadingTheTunModule
..see the comments by mikebutash:
I've almost got this working on a droidx, copy the tun.ko from the site eddie posted to the sd. Then do the commands:
Code:
mount -o rw,remount -t yaffs2 /dev/block/mddblock3 /system
cp /sdcard/tun.ko /system/lib/modules/
busybox mknod /dev/net/tun char 10 200
ln -s /dev/tun /dev/net/tun
insmod /system/lib/modules/tun.ko
If I launch via the gui, I see it connect to my pix successfully, but it reports failure still....
...found out the root instructions for droid doesn't fully setup busybox - get-a-robot-vpnc needs symlinks from busybox. Can be installed with the following:
Code:
cd /system/bin
busybox --install .
Note the period after the --install, absolutely required.
Click to expand...
Click to collapse

I know literally nothing about building kernels or what exactly you guys are trying to accomplish with these modules, but from reading over these posts it appears that you can alter the way the current kernel does its stuff, right?
Assuming you would use a kernel module to OC a D2, is there a (simple) way for me to add a module with 7 speed slots? I'm tired of dealing with OC'ing with only 4 slots when setCPU could be waaay more useful with a few more options.

Don't suppose any of you gents would be willing to give this a shot? this could mean good stuff for us if we can get it working:
http://aliasxerog.wordpress.com/2011/01/19/droid-x-kexec-kernel-module/

Related

Testers needed - latest busybox compiled for Android

PLEASE NOTE: THIS THREAD IS NOW OBSOLETE, BUSYBOX COMES WITH JUST ABOUT EVERY COOKED ROM
Hi all,
This is my first attempt at compiling anything for the android platform. My reason for doing this is whilst the busybox version does what we need it to do when rooting our HTC Dream's / G1's, as an everyday app it fails because it segfaults all the time.
This isn't a dig at Benno because to be honest, he's a bit of a hero for compiling it the first time round, without him it would have been a lot harder (if not impossible) to root our G1's.
Problem is, his version of busybox was compiled over a year ago (14 nov 2007 if his blog is anything to go by) and segfaults quite a lot (probably because it wasn't compiled for the G1, but more for the Android emulator), particularly if you try and do "ls -al"..
So what I've done is I've compiled the latest stable version of busybox (1.13.1 as of 14 December 2008) for the G1, I've tested this on my own G1 and it seems to work fine, but I could do with some help extensively testing it.
You can grab it here (for G1: long press -> save, for other browsers: right click -> save as / save target)
Installation Instructions:
Download the above file to your G1, it should be saved as /sdcard/download/busybox2.asc
(if you downloaded it with the G1 browser that is, otherwise please copy it to your G1's SD card to that exact path / name)
Remount your /system partition with this command:
Code:
mount -o remount,rw /dev/block/mtdblock3 /system
Copy the busybox binary into the /system/bin/ folder by running this command:
Code:
dd if=/sdcard/download/busybox2.asc of=/system/bin/busybox
Set the busybox binary as executable with suid bit by running this:
Code:
chmod 4755 /system/bin/busybox
Remount your /system/bin partition as read only again (unless you want to create more shortcuts) by doing the following:
Code:
mount -o remount,ro /dev/block/mtdblock3 /system
And thats it! Please test it as thoroughly as you can and let me know in this post if you have any problems
Ps. I take no responsibility for any damage that occurs directly or indirectly from using this program. Although I will try and make amends if something doesn't work as expected, you must acknowledge that you are solely responsible for your actions when modifying the filesystem of your G1.
Please note, this version is compiled as follows:
* It is compiled against regular libC so is 1.8MB big
* It is compiled with the soft links options
I'm investigating compiling it against uClibC to get the size down dramatically, and compiling it with a seperate set of options so it auto-identifies when to use itself when you're shell is busybox sh.
Appears to have installed alright! Haven't had a chance to test it out otherwise, but I'll let you know if my phone explodes.
Excellent going through it now!!!
Thank you!
anybody else get
Code:
/system/bin/busybox: write error: no space left on device, 1045+0 records in , 1044+0 records out, then the speed stats
Im just gonna chmod it anyway, I wonder which file it forgot?
man all my G1 hack went smooth till I tried the market cache move, i got 1 file and 100 force closes, tried moving them back to no avail..HARD RESET, now I messed up this one somehow, Its par for my course these days, f'it...
bhang
edit:
I reran the "dd" command after I freed up almost a meg and it output same write error: no space left on device 1+0 records in 0+0 out, looks like it copied the last file I missed in the first run? do I need to chmod everything again since I dunno which 1 of the files it may have been..
on second thought 'dd' looks like it may have realized it only needed the 1 file but still needed more room cause 0+0 out, I dunno im confused any advice?
good work
installed successfully. so far no problems. does this new version contain commands not found in the previous versions, ie/ the version JesusFreke used in modified rc30 v1.2 (Sauriks' version from here: http://www.telesphoreo.org/pipermail/g1-hackers/2008-November/000032.html)?
edit: just realized that the previous ver i had installed was 1.12.2 (2008-11-16)
I think JesusFreke was compiling the bionic version last night. Might wanna check on that before you spend your time doing if it you have not already.
Darkrift said:
I think JesusFreke was compiling the bionic version last night. Might wanna check on that before you spend your time doing if it you have not already.
Click to expand...
Click to collapse
uninstall is just as easy as installing
-beers!
Bhang, have you installed anything else on your /system partition bar the stock files?
I'm working on a solution at the moment that moves all this to the /data partition to provide some more usability. For now I suggest you delete busybox from /system/bin/ so you don't fill up your /system partition.
syntax?
I could not quite get this to work as stated. I am no command line expert, so I guessed at what might work. I did the following:
Instead of this:
mount -o remount, rw /dev/block/mtdblock3 /system
I did this:
mount -o remount, -rw /dev/block/mtdblock3 /system
At the last I did this:
mount -o remount, -r /dev/block/mtdblock3 /system
Then I rebooted. Everything seems fine. I looked up some busybox commands, but they don't seem to do anything. Any way to know for sure?
my bad, it works!
Excuse a noob, I didn't know you had to type "busybox" in front of the command...
Hi, the link is down, can someone please re-upload? Thank you .
Please note, this is now obsolete as busybox comes with just about every other ROM out there.
foxdie said:
Please note, this is now obsolete as busybox comes with just about every other ROM out there.
Click to expand...
Click to collapse
Unfortunitally there have been people releasing versions without busybox recentl for the mytouch series mainly and we need a good version of Busybox if possible
Hi,
I know that, but I'm having problems getting SUFBS (http://forum.xda-developers.com/showthread.php?t=530271) to work correctly. I read through the thread and someone tried your busybox and it worked. Also, the one I have (using myhero 0.0.7) is using 1.8.1.
You can actually rip the busybox binary out of any of the roms that come with it.
Any instructions? It'd be simpler if foxdie's busybox is re-uploaded though. Thanks!
Wysie said:
Any instructions? It'd be simpler if foxdie's busybox is re-uploaded though. Thanks!
Click to expand...
Click to collapse
try this out, it's what i used http://benno.id.au/blog/2007/11/14/android-busybox
http://www.busybox.net/downloads/snapshots/busybox-snapshot.tar.bz2
can anyone please compile the latest source or explain how to do this with windows and visual studio?
I tried to build busybox latest with android bionic lib and gave up on passwd.
I had problems with bionic umtp, no strchrnul in string.h and no pw_gecos in passwd.
I can not understand how other busybox builds where able to get build. Any experiances?
EDIT: Doh, stupid me. I made 2 big mistakes. I will give it a new try with an other compile.
EDIT2: wich lib was taken to compile busybox? androids c lib bionic was not possible for me.

[KERNEL] CIFS + UTF8 NLS support for the official HTC Desire Froyo kernel

with the release of the source code for the bravo kernel this has become redundant
to be able to directly access my stuff on samba shares i made a _patch_ for the cifs code in 2.6.32.15 and built cifs.ko and nls_utf8.ko with arm-eabi-4.4.0
i thought i'd share them here in case it was of use to anyone else
this is how i installed them:
Code:
(boot into recovery mode)
$ adb shell mount /system
$ adb push cifs.ko /system/lib/modules
$ adb push nls_utf8.ko /system/lib/modules
$ adb shell chmod 644 /system/lib/modules/*.ko
$ adb shell "cd /system/lib/modules; ln -s . 2.6.32.15-gf9c0527"
$ adb shell umount /system
(reboot)
this is how i tested them:
Code:
sh-3.2$ su
sh-3.2# modprobe nls_utf8
sh-3.2# modprobe cifs
sh-3.2# busybox mount -t cifs -o user=<username>,password=<password>,uid=1000,gid=1015,file_mode=0775,dir_mode=0775,iocharset=utf8,nodfs //10.0.1.2/public2 /sdcard/smb/public2
(1015 is the gid of 'sdcard_rw')
--
cifs_bravo_2.6.32.15-gf9c0527.zip
cifs_bravo_2.6.32.15-gd96f2c0.zip
Hey cheers for this will try it out
Sent from my C64
just tried
init_module 'cifs.ko' failed (Exec format error)
epyon1873 said:
init_module 'cifs.ko' failed (Exec format error)
Click to expand...
Click to collapse
as stated above it works with the stock htc kernel, which is 2.6.32.15-gf9c0527
check the output of uname -r
snq- said:
as stated above it works with the stock htc kernel, which is 2.6.32.15-gf9c0527
check the output of uname -r
Click to expand...
Click to collapse
Thx find htc kernel is 2.6.32.15-g1fc4045 @ NexTSense Rom orz
epyon1873 said:
Thx find htc kernel is 2.6.32.15-g1fc4045 @ NexTSense Rom
Click to expand...
Click to collapse
afaik the current nextsense comes with Myshkinbob's cifs module (although not with the latest one) - it's module version id was simply patched to suppress the version mismatch error message you got
here is mine if still interested:
(be sure to type "ln -s . 2.6.32.15-g1fc4045" instead of "ln -s . 2.6.32.15-gf9c0527" when installing)
--
cifs_bravo_2.6.32.15-g1fc4045.zip
Thx~! go to try it.
Greetings,
I tried using your patch on the source for the supersonic (evo) and it went in and compiled perfectly, i was able to do an insmod and loaded the driver fine, but when i go to do a mount the phone crashes.
any ideas?
(i have tried both the arm-eabi-4.4.0 and the arm-2010q1 toolchains)
Thanks!!
adambot said:
I tried using your patch on the source for the supersonic (evo) and it went in and compiled perfectly, i was able to do an insmod and loaded the driver fine, but when i go to do a mount the phone crashes.
any ideas?
(i have tried both the arm-eabi-4.4.0 and the arm-2010q1 toolchains)
Click to expand...
Click to collapse
the patch does not cleanly apply to supersonic-2.6.32.15-g746f4f0, as it is for vanilla 2.6.32.15
please overwrite fs/cifs with the vanilla sources before you apply it
just tried and was able to build the very same .ko published in the first post (except for the buildstamp of course):
pulled the supersonic kernel source from developer.htc.com
overwrote fs/cifs/* with vanilla
pulled & applied the patch from pastebin
pulled .config from my phone
in menuconfig
set the localversion (general setup)
selected cifs + nls_utf8 to be built as module
did _not_ touch the debug options already set
did 'make modules'
stripped the modules with arm-eabi-strip --strip-debug
insmod worked, mount worked, browsing the share worked
if you get crashes, check /proc/last_kmsg after reboot
snq- said:
the patch does not cleanly apply to supersonic-2.6.32.15-g746f4f0, as it is for vanilla 2.6.32.15
please overwrite fs/cifs with the vanilla sources before you apply it
Click to expand...
Click to collapse
What is considered "vanilla sources"?
I used git and pulled the whole android repo but am not finding the vanilla sources there...
do you mean the vanilla linux sources??
[edit]
i tried the cifs files from the vanilla linux source (same version) but the phone still crashes (even after the debug strip)
Should i try to use a different config (rather than the one from the supersonic templates?)
Do you have an evo that you tested this on?
Thanks again!!!
[/edit]
adambot said:
do you mean the vanilla linux sources??
Click to expand...
Click to collapse
sorry if i wasn't clear enough. linux-2.6.32.15.tar.bz2 (kernel.org)
adambot said:
Should i try to use a different config
Click to expand...
Click to collapse
i pulled the config from the device ($adb shell zcat /proc/config.gz > .config)
i do not own an evo, the only reason for me to use evo/incredible sources is that htc haven't released bravo-froyo kernel sources yet
adambot, please let me know if this works for you
--
cifs_supersonic_2.6.32.15-g746f4f0.zip
snq- said:
adambot, please let me know if this works for you
Click to expand...
Click to collapse
WOW!!! That worked PERFECTLY!!!!!
Thanks SO MUCH!!!
(now i just have to figure out why mine wasn't working... I'll try again with your steps and compare the good one to mine with diff)
if you don't mind just to recap:
get linux vanilla kernel source
get supersonic kernel source
replace supersonic fs/cifs with vanilla
edit Makefile with extra EXTRAVERSION info
get .config from running device
make CROSS_COMPILE=CROSS_COMPILE=arm-eabi-4.4.0/bin/arm-eabi- oldconfig (accept defaults)
edit .config and make cifs and nls_utf8 modules
make CROSS_COMPILE=arm-eabi-4.4.0/bin/arm-eabi- modules
arm-eabi-4.4.0/bin/arm-eabi-strip fs/cifs/cifs.ko and fs/nls/nls_utf8.ko
adambot said:
WOW!!! That worked PERFECTLY!!!!! Thanks SO MUCH!!!
Click to expand...
Click to collapse
no problem, glad it worked out
adambot said:
if you don't mind just to recap: ...
Click to expand...
Click to collapse
- i don't see the step where you applied the patch
- i didn't edit the makefile per hand
- i didn't edit .config per hand
- as i don't own an evo, instead of pulling the config from the device i did a 'make supersonic_defconfig' before 'make menuconfig'
snq- said:
no problem, glad it worked out
- i don't see the step where you applied the patch
- i didn't edit the makefile per hand
- i didn't edit .config per hand
- as i don't own an evo, instead of pulling the config from the device i did a 'make supersonic_defconfig' before 'make menuconfig'
Click to expand...
Click to collapse
I got it to work FINALLY!!! I will be posting the step by step (copy/paste) directions in the evo section. Do you mind if i post the patch here as an attachment? also -- how do you want credit -- do snq- or do a different name?
thanks again!!
Adam
adambot said:
Do you mind if i post the patch here as an attachment?
Click to expand...
Click to collapse
feel free to use it for whatever you want
you might however want to post the patch directly applicable to the supersonic source (attached)
thanks for crediting me, using the nick is fine
--
supersonic-2.6.32.15-g746f4f0_cifs.patch
snq- said:
feel free to use it for whatever you want
you might however want to post the patch directly applicable to the supersonic source (attached)
thanks for crediting me, using the nick is fine
Click to expand...
Click to collapse
What did you do differently? (or what is the difference between cifs-supersonic and cifs-vanilla) -- I would look myself, but i'm not the best at coding... (that's what i get for being a sysadmin and not a dev -- but i can script until the cows come home )
Help me
I need nls_utf8.ko for 2.6.34 kernel
I would like cifs module for 2.6.32.15-g6a358a9 kernel, is it posible?
Thanks!
any for 2.6.32.15-ge2fb08e?

Modules (jbd,ext2,3,4) for 2.1 Eclair Kernel

Hi guys..
There was some interest in different filesystem modules for Eclair.
I built these from the source from Samsung. I'm running Froyo, so I have no way to exactly test these. In theory they should work, but I can't guarantee it. I couldn't find any of these modules anywhere on xda-developers, so I'm hoping I'm not redoing other peoples' work.
The crc16.ko and mbcache modules may be required in order to insmod the ext and/or jbd modules. ext4 does need jbd in order to properly be imported I believe.
To use:
Simply copy to your sdcard in a "modules" folder.
* AS ROOT * from adb or a shell on your phone, run:
Code:
insmod /sdcard/modules/ext2.ko
Change ext2.ko to whatever module you'd like to load.
I'd like to hear feedback.
DOWNLOAD LINK: http://www.multiupload.com/K356AARKOG
zip password: "eclair"
-P
Wow nice job, and what are the exact benefits then? Ext4 is faster then Ext2?
So one could finally insmod the ext2 module and then install the lagfix...
so do we need to apply the insmod in every boot or just do it one time and DONE?
Thanks so much for your contributions.
Ext4 is better than 2 in various ways, however it arguably uses more cpu than ext2... But now we have the chance to debunk that if it's actually untrue.
It's just as easy to compile both of them in as it is one, so I figured I'd just do all of them.
You'll need to do an insmod every boot, since modules don't stay in the kernel between reboots. Things like filesystems can be compiled right into the kernel (except for proprietary ones like rfs - since then Samsung would need to release the source code for it).. so I may be able to compile you guys a new zImage that includes ext2 (or 4), with tun support and cifs if needed..
If this works, you should be able to add it to the init scripts in /system.
Hello friend, does this module work on the tablet Coby MID7015, which has the Android 2.1 (Eclair)? If so how would he incorporates into the kernel to not have to keep typing the command on each boot. Thanks
I thought it would be easy, but it's not!
I can insmod all modules except ext4 but nothing seems to happen. Still cannot mount an ext2 partition. I can leave with FAT!

Working aircrack-ng with monitor mode and packet injection !

Hi,
so after few days of playing with drivers patches kernel sources i finally got aircrack-ng working on g1 ! ( If you dont know whats aircrack-ng http://www.aircrack-ng.org/) I tested airodump for 1h, had it dumping packets to the sdcard to a cap file with channel switching and aireplay with deauth attack. I monitored this from my laptop to see if the packets are being sent ok and the client was disconnected from the network as expected.
I used patches for the n900 form the "download here" link at the bottom of this page http://david.gnedt.eu/blog/wl1251/. I also followed this tutorial http://bobcopeland.com/android_wifi.html and used his excellent kernel patch to get the msm_wifi.ko module. I then used the kernel and the zip file herehttp://forum.xda-developers.com/showpost.php?p=14768272&postcount=2427
You will want to make a backup of your system before you do anything. With that kernel you won't be able to use wifi in the Android UI.
Requirements to use attached files:
2.2 Rom
Debian installed in chroot on g1 with aircrack-ng installed ( you can use this img http://www.mediafire.com/?0ab95ia8xbale0i , just extract in on /sdcard/ so debian.img path is /sdcard/debian/debian.img )
How to make it work ?
steps 1-5 are one time only
First boot your android ROM and type
adb shell
$ su
# mount -o remount,rw /
# cd /system/etc/firmware
# ln -s ../wifi/Fw1251r1c.bin wl1251-fw.bin
# cat /proc/calibration > wl1251-nvs.bin
# mount -o remount,ro /
Click to expand...
Click to collapse
Extract attached files ( g1_wl1251.zip ) to sdcard
Apply ez_1.5.1_wl1251.signed.zip from recovery ( it got 2708 and ebi0 kernel for now will add ebi1 later)
Boot the phone
adb shell
su
cd /sdcard/wl1251_modules
sh ../insmod.sh
Click to expand...
Click to collapse
Now chroot into you debian installation ( if you used mine debian.tar.bz2 there is script startdeb just write: sh /sdcard/debian/startdeb and you should be chrooted correctly )
screen ( dont know why airodump doesnt give any output without screen on adb shell ?! )
bash
airmon-ng start wlan0
airodump-ng -i mon0
and DONE
How com compile it
First you need to get sources:
kernel sources i used https://github.com/ezterry/kernel-biff-testing tag ezgb-2636-v1.5.1-20110820
prepatched compat-wireless-2010-12-22 ( attached in sources.zip. I did some small build fixes and applied every patch from wl1251-maemo/patches/wireless-testing/ EXCEPT 0003-wl1251-fix-scan-behaviour-while-not-associated.patch as i got build errors with it )
rest of the files in patches.zip
Kernel:
You can just apply all patches in the kernel dir
If you want to make your config by yourself you have to compile as module cfg80211 and mac80211, compile in CONFIG_RFKILL_PM, CONFIG_CRC7 and UNSET CONFIG_TIWLAN1251. Its important as there as some ifdefs for CONFIG_TIWLAN1251 in drivers/mmc/core/core.c which is compiled in and with CONFIG_TIWLAN1251 WL1251 drivers doesnt work !
Compat wireless:
there is make.sh script edit it and change the patchs for your crosscompile toolchain and kernel location
./make.sh
and copy all *.ko modules
I hope everything is clear and more ppl can use it in custom roms If something is unclear plz write about it
too bad i sold my g1!
Thank you for the great tutorial! I think many people are using Gingerbread right now with several different incompatible ROMs. I think it would be useful if you list your ROM version as well as SPL & Radio info. Also if you could PLEASE make an image of your G1 with the debian install, it would help a lot. If you don't want your personal data in the image then I can remove it for you and will host the image. At the very least people need to know how exactly you installed debian before attempting this.
Please PM me if you can supply the image, thanks again!
Debian location can by anywhere, nothing depends on it and i got it on sdcard so g1 dump wont do anything. But i can send u ready debian.img to mount it with wireless tools installed just want to add new kismet and as i cant find ready deb for debian i would need to compile it probably. As for the radio u can use that new 2708 radio and old one for kernel i provided. I used cm6 for it but i think you can use any 2.2 rom as its froyo kernel. I need to clean up everything and redo it to write good tutorial how to compile it for any kernel and how to patch drivers.
zewelor said:
Debian location can by anywhere, nothing depends on it and i got it on sdcard so g1 dump wont do anything. But i can send u ready debian.img to mount it with wireless tools installed just want to add new kismet and as i cant find ready deb for debian i would need to compile it probably. As for the radio u can use that new 2708 radio and old one for kernel i provided. I used cm6 for it but i think you can use any 2.2 rom as its froyo kernel. I need to clean up everything and redo it to write good tutorial how to compile it for any kernel and how to patch drivers.
Click to expand...
Click to collapse
Thanks for the response. I just upgraded my hboot to a version that CM6 doesn't support, but I can use a different Froyo ROM that is still working.
On Gingerbread I am having a very hard time getting ext2.ko loaded. I already have an EXT(4) partition mounted, but since I am not on Froyo none of the kernel modules can be loaded correctly. I also think that ext2 support is already there but I don't know how to make use of it. There are filesystem modules under /system/lib/modules/2.6.36.4-s3-cos/.
My goal is to create a clockwork image of a Froyo/Debian install (with working injection driver) and use it as needed while keeping a 2.3.4/2.3.5 Android image for testing newer Apps that don't work on 2.2.
For anyone that just needs the Debian image, you can download it from the original G1 Debian tut site here: http://www.saurik.com/id/10
Please PM me if you are willing to upload a copy of your .img container file & I will host it for everyone to use. Thanks!
If u want u can still flash cm6 and after flashing it, flash kernel.zip from attached zip in 1st post ( it got also kernel for newer radio, but i havent tested it as i got older radio). As i saw in ezterry's kernel config ext2 partitions are mounted using ext4 so u dont have to load ext2 ( it works at least in froyo version of ezterry's kernel ). I can send now debian.img without working kismet but i think its better to get also kismet running so ppl wont have to redownload it. My debian.img its normal debian only with aircrack-ng installed nothing special in it. Only magic is kernel config and modules with patches compiled for that kernel thats it nothing more.
zewelor said:
If u want u can still flash cm6 and after flashing it, flash kernel.zip from attached zip in 1st post ( it got also kernel for newer radio, but i havent tested it as i got older radio). As i saw in ezterry's kernel config ext2 partitions are mounted using ext4 so u dont have to load ext2 ( it works at least in froyo version of ezterry's kernel ). I can send now debian.img without working kismet but i think its better to get also kismet running so ppl wont have to redownload it. My debian.img its normal debian only with aircrack-ng installed nothing special in it. Only magic is kernel config and modules with patches compiled for that kernel thats it nothing more.
Click to expand...
Click to collapse
Yes, let's wait until Kismet is working and then you can upload the image. I will try your suggestion and use EXT4. If I still have trouble I will create a flashable ZIP that has Froyo optimized for Debian with your Kernel patch included and a startup app to launch Debian via UI. Thanks again for your great contribution!
But when you mount debian img just write mount -o loop -t ext2 not ext4 it should work
Updated first post with some instructions how to compile drivers and kernel
Constantly getting "mount: can't setup loop device: No such file or directory"
I tried "mknod /dev/loop0 b 7 0" but neither "mount -o loop,noatime /mnt/sdcard/debian.img /data/local/mnt" nor other variations using ext2 work. I did mount / as rw and created the /data/local/mnt directory. I also tried 2 versions of busybox and so far no luck; I guess you are using the version that comes with CM6? Thanks
Yes i used busybox from cyanogenmod
Copy debian.img to /sdcard/debian/debian.img ( or change location in startdeb script )
First do mkdir -p /data/local/debian/mnt
then sh /sdcard/debian/startdeb ( or where u got it )
startdeb script i used:
#!/system/bin/sh
if [ ! -e /dev/block/loop99 ]
then
mknod -m 660 /dev/block/loop99 b 7 99
fi
if [ ! -e /dev/loop1 ]
then
ln /dev/block/loop99 /dev/loop0
fi
mount -o loop -t ext2 /sdcard/debian/debian.img /data/local/debian/mnt
busybox mount -o bind /sdcard /data/local/debian/mnt/sdcard
export PATH=/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
busybox mount -t proc none /data/local/debian/mnt/proc
busybox mount -t sysfs sysfs /data/local/debian/mnt/sys
busybox mount -t devpts devpts /data/local/debian/mnt/dev/pts
busybox chroot /data/local/debian/mnt/ /bin/bash
Click to expand...
Click to collapse
can u do it for lg optimus black ?
That depends on wifi chipset there, if its wl1251 it should be doable.
nice work, a year ago I did the same work (I think I posted it in the modaco android forum), however there was no injection patch at that time, so only packet capturing worked. The HTC Hero has the same TI wifi chip (wl1251). By the way you don't need an entire linux environment it is sufficient to compile static binaries (aircrack, kismet..). If i remember correctly compiling aircrack was very straight forward, however for kismet I had to make a dirty hack because it complained for a missing environment variable, but int he end Kismet worked fine too, even the gps . Unfortunately I lost my dev environment due to a harddisk failure, otherwise I would share the patches and binaries.
[EDIT]
HA! I found the aircrack binaries on an old backup disc
If you want to copy the files on your sdcard remember to remount it with (mount -o,exec,remount /mnt/scard), because by default the noexec flat is set or you copy the files to internal memory.
Thx for that aircrack I have chosen debian to avoid recompiling everything i will like to use and to have normal command line enviroment. Except aircrack and kismet u can also like to have iw / wireless tools / ping / nmap /tcpdump etc so you will have to search for it or recompiling staticly everything. I just prefer to find .deb file and install it, as using apt-get on g1 takes forever Also htc magic got wl1251 as afaik its the same as g1 (?).
yeah thats true, I decided to compile everything statically because I had very poor performance using debian (apt-get, compiling stuff etc), another advantage is you can start the programs very easily from the homescreen using gscript, sl4a..., in the end its just a question of preference
Sorry for asking in wrong topic, but:
Is there any airdump app that works well on HD2 ? (Broadcom chip: bmc 4329).
Or maybe the right question is : If it is even possible to create such app for hd2/nexus ?
misieq666 said:
Sorry for asking in wrong topic, but:
Is there any airdump app that works well on HD2 ? (Broadcom chip: bmc 4329).
Or maybe the right question is : If it is even possible to create such app for hd2/nexus ?
Click to expand...
Click to collapse
The problem is not the app, the problem is having wireless driver that support packet injection/Promiscuous-mode for the specific wireless chip, which in this case are afaik not available.
And even not a driver but firmware for specific chipset that allow to do that. As i read the main problem in bmc4329 is the firmware as driver can only do what firmware will allow. Well u can rewrite driver to workaround some limitations in firmware etc. Anyway here is a page u can follow http://linuxwireless.org/en/users/Drivers/brcm80211 they even got monitor mode in todo so maybe it can be done
Hi guy, final step, I got this:
airmon-ng start wlan0
Interface Chipset Driver
wlan0 wl1251_sdio - [phy0]SIOCSIFFLAGS: No such file or directory
(monitor mode enabled on mon0)
Click to expand...
Click to collapse
and this:
airodump-ng mon0
ioctl(SIOCSIFFLAGS) failed: No such file or directory
Click to expand...
Click to collapse
how should i fix this? plz.
Thank you.

[FOR CHEFS] xpad/cifs/hfs/squashfs/btrfs modules for stock kernel ICS v9.2.1.11

I took a vanilla 2.6.39.4 linux source tree, copied in the .config from /proc from my running ICS v9 build. And compiled it.
After that, turned on CIFS and XPAD support in the config and compiled them as modules.
These modules load fine if I insmod them, and I can confirm that after loading ff_memless and xpad I now have my xbox360 pad working on the home screen (I can move through screens and icons).
edit: Just played a round of Riptide GP, works fine .
edit: I updated the cifs module and included the md4 crypto module, and they now work! I manually 'insmodded' md4.ko and then cifs.ko, and from the command line and / or from cifsmanger I can now mount a share.
As I said, these modules load fine, but in dmesg there is a notion that the version magic isn't perfect yet. So I might make updated ones with proper versionmagic set. But for now it seems to be working.
Might be handy for ROM chefs who are working with the stock ICS kernel for which we have no sources yet.
TUN module is _builtin_ by default on ICS stock kernel, so no need for it anymore.
EDIT v2 zips: I recompiled them with the correct version info, so they give no more warnings when loaded through insmod. I added them to my stock rom to auto-load during boot (created a simple /system/etc/install-recovery.sh) and all seems fine so far.
For voodoo sound to work, is it a simple module which I can get anywhere? I only see 2.6.36 kernel trees on Project Voodoo website
----------------------------------------------------------
hfs @ http://forum.xda-developers.com/showpost.php?p=23018909&postcount=19
squashfs + btrfs @ http://forum.xda-developers.com/showpost.php?p=23019453&postcount=20
good for those complaining about cifs
dipje said:
I took a vanilla 2.6.39.4 linux source tree, copied in the .config from /proc from my running ICS v9 build. And compiled it.
After that, turned on CIFS and XPAD support in the config and compiled them as modules.
These modules load fine if I insmod them, and I can confirm that after loading ff_memless and xpad I now have my xbox360 pad working on the home screen (I can move through screens and icons).
edit: Just played a round of Riptide GP, works fine .
edit: I updated the cifs module and included the md4 crypto module, and they now work! I manually 'insmodded' md4.ko and then cifs.ko, and from the command line and / or from cifsmanger I can now mount a share.
As I said, these modules load fine, but in dmesg there is a notion that the version magic isn't perfect yet. So I might make updated ones with proper versionmagic set. But for now it seems to be working.
Might be handy for ROM chefs who are working with the stock ICS kernel for which we have no sources yet.
TUN module is _builtin_ by default on ICS stock kernel, so no need for it anymore.
For voodoo sound to work, is it a simple module which I can get anywhere? I only see 2.6.36 kernel trees on Project Voodoo website
Click to expand...
Click to collapse
in case you want to try that too because its faster than cifs
nfs support is in the kernel, no additional modules required
to get it working with cifsmanager mountings nfs shares i did the following
(it also works with commandline)
### as su and /system readwrite mounted
### remove symlink to toolbox
rm /system/bin/mount
### and use busybox instead
ln -s /system/xbin/busybox /system/bin/mount
mount options: rw,intr,soft,nolock
the modules are already working.
NFS support is nice for people with linux boxes but most windows users don't have a use for it , that's why they want cifs .
I don't care much for overclocking, so with cifs support + xbox360 support I'm more than happy with rooted stock now . And rom chefs can include the modules in their optimized ROMs until we have proper kernel source
Care to share how to get this loaded into the current ics roms. I have copied to /system/lib/modules and tried to load using mount manager and cifs manager with no luck.
comfort69 said:
Care to share how to get this loaded into the current ics roms. I have copied to /system/lib/modules and tried to load using mount manager and cifs manager with no luck.
Click to expand...
Click to collapse
you can e.g. create a script (like I believe OP did) in /etc/system/install-recovery.sh with
#!/system/bin/sh
insmod cifs.ko
insmod md4.ko
or you can mount it by hand in terminal (with insmod)
or you can simply create init.d script and call it 91modules:
#!/system/bin/sh
sleep 1
insmod /system/lib/modules/cifs.ko
echo "CIFS support activated";
and place it in system/etc/init.d if custom ROM supports init.d support.
comfort69 said:
Care to share how to get this loaded into the current ics roms. I have copied to /system/lib/modules and tried to load using mount manager and cifs manager with no luck.
Click to expand...
Click to collapse
jerry was close. Module auto-loading won't work, so you have to do it by hand.
Through an 'adb shell' or with a terminal emulator app from the market, type the following:
su -
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
cifsmanager should work, until you reboot, you'll have to do the lines again.
Creating a file /system/etc/install-recovery.sh will do it auto on boot:
Code:
#!/system/bin/sh
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
Make sure to create the file executable (permissions 777 will do ).
I hope rom chefs will use them and make them auto-load at boot until we have the sources from Asus.
edit: What mike said works, IF you have init.d support. Most custom ROMs have this, stock rom has not I believe.
dipje said:
jerry was close. Module auto-loading won't work, so you have to do it by hand.
Through an 'adb shell' or with a terminal emulator app from the market, type the following:
su -
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
cifsmanager should work, until you reboot, you'll have to do the lines again.
Creating a file /system/etc/install-recovery.sh will do it auto on boot:
Code:
#!/system/bin/sh
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
Make sure to create the file executable (permissions 777 will do ).
I hope rom chefs will use them and make them auto-load at boot until we have the sources from Asus.
Click to expand...
Click to collapse
Keep in mind that install-recovery.sh is executed from ramdisk (init.ventana.rc or init.rc, don't remember now) and some chefs (including me) removed that execution line. So much easier to add init.d script I think. Just a suggestion
EDIT:
yeah, for those on stock ROMs install-recovery.sh method is good, for those using custom ROMs it's better to use init.d
I tried to get it to run manually using terminal emulator and get
failed file exists
Sent from my Transformer TF101 using Tapatalk
comfort69 said:
I tried to get it to run manually using terminal emulator and get
failed file exists
Sent from my Transformer TF101 using Tapatalk
Click to expand...
Click to collapse
my guess is you're trying to load them double or something.
If you give the command 'lsmod' you get a listed of loaded modules. Check if they're there or not.
Anyone got Junos working with the builtin tun.ko ?
comfort69 said:
Care to share how to get this loaded into the current ics roms. I have copied to /system/lib/modules and tried to load using mount manager and cifs manager with no luck.
Click to expand...
Click to collapse
cifsmanager - preferences:
check "load with insmod"
if its not already, adjust path to cifs.ko and other modules
btw: as rmmod tries to remove /lib/modules/cifs.ko instead of /system/lib/modules/cifs.ko there's no way to unload the module other than rebooting.
just sharing how I did manage cifs to work
I've installed Revolution HD 3.00 (ICS 4.0.3), installed CifsManager, didn't work, tried to copy cifs.ko and md4.ko in /system/lib/modules with File Expert or Root Explorer, couldn't because of a read-only system files, plugged my tablet on a PC, launched an adb session and typed:
$ adb shell
$ su
$ mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
pushed through adb cifs.ko and md4.ko in /system/lib/modules
changed the permission to 777 using File Expert
launched cifs and md4 using terminal emulator:
insmod /system/lib/modules/cifs.ko
insmod /system/lib/modules/md4.ko
in cifsmanager settings, didn't check load modules on boot and load through insmod
tried to connect my shares: succeed
Hope it will help somebody
jeanvdr said:
$ mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
hmm strange
my /system is mounted elsewhere
/dev/block/mmcblk0p1 on /system type ext4
anyway
another method without terminal (and.revol hd 3.0.0 only)
adb shell sysrw
adb push cifs.ko /system/lib/modules
adb push md4.ko /system/lib/modules
adb shell chmod 644 /system/lib/modules/*.ko
adb shell insmod /system/lib/modules/cifs.ko
adb shell insmod /system/lib/modules/md4.ko
If the modules don't cause problems, they will likely be in the next ARHD version.
Remounting goes like this: busybox mount -o remount,rw /system
Yaffs2 filesystem isn't used anymore, and 'remount ' ignores these parameters anyway .
Please keep it readable for people on stock ics, custom roms will get these modules somehow anyway.
Adb sysrw will not work without modified bootdisk AFAIK.
Wat is Janos? ? Maybe it needs more than the tun module, like crypto modules?
Btw, my tablet still working fine. Never had a Sleep of Death. Actually, never EVER had a SOD with my tablet, and I can't seem how any cifs module can cause it like some people are saying.
woti23 said:
cifsmanager - preferences:
check "load with insmod"
if its not already, adjust path to cifs.ko and other modules
Click to expand...
Click to collapse
The problem is this cifs.ko module required md4.ko, and AFAIK cifsmanager doesn't try to load it.
dipje said:
The problem is this cifs.ko module required md4.ko, and AFAIK cifsmanager doesn't try to load it.
Click to expand...
Click to collapse
actually it does, if you
check "load cifs module at start"
check "load per insmod"
fill out "path to cifs.ko":
/system/lib/modules/cifs.ko:/system/lib/modules/md4.ko:/system/lib/modules/nls_iso8859_1.ko
[email protected]:/~# >lsmod
nls_iso8859_1 3107 0 - Live 0xbf066000
cifs 218286 0 - Live 0xbf12a000
md4 3007 0 - Live 0xbf003000
it is a little work to type the pathes, and you surely are right that for most people its easier if it is loaded in the rom (init.d or somewhere else) automagically
btw: if you once compile modules again would you mind compiling the hfsplus module en passant? it should compile without any troubles and dependencies and allows manually (command line) mounting a mac os x external harddisk?
woti23 said:
btw: if you once compile modules again would you mind compiling the hfsplus module en passant? it should compile without any troubles and dependencies and allows manually (command line) mounting a mac os x external harddisk?
Click to expand...
Click to collapse
I haven't tested them (as in, didn't even try if they would load OK).
I just noticed I screwed up the vermagic again, so you'll get a warning in dmesg while loading. Should load ok though.
edit: Ok I've redone them. Proper cpu + vermagic now
And if people wanna experiment, mess with stuff:
squashfs
btrfs

Categories

Resources