[modules] cifs.ko, md4.ko, nls_utf8.ko, stock [4.2 / 4.2.2] 3.4.5-g4e6298b / gaf9c307
I have managed to get CIFS working on stock Nexus 10.
It's quite a bit more problematic on the Nexus 10 than normal.
There are 2 main issues to deal with. Newer versions of the Linux kernel require a UNC variable to be passed to them and the current version of busybox doesn't do this. There is a patch out. I have extracted the patched busybox binary from craigacomez's AOSP Nexus 10 rom.
(Check it out here: http://forum.xda-developers.com/show....php?t=1998585
). Otherwise it should work on the stock mount command if you specify the unc= mount option with the share.
The other issue is the multiuser stuff. If you execute the mount command from inside Terminal Emulator (or a script program) it looks like it mounts ok and you can 'ls' in the directory but it doesn't work for Android apps, they just see an empty directory but if you do it via a 'adb shell' it works fine in Android apps. My theory is ADB is outside of the multiuser stuff. adb actually ships on the device.
1) Unlock bootloader (fastboot oem unlock)
2) Flash recovery adb flash recovery whatever.img
3) Root device (flash CWM-SuperSU-0.98.zip)
4) Install BusyBox (from the market)
5) Copy md4.ko and cifs.ko to device. The files can go anywhere you like. In this example I will just use the root of the sdcard. Some people like them in /system/modules or /system/lib/modules
6) busybox mount -o rw,remount /
7) adb shell
8) Override /system/bin/busybox with the patched version (maybe move it first so it's backed up).
9) insmod /sdcard/md4.ko
10) insmod /sdcard/cifs.ko
11) busybox mount -t cifs -o username=MYUSER,password=MYPASS,unc=\\\\192.168.1. 1\\storage //192.168.1.1/storage /data/media/0/cifs/Storage
You will need to manually preform the last 3 commands each time you reboot the device from a adb shell.
NOTE: You can probably get rid of the -o flags completely. In theory the patched version of busybox makes the UNC bit redundant. Possibly you can use the stock busybox with the UNC flag and avoid using the patched one totally. I have just included it to be sure.
Make sure you type 'busybox mount' not 'mount', by default they are different binaries. Otherwise you can remove the /system/bin/mount command and make a new one linking /system/bin/mount to /system/bin/busybox.
Possibly there is some way to get the mount working in the multiuser environment without requiring busybox. If you figure it out please tell ☺
Some threads on the issue:
The modules are for 3.4.5-g4e6298b.
I added nls_utf8.ko by request
Since adb comes on the device, it is possible to use it to connect to local host:
1) Install cifs modules to /system/lib/modules
2) Install Script Manager from the play store
3) Copy script to device
4) Start SManager
5) Find your script and open it.
6) Tick the su box
7) Hit save
8) Goto home sccreen
9) Add a 'SMShortcuts' widget to your home screen
10) "Add one script shortcut"
11) Choose your script
12) Optionally use this pretty icon
13) Give it a nice name like "Mount Shares"
Here is a shell script...
# Your settings here
# If you need to change the mount command edit this
mount -t cifs \
insmod /system/lib/modules/md4.ko; \
insmod /system/lib/modules/nls_utf8.ko; \
insmod /system/lib/modules/cifs.ko; \
# Starting ADB...
setprop service.adb.tcp.port 5555
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.";
echo Mounting share via adb...
adb -s $SERIAL shell su root -c "$COMMANDS"
# If you started adb, then stop it here for security:
adb disconnect localhost
setprop service.adb.tcp.port $PORT
RESULT=`mount | grep $MOUNT_POINT`
if [ "$RESULT" = "" ] ; then
echo "Mounting failed..."
echo "Mounting sucess!"
echo Done... You may close this script window.
Added usbserial.ko, option.ko and usb_wwan.ko
Some users have reported that the need to modify the script
to get it working with their version of SU.
I have uploaded modules for 4.2.2, kernel 3.4.5-gaf9c307 but I haven't actually tested them myself (still on 4.2.1). Apparently the adb loophole has also been patched but it is possible to reenable it by putting a RSA key onto the device. Check out this set of instructions here
I have updated to 4.2.2 on my Nexus 10 and can confirm the new modules work.
You must setup the adbkey or you will get a "device: offline" message. By default adb when adb first runs it tries to create the keys in the $HOME dir which is /data/.android, but the data directory isn't accessible by the 'shell' user.
I got it working simply by setting the HOME variable to /sdcard and restarting the adb server in the script then Android popped up a query (I have update the script above).
The Android Media scanner recursively scans folders for media to add the the database so it shows up in programs like Google Music. On large shares this can be a long process and use heaps of battery life. To prevent this add a blank file with the name ".nomedia" to the root of your mount points (or each individual share if you aren't used 1 folder for all your mounts). This will stop music showing up in programs though.
If you find that the device stops responding (the launcher might work but apps fail to load) or you get reboots (often after the previous bug) this is probably due to a bad wifi connection.