yashsingh1/xdaforums huggingface dataset:
[Nexus 10 Android Development] DanielGwalter:
Hi

can someone give me an update on this thread please.

I am running CM nightlies that have cifs modules installed and I have tried the fixup script version too both to no avail

I have tried the script method (and via mount manager) and i get empty folders

I have also tried the ADB method but I get a permission denied when executing the command (not sure where this is coming from and am using script manager with SU option to load the script provided by the OP in edit 3.

....

is it the common view that at this point in time CIFS mounts are not achievable in 4.2?

please advise, I am not fussed about multi user functionality and would happily break it to get CIFS working!

thanks

Dan.
[Nexus 10 Android Development] H3g3m0n:
It's still working fine here but I'm on stock. Try doing the commands manually 1 by 1 on the terminal to find out exactly which command is giving the error.
[Nexus 10 Android Development] DanielGwalter:
Thanks for the reply....

What version of the method are you using and is it stable an viewable from other apps ... For example can you view the files on a share from a file manager?

Also what version of android are you running?

Sorry, for all the questions, just I was convinced this did not work!

Thanks

Dan
[Nexus 10 Android Development] H3g3m0n:
I'm using the script with the modules in my OP. Working fine in all apps, doesn't matter if they where load before or after the script. Stock Android (rooted, busyboxed) 4.2.1
[Nexus 10 Android Development] DanielGwalter:
I was hoping you wouldnt say that!!!...

I am running CM nightly ... rooted, busyboxed when executing insmod in the script I get exec format error .... is this something you can help with ?

D
[Nexus 10 Android Development] H3g3m0n:
The modules in this thread are specific to the kernel that ships with the stock version of Android 4.2 and 4.2.1 (possibly future versions if they don't change the kernel).. You will need modules for CM. Someone in a previous post said that it now ships with them. If that's correct you will need to find where they are installed and insmod them instead.
[Nexus 10 Android Development] regystro:
Got the adb script working

For those having trouble with the adb script in POST #1 you may try this:

Remove the word "root" from line: adb -s $SERIAL shell su root -c "$COMMANDS"

I also changed the "mount" command by "busybox mount" (I didn't make the hardlink as recommended in some posts)

That was driving me nuts. Everytime I executed the script I saw "SuperSU - Copyright [...] Chainfire" message until I removed the "root". Now it all works flawlessly. I guess this may be happening because of the superuser binary version I have installed.

Merry Xmas.
[Nexus 10 Android Development] x51:
I spent HOURS messing with this.. Finally!! his worked for me.Thanks.

I still have other issues.. but this got me closer to something that resembles working.
[Nexus 10 Android Development] DanielGwalter:
Hi,

last night i decided to start fresh with a new install (complete wipe back to factory defaults)..

I am now running the cm nightly based on 4.2.1 with kernel version 3.4.5-g73335a3

inside system/lib/modules there is a cifs.ko (installed as part of the cm10 distro)

I have script manager installed and have been trying to run the script from the OP (localhost adb).

i have not copied any new files as the ones on this post were meant for a stock rom and they always result in errors (invalid argument etc etc).

when i run the script it executes fine down to the actual mount command at which point i get "segmentation fault" in the terminal window.

the only edit I have made to the file is to remove the two additional insmods (as i dont have those files!) and to adjust the paths to suit my network.

can anyone point me in the right direction to move past segmentation fault and onto a working solution!!!

thanks in advance

Dan.
[Nexus 10 Android Development] H3g3m0n:
The only time I managed to get mount to segfault was when I was trying to pass the 'make shared' option which I was hoping would allow it to multi mount without the adb hack.

It's possible CM have applied some hack to try and get mounts working through the multiuser stuff.

Your correct in not needing the files from the original post but you may still need to insmod the CM modules. I'm not sure if it loads them by itself.

Ignore the script for now and try stripping the mount command down to it's most basic possible line. This will let you see if it mounts without using the adb hack and if the files are visible on the console (if not the apps). See if removing the UNC option does anything, it's only needed for unpatched Busybox binaries (CM may have patched their busybox binary already).

If it's still segfaulting with a very basic mount command, then I would file a bug with the CM people.

Did you happen to try a cifsmanager at all? Maybe CM have applied patches that allow it to work unmodified.
[Nexus 10 Android Development] DanielGwalter:
hi,

I tried cifs manager but that only shows up in the current session (ES File manager but no other apps).

so, i stripped all the commands back to the point where i could get it to mount, then i started adding back and got it working ....

question: I am trying to write a script that cleans up and creates the mounts....

what command can i use to unmount the mount points. i tried umount <path> and this appears to work (as long as you su it) but then when i try to delete the folder i get "device busy" ... if i reboot and delete its fine but thats not the desired umount method!

so what I am looking for is a forcible unmount and delete of mount folder...

thanks

Dan.
[Nexus 10 Android Development] ThurstonX:
I'm trying to make this work on a Nexus 7. I've got the modules and the script seems to load them and mount successfully. The mount point is empty, though.

Script Manager reports the following after connecting to localhost:5555 and "Mounting share via adb...":

Usage: adb services [-l] (I think that's a lowercase "L")

usage: setprop <key> <value>

Mounting success!

To get that far I had to edit the script to change ` to ' and to stop CIFS Manager from loading the modules at startup (was getting "insmod .... failed (file exists)" errors.

I realize this is a Nexus 10 thread, but surely the principles are the same.

Any advice? Thanks.

My script:

#!/system/bin/sh

# Your settings here
USERNAME=guest
PASSWORD=
IPADDRESS="192.168.1.200"
SHARE="myshare"
MOUNT_POINT="/sdcard/cifs/myshare"

# If you need to change the mount command edit this
MOUNT_CMD="\
busybox mount -t cifs \
\
-o ro \
user=$USERNAME,\
password=$PASSWORD,\
unc=\\\\\\\\\\\\\\\\$IPADDRESS\\\\\\\\$SHARE \
\
//$IPADDRESS/$SHARE \
$MOUNT_POINT"

COMMANDS="\
insmod /sdcard/modules/CIFS/md4.ko; \
insmod /sdcard/modules/CIFS/nls_utf8.ko; \
insmod /sdcard/modules/CIFS/cifs.ko; \
$MOUNT_CMD
"

# Starting ADB...
PORT='getprop service.adb.tcp.port'
setprop service.adb.tcp.port 5555
stop adbd
start adbd
adb connect localhost

# Make sure we only use the first device (sometimes there is more than one)
SERIAL='adb devices | head -n2 | tail -n1 | cut -f1'
if [ "$SERIAL" = "" ] ; then
echo "ERROR: Could not find ADB device.";
fi

echo Mounting share via adb...
adb -s $SERIAL shell su -c "$COMMANDS"

# If you started adb, then stop it here for security:
adb disconnect localhost
stop adbd
setprop service.adb.tcp.port $PORT
start adbd

RESULT='mount | grep $MOUNT_POINT'

if [ "$RESULT" = "" ] ; then
echo "Mounting failed..."
else
echo "Mounting sucess!"
fi

echo Done... You may close this script window.
[Nexus 10 Android Development] H3g3m0n:
Well that confirms you can mount cifs. The next step would be to try a manual mount via adb. 'adb shell' into your phone and do the mount there, see if you get the seg fault and if not if it shows up in apps.

As for unmounting, umount seems to work fine for me although I have never tried to delete the mount point afterwards. It's possible you have to umount from within adb if you mounted in adb. On a full Linux there is also 'umount -lf /mountpoint' (-l for lazy and -f for force) but I don't know if busybox supports that. It does seem to support moving a mount via the -o move option (i would assume the syntax is 'mount -o move /mnt/old /mnt/new' (untested). You could perhaps use that to just move it somewhere out of the way, then delete the folder.

There is a typo in the script that causes the setprop message, I was going to fix it but forgot, it doesn't seem to matter other than popping up a warning.

As for the modules. you need ones for the kernel version of your device, specifically you need to match the g4e6298b at the end which is the Nexus 10 kernel. I believe the Nexus 7 uses 3.1.10-g22b4fcd. So are you using Nexus 7 cifs specific modules or ones you got from here? There are Nexus 7 ones here.

If you are using the correct modules, fire up a terminal and check the output of 'mount' to see if your mountpoint is listed and then check if you can see the mount contents in the terminal.
[Nexus 10 Android Development] regystro:
[SOLVED] Share is read only

So far I managed to get the adb script working, but the share is mounted as read only (permission denied when trying to mkdir). When connected by ES Explorer LAN using same credentials I can read/write, so no Windows/user permissions problem. I checked the local folder permissions and seem correct (chmod 777).

Is this a cifs module limitation? Do I have to add anything to the mount line to allow write permissions?

Thank you in advance.

EDIT: Solved. Just found that adding file_mode=0777,dir_mode=0777 to the mount code solves my problem. Full RW permissions achieved.
[Nexus 10 Android Development] ThurstonX:
Thanks for the reply.

I'm on 4.2.1 and I am using those modules. The script still says "Mounting success!" but the mount command does not show my mount point. The script is supposed to return "Mounting failed..." if the grep doesn't see it, so I can only assume the mount point is returned at that point in the script.

Here's how I tested it: mount | grep myshare > /storage/emulated/0/mount.txt

The text file is empty.

A couple things:

1. even when I delete the mount point folder, I still get the "Mounting success!" message in the Script Manager window. How can that be?

2. if I use mount | grep data > /storage/emulated/0/mount.txt I get all the references to "data" from the grep in the text file.

I read that I might need a patched version of busybox. I don't think I have that. I have the free BusyBox 1.20.2 from the App Store. If I need the patched busybox, where can I get it?

here's the script:

#!/system/bin/sh

# echo the script as it runs
set -x

# Your settings here
USERNAME=guest
PASSWORD=
IPADDRESS="192.168.1.200"
SHARE="myshare"
MOUNT_POINT="/storage/emulated/0/cifs/myshare"

# If you need to change the mount command edit this
MOUNT_CMD="\
busybox mount -t cifs \
\
-o ro \
user=$USERNAME,\
password=$PASSWORD,\
unc=\\\\\\\\\\\\\\\\$IPADDRESS\\\\\\\\$SHARE \
\
//$IPADDRESS/$SHARE \
$MOUNT_POINT"

COMMANDS="\
insmod /storage/emulated/0/modules/md4.ko; \
insmod /storage/emulated/0/modules/nls_utf8.ko; \
insmod /storage/emulated/0/modules/cifs.ko; \
$MOUNT_CMD
"

# Starting ADB...
PORT='getprop service.adb.tcp.port'
setprop service.adb.tcp.port 5555
stop adbd
start adbd
adb connect localhost

# Make sure we only use the first device (sometimes there is more than one)
SERIAL='adb devices | head -n2 | tail -n1 | cut -f1'
if [ "$SERIAL" = "" ] ; then
echo "ERROR: Could not find ADB device.";
fi

echo Mounting share via adb...
adb -s $SERIAL shell su -c "$COMMANDS"

# If you started adb, then stop it here for security:
adb disconnect localhost
stop adbd
setprop service.adb.tcp.port $PORT
start adbd

RESULT='mount | grep $MOUNT_POINT'

if [ "$RESULT" = "" ] ; then
echo "Mounting failed..."
else
echo "Mounting sucess!"
fi

mount | grep Vault > /storage/emulated/0/mount.txt

echo Done... You may close this script window.
[Nexus 10 Android Development] MrGrimace:
Tried the script.

Getting numerous "not foundulated" for all lines that set a variable

EDIT: Turns out it is saying "not found" and tacking on the last part of "emulated"

Then it gets to the SERIAL

if [ "$SERIAL" = "" ] ; then

and it stops/fails. I tried to echo $SERIAL and it was empty.

I am betting this is due to the "not found" for variable sets.

Sorry for the noobishess, but what goes wrong?

#!/system/bin/sh

# Your settings here
USERNAME="user"
PASSWORD="password"
IPADDRESS="10.0.0.84"
SHARE="DriveJ"
MOUNT_POINT="/sdcard/cifs/Drive"

# If you need to change the mount command edit this
MOUNT_CMD="\
mount -t cifs \
\
-o \
user=$USERNAME,\
password=$PASSWORD,\
unc=\\\\\\\\\\\\\\\\$IPADDRESS\\\\\\\\$SHARE \
\
//$IPADDRESS/$SHARE \
$MOUNT_POINT"

COMMANDS="\
insmod /sdcard/mods/md4.ko; \
insmod /sdcard/mods/nls_utf8.ko; \
insmod /sdcard/mods/cifs.ko; \
$MOUNT_CMD
"

# Starting ADB...
PORT=`getprop service.adb.tcp.port`
setprop service.adb.tcp.port 5555
stop adbd
start adbd
adb connect localhost
echo adm connected
# Make sure we only use the first device (sometimes there is more than one)
echo serial being set
SERIAL=`adb devices | head -n2 | tail -n1 | cut -f1`
echo SERIAL=$SERIAL
if [ "$SERIAL" = "" ]; then
echo "ERROR: Could not find ADB device.";
fi

echo Mounting share via adb...
adb -s $SERIAL shell su -c "$COMMANDS"

# If you started adb, then stop it here for security:
adb disconnect localhost
stop adbd
setprop service.adb.tcp.port $PORT
start adbd

RESULT=`mount | grep $MOUNT_POINT`

if [ "$RESULT" = "" ]; then
echo "Mounting failed..."
else
echo "Mounting sucess!"
fi

echo Done... You may close this script window.
[Nexus 10 Android Development] blurp76:
$MOUNT_CMD

"

The quotes should be on the same line of $MOUNT_CMD
[Nexus 10 Android Development] MrGrimace:
Tried 1 lining all commands and removing comments. Destroys readability, but it cuts down the errors. sh still fails to set variables for some reason.

sh in this case is built in and is not a soft-link to busybox. But I tried the same script with ash which IS busybox and same issue. Gets to if statement and then says "if" not terminated or not matching pair (not in front of me at the moment)

What is strange is that nobody else seems to be having these issues and we are all on Nexus 10. I am rooted on Stock and installed BusyBox 12.0.2 and replaced the busybox binary as instructed.
[Nexus 10 Android Development] arma_esiea:
Thank you for this modules, it's work perfectlly on a stock rom.

But I have a question, when i mount my cifs drive i can see file in all program but not in google music...

Anybody have a solution for see music file in google music ?

Thank's you in advance.
[Nexus 10 Android Development] H3g3m0n:
Google Music will be using the media scanner. So Android must scan your folder before it shows up. This is a pain as it will actually scan every folder on a mounted partition (unless you add a blank file named ".nomedia").

Probably a better idea to look at DAAP/UPnP or use the Google Music cloud sync feature.
[Nexus 10 Android Development] Borbosch:
After the update to 4.2.2 the loopback method to use the adb shell directly on the device isn't working anymore. A XDA-User allready filed a bug-report here: http://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=48126

Damn it, no mount anytime soon...
[Nexus 10 Android Development] regystro:
New modules for kernel 3.4.5-gaf9c307?

Hi H3g3m0n.

Last OTA 4.2.2 made more difficult to adb from localhost because key validation is needed even for loopback connections. I managed to get it working appending the public key generated by the loopback connection as they say in the page that Borbosch posted in #69.

Now I can ADB but I get the Exec format error when loading the modules. I guess that's because the kernel changed to 3.4.5-gaf9c307. I had no problems with 3.4.5-g4e6298b.

Could you please compile new modules for the new kernel version? I've been trying to find custom kernels with cifs enabled but didn't succeed. I know several roms out there have cifs enabled, but I'd rather use stock rom and modules / kernel patches.

Thank you in advance.
[Nexus 10 Android Development] pmincz:
Question from new user

Hi,

I want to know if is it possible to do this with a Nexus 10 rooted with Android 4.2.2 and the original kernel?

Thanks in advance.

Regards,

Pablo.
[Nexus 10 Android Development] jmtw000:
Hi Pmincz,

I don't have a nexus 10, so I can't say for certain, but I have gotten it to work on my rooted stock nexus 7. I don't see any reason why it wouldn't work on the 10. You can see how I did it on my 7 over at http://xdaforums.com/showthread.php?t=1781411&page=20 post #197 . The only difference should be, you'll need the modules for your device. I doubt the ones from my post would work as they're for the 7.
[Nexus 10 Android Development] prysme:
Since the 4.2.2 the modules provided in the OP are no longer valid :(

<3>[ 519.978824] cifs: version magic '3.4.5-g4e6298b SMP preempt mod_unload ARMv7 p2v8 ' should be '3.4.5-gaf9c307 SMP preempt mod_unload ARMv7 p2v8 '
[Nexus 10 Android Development] prysme:
Is someone is able to compile a nls_utf8 module with the latest sotck kernel or CM10 kernel or any other kernel ?

I'm able to mount my cifs share, but my file are not well formatted due to UTF8 character ... i'm desesperate to not find any kernel with CIFS and UTF8 :)
[Nexus 10 Android Development] woggy:
Exists any DL for new 4.2.2 compatible kernel modules?
[Nexus 10 Android Development] regystro:
You may try adding iocharset to the mount options. That's my code:

busybox mount -t cifs -o user=$USERNAME,password=$PASSWORD,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 [...]

That worked for me. Network share is Windows. The rw and 077 modes allow file writing permission (check Windows share permissions before).
[Nexus 10 Android Development] H3g3m0n:
I have uploaded modules that should work with 4.2.2. I haven't tested them so let me know if there is any problems with insmod'ing them. The adb hack now requires an extra step to add an encryption key, check here. I'm also not sure if the patched busybox is needed (there has been a new release).
[Nexus 10 Android Development] prysme:
This parameter is only working if the kernel support UTF8 and/or have a NLS_UTF8 module loaded.

By the way, I've successfully compiler Franco Kernel with CIFS and NLS_UTF8 builtin, so I've fixed my issue.
[Nexus 10 Android Development] darkuni:
Hey...

So what does this mean? You have a kernel that CIFS works "out of the box" without all the other fun stuff needed? Or is this just to eliminate needing to have the mod files referenced locally on your filesystem?

I can't believe it's been THIS long and we still don't have a more turnkey, easier solution than the OP. :(
[Nexus 10 Android Development] dafunk60:
Trinity Ten mounts CIFS shares without the need for additional modules. Been using it for a while.
[Nexus 10 Android Development] darkuni:
Installed. Still cannot mount. Do I need a patched Busybox?
[Nexus 10 Android Development] dafunk60:
No busy box needed. I provided details here http://xdaforums.com/showthread.php?p=39563553

I used the method in the link with task650 4.2.2 & mrrobinsons aokp pub 4.2.2
[Nexus 10 Android Development] darkuni:
Thanks for the help. I got everything set up, but ADB is providing me with a error: device offline message when running the script .. thoughts?
[Nexus 10 Android Development] dafunk60:
Settings » Developer Options » USB Debugging

Is it checked?
[Nexus 10 Android Development] darkuni:
First place I checked :)

Does this have something to do with the RSA keys, etc. mentioned earlier or no?
[Nexus 10 Android Development] dafunk60:
I don't think so. I did nothing special to get it to work. Flashed AOKP PUB last night. Flashed Trinity Ten. Installed SManager ads, ran my scripts as root. Same deal with task650 AOKP 4.2.2.

What rom are you using?

Edit: I'm also using chainfires super su pro. Not sure if the pro version is necessary however.
[Nexus 10 Android Development] H3g3m0n:
The 'device offline' is caused by the RSA keys (or an old version of adb which shouldn't be an issue on the phones, but could be the case if you encounter it on a computer).

Make sure you are setting the HOME environment variable in your script, I updated the script previously but it's possible you missed the change. If it's done correctly it should popup a box asking you to authorize the key. By default the HOME is set to something like /data that isn't writeable by users.
[Nexus 10 Android Development] darkuni:
Thanks again .. This just isn't working. I am writing off CIFS. I've wasted DOZENS of hours trying to shove a square peg into a round hole. I'm working instead on getting SMB support for the emus and tools I need to directly access network shares for.

Seems to be a better solution.
[Nexus 10 Android Development] wakaru:
Has anyone managed to get the CIFS modules for JB 4.2.2._3.4.5-gaf9c307, working in the latest official kernel?

If so I could do with a bit of help because I have not managed to do it.

Thanks :rolleyes:
[Nexus 10 Android Development] cien12:
I suggest to use the build in Modules with the trinity kernel. Only flash the trinty kernel and install Mount Manager and enjoy cifs mount.

You dont need any scrips.
[Nexus 10 Android Development] Bragabondio:
mount manager

Tried with the latest AOKP + Trinity kernel + Mount manager but alas no luck. The script was also not working (i did everything to the letter except generating the RSA key) so at this stage I give up and will wait for s/g more mainstream.
[Nexus 10 Android Development] cien12:
AOKP doesn`t work yet.

Use Sentinel, CM10.1 or Sabermod for example.
[Nexus 10 Android Development] H3g3m0n:
Hmm I'm having a look at 4.3.

It seems that it might not be possible to do cifs with a stock kernel as there is a commit that disables module support in the 3.4.39 kernel :(

Guess it's time to jump from the stock rom, or at least use a custom kernel.
[Transformer TF300T Q&A, Help & Troubleshooting] heatti:
Hey! Im currently running Jellybean-Hydro 4.1 rom with stock clocks. Feels very snappy after tweaking out a bit :)

What are the fastest CM-Based rom's at the moment?

I remember i really liked the Baked Blackbean rom on ICS, but the latest ported Blackbean-6 werent as snappy as Jellybean-Hydro rom what i am currently using.

I have randomly tried different JB roms but im really interested in CM roms :)

So go on and suggest me some good roms to flash! :D

Thanks!
[Transformer TF300T Q&A, Help & Troubleshooting] mikaole:
there are only 3 out there basing on CM. In my opinion the best is

http://xdaforums.com/showthread.php?t=1989984

But best Roms out so far are the Clean Rom 2.,5 for the TF700 with clemsyns Kernel (you can choose it during installation)

http://xdaforums.com/showthread.php?t=1998664

and

http://xdaforums.com/showthread.php?t=2000542
[Transformer TF300T Q&A, Help & Troubleshooting] heatti:
Thanks!
[Nexus 4 Q&A, Help & Troubleshooting] android88:
Basically what the title says. What are you using with your N4 in terms of cases, screen protectors, ROMs, kernels, etc. I don't have my Nexus 4 yet but this is how I'll use it when it comes.

Case: Not sure yet. I'll see when more start coming out.

Screen Protector: BSE, Skinomi TechSkin, or ArmorSuit. I can't decide.

ROM: Jellytime

Kernel: Stock, maybe custom once they start coming out.

Other: Wireless Charging Pad (maybe, why not?), Bumper from Google (again, maybe)

Just set up your setup the same way I did to keep the thread nice.
[Nexus 4 Q&A, Help & Troubleshooting] nba1341:
Case: A full tpu case or bumper (depending on wireless orb cost)

Screen Protector: Cheap ebay clear one (Usually replace every couple months as it gets scratched.)

Rom: Bruce's Rom

Kernel: Bruce's Kernel

Other: How much will wireless charging orb cost -_-
[Nexus 4 Q&A, Help & Troubleshooting] DarkRyoushii:
Case: none.

Screen Protector: BSE for the back, maybe use the front one if it covers the curved edges.

ROM: CM10.1 when released

Kernel: Any that increase touch sensitivity

Extras: Wireless charging orb from Google when released

Sent from my Nexus 4