Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

How I got CIFS mounts to work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How I got CIFS mounts to work

    Originally posted by milanj View Post
    Somehow I managed to get CIFS working with latest 4.2 kernel for TV Sticks. I hope this helps @d33 to fix CIFS problem.

    1. To get a successfull mount I used hints from here and issued a Terminal command (as 'su'):
    Code:
    mount -o unc=\\\\192.168.X.X\\ShareName,username=guest,password=guest -t cifs none /sdcard/cifs/ShareName
    This actually got me a successfull errorless mount of my share. The next problem was this mounted share was only visible to root, e.g. when I did "ls" command as 'su' in Terminal I could see the folders inside the mount, but when I tried to see the share using filexplorers ES and RootBrowsers folders were empty.

    2. The I stumbled uppon this post.
    So I did excatly what that user has done. I masqueraded mount command inside '/system/bin/start-ssh' script, with endless loop added at the end:
    Code:
    #!/system/bin/sh
    mount -o unc=\\\\192.168.X.X\\ShareName,username=guest,password=guest -t cifs none /sdcard/cifs/ShareName
    while :; do echo 'Hit CTRL+C'; sleep 1; done
    After I invoked the script using
    Code:
    [COLOR=#222222][FONT=Arial]start sshd[/FONT][/COLOR]
    I got my share mounted and also it was visible to all users.

    3. The next challenge is to see how I could issue this command and startup using init.d script, but late enough at boot to have wireless first connected.
    I guess this is somewhat of a temporary solution...
    I had given up on getting CIFS mounts to work after asking for help and receiving either none or one-word replies. After falling behind in keeping up with the forum, I came across the post above by milanj which reignited my desire to get it working. Armed with this and some new search terms for google, I found the following...

    The su binary now also has a "--mount-master" option that connects you to a su session in the main mount namespace. Mount commands in this session should affect all processes.


    So using 'su --mount-master' and then executing the mount command will allow non-root processes to access mounted directories and files. I've tested this on my 4.4.2 stick and it works.

    I haven't yet automated it into a boot script, but I think I've found a bit of code that I can use to do that. Will keep you updated.

    #2
    Here is your last mile!!!

    FIRST THINGS FIRST!! - Thank you! I just only register to say that and to put my 2cents maybe.

    In the long way to make my MK809II work with Android 4.4.2 I had countless failures including bricking my MK809II and bringing it back to life making a bridge on pins 6 and 7 of the nand flash with a video from youtube.

    ...I flashed roms back and forth.... and never got CIFS working till NOW! ...... (mixing kernels from 4.2 to 4.4 broke my android stick by the way)

    Almost one week fingering and reading ...... ing .... ing.....ing..... about the new permisions system etc bla .

    I DID IT!!! got CIFs working LIKE i WANTED!

    Here is the whole matter to do it: the "--mount-master" su command, and there is no need to use "unc////" adress.

    THIS IS THE RIGHT SYNTAX: (btw: you need a rooted device and the "supersu" app dont know if works with the "superuser" app, and i recomend the "terminal emulator" app because we can make an icon (widget) to launch the comand and make it aviable fast.

    on the terminal emulator:
    Code:
    su --mount-master -c mount -rw -o [COLOR=#3E3E3E][I]username=YOURS,password=YOURS, -t cifs //IP-ADRESS/SHARE [/I][/COLOR] //mnt/SHARE
    Unfortunately that mount wont be writteable even if we set that. because of the new permisions.... but if you mount in other folder you create and sets propers permisions example //data/SHARE you could make it writeable.

    NOW the last mile you want (an easy script to set up):

    You can add a widget in the desktop if you install "terminal emulator" https://play.google.com/store/apps/d...al.androidterm

    THAT widget cant execute our commands, so you can make one to create a writeable folder, and, or, for the CIFS MOUNTS!!!!! VOILA!!!

    Thanks againg mate, and for all others reading too!. Love FreakTab

    Kodiz, from Argentina.

    Comment

    Working...
    X