[KERNEL] [15/08] CIFS module for HTC's OTA 2.6.32.15 kernel - Desire Android Development

How i got it working..
You may've seen me nagging around the forums for a sense-ui 2.2 rom with the cifs module in it. It looked like only the non-HTC roms have this module currently, that is, roms with a non-HTC custom compiled kernel.
This got me curious as to why, since people have compiled ext4 and tun modules for it just fine, they're in plenty of HTC kernel based roms.
So i got a cross-compile toolkit last night, and went looking for the closest kernel source i could find, and that turned out to be the msm branch of 2.6.32.9. I haven't even compiled a linux kernel in about 2 years, the last time i worked on kernel code was about 4 years ago, and i've never tried to make a module for a kernel that i don't have the source for. Meaning i got caught out with magic differences due to localversion appends etc, but eventually i built a cifs.ko that'd insmod.
I imagine that's how people made their ext4 and tuns (vpn) modules for the HTC built 2.6.32.15 too. So why no cifs module floating around for it already? Inserting the module fails with missing symbol errors for slow_work functions.
A patch was added after 2.6.31 called slow_work, that essentially stops certain filesystem activities blocking excessively. If you enable cifs in 2.6.32, even as a module, it requires slow_work to be enabled on your kernel. Likewise if you don't enable CIFS then slow_work isn't built into your kernel. Curiously the only two filesystems are cifs and gfs2 that require a slow_work enabled kernel.
HTC made the kernel, they didn't include cifs, it doesn't have slow_work enabled, so you can't fudge a module for it. Well, unless you edit out the slow_work code from the cifs filesystem in 2.6.32. As luck would have it, slow_work provided additional functionality, but didn't replace any.
So i edited out the slow_work code from the cifs headers and source files. Get the module for HTC's 2.6.32.15 below.
Edit: Changed the source from android git 2.6.32.9 to HTC's 2.6.32.15. Updated to remove debug symbols and tidied up the oplock code just in case anyone is writing many files to heavy traffic shared drives. UTF8 module included now also for non-ASCII filenames. Full credit to snq- for the tip on debug symbol stripping, the idea of including unicode support, and making me consider people might use this for writes on busy shares.
http://rapidshare.com/files/413103029/cifs.zip
For anyone interested i cross-compiled this using Sourcery G++ Lite 2010q1-188 for ARM EABI on ubuntu x86 installed to a virtualbox VM, with the 2.6.32.15 kernel source from the HTC incredible.
What's so good about CIFS anyway?
Support for CIFS lets you log into windows network shares from a linux OS and mount them as part of the linux filesystem. How's that any different to the SMB aware file managers like Astro or estrong file explorer? Transparent file streaming.
With a software client you can list and copy files from your windows share to your phone. If you instead mount the windows share into your filesystem, you can use files that're on the server as if they're already on the phone.
For example i'm connected to my home network right now over wifi and just opened a 700MB avi file instantly, as if it were already on my sdcard, instead of waiting 5-10 minutes for it to copy over usb, or half the movie's actual duration for it to copy over wifi.
Combine it with VPN and that's like having your entire movie/music collection on your phone anywhere you can get a broadband connection. No copying, no waiting, no ugly transcoding or streaming media servers, just use the files as if you already put them on the SD card.
The only real limiting factor is when the file's encoded bitrate exceeds your connection bitrate, eg. playing a 320kbit mp3 on a 200kbit EDGE connection.
How do i use this CIFS module?
You need a rooted phone with the official OTA 2.6.32.15 kernel, and possibly busybox too (for a mount binary with cifs support).
Quick and ugly instructions are to download the file above, copy it somewhere on your phone, eg. /sdcard/cifs.ko, and do the following as su in a terminal...
Code:
mkdir /sdcard/share
insmod /sdcard/cifs.ko
busybox mount -t cifs //192.168.0.1/sharedfolder /sdcard/share -o username=user,password=pass
Replace //192.168.0.1/sharedfolder with your windows share server name or ip and the folder you wish to access. Replace user and pass with your username and password, naturally.
For more detailed instructions on automating the mount and umount etc, there's an excellent thread here...
http://forum.xda-developers.com/showthread.php?t=733490
and also..
http://forum.xda-developers.com/showthread.php?t=740695
Note to ROM authors
Any rom authors using 2.6.32.15 who would like to include this module in their rom, you're quite welcome to. You don't need to credit me either, although it would be nice.

Nice work buddy, I will test this out when I get back home.

Nice! Thanks for the module!
FYI: HTC just released the HTC EVO 4G - MR release - 2.6.32 kernel source and
Droid Incredible by HTC (Verizon) - MR release - 2.6.32 kernel source code.

It's working flawlessly!! Thanks you very much for this. And as you looks skilled, now pls try to find a way, how to connect bluetooth keyboard in Sense ROM and you are definitely my hero

insmod /sdcard/cifs.ko -> exec format error
busybox insmod /sdcard/cifs.ko ->invalid module format...
Why is that? Using nextsense with 2.6.32.15 kernel
Thanks
Sent from my HTC Desire using XDA App

maslinar said:
insmod /sdcard/cifs.ko -> exec format error
busybox insmod /sdcard/cifs.ko ->invalid module format...
Why is that? Using nextsense with 2.6.32.15 kernel
Thanks
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
Go to software information on the phone, is your kernel listed as Linux-2.6.32.15-gf9c0527? This module is built for the specific HTC OTA build of the 2.6.32.15 kernel only.
ranwej said:
It's working flawlessly!! Thanks you very much for this. And as you looks skilled, now pls try to find a way, how to connect bluetooth keyboard in Sense ROM and you are definitely my hero
Click to expand...
Click to collapse
It's pretty much impossible to get bluetooth keyboards working on the HTC kernel without it's source code, since it'd require a full kernel recompile to enable it. Although the current HTC kernel has bluetooth HID support enabled, it doesn't have keyboard support enabled in the input devices section. Keyboard support can't be built as a module, only built into a kernel. Sorry!
If anyone is using gscript to automate their cifs mount/umount, i made up a little script to toggle the mount, for use as a gscript homescreen shortcut.
Code:
if test -f /sdcard/sharefolder/mounted.txt
then
busybox umount /sdcard/sharefolder
else
insmod /path/to/cifs.ko
busybox mount -t cifs //192.168.0.2/sharename /sdcard/sharefolder -o username=user,password=pass
fi
busybox df -h
Create a file called mounted.txt in the root of your shared drive, this is used to detect if the share is currently mounted.
replace /sdcard/sharefolder with the name of the directory you're mounting the share on.
replace /path/to/cifs.ko with your path to the cifs.ko module.
replace //192.168.0.2/sharename with your server ip and share name.
replace user and pass with your username and password.
Lastly the df -h is there for visual confirmation whether the share is mounted or not, it'll always be the last line of df -h when it's mounted, the bottom of the gscript window.

Thanks Myshkinbob,
It works
Just one problem.
I add my music as a share, I can play all songs but just a song at a time cannot have a playlist.
Is a way to do this with the default music player? or do I need another player?
Once more thanks Myshkinbob for this.
JoseF
Found solution using Astroplayer

excellent worked great for me

After loading the module and typing this:
Code:
busybox mount -t cifs //192.168.1.5/Shows /sdcard/share/shows -o username=XXX,password=XXX
I'm getting this error:
Code:
mount: mounting //192.168.1.5/Shows on /sdcard/share/shows failed: Cannot allocate memory
Any thoughts?

Demp said:
After loading the module and typing this:
Code:
busybox mount -t cifs //192.168.1.5/Shows /sdcard/share/shows -o username=XXX,password=XXX
I'm getting this error:
Code:
mount: mounting //192.168.1.5/Shows on /sdcard/share/shows failed: Cannot allocate memory
Any thoughts?
Click to expand...
Click to collapse
I had the same error connecting to one computer, if you try to connect using estrongs file manager (free version), that will fail also? Switch estrongs to LAN, hit menu, click new, click scan, then select the PC you're trying to get cifs to connect to. I wouldn't use Astro SMB, it seems a little buggy in 2.2, for me at least.
Just to elaborate, i did all my testing on my desktop pc, windows 7 ultimate x64, and that connected fine. When it came to connecting to my media center pc, windows 7 ultimate x86, i got the same memory allocation error you're seeing.
Estrongs file manager failed to connect also, so i knew it wasn't a cifs module bug. Both machines are on the same network, same firewall settings, it was a real puzzle why the desktop was reachable, and the media pc wasn't.
Does your computer have a long name by any chance? It's a bit bizarre, but my desktop has a very short name, bob-pc, and my mediacenter had a long name, mediacenter-pc. I changed the mediacenter-pc name to media-pc which then required a reboot, and restarted my desire to clear the DNS cache. When i tried now, estrongs file manager could connect, and my cifs mount no longer gave a memory allocation error.
So i'd try pinging 192.168.1.5 from your phone first, then check sharing settings on the pc and that your firewall considers the phone trusted or in a trusted ip range, then if that's all good, try giving the computer a shorter name if it has a long one, and rebooting everything.
I'd recommend you do the connectivity testing with estrongs file manager's LAN - menu - New - Scan, since it rules out any serious user error such as typos in the mount command or mounting to a non-existent directory.

Myshkinbob said:
I had the same error connecting to one computer, if you try to connect using estrongs file manager (free version), that will fail also? Switch estrongs to LAN, hit menu, click new, click scan, then select the PC you're trying to get cifs to connect to. I wouldn't use Astro SMB, it seems a little buggy in 2.2, for me at least.
Just to elaborate, i did all my testing on my desktop pc, windows 7 ultimate x64, and that connected fine. When it came to connecting to my media center pc, windows 7 ultimate x86, i got the same memory allocation error you're seeing.
Estrongs file manager failed to connect also, so i knew it wasn't a cifs module bug. Both machines are on the same network, same firewall settings, it was a real puzzle why the desktop was reachable, and the media pc wasn't.
Does your computer have a long name by any chance? It's a bit bizarre, but my desktop has a very short name, bob-pc, and my mediacenter had a long name, mediacenter-pc. I changed the mediacenter-pc name to media-pc which then required a reboot, and restarted my desire to clear the DNS cache. When i tried now, estrongs file manager could connect, and my cifs mount no longer gave a memory allocation error.
So i'd try pinging 192.168.1.5 from your phone first, then check sharing settings on the pc and that your firewall considers the phone trusted or in a trusted ip range, then if that's all good, try giving the computer a shorter name if it has a long one, and rebooting everything.
I'd recommend you do the connectivity testing with estrongs file manager's LAN - menu - New - Scan, since it rules out any serious user error such as typos in the mount command or mounting to a non-existent directory.
Click to expand...
Click to collapse
I tried connecting to my other PC last night, and it worked fine, so its a problem with my PC.. I fiddled with my sharing settings so many times that I must have screwed up something in the process sometime.
I'm at work now so I'll do those tests when I get home, but I'm positive it'll work
Great work, really useful for streaming music and video. Maybe I'll create an application to make it easier to mount and unmount during the weekend. It would be really nice to see this module implemented on ROMs, and custom kernels.
Btw, any point in unloading the module? (to conserve battery or any other reason?).

unloading the module i don't think so....but i think that unmounting the share is going to save resources....not sure though

Oh one thing i can think of, disabling media sharing might fix it too. My media center has several accounts on it, all providing an individual share for the accounts media, i got rid of those at some point.
I'm not sure that using modprobe -r to remove the module would make any difference to battery usage, since unless you're actively browsing a cifs mount, the module isn't doing any work. It's probably best to unmount when you're done with your share tho, since i'm not sure how well cifs behaves when the network connection isn't available to a mounted share. It might just keep re-enabling wifi to get access to it.
I've since come across a nasty issue btw, video streaming is fine since it keeps the screen alive, but music streaming has a huge problem; when the screen turns off, the phone drops into sleep mode, and the wifi chipset drops down to keep-alive low power mode.
This destroys wifi bandwidth, a typical VBR 160kbps mp3 stutters like mad, so i'm guessing it leaves wifi at around 60kbps, certainly sub-100kbps.
There are 3 solutions i know of...
1) leave the usb cable plugged into either the charger or the computer, the trickle charge from a usb connection allows the wifi chipset to stay out of low power mode when the screen is in standby.
2) an app called WiFi Fixer, that was made for the nexus one. It was made to prevent wifi dropping completely during sleep mode, which isn't my problem exactly. However, in the options menu there's an advanced option called standby fix 2, or words to that effect, and it's meant to prevent the wifi chipset going to sleep. It's kind of buggy, and so far as i can tell it works by disabling/re-enabling wifi once the phone is in standby, to wake the wifi chipset out of low power mode. Like i said tho, it's far from perfect, and if you're using something like msn talk at the same time, you'll lose your connection to it while it switches wifi on and off.
3) Tinker with the broadcom wifi kernel driver. I -think- this is a module so it might be possible to remove low-power mode from it with the HTC kernel. Certainly this fix is used in some of the custom built kernels available.

I went with option 3, just hacked up the bcm4329 wifi kernel module to prevent it entering full standby mode.
mp3 streaming seems to work okay with the screen turned off now, just going to find some 320kbit to test it properly, or dare i say, some FLAC encodings.
Edit:
Just used http://www.appbrain.com/app/net.avs234 to test and even the mighty FLAC plays cleanly in standby over wifi now. Result!
kernel module posted - http://forum.xda-developers.com/showthread.php?p=7638714#post7638714

Myshkinbob said:
How i got it working..
You may've seen me nagging around the forums for a sense-ui 2.2 rom with the cifs module in it. It looked like only the non-HTC roms have this module currently, that is, roms with a non-HTC custom compiled kernel.
This got me curious as to why, since people have compiled ext4 and tun modules for it just fine, they're in plenty of HTC kernel based roms.
So i got a cross-compile toolkit last night, and went looking for the closest kernel source i could find, and that turned out to be the msm branch of 2.6.32.9. I haven't even compiled a linux kernel in about 2 years, the last time i worked on kernel code was about 4 years ago, and i've never tried to make a module for a kernel that i don't have the source for. Meaning i got caught out with magic differences due to localversion appends etc, but eventually i built a cifs.ko that'd insmod.
I imagine that's how people made their ext4 and tuns (vpn) modules for the HTC built 2.6.32.15 too. So why no cifs module floating around for it already? Inserting the module fails with missing symbol errors for slow_work functions.
A patch was added after 2.6.31 called slow_work, that essentially stops certain filesystem activities blocking excessively. If you enable cifs in 2.6.32, even as a module, it requires slow_work to be enabled on your kernel. Likewise if you don't enable CIFS then slow_work isn't built into your kernel. Curiously the only two filesystems are cifs and gfs2 that require a slow_work enabled kernel.
HTC made the kernel, they didn't include cifs, it doesn't have slow_work enabled, so you can't fudge a module for it. Well, unless you edit out the slow_work code from the cifs filesystem in 2.6.32. As luck would have it, slow_work provided additional functionality, but didn't replace any.
So i edited out the slow_work code from the cifs headers and source files. Get the module for HTC's 2.6.32.15 below.
http://rapidshare.com/files/412285213/cifs.zip
For anyone interested i cross-compiled this using Sourcery G++ Lite 2010q1-188 for ARM EABI on ubuntu x86 installed to a virtualbox VM, with the kernel source taken from the android kernel git.
What's so good about CIFS anyway?
Support for CIFS lets you log into windows network shares from a linux OS and mount them as part of the linux filesystem. How's that any different to the SMB aware file managers like Astro or estrong file explorer? Transparent file streaming.
With a software client you can list and copy files from your windows share to your phone. If you instead mount the windows share into your filesystem, you can use files that're on the server as if they're already on the phone.
For example i'm connected to my home network right now over wifi and just opened a 700MB avi file instantly, as if it were already on my sdcard, instead of waiting 5-10 minutes for it to copy over usb, or half the movie's actual duration for it to copy over wifi.
Combine it with VPN and that's like having your entire movie/music collection on your phone anywhere you can get a broadband connection. No copying, no waiting, no ugly transcoding or streaming media servers, just use the files as if you already put them on the SD card.
The only real limiting factor is when the file's encoded bitrate exceeds your connection bitrate, eg. playing a 320kbit mp3 on a 200kbit EDGE connection.
How do i use this CIFS module?
You need a rooted phone with the official OTA 2.6.32.15 kernel, and possibly busybox too (for a mount binary with cifs support).
Quick and ugly instructions are to download the file above, copy it somewhere on your phone, eg. /sdcard/cifs.ko, and do the following as su in a terminal...
Code:
mkdir /sdcard/share
insmod /sdcard/cifs.ko
busybox mount -t cifs //192.168.0.1/sharedfolder /sdcard/share -o username=user,password=pass
Replace //192.168.0.1/sharedfolder with your windows share server name or ip and the folder you wish to access. Replace user and pass with your username and password, naturally.
For more detailed instructions on automating the mount and umount etc, there's an excellent thread here...
http://forum.xda-developers.com/showthread.php?t=733490
and also..
http://forum.xda-developers.com/showthread.php?t=740695
Note to ROM authors
Any rom authors using 2.6.32.15 who would like to include this module in their rom, you're quite welcome to. You don't need to credit me either, although it would be nice.
Click to expand...
Click to collapse
Combine it with VPN and that's like having your entire movie/music collection on your phone anywhere you can get a broadband connection. No copying, no waiting, no ugly transcoding or streaming media servers, just use the files as if you already put them on the SD card
Please could you please explaine how to do that?
Regards
JoseF

Hi! i got the share mounted but its not unmounting now, i have tried to force unmount also but its not working, i am getting operation not permitted. initially i was getting resource busy. Any ideas?

lept0n said:
Hi! i got the share mounted but its not unmounting now, i have tried to force unmount also but its not working, i am getting operation not permitted. initially i was getting resource busy. Any ideas?
Click to expand...
Click to collapse
I get this occasionally, usually it's some background task that was using the share, such as a file explorer, music or movie player. Even though they weren't currently in the shared directory, they still prevented me unmounting. Killing all media/file explorer apps should let you unmount.

you seem to have compiled your module with debugging options, that's why it's size is about 3MB
you might want to strip debugging symbols and sections (just them) with arm-eabi-strip --strip-debug (or arm-none-eabi-stip in your case)
Myshkinbob said:
As luck would have it, slow_work provided additional functionality, but didn't replace any.
Click to expand...
Click to collapse
except for the whole oplock break handling
i took a slightly different approach (patch provided):
h**p://forum.xda-developers.com/showthread.php?t=754793
(sorry, beeing a new user i am not yet permitted to post links)

tried this last night and works great
Found the stock movie player lags a bit but rockplayer works fine.

How do you set up an VPN SSL conection in Windows 7?
I've tryed but didn't works

Related

USB tethering without root (not SOCK5)

This is a program I wrote a while back that allows transparent tethering over USB without requiring root access. It works by simulating an unencrypted OpenVPN server and then internally running everything through a Java-based NAT. I get decent speeds off it, but your mileage may vary. It's a bit beta! Might explode! Wear eye protection!
It has a really basic website at http://lfx.org/azilink/, but to spare your eyes I'll just paste the instructions below:
Required files:
- ADB from the 1.1 SDK or from http://lfx.org/azilink/adb.zip
- OpenVPN 2.1 (not 2.0) from http://openvpn.net/index.php/downloads.html
- AziLink.apk from http://lfx.org/azilink/azilink.apk
- AziLink.ovpn from http://lfx.org/azilink/azilink.ovpn
Installation:
1) Install OpenVPN on the host. I use version 2.1_rc15, but any version should work. Apparently if you use version 2.0 you'll need to remove the NO_DELAY option from the AziLink.ovpn configuration file. You can find OpenVPN at:
http://openvpn.net/index.php/downloads.html
2) Enable USB debugging on the phone. From the home screen, this is under
Settings>Applications>Development>USB debugging.
3) Install the Android USB driver (if you don't already have one installed).
See http://code.google.com/android/intro/develop-and-debug.html#developingondevicehardware
4) Install the program. You can either use ADB to install by typing
"adb install azilink.apk" with the file in the current directory, or you can browse (on the phone!) to: http://lfx.org/azilink/azilink.apk
Either way you might need to allow installation from unknown sources
under Settings>Applications>Unknown Sources.
Configuration steps:
1) On the host, run "adb forward tcp:41927 tcp:41927" to set up port forwarding. Be sure to use adb from the Android 1.1 SDK! The version from 1.0 will lock up under heavy load. If you don't want to download the entire SDK, you can get a copy of ADB+drivers from http://lfx.org/azilink/adb.zip
2) On the phone, run AziLink and make sure "Service active" is checked.
3) Right click AziLink.ovpn on the host (not in the web browser!) and select "Start OpenVPN on this configuration file." You can find this file at: http://lfx.org/azilink/azilink.ovpn. If you're using Linux or, god forbid, MacOS, you'll also need to manually set the nameserver to 192.168.56.1 (the phone's NAT IP address).
Nice work around.
Wow, amazing work! I'll definitely have to mess around with this tomorrow...
OpenVPN 2.0.9
Thnx for the manual..!! Took me something to get it working, i'll find out, that it isn't working with OpenVPN version 2.0.9
OpenVPN 2.0.9 doesn't recognize the following rule in azilink.ovpn:
socket-flags TCP_NODELAY
And it worked with version 2.1rc15...
So no more Internet Sharing on Windows Mobile...
OpenVPN 2.0.9
Thnx for the manual..!! Took me sometime to get it working, i'll find out, that it isn't working with OpenVPN version 2.0.9
OpenVPN 2.0.9 doesn't recognize the following rule in azilink.ovpn:
socket-flags TCP_NODELAY
And it worked with version 2.1rc15...
So no more Internet Sharing on Windows Mobile...
help
Ok I'm a complete noob and I've played about with this but can't get it to work. How do I run adb? As in the very first step? Where do I type that. Do I need to install adb and how do I do it?
Thanks
Got it working
Man this is awesome.
I realised i needed to run the adb from cmd. see when i tried to open adb.exe it just kept closing.
thanks alot. this rocks
ps im writing this off my tethered pc
zecbmo said:
Ok I'm a complete noob and I've played about with this but can't get it to work. How do I run adb? As in the very first step? Where do I type that. Do I need to install adb and how do I do it?
Thanks
Click to expand...
Click to collapse
Nah, you can just unzip adb and run it directly from that folder. It's a command line program, so you'd need to run it from a command prompt (cmd.exe). I'm not sure whether adb needs to run as an administrator or not (I disable all that UAC garbage in Vista). If you have the proper driver installed, then the ADB command should return immediately without saying anything. If it says "waiting for device..." that means it wasn't able to find the Android debug driver.
I know this is all a bit hacky, but now that we've got root and wifi tethering I figured that there wouldn't be too much interest.
cheers
its working great like. im using this cus i havent rooted my phone yet. tethering was the only reason why i wanted to root it but this is a great alternative
Works Great. Thanks for the easy instructions.
Here is translation of post on Russian with images http://androidteam.ru/faq/azilink-tethering-with-android-usb.html
I have repacked all in one zip, and make some command files to make process a little easy.
another trick that may help on XP machines, probably other versions as well.
Create a shortcut to adb.exe on your windows desktop (mine is located in C:\and\tools)
Modify the 'target' (right-click,properties) of the shortcut to read C:\and\tools\adb.exe forward tcp:41927 tcp:41927 <I think this is the right code, I'm still using tetherbot on 1080>
That's it. Once everything's set up connecting is easy. one click on the computer, no cmds required
does this allow for media such as flash on web site to play on the laptop?
clevetbs said:
does this allow for media such as flash on web site to play on the laptop?
Click to expand...
Click to collapse
If you've got enough bandwidth. I'm not really sure what bitrate flash video runs at though.
Many thanks for this, aziwoqpd. I've not had the time to root, but have been looking for an easy way to tether. A usb connection is great, since the battery drains so quickly anyway it's nice to keep a charge going.
sonikamd - thanks for the suggestion, it's a great idea. Unfortunately my XP doesn't want to accept your syntax. I wish I could offer something else, but my skills (ha!) are nonexistant. I'm embarassed to say that I had to refresh my memory on how to maneuver around command lines...
Got any other suggestions?
Thanks again for all your work!
the AziLink.ovpn file wont download for me.
works fine for me, GREAT WORK!
Okay, so I'm trying this out on a mac. I've successfully built openvpn and have my tunneling device (/dev/tun0, /dev/tun1, etc.). I run the adb forward command and it starts the daemon successfully, I fire up azilink on the phone and it says it's waiting for the connection, I fire up openvpn and the phone changes to stating that it's connected. Openvpn does not exit out - it starts the tunnel - BUT in the logging it reports " ROUTE: problem writing to routing socket" twice (which oddly appears to be a non-fatal error to the application), and traffic is unable to flow. I'm guessing it's something about openvpn not correctly manipulating the darwin routing tables, but I've been unsuccessful thus far in figuring out the nature of the problem so I thought I'd check here.
I'm running the straight azilink openvpn config file, which means if I need any syntactical changes for darwin I haven't applied them. The openvpn documentation is not terribly good and I was unable to find any documentation of routing command differences for MacOS (if that's even the problem, of course).
Edit: I forgot to mention, I've been trying to ping known-good IPs by address to test the routing - after my first attempt at loading a web page failed I figured it best to remove name services from the possible list of problems. The bytes sent count was slowly incrementing (up to about 23K bytes in ten minutes of diagnosis), and the inbound count got up to about 900 bytes in the same period, so clearly *something* was getting through - unless those counters are counting all traffic into and out of the phone and just going over the cable - but I got no ping responses, no websites could load, and by all appearances from the terminal, no data was moving.
lindsayt said:
I'm running the straight azilink openvpn config file, which means if I need any syntactical changes for darwin I haven't applied them. The openvpn documentation is not terribly good and I was unable to find any documentation of routing command differences for MacOS (if that's even the problem, of course).
Edit: I forgot to mention, I've been trying to ping known-good IPs by address to test the routing - after my first attempt at loading a web page failed I figured it best to remove name services from the possible list of problems. The bytes sent count was slowly incrementing (up to about 23K bytes in ten minutes of diagnosis), and the inbound count got up to about 900 bytes in the same period, so clearly *something* was getting through - unless those counters are counting all traffic into and out of the phone and just going over the cable - but I got no ping responses, no websites could load, and by all appearances from the terminal, no data was moving.
Click to expand...
Click to collapse
The byte counters only include traffic that OpenVPN is forwarding, so something is making it over. Did you try changing the DNS server to either 192.168.56.1 or an external address like 4.2.2.2? OpenVPN on MacOS and Linux won't set the nameserver automatically.
Also, there's a bit of a problem with pinging. The app on the phone can't generate ICMP ping packets since it isn't running as root. When you send an ICMP ping, the phone translates it to a UDP ping, sends it, and translates the reply back to a ICMP ping. Unfortunately, probably about 50% of hosts don't reply to UDP pings. Some that I've tested with that do work are lfx.org and he.net.
I'll see if I can give it a quick test on a Mac sometime tomorrow.
EDIT: I managed to get it working, although T-Mobile's so-called "transparent" web proxy is barely working today so I was having trouble accessing websites without getting errors. SSH was working fine, though. Anyway, here's what I did:
1- Installed a MacOS port of OpenVPN called Tunnelblick (didn't have XCode handy to compile my own and it's got a pretty GUI)
2- Copied azilink.ovpn to /users/azi/library/openvpn or whatever it is
3- Click the Tunnelblick icon in the upper-right, go to details, click "set nameserver"
4- Remove the TCP_NODELAY line because it was complaining that my kernel didn't support it (and would cause my connection to timeout after about 30 seconds).
5- Clicked connect
If you want to see what traffic's going over openvpn, you can just run "sudo tcpdump -n -i tun0"
wow ... this works great ... tested using a german G1 under linux (arch 686), win vista (x64) & win xp (x86) ... pretty good speed and low latency (actually i can't notice any latency at all - no mather if using wlan or 3g)!
GREAT WORK!!!

Auto Mount SMB shares when connected to WiFi with Tasker + Execute + scripts

So I've really grown to like having my local SMB shares from my media server mounted to my Xoom so that I can stream video and/or music or whatever on the fly. I don't like the mountpoints getting all messed up when I leave the network though, and I had less than stellar experiences with both Mount Manager and CIFSManager.
CIFSManager worked, but didn't integrate with Tasker, so I couldn't automate it. Mount Manager (the paid version anyway) came with a Tasker plugin, but I don't think it was fully compatible with the Honeycomb OS and I had a lot of issues with it (called the developer and left a message a few hours after buying it, hopefully I can get a refund for my $2.99).
Then I found the (free!) Locale Execute plugin and decided to just script the behavior I wanted myself. If you have Tasker and local SMB shares as well this could be a good solution for you. Just install the Locale Execute plugin from the market and follow these instructions. I'll post them here because I can't post to the dev section yet, and I'm not really sure if this is dev worthy anyway.
First I setup a profile for my home WiFi network (WiFi Connected > SSID [my home WiFi SSID]. Then I added an Enter action with the Execute plugin:
Code:
@!sh /[path]/[to]/[chk_and_mnt_script]/cifs_chk_and_mnt.sh
But I needed to make sure the mount points are cleaned if I disconnect for any reason so I added an Exit action with the Execute plugin as well:
Code:
@!sh /[path]/[to]/[umnt_script]/cifs_umount.sh
In Execute the "@" symbol is used to keep the program from echoing commands to "toasts" (the little black notification boxes you get sometimes, like when an app is "granted SuperUser permissions") and the "!" symbol is used to grant the line of Execute code root access.
I removed the toasts but I still wanted some notification as to what was going on and a quick google revealed this xda post: http://forum.xda-developers.com/showthread.php?t=773232
In that post I found a little .apk that would allow me to call a toast from a bash script. I've attached it to this post.
In the mount script I run a little check to find out if the "cifs.ko" kernel module is already loaded. If it is I skip that block, but if not I go ahead and load it. This way I always know that the kernel module is available before I try to mount the SMB shares.
Here's the Enter bash script I wrote called "cifs_chk_and_mnt.sh":
Code:
#!/bin/bash
lsmod | grep -q 'cifs' #check if cifs module is loaded
if [[ $? -eq 1 ]] #if not
then
am start -a android.intent.action.MAIN -e message 'cifs.ko kernel module not yet loaded. Loading now...' -n com.rja.utility/.ShowToast #displays toast
insmod /system/lib/modules/cifs.ko #loads kernel module
fi
am start -a android.intent.action.MAIN -e message 'Mounting local SMB network shares...' -n com.rja.utility/.ShowToast #displays toast
mount -o username=[windows login],password=[your password] -t cifs //[host ip]/[share] /[path]/[to]/[mount]/[point] #actually mounts share
#replace "[]" info with your own with NO "[]" and copy and paste line for as many shares as you want to mount
And here's the Exit script called "cifs_umount.sh":
Code:
#!/bin/bash
am start -a android.intent.action.MAIN -e message 'Home network lost. Clearing local SMB share mount points...' -n com.rja.utility/.ShowToast #displays toast
umount /[path]/[to]/[mount]/[point]
#replace "[]" info with your own with NO "[]" and copy and paste line for as many shares as you have mounted in the Enter script
Now, like I said, I used the linked (and attached) .apk to display toasts from the BASH scripts, but if you don't want it or care enough to use it then feel free to delete the toast lines or throw a "#" in front of them. If you do want the toasts displayed then you'll have to download it and install it. It won't show in your app drawer.
Anyway, here are the files (I had to add a ".txt" extension to the .sh files to comply with xda's attachment rules, but you can just rename them):
Thanks for this, looks great! I literally just paid for one of the premium smb apps only to find it didn't do quite what I wanted. I'm sure this will be what I'm looking for, cheers.
Edit:
Something for users to note: The umount script wasn't working for me, after some investigation it turns out that though when mounting, '/sdcard/dir' is acceptable, though the mount command actually considers my sdcard to actually be at '/mnt/sdcard' , so *that* was the dir I had to use when unmounting afterwards. This may be true for others too. I am using CM7 on a Desire.
Looking into this, I found that on my CM7 Desire, mounting the shares worked even if "lsmod | grep cifs" returns nothing, and the file is not in the place mentioned in your script either. To streamline the whole process, I just removed all the complicated stuff from the script and ran the mount command directly, saving time. Just a heads up for others, try it and see if it works for you.
Thanks so much for this!
Unfortunately, I have a couple of problems... When the share mounts, it is not in utf-8 format, so folders with odd characters do not show, even though I have that preference set in Mount Manager!
In addition, the unmount script does not work for some reason. When disabling wifi, I recieve a toast that Tasker got the message and executed my exit task, but there is no toast for the unmount script. I've triple checked for grammatical or directory errors, but there are none. Any idea why the unmount script isn't working?
cavemandaveman said:
Thanks so much for this!
Unfortunately, I have a couple of problems... When the share mounts, it is not in utf-8 format, so folders with odd characters do not show, even though I have that preference set in Mount Manager!
In addition, the unmount script does not work for some reason. When disabling wifi, I recieve a toast that Tasker got the message and executed my exit task, but there is no toast for the unmount script. I've triple checked for grammatical or directory errors, but there are none. Any idea why the unmount script isn't working?
Click to expand...
Click to collapse
To be honest, I completely forgot I ever wrote this. Still, the unmount issue could be due to your busybox version. Have you tried executing the relevant commands at a root enabled terminal? Do they work there?
Moreover, you should understand that I apparently wrote this to be completely independent of "Mount Manager" or any related app and these scripts are dependent only on: busybox, Tasker, and the Execute plugin.
-Mike
mikeserv said:
To be honest, I completely forgot I ever wrote this. Still, the unmount issue could be due to your busybox version. Have you tried executing the relevant commands at a root enabled terminal? Do they work there?
Moreover, you should understand that I apparently wrote this to be completely independent of "Mount Manager" or any related app and these scripts are dependent only on: busybox, Tasker, and the Execute plugin.
-Mike
Click to expand...
Click to collapse
I tried executing from terminal and the mount script works fine, but the unmount does not work. It gives me a "no closing quote" error. I'm pretty noobish when it comes to scripts, but it doesn't look like there are errors in the script itself...
Also, if it is independent of Mount Manager, is there a way to include utf-8 formatting in the script?
Sent from my Galaxy Nexus
mikeserv said:
So I've really grown to like having my local SMB shares from my media server mounted to my Xoom so that I can stream video and/or music or whatever on the fly. I don't like the mountpoints getting all messed up when I leave the network though, and I had less than stellar experiences with both Mount Manager and CIFSManager.
CIFSManager worked, but didn't integrate with Tasker, so I couldn't automate it. Mount Manager (the paid version anyway) came with a Tasker plugin, but I don't think it was fully compatible with the Honeycomb OS and I had a lot of issues with it (called the developer and left a message a few hours after buying it, hopefully I can get a refund for my $2.99).
Then I found the (free!) Locale Execute plugin and decided to just script the behavior I wanted myself. If you have Tasker and local SMB shares as well this could be a good solution for you. Just install the Locale Execute plugin from the market and follow these instructions. I'll post them here because I can't post to the dev section yet, and I'm not really sure if this is dev worthy anyway.
snip...
Click to expand...
Click to collapse
I dont care this post is 5 years old, i dont care that i'm bumping this thread...this little gold brick of information was FINALLY what i needed to figure out how to mount cifs without that "never-gonna-be-updated-ever-ever-again-cifsmanager" apk. I just threw the same basic code into tasker and finally got a mount. thank you! if i was more secure in my manhood, i just might embarrass myself.
the real reason for the bump, instead of mere word wasting, is to help anyone anyone searching for the cifs manager apk, or getting the error "no such device" when trying to mount. The issue is connected to the both the "mount name space separation" in SUPERSU, the old android sdcard permissions and who knows what else.
heres' the code I put into tasker:
su --mount-master -c busybox mount -o username=[USERNAME],password=[PASSWORD],rw,file_mode=0777,dir_mode=0777,iocharset=utf8,context=ubject_r:rootfs:s0 -t cifs //192.168.xxx.xxx/cifsync /sdcard/cifsync
no brackets of course.
that popped it right online, no issues but my kernel provides cifs.io support through synapse settings app. so it was easy to load the module at startup
loogielv said:
I dont care this post is 5 years old, i dont care that i'm bumping this thread...this little gold brick of information was FINALLY what i needed to figure out how to mount cifs without that "never-gonna-be-updated-ever-ever-again-cifsmanager" apk. I just threw the same basic code into tasker and finally got a mount. thank you! if i was more secure in my manhood, i just might embarrass myself.
the real reason for the bump, instead of mere word wasting, is to help anyone anyone searching for the cifs manager apk, or getting the error "no such device" when trying to mount. The issue is connected to the both the "mount name space separation" in SUPERSU, the old android sdcard permissions and who knows what else.
heres' the code I put into tasker:
su --mount-master -c busybox mount -o username=[USERNAME],password=[PASSWORD],rw,file_mode=0777,dir_mode=0777,iocharset=utf8,context=ubject_r:rootfs:s0 -t cifs //192.168.xxx.xxx/cifsync /sdcard/cifsync
no brackets of course.
that popped it right online, no issues but my kernel provides cifs.io support through synapse settings app. so it was easy to load the module at startup
Click to expand...
Click to collapse
in code format so there will be no syntax issues -
Code:
su --mount-master -c busybox mount -o username=[USERNAME],password=[PASSWORD],rw,file_mode=0777,dir_mode=0777,iocharset=utf8,context=u:object_r:rootfs:s0 -t cifs //192.168.xxx.xxx/cifsync /sdcard/cifsync

[POC][WIP] Easy Reverse Bluetooth Tethering (ZeroBT)

ZeroBT - Reverse Bluetooth Tethering
This was a modification I released on Android Central for the LG Optimus S. I know there's quite a few tutorials on Reverse Tethering however I made this so it would be easy to connect/disconnect for tablets and phones without data service, so without further to do...
Some notes before I give the download link and Instructions:
This is a proof-of-concept, the concept? That using the SQLite3 binary you can create Android services that watch for specific changes to the Android settings database. This Reverse Bluetooth Tethering mod watches /data/data/com.android.provider.settings/databases/settings.db for changes to WiFi, Bluetooth and Mobile Data states.
This currently will not work with phones that have an active data service, this is because it watches the Mobile Data setting and dials if it's turned on at the same time as Bluetooth, However I cannot block Android's mobile data at the same time.
Warning:
If your kernel does not have PPP support in it's kernel, You'll have to either compile the kernel modules yourself or find a kernel that does have support.
Originally, this package contained the PPP kernel modules but they were compiled for the iScream Kernel found on Android Central. Likewise, the binaries included might not work or might overwrite the ones included in your ROM if they already exist, if this is the case, please copy the files from your ROM's ZIP back into the xbin folder (rfcomm, chat)
Download:
ZeroBT 0.0.1.0 Beta 1 (Signed): Download the attached version, I can't post links yet.
Unless the carrier you plan to be tethering from is Verizon, you might need the Peers and Chat script files from a Berry4All package (Or download the Berry4All-PPPd-stuff.zip file attached).
Installation:
Flash the ZIP file and then mount your USB Storage without exiting recovery,
On your SD Card you'll see the ZeroPPP folder, copy your carrier's Options and Chat script here. Open Configuration.ini to begin configuration.
Configuration:
Let's say your a Sprint customer and want to reverse tether your Sprint phone to your Android device.
Your configuration.ini would look like this:
Code:
# Bluetooth Settings
BluetoothAddress=XX:XX:XX:XX:XX:XX
# PPPd Settings
PPPOpts=/sdcard/ZeroPPP/sprint
CSisEXE=no <-- This is only yes if the chatscript file is a bash script that calls chat.
ChatScriptFile=/sdcard/ZeroPPP/sprint-chat
EnableLogging=no
PPPLogFile=/sdcard/ZeroPPP/pppd.log
Use:
Now this is the reason that I stated not to install this mod if you have an active data service/plan..
To trigger connection while the Daemon is running:
Toggle Wifi Off, Bluetooth On, and Mobile Data on.
within aprox. 10 seconds (Some debug statements I forgot to take out makes it wait 5 so you can check logcat and to keep the log clean) your bluetooth phone (in my case a MotoRAZR) should connect to your Android device and start dialing.
Enjoy.
I posted this here on XDA-Developers because it could be of some use to someone later on. This is by no means a completed reverse tethering modification, however maybe someone could give me ideas for a new trigger. (I was planning to create a Settings UI using SL4A and Python.)
Please give some feedback, this is my second real Android mod and I would love for it to be available for public scrutiny. I know this might be better on Tablets so feel free to take the scripts included and tinker with them as you wish
Thanks! I don't think this thread got the attention it deserved! Im looking to do similar, but using computer to phone. The information has been helpful.

[Q] how to permanently disable Timestamps TCP option?

There is a particular web site I was not able to connect to from my android devices but connected just fine from my windows PCs/laptops.
After some playing around with wireshark and Shark for Root, I saaw the server never answered the SYN from the android clients. Comparing the SYN packets between the windows 7 and android stacks, the only differences were in the options, and I was able to determine that either the server, or more likely a router/firewall in the path is choking on the TCP Timestamps option (option #8)
I if I temporarily disable the timestamps option echo 0 > /proc/sys/net/ipv4/tcp_timestamps, the android device connects just fine.
Once I identified the problem I found at least one thread showing that some servers still don't handle this 20 year old RFC properly (see http://serverfault.com/questions/23...-a-syn-ack-packet-in-response-to-a-syn-packet, I didn't have to muck with windows scaling in my case).
writing to /proc/sys is only a temporary solution though. it gets cleared when the device reboots.
Under linux, I would modify /etc/sysctl.conf to make the change permanent, but it doesn't look like android uses the sysctl.conf system (at least it's not present on any of my devices, custom ROMs or stock)
what's the proper way to disable the Timestamps option permanently?
I run SmoothROM on my nexus 7 and it has support for init.d, so at least one workaround was to create a /data/lcoal/userinit.sh that writes 0 to /proc/sys/net/ipv4/tcp_timestamps at every boot.
ParanoidAndoird on my Galaxy Nexus seems to also support init.d (edit: yup it does)
My main phone, a Nexus 4, is running 4.2.2 stock (albeit rooted) and doesn't seem to support init.d....
looks like installing busybox will install sysctl, so it might be an avenue to explore, although it's getting too late for me to try today.
I also saw mention somewhere of the later versions of busybox implementing init.d?
install-recovery.sh appears to be run at each boot, so I can add my tweak to that file on my rooted Nexus 4, or I could implemnt the full init.d solution described in this thread, although it's overkill for me: http://forum.xda-developers.com/showthread.php?t=1933849
Bottom line is maybe it's klugy, maybe it's the only way, but I got the tmestamps option disabled on all my android devices and can now connect flawlessly.

[SOLVED] Mount a smb/cifs share

Thank you in advance if you can help with this, unfortunately I'm not going to be able to follow through with this very well at the moment. If this gets no attention I'll bump it when I can follow through.
I want to mount a smb/cifs share from my router to my Nexus 5.
I can successfully mount the share and view it in terminal but none of it shows up in any apps...and that's pretty much my issue.
Here's some unimportant info, and a little info about me, I'm as scatterbrained as they come. The reason I want to do this is to stream my movies on the "NAS" to my Chromecast through Allcast or something.
As of now I'm using an entware mini dlna package on the router to stream everything to Avia. My problem is dlna broadcasts all my media to my entire network...no password required or anything. Also accessing my files through Avia is a pain in the ass, navigating through the folders repetitively gets exhausting.
Here's what I've come up with so far:
I'm using hammerhead-faux123-010m kernel, and SlimRC3.
CIFS DebugData:
Code:
CIFS Version 1.78
Features: posix xattr
Active VFS Requests: 0
Servers:
1) Name: 192.168.1.1 Domain: WORKGROUP Uses: 1 OS: Unix
NOS: Samba 3.0.37 Capability: 0x80e3fd
SMB session status: 1 TCP status: 1
Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
Shares:
1) \\192.168.1.1\NAS Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0xf
PathComponentMax: 255 Status: 0x1 type: 0
MIDs:
The disk is actually Ext3, not NTFS.
This guy kinda just crushed all my hopes and dreams of the future but I'm trying to use his OneClickMount alpha app.
http://forum.xda-developers.com/showpost.php?p=49651026&postcount=127
app here:
http://forum.xda-developers.com/showpost.php?p=49693815&postcount=129
This is what I have tried, I ended up with the same results:
Code:
[email protected]:/storage/emulated/0/cifs # setenforce Permissive
[email protected]:/storage/emulated/0/cifs # getenforce
Permissive
[email protected]:/storage/emulated/0/cifs # mount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /storage/emulated/0/cifs
[email protected]:/storage/emulated/0/cifs # ls
My Music
My Pictures
My Videos
Torrents
Then I tried OneClick Mount app:
https://www.dropbox.com/sh/muabb9vp1i8ubxt/o78FSYMcHo
From what I can tell from the app logcat, the app tries to move the debuggered file, create its own with a chosen command inside, start then stop it, and restart the original.
I might try to do this manually later, as in a month from now at the least. I'm pretty sure a certain someone is pissed off at me for not becoming one with the universe n all that jazz.
I'm gonna leave a couple links here so I can delve into them later, they seem to have crazy amounts of useful information:
[HINT] How Stickmount (and others...) are working with Android 4.2
Debuggered script
Sincerely, Head is spinning
Sorry but as of android 4.4.2 CIFS at a device level (all accounts see the network shares) no longer works and no one has a solution. This includes rooted devices and custom Roms. Of course apps such as ES File Explorer can have network share accesses but not all apps can utilize that access. For example MX player can be invoked from an ES file folder by clicking on a video file but apps like PowerAmp cannot see those folders. Some apps include built in network share features but they have the same restrictions as I previously described.
Things all changed when Android included multiple accounts and security started to get tighter. Initially developers found ways around those measures but too my knowledge, with 4.4.2 no one has found a work around.
Sent from my Nexus 10 using XDA Premium HD app
3DSammy said:
Things all changed when Android included multiple accounts and security started to get tighter. Initially developers found ways around those measures but too my knowledge, with 4.4.2 no one has found a work around.
Sent from my Nexus 10 using XDA Premium HD app
Click to expand...
Click to collapse
One workaround is hijack a system process such as debuggerd (debugger daemon) which runs with higher than su permissions. This method still works but is awkward to exploit manually. Apps such as foldermount use this workaround but not for network mounting, but it shows that it is still possible.
I have a Raspberry Pi running OpenELEC for streaming my locally stored media. I use my Chromecast for streaming Netflix, Google Play media, etc.
I understand what you are trying to do, but a dedicated device works great for me.
That said, you might keep an eye on VLC to see if they start supporting casting to Chromecast. That would likely accomplish what you are asking.
rootSU said:
One workaround is hijack a system process such as debuggerd (debugger daemon) which runs with higher than su permissions. This method still works but is awkward to exploit manually. Apps such as foldermount use this workaround but not for network mounting, but it shows that it is still possible.
Click to expand...
Click to collapse
This is what I'm going to attempt next, from what I read it can be terribly inconsistent if not done through SSH, so that's a bummer. I just need to get more information on how to do it. Debuggered in general confuses me.
embhorn said:
I have a Raspberry Pi running OpenELEC for streaming my locally stored media. I use my Chromecast for streaming Netflix, Google Play media, etc.
I understand what you are trying to do, but a dedicated device works great for me.
That said, you might keep an eye on VLC to see if they start supporting casting to Chromecast. That would likely accomplish what you are asking.
Click to expand...
Click to collapse
This is what I've been wanting to do with my old Galaxy Nexus. I have the HDMI adapter and everything but the screen is broke (the digitizer works), so I plug it into my TV and randomly hit the screen hoping to eventually connect my bluetooth mouse lol. No such luck. I wish I could just boot it into a custom build but that's never gonna happen. Unless OpenELEC works on android devices? Seems unlikely.
debuggerd can be replaced with a shell script with the mount command in it and it will run at boot.
It's really messy. I found I had to put the original debuggerd back or the phone would lock up.
Sent from my Nexus 5 using Tapatalk
WEEEEEOOOOOOO I finally got all my stuff to show in a file manager, now I just need to find a terminal command to trigger media scan on the folder. Right after I eat a bunch of chicken.
Awesome, it works perfectly. And by perfectly I mean it's the messiest thing I've ever done on Android. I'm not really sure how this affects battery and all but thank god this finally works.
For anyone interested:
Follow the directions in this post.
I didn't understand the mount command he used so I used
Code:
/system/xbin/busybox mount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /data/media/0/cifs
You also need to use /data/media/0/ otherwise it will only work in already opened apps apparently.
So thanks rootSU...And that should work, I'm going to do it in a way where I don't have to use scriptmanager but that's the gist. All the credit goes to the people in the threads I linked, I have absolutely no idea what I did here and I learned nothing.
Nothing special to see here. :good:
Here's a way to unmount it so it doesn't explode your apps when you disconnect WiFi:
/system/bin/debuggerd.binnn
Code:
#!/system/bin/sh
/system/bin/umount_movies.sh
exec /system/bin/debuggerd.bin "[email protected]"
/system/bin/umount_movies.sh
Code:
#!/system/bin/sh
/system/xbin/busybox umount /data/media/0/cifs
/system/xbin/busybox umount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /data/media/0/cifs
Script_eject.sh
Code:
#!/system/bin/sh
mount -o rw,remount /system
sleep1
/system/xbin/busybox mv /system/bin/debuggerd /system/bin/debuggerd.binn
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd.binnn /system/bin/debuggerd
sleep 1
mypid=$(/system/xbin/busybox ps -o pid,comm | /system/xbin/busybox grep 'debuggerd' | /system/xbin/busybox awk 'NR == 1 {print $1}')
/system/bin/kill $mypid
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd /system/bin/debuggerd.binnn
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd.binn /system/bin/debuggerd
sleep 1
mount -o ro,remount /system
I'm automating all this with Tasker.
Script task: (I have it run at boot)
waits 15 seconds
run shell command to kill debuggerd
wait 5 seconds
media action scan card /
Script_eject task: (I have it run when I disconnect from my SSID)
run shell command with the script_eject.sh code
wait 6 seconds
media scan card /
It has been seamless so far, also lol.
sendan said:
For anyone interested:
Follow the directions in this post....
Click to expand...
Click to collapse
I have yet to try your solution but what Rom and kernel do you have installed? I ask because in the past (Android 4.1) you needed a custom kernel that supported CIFS or you needed to add modules to stock.
I'm using rooted stock, Franco Kernel.
Sent from my Nexus 10 using XDA Premium HD app
3DSammy said:
I have yet to try your solution but what Rom and kernel do you have installed? I ask because in the past (Android 4.1) you needed a custom kernel that supported CIFS or you needed to add modules to stock.
I'm using rooted stock, Franco Kernel.
Sent from my Nexus 10 using XDA Premium HD app
Click to expand...
Click to collapse
I'm on the latest Slim, with latest faux kernel. Faux has cifs modules built in, I'm not sure about Slim or Franco kernel. If you have a cifs folder in /proc/fs I assume that means the kernel has the cifs modules.

Categories

Resources