maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs) (https://talk.maemo.org/showthread.php?t=38536)

heretic 2010-01-14 04:42

Re: How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)
 
well, thanks Qole and Nathan for the samba support. I tried winfs and kernel-module-cifs, and both work. but I hope you guys compile another module or component into it. I can't use the parameter, -o iocharset=utf8 . I usually do this to mount windows filesystem from my desktop linux because I got many different language filenames, like japanese, chinese, russian. It can make the files display correctly so that I will be able handle with these in command line.

Nathan 2010-01-14 05:01

Re: How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)
 
Quote:

Originally Posted by heretic (Post 469644)
well, thanks Qole and Nathan for the samba support. I tried winfs and kernel-module-cifs, and both work. but I hope you guys compile another module or component into it. I can't use the parameter, -o iocharset=utf8 . I usually do this to mount windows filesystem from my desktop linux because I got many different language filenames, like japanese, chinese, russian. It can make the files display correctly so that I will be able handle with these in command line.

The cifs component should support iocharset; the only thing that isn't compiled into cifs is the experimental dfs support. I didn't disable anything. Now, it is possible that something else in the Maemo Kernel is not support utf8. But iocharset as a command line should work when passed on to the mount command.

According to the cifs readme:

iocharset:
Codepage used to convert local path names to and from
Unicode. Unicode is used by default for network path
names if the server supports it. If iocharset is
not specified then the nls_default specified
during the local client kernel build will be used.
If server does not support Unicode, this parameter is
unused.

I looked through the source code and it showed that it could try and load a charset and fail. I'm not sure what would cause it to fail; other than maybe it not being compiled into the kernel?

Nathan

Nathan 2010-01-14 05:03

Re: How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)
 
Quote:

Originally Posted by qole (Post 469433)
I would argue that the best way to ensure that is to never keep any "important" (ie "secret") data on your mobile device.

Well that is true; not having the data on it would be the "Best" -- but I prefer to use it as a untethered computer; so I need the data on it. ;-)

Nathan.

GameboyRMH 2010-01-14 15:18

Re: How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)
 
Hey I've been working on that script, I'm almost finished, do you need root permissions in Fremantle to create a directory in /media or use the mount command? I don't know, I'm still waiting for my N900 to arrive :(

Nathan 2010-01-14 17:50

Re: How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)
 
Quote:

Originally Posted by GameboyRMH (Post 471054)
Hey I've been working on that script, I'm almost finished, do you need root permissions in Fremantle to create a directory in /media or use the mount command? I don't know, I'm still waiting for my N900 to arrive :(

1. You need sudo/root privs to run the mount/umount (or add it to your sudoers)

2. You need to create the initial directory as root; but if you chown the directory back to the user; then the user can create any sub-directories inside it for mounting points. ;-)

3. You could probably mark the script for elevated rights and bypass the root requirements of mount/umount.

Nathan

asidana 2010-01-14 19:57

Re: How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)
 
Quote:

Originally Posted by qole (Post 467517)
winfs 0.2 now adds the /etc/event.d/cifs script and automatically adds the cifs module upon install. You still have to mount things manually, however, or use a front end that supports mount.cifs.

NOOB ALERT!

Guys i am totally lost. Could someone post command line to mount


\\server\multimedia to MyDocs as Server folder

after installing winfs from qole's repo?

Thanks

GameboyRMH 2010-01-14 20:12

Re: How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)
 
OK, probably best to run the script as root then. This script will chown the mountpoint automatically.

So here's my "easy cifs mounter" shellscript. First time I've written such a fancy one :cool: you can either pass arguments to it or run it in "wizard mode" by passing no arguments.
Code:

#! /bin/sh
#arguments: servername serverip share username password mountpoint
#username, password and mountpoint are optional arguments
args=("$@")
if [ "${args[0]}" == "" ]; then
    #Go into "wizard mode" if there are no arguments
    echo -e "No arguments passed - running wizard"
    echo -e "Enter the server name:"
    read servername
    echo -e "Enter the server IP"
    read serverip
    echo -e "Enter the share name or path"
    read sharename
    echo -e "Enter a username, or leave blank for anonymous"
    read username
    username_orig=$username
    if [ "${username}" != "" ]; then
        echo -e "Enter a password"
        read password
    fi
    echo -e "Enter a mount point, or leave blank for automatic"
    read mountpoint
fi
#if arguments were passed from the command line, use them:
if [ "${args[0]}" != "" ]; then
    servername=${args[0]}
    serverip=${args[1]}
    sharename=${args[2]}
    username=${args[3]}
    username_orig=$username
    password=${args[4]}
    mountpoint=${args[5]}
fi
#set default mountpoint if the user didn't enter one
if [ "${mountpoint}" == "" ]; then
    mountpoint="/media/Remote_Filesystems/$servername@$sharename"
    #make sure the Remote_Filesystems directory exists
    mountparentdir="/media/Remote_Filesystems"
    if [ -d $mountparentdir ]; then
        echo -e "$mountparentdir found."
    else
        echo -e "Creating $mountparentdir"
        mkdir $mountparentdir
    fi
fi
#requote variables to escape special characters
servername=$(printf '%q' "$servername")
serverip=$(printf '%q' "$serverip")
sharename=$(printf '%q' "$sharename")
username=$(printf '%q' "$username")
password=$(printf '%q' "$password")
mountpoint=$(printf '%q' "$mountpoint")
#check for mountpoint and create it if it doesn't exist
if [ -d $mountpoint ]; then
    echo -e "Mount point already exists - will attempt to use."
else
    echo -e "Creating mountpoint $mountpoint"
    mkdir $mountpoint
fi
echo -e "Attempting to mount //$servername/$sharename at $mountpoint"
#Run the mount command
if [ "${username_orig}" != "" ]; then
mount -t cifs //$servername/$sharename $mountpoint -o user=$username pass=$password ip=$serverip
else
mount -t cifs //$servername/$sharename $mountpoint -o ip=$serverip
fi
#chown mountpoint to user
chown -R user $mountpoint
echo -e "To unmount this share, run umount $mountpoint as root"



Noob instructions:
Copy contents, save it as something like say "cifsmount", then run "chmod u+x cifsmount." You need to run this script as root, so with rootsh installed run "sudo gainroot." You can then either run it in "wizard mode" by running "./cifsmount" or pass arguments to it like "./cifsmount myhomeserver 192.168.254.10 mysharedfolder myusername mypassword /mount/point" (arguments are all documented in the code comments)

Username, password and mountpoint are all optional. You must specify a username and password to use a custom mountpoint if you're doing it with arguments, but if you're connecting to an anonymous share you can put anything in those fields.

By default it uses the same mountpoints as Wizard Mounter: /media/Remote_Filesystems/servername@share. You have to unmount manually: "umount /media/Remote_Filesystems/whatever@whatever." The script will tell you exactly what at the end.

asidana 2010-01-14 20:46

Re: How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)
 
i copied it under MyDocs and run "chmod u+x cifsmount." as root
when i run "./cifsmount" i get permission denied error saying permission denied

GameboyRMH 2010-01-14 21:26

Re: How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)
 
Edit: nm, SubCore got it.

SubCore 2010-01-14 21:30

Re: How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)
 
Quote:

Originally Posted by asidana (Post 472079)
i copied it under MyDocs and run "chmod u+x cifsmount." as root
when i run "./cifsmount" i get permission denied error saying permission denied

the partition which is mounted on MyDocs is a VFAT partition, and as such doesn't support the executable flag.

you have to copy it somewhere else, for example /home/user instead of /home/user/MyDocs, and then rund chmod +x. (/home is the 2GB partition, and mounted as ext3)


All times are GMT. The time now is 11:43.

vBulletin® Version 3.8.8