[DEV]TUN, CIFS modules (UPDATE EXP. 4.0.A.2.364) - Xperia Play Android Development

Compiled tun.ko, cifs.ko and slow-work.ko modules for our Xperia Play.
unzip the attached file and
adb push tun.ko /sdcard/
adb push slow-work.ko /sdcard/
adb push cifs.ko /sdcard/
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
cp /sdcard/tun.ko /system/lib/modules/
cp /sdcard/slow-work.ko /system/lib/modules/
cp /sdcard/cifs.ko /system/lib/modules/
cd /system/lib/modules/
chmod 644 tun.ko
chmod 644 slow-work.ko
chmod 644 cifs.ko
insmod tun.ko
insmod slow-work.ko
insmod cifs.ko
to mount a share (example, use your own parameters):
# mount -t cifs -o username=USER,password=PASSWORD //192.168.1.5/music /sdcard/music
Or use cifs manager from Market
CIFS Manager
GSCRIPT VERSION by FrAsErTaG
Link: click here
Instructions:
1) if you already use gscript skip to step 3
2) install gscript from market, create a folder on sdcard called gscript
3) extract files from archive to gscript folder on sdcard
4) load gscript press menu, select add script, then select load script
5) MAKE SURE SU is ticked, then run script
6) Enjoy streaming mp3's and avi's from your home/work pc's to your phone
7) Click the thank you button for FrAsErTaG for the gscript.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
ADDED! New modules for firmware 4.0.A.2.364 for testing. Input is needed from ARC/NEO/PLAY if it is working, as I only have the Play, and no new firmware ..

What does it do?

NielDK said:
to mount a share (example, use your own parameters):
# mount -t cifs -o username=USER,password=PASSWORD //192.1681.5/music /sdcard/music
Click to expand...
Click to collapse
or download cifs manager from the market
awesome work, cant test tonight but will test tomorrow

svenk919 said:
What does it do?
Click to expand...
Click to collapse
Mounts a share from a Windows/Mac/Linux on your device

FrAsErTaG said:
or download cifs manager from the market
awesome work, cant test tonight but will test tomorrow
Click to expand...
Click to collapse
It works
Sent from my R800i using XDA Premium App

NielDK said:
It works
Sent from my R800i using XDA Premium App
Click to expand...
Click to collapse
im having trouble getting it to work
busybox ls -lah
drwxr-xr-x 1 0 0 2.0K May 11 08:20 ←[1;34m.←[0m
drwxr-xr-x 1 0 0 2.0K May 1 06:41 ←[1;34m..←[0m
-rw-r--r-- 1 0 0 264.0K Apr 20 18:58 ←[0;0mbcm4329.ko←[0m
-rw-r--r-- 1 0 0 3.2M May 11 08:20 ←[0;0mcifs.ko←[0m
-rw-r--r-- 1 0 0 136.4K May 11 08:20 ←[0;0mslow-work.ko←[0m
-rw-r--r-- 1 0 0 217.2K May 11 08:19 ←[0;0mtun.ko←[0m
thats the ls of my /system/lib/modules
So permissions are set correctly
but then
# insmod cifs.ko
insmod cifs.ko
insmod: init_module 'cifs.ko' failed (No such file or directory)
also tried
# insmod /system/lib/modules/cifs.ko
insmod /system/lib/modules/cifs.ko
insmod: init_module '/system/lib/modules/cifs.ko' failed (No such file or direct
ory)
also tried with busybox commands and from terminal from phone all return that error... any idea?
Im using binary's img

FrAsErTaG said:
im having trouble getting it to work
busybox ls -lah
drwxr-xr-x 1 0 0 2.0K May 11 08:20 ←[1;34m.←[0m
drwxr-xr-x 1 0 0 2.0K May 1 06:41 ←[1;34m..←[0m
-rw-r--r-- 1 0 0 264.0K Apr 20 18:58 ←[0;0mbcm4329.ko←[0m
-rw-r--r-- 1 0 0 3.2M May 11 08:20 ←[0;0mcifs.ko←[0m
-rw-r--r-- 1 0 0 136.4K May 11 08:20 ←[0;0mslow-work.ko←[0m
-rw-r--r-- 1 0 0 217.2K May 11 08:19 ←[0;0mtun.ko←[0m
thats the ls of my /system/lib/modules
So permissions are set correctly
but then
# insmod cifs.ko
insmod cifs.ko
insmod: init_module 'cifs.ko' failed (No such file or directory)
also tried
# insmod /system/lib/modules/cifs.ko
insmod /system/lib/modules/cifs.ko
insmod: init_module '/system/lib/modules/cifs.ko' failed (No such file or direct
ory)
also tried with busybox commands and from terminal from phone all return that error... any idea?
Im using binary's img
Click to expand...
Click to collapse
Did you insmod the slow-work.ko, it is needed: Do the insmods in this order:
insmod tun.ko
insmod slow-work.ko
insmod cifs.ko
as root.
Seeing my proporties of the files, are they all owned by root? mine are!
chown 0 tun.ko
chgrp 0 tun.ko
chown 0 slow-work.ko
chgrp 0 slow-work.ko
chown 0 cifs.ko
chgrp 0 cifs.ko
Also, my image is not bin4's, but a generic .184 world image, flashed using flashtool. Not sure if it matters, but it really shouldnt.
Tested on company windoze shares, and home Apphmmmm share here.

Thanks!!!
I got it working...Not sure if it was the adding root, But I may have been doing the insmod in the wrong order...
either way i deleted all the modules and rebooted and then created a gscript that does the job for you, I have uploaded it to mediafire the link is below.
GSCRIPT VERSION
Link: click here
Instructions:
1) if you already use gscript skip to step 3
2) install gscript from market, create a folder on sdcard called gscript
3) extract files from archive to gscript folder on sdcard
4) load gscript press menu, select add script, then select load script
5) MAKE SURE SU is ticked, then run script
6) Enjoy streaming mp3's and avi's from your home/work pc's to your phone
7) Click the thank you button for NielDK at top of this thread.

FrAsErTaG said:
Thanks!!!
I got it working...Not sure if it was the adding root, But I may have been doing the insmod in the wrong order...
Click to expand...
Click to collapse
Cool, added your input to the first post!

Aw man... I think I searched for cifs.ko for the arc literally hours before you posted this, and thinking there was none, proceeded to spend hours setting up a linux environment and figuring out how to compile this...
oh well I guess i learned something. Thanks for putting it up anyway!

it works,
however, all the chinese/jap/korean folders and file names turn into "?"
Are there any ways to make it utf8 unicode support?
I tried google and said it might need a nls-utf8?. Ko , does it mean i can copy and paste any nls-utf8.ko into the module folder?
Please help.

Try the attached file
Same procedure, copy the file to /system/lib/modules/ and chmod 644 insert with insmod (like first post for other modules)

NielDK said:
Try the attached file
Same procedure, copy the file to /system/lib/modules/ and chmod 644 insert with insmod (like first post for other modules)
Click to expand...
Click to collapse
thanks NielDK!
I kind of get it work, but I got some error while running the gscript.
I just wonder can you or FrAsErTaG explain to me why does it happen when running gscript please?
i got these error if I do not manually put the ko files in the models folder
unable to chmod /system/lib/modules/cifs.ko: no such file
stderr: chgrp: not found
stderr: insmod: can't open 'system/lib/modules/tun.ko'
if I use rootexplorer to copy the files into /system/lib/modules then run the script,
everything seems fine then
Another question is that do we need another series of KO files after a system update?
Or we can just use these files and CIFS should work ?
thanks heaps again~

Sounds like you are not root. Did you use su command in shell?
Also the order of insmod the .ko files are important.
Sent from my R800i using XDA Premium App

so what does it to exactly?

NielDK said:
Sounds like you are not root. Did you use su command in shell?
Also the order of insmod the .ko files are important.
Sent from my R800i using XDA Premium App
Click to expand...
Click to collapse
my PLAY is rooted, i can use ROOT explorer to copy/paste the file, and the CIFS manager work
but that's the error I got when running the scripts
insmond goes through without error, unless I run the script again, and it ll say that the file is already exsisted.
the 2.3.3 update service seems out for some country, eg: Hong Kong, but not rootable.
Thanks.
AriStar said:
so what does it to exactly?
Click to expand...
Click to collapse
it let you mount a network drive, like the "MAP Network Drive" function in microsoft windows explorer.

You don't need the insmod when using cifs manager. it will issue those. root explorer is fine to use, you really just want to achieve getting the modules in place. I like adb shell, but that is individual .
it may work on system updates, if kernel version don't change, else a recompile is needed.
Sent from my R800i using XDA Premium App

i think u can add (the insmod lines) to:
/system/etc/hw_config.sh
so that they are executed at every boot
P.S.: from which baseband/FW sources have u compiled these?
cause on the X10 we had similar modules and those are specific to baseband/kernel sources from which they ware compiled
ADDITIONALLY:
u can execute:
Code:
lsmod
to verify that the modules are live or not (stuck at loading)

Modules are compiled for 2.6.32.9 kernel. From Sony Ericsson available sources. Baseband doesn't matter to my knowledge.
Sent from my R800i using XDA Premium App

NielDK said:
Modules are compiled for 2.6.32.9 kernel. From Sony Ericsson available sources. Baseband doesn't matter to my knowledge.
Sent from my R800i using XDA Premium App
Click to expand...
Click to collapse
seeing the 2.3.3 update is same kernel version, once this is rooted these modules should still work FYI.
Sent from my R800i using XDA Premium App

Related

[Q] tun.ko and vpn for Dell Streak

I am trying to connect to my company's vpn server (Cisco) with an application named vpnc.
but it needs a tun.ko module which I can't find on the Dell Streak.
I find tun.ko for other devices but I can't use them as a module on the Dell Streak. It does not accept the exec format.
Can anyone compile a tun.ko for Dell Streak ? Or is there any compiled tun.ko for it ?
Thanks.
I'd appreciate any help...
I misunderstood the OP query
As the OP said, tun.ko needs to be specific to the device.
The one you found says:
"tun for Android 2.2 (Froyo) Nexus One devices"
We are both looking for one for the Streak - in my case at 2.1 level.
Thanks for looking.
Post #12 Here http://forum.xda-developers.com/showthread.php?t=630703&page=2 appears to have all the instructions, but I don't have the skills.
mardibloke said:
As the OP said, tun.ko needs to be specific to the device.
The one you found says:
"tun for Android 2.2 (Froyo) Nexus One devices"
We are both looking for one for the Streak - in my case at 2.1 level.
Thanks for looking.
Post #12 Here http://forum.xda-developers.com/showthread.php?t=630703&page=2 appears to have all the instructions, but I don't have the skills.
Click to expand...
Click to collapse
is there really that much difference between the streak and the nexus?
I misunderstood what the OP meant by "other devices" I Presumed he meant linux not android,
have you thought about asking on that google code page for them to compile it for you?
-----edit scratch that..
having read that thread..
I think you need the streak source code..
Best get involved in the attempts to get Dell to release it to comply with the GPL.
actually, we don't need the source code of Streak.
we just need to compile tun.ko for Streak.
I don't know how to do that.
I asked in the project site but nobody answered.
mrmrmrmr said:
actually, we don't need the source code of Streak.
we just need to compile tun.ko for Streak.
I don't know how to do that.
I asked in the project site but nobody answered.
Click to expand...
Click to collapse
according to the thread mardibloke posted you need the source as he checks out the nexus-one specific head..
Finaly! I figured out how to build tun.ko module for the stock kernel.
If anybody wants to repeat that:
* I have Android OpenSource installed in /opt/android
* In /opt/android I did: git clone git://android.git.kernel.org/kernel/msm.git kernel-nexus
* In kernel-nexus I did:
- git checkout -b origin/android-msm-2.6.29-nexusone
- git checkout HEAD^
(The last operation reverses one revision, I needed a previous revision from the tree. Different revisions generate modules with different vermagic values)
(Actually, instead of previous two this should work as well - it should checkout the correct revision: git checkout 4bc62c230b2942bea72c3b5258e3e4f1d6cb534b )
- make ARCH=arm CROSS_COMPILE=/opt/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- distclean
- adb pull /proc/config.gz
- gunzip config.gz
- mv config .config
- Edited .config: changed "# CONFIG_TUN is not set" to: "CONFIG_TUN=m"
- make ARCH=arm CROSS_COMPILE=/opt/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- modules
- The driver ends up in: drivers/net/tun.ko
- You can verify if it is going to match the kernel by running:
+ strings drivers/net/tun.ko | grep 2.6.29
+ It should produce "vermagic=2.6.29-01117-g4bc62c2 preempt mod_unload ARMv7"
+ The "2.6.29-01117-g4bc62c2" should be the same as the "Kernel version" in "Settings->About phone" on your phone.
* Now you can upload the module to your phone. I did:
- adb shell mount -o remount,rw /dev/block/mtdblock3 /system
- adb push drivers/net/tun.ko /system/lib/modules/
- adb shell mount -o remount,ro /dev/block/mtdblock3 /system
- And you can use adb shell, enter /system/lib/modules and run: insmod tun.ko
- It should work
Click to expand...
Click to collapse
Made some progress, but now stuck getting the tun.ko file copied onto my streak.
Streak 2.1 does not appear to have cp or pull commands.
Cannot push the file over via adb, to where I need it
Cannot move the file
Any help really appreciated.
>adb push tun.ko /system/lib/modules/tun.ko
failed to copy 'tun.ko' to '/system/lib/modules/tun.ko': Permission denied
>adb push tun.ko /sdcard/tun.ko
877408 KB/s (158130 bytes in 0.000s)
>adb shell
$ su
su
# mount -o remount,rw /dev/block/mtdblock3 /system
mount -o remount,rw /dev/block/mtdblock3 /system
#
# mv /sdcard/tun.ko /system/lib/modules/tun.ko
mv /sdcard/tun.ko /system/lib/modules/tun.ko
failed on '/sdcard/tun.ko' - Cross-device link
how did you get it compiled for the streak without the kernel source?
Can we see if I get it working before I comment on that
couldn't you just put in on your sd card and copy over to system/lib/modules once you mount it r/w with root explorer?
I don't appear to have the cp command available
You see I tired to move it (as mv command was available), and that failed.
I'm new to Linux, so maybe I missed something obvious?
>adb shell
$ su
su
# mount -o remount,rw /dev/block/mtdblock3 /system
mount -o remount,rw /dev/block/mtdblock3 /system
#
# mv /sdcard/tun.ko /system/lib/modules/tun.ko
mv /sdcard/tun.ko /system/lib/modules/tun.ko
failed on '/sdcard/tun.ko' - Cross-device link
more coffee, and found CAT is available..
cat /sdcard/tun.ko > /system/lib/modules/tun.ko
appears to have worked, off for some more testing.
can you share that ?
Attached is tun.ko that as you will see below appears to run on my 2.1 Streak
VPNC not currently connecting for me though :/
Code:
[email protected]:~/mydroid/kernel-streak$ adb push drivers/net/tun.ko /sdcard/tun.ko
1572 KB/s (161314 bytes in 0.100s)
[email protected]:~/mydroid/kernel-streak$ adb shell
$ su
# mount -o remount,rw /dev/block/mtdblock3 /system
# cat /sdcard/tun.ko > /system/lib/modules/tun.ko
# mount -o remount,ro /dev/block/mtdblock3 /system
# cd /system/lib/modules
# insmod tun.ko
# exit
$ exit
[email protected]:~/mydroid/kernel-streak$
thank you for sharing. but why doesn't vpnc connect ?
Sorry don't know why vpnc does not connect.
To be honest, I don't know how to tell tun is running properly.
Any advice, places to check logs etc appreciated.
Was interested if it worked for you, as I may just have my vpnc config wrong for our work connection.
Nothing bad has happened since I installed, and ran the tun.ko that I attached, but clearly I should say using it is at your own risk.
For example i see:
Known issues¶
Usernames can not contain the @ symbol
and my usernames do have the @ symobol for my work credentials
w00t! or whatever you say after spending 3 evenings trying to get this working.
Am connected fine, using the tun.ko file I already attached.
Final issue for me was solved by some debug with using a shell on my Streak and command:
Code:
/data/data/org.codeandroid.vpnc_frontend/files/vpnc --script /data/data/org.codeandroid.vpnc_frontend/files/vpnc-script --no-detach --debug 1
To see what was going on, turns out I *just* needed to install Busybox.
So I think what you need to be the same as me is:
2.1 UK Build 6941
Rooted
Busybox install - on marketplace
Then the tun.ko file I posted, and use the commands shown in the same post.
Any problems, just ask.
Did I mention, pretty pleased
it's obvious that you are pleased
let's see:
I have only Android 1.6 on my Dell Streak.
Would that work ?
it's rooted already.
installing BusyBox right now. (why is that needed btw ?)
done !
copied tun.ko to /system/lib/modules
insmod is fine. I can see the module loaded by "lsmod"
configured my company vpn.
btw, my user also has @ sign , is that a problem ?
leave password empty. it asks for password. fine....
"failed to connect"
what do I have to check ?

[Q] loading cifs module

Vegan ginger - loaded the standard with pershoot kernel but it has no cifs support. Replaced with clemsyn and cifs was great but after rebooting my screen hung and eventually I had to revert to my original without cuts. I think there is a way to instruct the pershoot kernel to load cifs support even thought it isn't compiled into the kernel. I'm looking for some step by step instructions to learn how to do that. Anyone know how?
How about reading the instructions posted by pershoots on the very same page from which you downloaded the kernel ?!?
To use one of the kernel modules:
Pull the one you want from lib-2632.39.tar.gz (winrar can open this),
adb remount
adb push MODULE.ko /system/lib/modules/2.6.32.39-cyanogenmod/
adb shell chmod 644 /system/lib/modules/2.6.32.39-cyanogenmod/MODULE.ko
adb shell insmod /system/lib/modules/2.6.32.39-cyanogenmod/MODULE.ko
Click to expand...
Click to collapse
- if you don't use adb then just use "terminal emulator" (from the market or preloaded with the some ROMs).
- replace "MODULE" with "cifs"
- use the lib file appropriate to your ROM and bootloader.
Best of luck,
Yeah - that was helpful !
"How about reading the instructions posted by pershoots on THE VERY SAME PAGE FROM WHICH YOU DOWNLOADED THE KERNEL?!?"
Having a bad day were we???
The kernel came with the rom so I never downloaded a kernel and had no idea where the page was - your link was helpful in that it took me to that page (not on xda forum) so I was able to download the library anyway. Sadly, I am not using cyanogen so the paths listed in the instructions don't apply I don't think. I'm also not using adb yet although I'm working up to it. I can use terminal emulator so that shouldn't be a problem assuming I find where to put the module. Possibly it can go anywhere in the system/lib/modules directory as long as I can point to it? I guess we'll have to try it and see.
The real question that you have raised is "use the lib file appropriate to your ROM and bootloader." How do you determine what is "appropriate"?
So perhaps someone would be willing to share a tad more knowledge and perhaps we will have a thread that other g-tab owners can use to learn from.
Pushing modules in the kernel is the same no matter the rom and vegan ginger is built from cm source anyway
thebadfrog said:
Pushing modules in the kernel is the same no matter the rom and vegan ginger is built from cm source anyway
Click to expand...
Click to collapse
So I downloaded lib-2632.39.tar.gz and unpacked it, searched around and found the cifs.ko file. I'm guessing that I can put that anywhere logical in /system/library and point to it. My app (CIFS Manager) has an option to load via insmod and asks for a path to it. I'm assuming that insmod is available and my app will call it to load the module? I'd also like to know how I would know without someone telling me that the module was in lib-2632.39.tar.gz? Is there some rationale that would tell me how this library and the kernel are related or are these libraries just generic in some way? Thanks for the helping hand.
http://forum.xda-developers.com/showthread.php?t=903505
enigma0456 said:
I would know without someone telling me that the module was in lib-2632.39.tar.gz?
Click to expand...
Click to collapse
The kernel developers who provide the kernels and the extra optional modules provide information on their blogs when they post the availability of the kernel. For example, pershoot's blog has this info, as well as install instructions.
or you ask here.
enigma0456 said:
The kernel came with the rom so I never downloaded a kernel and had no idea where the page was.
Click to expand...
Click to collapse
Sorry I mistakenly assumed since you mentioned pershoot that you have been to his thread (the most active in the development section).
enigma0456 said:
Possibly it can go anywhere in the system/lib/modules directory as long as I can point to it?
Click to expand...
Click to collapse
Yes you certainly can.
enigma0456 said:
How do you determine what is "appropriate"?
Click to expand...
Click to collapse
If you have a gingerbread based ROM download the the lib file with "gb" in its file name.
If you have a the new bootloader on the your gtab use the ones with "newbl" in the file name.
enigma0456 said:
So I downloaded lib-2632.39.tar.gz and unpacked it, searched around and found the cifs.ko file.
Click to expand...
Click to collapse
Thats the wrong file (this is the one for Froyo ROMs).
enigma0456 said:
I'm assuming that insmod is available and my app will call it to load the module?
Click to expand...
Click to collapse
True
enigma0456 said:
I'd also like to know how I would know without someone telling me that the module was in lib-2632.39.tar.gz?
Click to expand...
Click to collapse
You wouldn't.
enigma0456 said:
Is there some rationale that would tell me how this library and the kernel are related or are these libraries just generic in some way?
Click to expand...
Click to collapse
There isn't any, just the developers choice.
^^^^ Good job lol
Thanks - that was really helpful. I like direct answers to questions. So I went and got the right library (looked for gb in name as directed). Moved the module onto my tab into a download directory via usb. Went to /System/Lib via terminal and there was no modules directory. I tried to make one and got an error that the file system is mounted read only. Arghhh I remember fighting with this when I was trying to install another keyboard. I never was able to resolve it. Theoretically "remount" should work but I searched and tried all different examples and I was never able to get it to work for me. I tested my cifs manager and it errors out - providing a base that cifs doesn't work without the module. I'm going to try pointing it at my download folder for now to see if the module would work. That is pretty messy so I would still like to put it in the proper place - if you feel up to it would you instruct me on how to overcome the deadly "mounted read only" file system problem?
________________________________
Update - put the cifs.ko file in /sdcard/download. Went into cifs manager and told it to load via insmod. Made path to cifs.ko = /sdcard/download (also tried /sdcard/download/cifs.ko) In all cases I get the message "... failed no such device". If I turn off the insmod feature I get the same message which leads me to believe that the cifs.ko isn't loading. As a test, I am using the exact same path to share, mount point, etc. on my other tab running Clemsyn/Calkulin that has cifs built into the kernel and it connects almost instantly. It is likely therefor that my problem revolves around this kernel loading cifs. Not sure what I'm doing wrong but suggestions are welcome.
enigma0456 said:
I'm guessing that I can put that anywhere logical in /system/library and point to it.
Click to expand...
Click to collapse
It's better if you put it in the standard place. What's the standard place? The paths in the kernel zip file and the module tar file should give you a clue:
Code:
$ tar -tzvf /mnt/sdcard/kernel/lib-2632.39_gb.tar.gz
drwxr-xr-x root/root 0 2011-04-30 20:14:37 lib/
drwxr-xr-x root/root 0 2011-04-30 20:14:37 lib/modules/
drwxr-xr-x root/root 0 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/
-rw-r--r-- root/root 73 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/modules.ieee1394map
-rw-r--r-- root/root 10709 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/modules.symbols.bin
-rw-r--r-- root/root 271 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/modules.alias
drwxr-xr-x root/root 0 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/
drwxr-xr-x root/root 0 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/
drwxr-xr-x root/root 0 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/sunrpc/
drwxr-xr-x root/root 0 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/sunrpc/auth_gss/
-rw-r--r-- root/root 408035 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/sunrpc/auth_gss/rpcsec_gss_krb5.ko
-rw-r--r-- root/root 532157 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/sunrpc/auth_gss/auth_rpcgss.ko
-rw-r--r-- root/root 3424305 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/sunrpc/sunrpc.ko
Looks like the kernel modules need to be in a lib/modules/KERNEL-VERSION/ directory. That looks very Linux-ish. Can we just untar it to / as we do in Linux? Better check:
Code:
$ ls -l / | /system/xbin/fgrep lib
$
Yikes! No /lib directory at all on Android. Where the heck do the kernel modules go? Let's look at the kernel zip file to see if there is a clue--the unzip on the gTablet doesn't understand this zip file format, so check on a Linux system:
Code:
$ unzip -l boot-cm_2632.39_gb-oc-uv-xtra-vfp_fp-043011.zip
Archive: boot-cm_2632.39_gb-oc-uv-xtra-vfp_fp-043011.zip
Length Date Time Name
--------- ---------- ----- ----
1123 2008-02-28 21:33 META-INF/MANIFEST.MF
1176 2008-02-28 21:33 META-INF/CERT.SF
1714 2008-02-28 21:33 META-INF/CERT.RSA
252000 2008-02-28 19:33 META-INF/com/google/android/update-binary
1015 2098-06-15 19:23 META-INF/com/google/android/updater-script
88544 2098-01-27 05:41 kernel/dump_image
76132 2098-01-27 05:54 kernel/mkbootimg
303 2098-03-22 09:35 kernel/mkbootimg.sh
70992 2098-01-27 05:53 kernel/unpackbootimg
56 2098-01-27 06:09 kernel/unpackbootimg.sh
2219848 2098-06-22 03:05 kernel/zImage
12234 2098-03-04 12:32 system/lib/hw/wlan/LICENSE.TXT
258778 2011-04-30 16:14 system/lib/hw/wlan/bcm4329.ko
249144 2011-04-11 01:13 system/lib/hw/wlan/fw_bcm4329.bin
249467 2011-04-11 01:13 system/lib/hw/wlan/fw_bcm4329_apsta.bin
0 2011-01-07 02:11 system/lib/modules/2.6.32.39-cyanogenmod/placeholder
--------- -------
3482526 16 files
Hmm, there is a placeholder file in system/lib/modules/KERNEL-VERSION/, so /system's where the modules are supposed to go.
Code:
$ su
# /system/xbin/mount -w -o remount /system
# cd /system
# /system/xbin/tar -xzvf /mnt/sdcard/kernel/lib-2632.39_gb.tar.gz
# /system/xbin/mount -r -o remount /system
My app (CIFS Manager) has an option to load via insmod and asks for a path to it. I'm assuming that insmod is available and my app will call it to load the module?
Click to expand...
Click to collapse
Asks a path to what? Insmod or the kernel module?
I'd also like to know how I would know without someone telling me that the module was in lib-2632.39.tar.gz?
Click to expand...
Click to collapse
Kernel functionality, like filesystems, are either built into the kernel or added using kernel modules. (You can also have filesystems implemented in userspace, but, we'll skip that complexity for now). So, the guy who gave you the kernel would either have compiled the filesystem in or must supply the module file for it. First, check if the filesystem is built-in:
Code:
$ cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev tmpfs
nodev debugfs
nodev sockfs
nodev usbfs
nodev pipefs
nodev anon_inodefs
nodev inotifyfs
nodev configfs
nodev devpts
ext3
ext2
ext4
nodev ramfs
vfat
msdos
yaffs
yaffs2
No CIFS, so it's not compiled in; we'll have to load the module:
Code:
$ su
# insmod /system/lib/modules/2.6.32.39-cyanogenmod/kernel/fs/cifs/cifs.ko
# cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev tmpfs
nodev debugfs
nodev sockfs
nodev usbfs
nodev pipefs
nodev anon_inodefs
nodev inotifyfs
nodev configfs
nodev devpts
ext3
ext2
ext4
nodev ramfs
vfat
msdos
yaffs
yaffs2
nodev cifs
Yup, CIFS is there now. But, this sort of thing gets tedious. You can use a shell script to make things easier. Here's what I use to mount my external USB HDD:
Code:
#!/system/bin/sh
PATH=/system/bin:/system/xbin
lsmod | fgrep -q nls_utf8 || insmod /system/lib/modules/`uname -r`/kernel/fs/nls/nls_utf8.ko
lsmod | fgrep -q ntfs || insmod /system/lib/modules/`uname -r`/kernel/fs/ntfs/ntfs.ko
exec mount -r -t ntfs -o fmask=0111,dmask=0022,nls=utf8 /dev/block/sda1 /mnt/usbdisk
Just save the file somewhere and make it executable and run the script as superuser to mount the USB HDD.
Is there some rationale that would tell me how this library and the kernel are related or are these libraries just generic in some way?
Click to expand...
Click to collapse
Since these are kernel modules, they are by definition related, no?
Note that you need a Terminal Emulator and the Superuser app (both from Market) and busybox (also from Market) for the above commands to work. Also, do not type in the prompts (the '$' and '#' characters) at the beginning of the commands. They are there as a reference to show you when you're in superuser mode and when you're a normal user.
enigma0456 said:
I tried to make one and got an error that the file system is mounted read only.
Click to expand...
Click to collapse
remount is specific to "adb", the equivalent in terminal emulator is:
Code:
su root
mount -o remount,rw /system
cp /sdcard/download/cifs.ko /system/lib/modules/cifs.ko
chmod 644 /system/lib/modules/cifs.ko
mount -o remount,ro /system
Then just use "Mount Manager" to load the copied CIFS module, might want to reboot if mount manager failed to do the insmod.
I have been using the above procedure with all pershoot's kernels without a problem.
This should solve your problem,
Best of luck,
I coludn't make it work either. It was in the right folder, suposedly "loaded" but it wasn't working.
I am on the Caulkin/Clemsyn ver 5 (the 1.5GHz) now - exactly because of this inability to load that module. I don't know why pershoot doesn't make it part of the kernel, maybe he doesn't have a PC in the house
Sure, the whole typing thingie in linux/android looks easy if that is what you do 24/7. But for less accustomed with that, all this is likely a turn-off.
SoNic67 said:
I coludn't make it work either. It was in the right folder, suposedly "loaded" but it wasn't working.
I am on the Caulkin/Clemsyn ver 5 (the 1.5GHz) now - exactly because of this inability to load that module. I don't know why pershoot doesn't make it part of the kernel, maybe he doesn't have a PC in the house
Sure, the whole typing thingie in linux/android looks easy if that is what you do 24/7. But for less accustomed with that, all this is likely a turn-off.
Click to expand...
Click to collapse
GScript lite can automate the "whole typing thingie" - just put the insmod command there.
The nice thing about it being a module for the functions you rarely use is, for the 99.999% of the time that you don't need the functionality, it's not taking up memory since its not loaded.
I was just shutting down to get some zzzzs but I fired my PC back up to have a go at this. I worked through part of it - did get the remount working and was able to copy things to the directory and then remount ro. It didn't work yet but I was tired and I may have made a typo. I REALLY appreciate the detailed explanation and examples. This is a page I will refer back to over and over until it becomes second nature. Thanks. Questions:
1. I follow how you arrived at the location (although I don't have a kernel zip file) - is "placeholder" a standard or was that just experience and intuition that informed you?
2. The whole section about un-tarring lib-2632.39_gb.tar.gz - Linux is not my primary language so how did you know that it would un-tar to the proper kernel module directory? Did I miss something?
3. I have to go back and retrace my steps but I tried using both cifs manager and mount manager and they both fail claiming "there is no such device" I tried the manual steps for loading insmod and the cifs.ko as the example described and I get "failed (Exec format error)
Please dispense more wisdom as needed.
enigma0456 said:
Questions:
1. I follow how you arrived at the location (although I don't have a kernel zip file) - is "placeholder" a standard or was that just experience and intuition that informed you?
Click to expand...
Click to collapse
Experience and intuition.
The `placeholder' file is not a standard. On Linux, kernel modules are placed in /lib/modules/KERNEL-VERSION/, and the standard utility (or, program) which we use to load modules, modprobe, looks there for kernel modules. In fact, it's normally unnecessary to manually load modules like we have done. Usually on Linux, because of the standardized module locations, the appropriate modules are automatically loaded when needed.
Things are irritatingly (and unnecessarily) different on Android. There is no modprobe supplied with the system and the busybox modprobe still attempts to use the /lib/modules/... path as on Linux. Which is why you have to resort to insmod and the long-winded path to the kernel module.
I am new to Android myself, and the steps I outlined above are what I used to determine where things should go on the gTablet.
2. The whole section about un-tarring lib-2632.39_gb.tar.gz - Linux is not my primary language so how did you know that it would un-tar to the proper kernel module directory? Did I miss something?
Click to expand...
Click to collapse
You didn't notice the 'cd /system' command before the tar command extracting the kernel modules.
You move to the directory where things should be placed before untar'ing; and when you untar, tar will re-create the directory structure you see in the tar file in the directory you're currently in. Some versions of tar have a `-C' flag which you can use to change the current directory; sort-of like the 'Extract to directory' option you have in GUIs. If you had one of those tar commands you'd do this:
Code:
# /system/xbin/tar -C /system -xzvf /mnt/sdcard/kernel/lib-2632.39_gb.tar.gz
instead of this:
Code:
# cd /system
# /system/xbin/tar -xzvf /mnt/sdcard/kernel/lib-2632.39_gb.tar.gz
3. I have to go back and retrace my steps but I tried using both cifs manager and mount manager and they both fail claiming "there is no such device" I tried the manual steps for loading insmod and the cifs.ko as the example described and I get "failed (Exec format error)
Please dispense more wisdom as needed.
Click to expand...
Click to collapse
The error messages are helpful clues.
The "Exec format error" probably means that you've downloaded the wrong version of the kernel and/or modules. Pershoot supplies 4 versions: for Froyo-ROMs, for Gingerbread-ROMs, for tablets with the new Bootloader and Froyo-ROMs, and tablets with the new Bootloader and Gingerbread-ROMs. Use the correct version for your hardware and ROM.
The "no such device" error message is also a clue. The output of 'cat /proc/filesystems', above, after the cifs module was loaded has a line like:
Code:
nodev cifs
which means that the cifs filesystem is not associated with an actual device file. The "no such device" means that you're (or the program you use is) incorrectly supplying a /dev/... parameter to the mount command, or have screwed up or incorrect options somewhere.
Here's how I mounted a Win 7 share on the gTablet just now. In a Terminal Emulator window:
Code:
$ su
# insmod /system/lib/modules/2.6.32.39-cyanogenmod/kernel/fs/cifs/cifs.ko
# mkdir /mnt/cifs
# mount -t cifs //SERVER-IP-ADDRESS/SHARE-NAME /mnt/cifs -o domain=DOMAIN,username=USERNAME,password=PASSWORD
This method is slightly insecure, though. It's better to create a file with
Code:
domain=DOMAIN
username=USERNAME
password=PASSWORD
and then pass the `credentials=filename' option instead of the `domain=...' above:
Code:
mount -t cifs //SERVER-IP-ADDRESS/SHARE-NAME /mnt/cifs -o credentials=/SOME/PATH/cifs-cred.txt
I know typing all this is a chore, but my goal is to help you troubleshoot things on your own in the future. Linux, and by extension, Android, is good in this regard. It's transparent and very inspectable--if something goes wrong, you can look around, and usually fix things up.
Cheers!
OK - well I tried the manual insmod as in your example and I get the "failed (Exec format error) so I'm going to assume that I still have the wrong module. I'm trying to avoid getting into the changing my kernel project right now so I'll go back and check again on Pershoots page to try and find the version of the kernel that is currently running in my g-tab and the appropriate library that goes with it. The problem must lie there. I was sure I had the right library to go with my 2.6.32.36-cynaogenmod [email protected] #1 but then again, the labeling on his site doesn't reflect a name like that. The best I can find is boot-cm_2632.36_gb-xtra-vfp_fp-032711.zip and the associated lib-2632.36_gb.tar.gz (kernel modules). Is this really the kernel in my g-pad? Don't know how to tell but sems to be the only gingerbread one with that numbering series.
If you use some kernel version X.Y.Z, you have to use the modules that were compiled with that kernel. It's not just the version numbers that have to match--the compilation options might matter too.
I.e., Make sure, you are running the kernel first, then install the modules. Just pick the latest GB (you mentioned you were running VEGAn-gingerbread) kernel from pershoot's page.
1. Download this kernel zip file: boot-cm_2632.39_gb-oc-uv-xtra-vfp_fp-043011.zip
2. Download the associated kernel module file: lib-2632.39_gb.tar.gz
3. Boot into ClockworkMod recovery to install the kernel. At the main menu, choose, "install zip from sdcard". Then select, "choose zip from sdcard", navigate to where you put the kernel zip file, then choose the zip file and apply it.
4. Reboot back into the normal system.
5. Now, follow the steps outlined above to untar the modules in /system. Do *not* use `chmod -R 644' to change permissions recursively. This command *removes* the execute permission from directories which *must* be present. The module tar file should, generally, have the correct permissions already.
6. Try the manual method first: insmod /SOME/PATH/cifs.ko must work, then try the mount command.
7. Unmount using `umount /MOUNT/POINT'.
You can troubleshoot the CIFS manager later.
Coda
This investigation lead me to the kernel naming investigation and the discovery that the module library must be compiled with the kernel that you are using. Obvious now but ... Anyway, in the process of learning about kernels I stumbled upon cyanogenmod so I loaded that onto my tab. I liked the way it works so I took another run at the cifs - and it did not work. I went back and followed these steps and made sure that I found the lib module that matched the kernel that came with my release of cyanogen. I extracted cifs.ko and copied it to the /system/lib/modules directory (I had to make the modules directory) and then I used cifsmanager to try and mount the share and it worked. Next I deleted the modules directory with the module in it and tried to mount the share and it failed. I put it all back and it worked again. So - the instructions preceding this post are sound and, if followed carefully, will work. The key seems to be making sure the lib module is the one that goes with your kernel. Thanks again to all those that contributed to my education!
swan song
enigma0456 said:
I went back and followed these steps and made sure that I found the lib module that matched the kernel that came with my release of cyanogen...
The key seems to be making sure the lib module is the one that goes with your kernel.
Click to expand...
Click to collapse
That may only have worked because CyanogenMod uses pershoot's kernel as its default kernel. Had it used Clemsyn's kernel instead, you may very well have ended up back at square one.
The golden rule is: Get the kernel and the kernel modules from the same guy, because he can (and probably does) build both at the same time. And because of this you can be sure that:
a) The modules were compiled with the correct kernel sources, header files and configuration options.
b) The same compiler was used to compile both the kernel and the modules.
c) The same compiler flags, like optimizations, were used for the compilations. In rare cases, I've seen mismatches here causing problems.
In most cases however, esp. on an architecture like the x86 which is very forgiving, slightly mismatched kernels and modules won't cause problems, but, this is not the sort of thing you should be futzing around with--unless you're a wizard.
I have 4 different versions of GCC (2 each for x86 and x86-64--stable and latest), the Intel C compiler v11, and 3 different compilers for the ARM (Android NDK, the prebuilt one from the Aboriginal Linux project and the latest GCC cross-compiled for the ARM). I use different version for different things and stick to each consistently.
OK, so kernels and modules have to be compiled together, but, what about userspace? Do normal programs have to be recompiled if you change the kernel?
No, not (generally) required. The Linux kernel developers have gone to great lengths to make sure that the kernel interface to userspace stay the same--in fact, it would only be a mild exaggeration to say that the kernel guys would rather give away their first-borns than break the userspace API.
This is the reason why you can run Clemsyn kernels on TnT-Lite, or pershoot kernels on VEGAn-Gingerbread, or whatever other combo you prefer.

[Q] tun/tap driver on gsb 3.7

since i only have 1 post, can anyone tell me how to get the tuntap driver to load on gsb 3.7? im trying to use the cisco anyconnect for rooted devices, but it appears that cm7 doesn't have the tun/tap driver installed correctly. i was able to download a tun.ko and put it in /system/lib/modules, but it won't execute with insmod (Exec format error).
Can you post the exact steps you followed, adb commands used, and any reference materials you used?
The first question I had after reading your post was I wondered if you changed permissions after loading the new file to /system.
Good Luck,
i was trying to get the cicso anyconnect for rooted devices to work, so i followed the following thread:
http://forum.xda-developers.com/showthread.php?t=1164088
i got it copied by remounting the /system mount to rw, then copied the tun.ko file to /system/lib/modules
after that, i did chmod 644 to match the other module in there (wlan.ko) and they are both owned by root.
drwxr-xr-x 1 root root 2048 Jul 10 16:38 .
drwxr-xr-x 1 root root 2048 Jul 10 16:38 ..
drwxr-xr-x 1 root root 2048 Jul 10 16:38 2.6.29-DecaFuctCFS-dirty-9ff84b92
-rw-r--r-- 1 root root 213388 Jul 14 08:28 tun.ko
-rw-r--r-- 1 root root 620128 Aug 1 2008 wlan.ko
then,
insmod /system/lib/modules/tun.ko
insmod: init_module '/system/lib/modules/tun.ko' failed (Exec format error)
mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
once done
mount -o ro,remount -t yaffs2 /dev/block/mtdblock1 /system
will mount the /system partition back to read only.
Click to expand...
Click to collapse
did this to mount /system as read/write.
What tun.ko module are you trying to use? Try the tun.ko from inside the attached zip which was compiled for Conap's kernel.
Edit: removed attached zip as it doesn't work either
from the app description:
COMPATIBLE DEVICES:
This release supports rooted Android 2.1+ devices. A compatiable tun.ko module is required, which should be placed in /data/local/kernel_modules/ if the tun module is not built into the kernel. The iptables binary is also required.
For those without root access, a fully supported production AnyConnect for a set of Samsung platforms is available as a separate download from the Android Market.
We cannot guarantee compatibility, but look forward to your feedback.
Click to expand...
Click to collapse
i'll try this too. i suppose it would have helped to read the entire app description.
\EDIT: nevermind, that folder doesn't even exist on gsb 3.7
sirblacknite said:
from the app description:
This release supports rooted Android 2.1+ devices. A compatiable tun.ko module is required, which should be placed in /data/local/kernel_modules/ if the tun module is not built into the kernel. The iptables binary is also required.
Click to expand...
Click to collapse
i'll try this too. i suppose it would have helped to read the entire app description.
\EDIT: nevermind, that folder doesn't even exist on gsb 3.7
Click to expand...
Click to collapse
Not sure if it will help but you could create the /data/local/kernel_modules directory and either place tun.ko there or symlink /system/lib/modules that contains tun.ko to the kernel_modules directory. Using adb shell or terminal emulator:
Code:
su
mkdir /data/local/kernel_modules
ln -s /system/lib/modules /data/local/kernel_modules
iptables support is included in the ROM but if you want to try providing the binary in the directory they specify, you can copy it from /system/bin
didnt' seem to make a difference. i copied the tun.ko from the zip you posted (for conaps kernel) to /system/lib/modules and it still gives the error.
# ls -al /system/lib/modules
ls -al /system/lib/modules
drwxr-xr-x 1 root root 2048 Jul 18 09:09 .
drwxr-xr-x 1 root root 2048 Jul 10 16:38 ..
drwxr-xr-x 1 root root 2048 Jul 10 16:38 2.6.29-DecaFuctCFS-dirty-9ff84b92
-rw-r--r-- 1 root root 160908 Jul 18 09:09 tun.ko
-rw-r--r-- 1 root root 620128 Aug 1 2008 wlan.ko
# insmod /system/lib/modules/tun.ko
insmod /system/lib/modules/tun.ko
insmod: init_module '/system/lib/modules/tun.ko' failed (Exec format error)
Click to expand...
Click to collapse
I get the same error when trying to insert it on my Eris running Evervolv Build 4. Or do I need a different tun.ko for that? Thanks.
sirblacknite said:
didnt' seem to make a difference. i copied the tun.ko from the zip you posted (for conaps kernel) to /system/lib/modules and it still gives the error.
Click to expand...
Click to collapse
snortman said:
I get the same error when trying to insert it on my Eris running Evervolv Build 4. Or do I need a different tun.ko for that? Thanks.
Click to expand...
Click to collapse
I've tried three different tun.ko modules but none seem to work. I pulled one from GSB 2.3 when workshed included a version to see if it would work, I also tried the one I posted that was from Conap's DecafuctCFSv9 kernel, and another that is in Evervolv(I assume it's a HeroC version).
Not sure if anyone ever found/compiled a tun.ko that worked for the gingerbread roms. It could be that one hasn't been built for the unreleased version of Conap's kernel that is used on all of these roms. I might try to figure out how to compile conap's kernel from his source with the tun.ko module getting built as well.
MongooseHelix said:
I've tried three different tun.ko modules but none seem to work. I pulled one from GSB 2.3 when workshed included a version to see if it would work, I also tried the one I posted that was from Conap's DecafuctCFSv9 kernel, and another that is in Evervolv(I assume it's a HeroC version).
Not sure if anyone ever found/compiled a tun.ko that worked for the gingerbread roms. It could be that one hasn't been built for the unreleased version of Conap's kernel that is used on all of these roms. I might try to figure out how to compile conap's kernel from his source with the tun.ko module getting built as well.
Click to expand...
Click to collapse
That would be cool. Thank you for your help so far on this.
Mongoose,
That would be awesome if you got the time and were able to do that. I suppose I could give it a stab myself, but I would have to get my dev environment setup first. Or if Cisco would just release a version that didn't require tun.ko, that would be great too (and would be something we could actually use in the company, without suggesting to some of these people who can barely use computers that they need to root their phone).
any update on this?
I've not forgotten about it but haven't had the time to look into it any and learn about kernel stuff. I did ask workshed if anyone found or compiled a working tun.ko module for CM7/GSB and he said no. Like I had suspected, he said someone would need to compile the kernel with it included. I'm not sure how difficult it is to figure out so we'll see if one of us can give it a go at some point.
I compiled and attached a new version of tun.ko that should work for ROMs using kernel version 2.6.29-DecaFuctCFS-dirty-9ff84b92. It's attached below. If the ROM devs would like to include a version of Conap's kernel with built-in tun.ko support, that could probably be done as well.
I haven't actually tested out any VPN stuff so you all will have to report back if it is in fact working. Hope it does!
Instructions:
* Download tun.zip and extract tun.ko
Code:
adb remount
adb push tun.ko /system/lib/modules/
adb shell
cd /system/lib/modules
chmod 644 tun.ko
insmod tun.ko
* check that it was inserted by typing the command "lsmod" which should output something like "tun 11252 0 - Live 0xbf000000"
that totally worked!
too bad i didnt catch it until the day my new phone was out for delivery, but at least i have something to show my employer that anyconnect actually does work on android.

[Q] init.d doesn't get executed

i made a file called "99mount" with a the content
mount -o bind /emmc /mnt/sdcard/external_sd
however, it isn't being executed an start tried also
busybox mount -o bind /emmc /mnt/sdcard/external_sd
and no luck, do i need to add 99mount to some xx.rc file?
im using siyah kernel and hydrogenics btw
toinktoink said:
i made a file called "99mount" with a the content
mount -o bind /emmc /mnt/sdcard/external_sd
however, it isn't being executed an start tried also
busybox mount -o bind /emmc /mnt/sdcard/external_sd
and no luck, do i need to add 99mount to some xx.rc file?
im using siyah kernel and hydrogenics btw
Click to expand...
Click to collapse
Using Siyah kernel, placing the script file in system/etc/init.d should do it.
Are there other files in init.d folder?
Try to remove all other file from init.d folder, re-flash the kernel and reboot the phone.
Good luck !
Maybe the script should be executable ?
chmod +x filename ?
I was trying exactly the same thing today
I can get it to work like this
Code:
#!/system/bin/sh
mount -o bind /mnt/emmc /mnt/sdcard/external_sd
Putting the file in the init.d folder is not enough, you need Script Manager app and set it to run as root + run at boot
You can also run it straight away, but it will not stick on reboot.
I need a solution without using any extra app....
EDIT:
I also tried this (hoping that it would work without Script Manager)
Code:
#!/system/xbin/sh
mount -o bind /mnt/emmc /mnt/sdcard/external_sd
but it does not do the trick
I noticed that there a sh file in the bin folder, but not in the xbin folder...could this be the reason? It shouldn't as lines beginning with # aren't normally parsed...
Is there an incompatibility with Busybox or what exactly is wrong here?
P.S. I'm using Slim ICS (with Siya most of the time)
It_ler said:
Using Siyah kernel, placing the script file in system/etc/init.d should do it.
Are there other files in init.d folder?
Try to remove all other file from init.d folder, re-flash the kernel and reboot the phone.
Good luck !
Click to expand...
Click to collapse
i am using siyah with hydrogen ics, and that is what i did and it isn't working
i messed up my phone, now menu and back button doesn't work T_T
anybody? please help!

CIFS Module for MOJO Kernel 3.4.35

Alright, finally we have CIFS support on MJO.
Cross compiled on ArchLinux from the sources posted by Rich, config pulled from /proc/config.gz and just compiled the CIFS+md4 module.
Works great here:
Code:
//10.0.0.11/vault 3.6T 2.9T 709.1G 81% /mnt/shell/emulated/0/vault
Make sure you have root, insmod md4.ko, insmod cifs.ko and enjoy! I'm using this to access my MP3s for aMPD so that my Mojo can act as my stereo too.
*edit* also make sure you have busybox installed in order to mount, and pass a username option. ie:
Code:
busybox mount -ousername=guest //1.1.1.1/share /sdcard/share
vostok4 said:
Alright, finally we have CIFS support on MJO.
Cross compiled on ArchLinux from the sources posted by Rich, config pulled from /proc/config.gz and just compiled the CIFS+md4 module.
Works great here:
Code:
//10.0.0.11/vault 3.6T 2.9T 709.1G 81% /mnt/shell/emulated/0/vault
Make sure you have root, insmod md4.ko, insmod cifs.ko and enjoy! I'm using this to access my MP3s for aMPD so that my Mojo can act as my stereo too.
*edit* also make sure you have busybox installed in order to mount, and pass a username option. ie:
Code:
busybox mount -ousername=guest //1.1.1.1/share /sdcard/share
Click to expand...
Click to collapse
That's a good idea.. just updating the modules rather then the actual kernel.
By any chance, would you know how to approach updating the kernel on the mojo?
Thank you! These modules worked for me. However I was getting an "invalid parameter" error message. Finally I had to work around it as:
Code:
busybox mount -o unc=\\\\192.168.0.2\\share name,username=myself,password=password1 -t cifs none /mnt/point
It may depend on the version of busybox..
@gwaldo if you wanted to flash a custom kernel this is what I would do:
Code:
[email protected]:/ # ls -al /dev/block/platform/sdhci-tegra.3/by-name
ls -al /dev/block/platform/sdhci-tegra.3/by-name
lrwxrwxrwx root root 2014-04-13 18:31 APP -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 2014-04-13 18:31 CAC -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 2014-04-13 18:31 DTB -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 2014-04-13 18:31 LNX -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 2014-04-13 18:31 MDA -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 2014-04-13 18:31 MSC -> /dev/block/mmcblk0p6
lrwxrwxrwx root root 2014-04-13 18:31 SOS -> /dev/block/mmcblk0p1
lrwxrwxrwx root root 2014-04-13 18:31 TMP -> /dev/block/mmcblk0p9
lrwxrwxrwx root root 2014-04-13 18:31 UDA -> /dev/block/mmcblk0p10
lrwxrwxrwx root root 2014-04-13 18:31 USP -> /dev/block/mmcblk0p7
[email protected]:/ #
key line:
Code:
lrwxrwxrwx root root 2014-04-13 18:31 LNX -> /dev/block/mmcblk0p3
grab the boot image:
Code:
cat /dev/block/mmcblk0p3 > /sdcard/boot.img
load it in archikitchen: http://forum.xda-developers.com/showthread.php?t=2597220
create a barebones project, put the boot.img in the project folder, unpack. gives us:
Code:
./kernel
./kernel/boot.img-cmdline
./kernel/boot.img-kerneloff
./kernel/boot.img-zImage
./kernel/ramdisk
./kernel/ramdisk/ueventd.goldfish.rc
./kernel/ramdisk/init.nv_dev_board.usb.rc
./kernel/ramdisk/proc
./kernel/ramdisk/data
./kernel/ramdisk/init.rc
./kernel/ramdisk/init.mojo.rc
./kernel/ramdisk/ueventd.mojo.rc
./kernel/ramdisk/system
./kernel/ramdisk/sys
./kernel/ramdisk/init.usb.rc
./kernel/ramdisk/init
./kernel/ramdisk/default.prop
./kernel/ramdisk/sbin
./kernel/ramdisk/sbin/watchdogd
./kernel/ramdisk/sbin/ueventd
./kernel/ramdisk/sbin/adbd
./kernel/ramdisk/init.trace.rc
./kernel/ramdisk/fstab.mojo
./kernel/ramdisk/dev
./kernel/ramdisk/init.qvs.rc
./kernel/ramdisk/init.tf.rc
./kernel/ramdisk/init.goldfish.rc
./kernel/ramdisk/ueventd.rc
./kernel/boot.img-tagsoff
./kernel/boot.img-ramdiskoff
./kernel/boot.img-ramdisk.gz
./kernel/boot.img-base
./kernel/boot.img-pagesize
./META-INF
./META-INF/com
./META-INF/com/google
./META-INF/com/google/android
./META-INF/com/google/android/update-binary
./META-INF/com/google/android/updater-script-85_USER
./META-INF/com/google/android/updater-script-10_SYMLINKS
./META-INF/com/google/android/updater-script-99_TAIL
./META-INF/com/google/android/updater-script-90_KERNEL
./META-INF/com/google/android/updater-script-80_EXEC
./META-INF/com/google/android/updater-script-91_MODEM
./META-INF/com/google/android/updater-script-00_HEAD
./META-INF/com/google/android/updater-script-20_PERMISSIONS
./META-INF/com/google/android/updater-script
./system
./boot.img
Replace
Code:
./kernel/boot.img-zImage
with a new built kernel, repack the boot image, and you can try to boot it with fastboot without killing anything:
Code:
fastboot boot newboot.img
Should work. I will experiment in a few days when I get more time, perhaps.
vostok4 said:
@gwaldo if you wanted to flash a custom kernel this is what I would do:
...
Should work. I will experiment in a few days when I get more time, perhaps.
Click to expand...
Click to collapse
Hi vostok4, thanks for the reply.
I used the zip config from the mojo and use my kernel with the extracted initramfs from the boot.img in mojo-signed-ota-MO0202-WW.zip firmware update.
./fastboot-linux -i 0x0738 boot zImage.gwald initramfs.cpio.gz
Click to expand...
Click to collapse
It boots fine and can confirm it booted the kernel via google's setting.
I add more FS (NTSF/exfat write) support in the kernel but I'm not familiar with androids permissions.
Just cautious with it.
It would be nice if there was a system recovery image so if we made a mistake we can reset it to factory.
I kinda left it there for a while.. not sure what else to add
From a recovery standpoint with the kernel, you already have the boot.img from the update, so you can always boot that... And the device auto goes into fastboot for you, so I think a recovery from every brick should be possible.
Words are cheap though
vostok4 said:
From a recovery standpoint with the kernel, you already have the boot.img from the update, so you can always boot that... And the device auto goes into fastboot for you, so I think a recovery from every brick should be possible.
Words are cheap though
Click to expand...
Click to collapse
Oh I meant doing something wrong on the filesystem, there's no rom/image for it , NAND I think it's called, the Android OS partition.
Like the guy that changed his permissions and made his entire MOJO readonly.. I think the only fix is the reflashing.
I did post about a guy who found the recovery menu on the MOJO
http://www.freaktab.com/showthread.php?12075-FOUND-MAD-CATZ-M-O-J-O-RECOVERY-MENU
So, that could work, haven't tried..
gwaldo said:
Oh I meant doing something wrong on the filesystem, there's no rom/image for it , NAND I think it's called, the Android OS partition.
Like the guy that changed his permissions and made his entire MOJO readonly.. I think the only fix is the reflashing.
I did post about a guy who found the recovery menu on the MOJO
http://www.freaktab.com/showthread.php?12075-FOUND-MAD-CATZ-M-O-J-O-RECOVERY-MENU
So, that could work, haven't tried..
Click to expand...
Click to collapse
I think working with similar key combinations to enable nvidia recovery mode is more important. That way with nvflash we can make a copy of a clean install, and always be able to flash it back. My mojo always goes to this mode when I try the fastboot method, but it might be a special unit
Can I ask you which toolchain you used / which guide you followed? I'm following the guide at http odroid.us/mediawiki/index.php?title=Step-by-step_Cross-compiling_a_Kernel but I'm having some problem (the compiled modules wind up being armv5 instead of armv7) and I'm noob at cross compiling.
paulatz said:
Can I ask you which toolchain you used / which guide you followed? I'm following the guide at http odroid.us/mediawiki/index.php?title=Step-by-step_Cross-compiling_a_Kernel but I'm having some problem (the compiled modules wind up being armv5 instead of armv7) and I'm noob at cross compiling.
Click to expand...
Click to collapse
Looks like how I did it, I use mint linux
i don't have much of a cheap sheet, but I'll post it when I get on my PC.
gwaldo said:
Looks like how I did it, I use mint linux
i don't have much of a cheap sheet, but I'll post it when I get on my PC.
Click to expand...
Click to collapse
Don't worry, I have managed to do it using the official ndk from google (I'll post the details if someone ask for them when I can find the time).
I have compiled uvcvideo.ko, but it still is not working (uvcvideo: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)), but I do not want to hijack you thread. I'll open a specific one if I can find the time to work on the issue for real.
Just for more information here, I compile on ArchLinux and use the following make line:
Code:
$ CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm make
With the following packages from the AUR (kernel headers package was modified to get the correct version):
Code:
arm-linux-gnueabi-binutils 2.24-1
arm-linux-gnueabi-eglibc 2.18-1
arm-linux-gnueabi-gcc 4.8.2-1
arm-linux-gnueabi-linux-api-headers 3.4.35-1
paulatz said:
Don't worry, I have managed to do it using the official ndk from google (I'll post the details if someone ask for them when I can find the time).
I have compiled uvcvideo.ko, but it still is not working (uvcvideo: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)), but I do not want to hijack you thread. I'll open a specific one if I can find the time to work on the issue for real.
Click to expand...
Click to collapse
It's not my thread, but here's what I do:
Mint Linux 14 (i know its old)
I downloaded the build chains:
https://github.com/DooMLoRD/android_prebuilt_toolchains/
Install extra utils:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
Click to expand...
Click to collapse
Export env vars:
export CROSS_COMPILE=/home/-USER-/-DIR-/android_prebuilt_toolchains-master/arm-eabi-linaro-4.6.2/bin/arm-eabi-
export ARCH=arm
Click to expand...
Click to collapse
Prepare the kernel
make clean && make mrproper
Click to expand...
Click to collapse
extract the kernel from your MOJO kernel.zip and place in the kernel folder.
make your changes:
make menuconfig
Click to expand...
Click to collapse
Compile it:
make -j5
Click to expand...
Click to collapse
how to install cifs module
vostok4 said:
Alright, finally we have CIFS support on MJO.
Cross compiled on ArchLinux from the sources posted by Rich, config pulled from /proc/config.gz and just compiled the CIFS+md4 module.
Works great here:
Code:
//10.0.0.11/vault 3.6T 2.9T 709.1G 81% /mnt/shell/emulated/0/vault
Make sure you have root, insmod md4.ko, insmod cifs.ko and enjoy! I'm using this to access my MP3s for aMPD so that my Mojo can act as my stereo too.
*edit* also make sure you have busybox installed in order to mount, and pass a username option. ie:
Code:
busybox mount -ousername=guest //1.1.1.1/share /sdcard/share
Click to expand...
Click to collapse
sorry, bui I don't understand how install the cifs module -cifs-module-kernel-3.4.35.zip-
Could anyone support me, please
darkodarko said:
sorry, bui I don't understand how install the cifs module -cifs-module-kernel-3.4.35.zip-
Could anyone support me, please
Click to expand...
Click to collapse
What are you doing exactly? Which result do you expect? Which result do you get instead?
cheers
paulatz said:
What are you doing exactly? Which result do you expect? Which result do you get instead?
cheers
Click to expand...
Click to collapse
I want connect my mojo with my nas through cifs and mount a specific folder.
I rooted mojo whit MMM MoDaCo Mod.
but I dont have any idea how use the cifs-module-kernel-3.4.35.zip file
Thanks in advance
You need to put the archive somewhere on your MOJO, and run the following as root:
insmod md4.ko
insmod cifs.ko
Then you can mount using either mine or gwaldo's mount line.
I can write up how I got it to automount later, in order for the mount to be accessible to every application it has to be outside of /sdcard, I did mine in /mnt/share, and have it mounting on boot (in an ugly method).
darkodarko said:
I want connect my mojo with my nas through cifs and mount a specific folder.
I rooted mojo whit MMM MoDaCo Mod.
but I dont have any idea how use the cifs-module-kernel-3.4.35.zip file
Thanks in advance
Click to expand...
Click to collapse
You need to extract the content of the zip file onto a usb drive/MICROSD and copy the files to the MOJO.
Then follow vostok4's instructions
in busybox (with root permission)
cd to-where-you-put your .ko files (you need to know linux command line)
then run
insmod md4.ko
insmod insmod cifs.ko
Then you need to mount it as below:
vostok4 said:
Alright, finally we have CIFS support on MJO.
Make sure you have root, insmod md4.ko, insmod cifs.ko and enjoy! I'm using this to access my MP3s for aMPD so that my Mojo can act as my stereo too.
*edit* also make sure you have busybox installed in order to mount, and pass a username option. ie:
Code:
busybox mount -ousername=guest //1.1.1.1/share /sdcard/share
Click to expand...
Click to collapse
PS: you'll need to do this EVERYTIME you reboot/restart MOJO.
PS2: I haven't done this my self but that's my understanding.
OK, in order to not do it everytime manually, I have something like this (note the sleep 30 is ugly but I didn't bother writing a method to trigger on network connectivity). This requires busybox installed (I use this one: https://play.google.com/store/apps/details?id=stericson.busybox)
If you aren't comfortable with manually mucking around, then I'm not sure what to tell you to This is assuming you have root and busybox installed.
In order to create files under /system and /etc you need to mount /system as read-write:
Code:
$ su
# mount -orw,remount /system
# cp /sdcard/install-recovery.sh /etc/
# chmod 777 /etc/install-recovery.sh
# mount -oro,remount /system
That would copy install-recovery.sh from the sdcard (we need to do this because we have a secure boot and can't adb push to /etc). It also sets the file as executable (we want that). SO, these are the files you need:
/etc/install-recovery.sh (needs chmod 777)
Code:
#!/system/bin/sh
# fake init.d support
/system/bin/sysinit
/system/bin/sysinit (needs chmod 777)
Code:
#!/system/bin/sh
# fake init.d support
# the script below is what i use to mount my cifs share
/system/bin/sh '/system/etc/init.d/99vault'
# these are commented out, but run-parts would be the proper way to use the init.d folder
# however I couldn't get it to work on my mojo, so i just call the script directly
#export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
#run-parts /system/etc/init.d
/etc/init.d/99vault (or /system/etc/init.d/99vault if you expand the symlink) (needs chmod 777)
Code:
#!/system/bin/sh
/system/xbin/busybox mount -orw,remount /
# sometimes disappears on reboot, lets just create the mount folder to be safe
/system/xbin/busybox mkdir /mnt/vault
/system/xbin/busybox mount -oro,remount /
# mount our cifs module
/system/xbin/busybox insmod /system/etc/cifs/md4.ko
/system/xbin/busybox insmod /system/etc/cifs/cifs.ko
# wait for network to come online
sleep 30
# mount the actual share
/system/xbin/busybox mount -ousername=guest //10.0.0.11/vault /mnt/vault
That will get you mounted after each reboot without fail, at least in my experience.
did someone managed to make it work on cm 12.1?

Categories

Resources