5,600,335 Members 34,989 Now Online
XDA Developers Android and Mobile Development Forum

[modules] cifs.ko, md4.ko, nls_utf8.ko, stock [4.2 / 4.2.2] 3.4.5-g4e6298b / gaf9c307

Tip us?
 
H3g3m0n
Old
#61  
Member - OP
Thanks Meter 16
Posts: 57
Join Date: Sep 2009
Quote:
Originally Posted by DanielGwalter View Post
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.
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.

Quote:
Originally Posted by ThurstonX View Post
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.
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.
 
regystro
Old
(Last edited by regystro; 1st January 2013 at 09:41 PM.) Reason: Solved
#62  
Junior Member
Thanks Meter 2
Posts: 6
Join Date: Feb 2008
Default [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.
 
ThurstonX
Old
#63  
Senior Member
Thanks Meter 26
Posts: 137
Join Date: Oct 2012
Quote:
Originally Posted by H3g3m0n View Post
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.
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:

Code:
#!/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.
 
MrGrimace
Old
(Last edited by MrGrimace; 7th January 2013 at 04:45 AM.)
#64  
MrGrimace's Avatar
Member
Thanks Meter 16
Posts: 64
Join Date: Jan 2012
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?

Code:
#!/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.
 
blurp76
Old
#65  
Member
Thanks Meter 2
Posts: 48
Join Date: May 2009
$MOUNT_CMD
"

The quotes should be on the same line of $MOUNT_CMD
The Following User Says Thank You to blurp76 For This Useful Post: [ Click to Expand ]
 
MrGrimace
Old
(Last edited by MrGrimace; 7th January 2013 at 05:36 PM.)
#66  
MrGrimace's Avatar
Member
Thanks Meter 16
Posts: 64
Join Date: Jan 2012
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.
 
arma_esiea
Old
#67  
arma_esiea's Avatar
Junior Member
Thanks Meter 0
Posts: 5
Join Date: Sep 2010
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.
 
H3g3m0n
Old
#68  
Member - OP
Thanks Meter 16
Posts: 57
Join Date: Sep 2009
Quote:
Originally Posted by arma_esiea View Post
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.
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.
 
Borbosch
Old
#69  
Member
Thanks Meter 1
Posts: 30
Join Date: Jan 2007
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/iss...sort=&id=48126

Damn it, no mount anytime soon...
The Following User Says Thank You to Borbosch For This Useful Post: [ Click to Expand ]
 
regystro
Old
#70  
Junior Member
Thanks Meter 2
Posts: 6
Join Date: Feb 2008
Default 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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes