Reply
Thread Tools
Posts: 323 | Thanked: 118 times | Joined on Nov 2007 @ Australia
#1
Hopefully this is useful for someone, some Linux users might already know this and is trivial, but for me I haven't had the N800 very long.

Ok, After reading up on CIFS for awhile I finally worked out how to get it to be usable by regular users (the standard mount by root doesn't allow users to access the mounted partition) and I've also written a bootup script to allow for any kernel modules that users want loaded to auto load at boot up (for me this is CIFS),.

This is all command line stuff, I'm sure there is a better way, but so far this is how I do it, feel free to improve and let me know what I should do different.

First I grabbed the CIFS kernel module for OS2008 that fanoush was kind enough to make available

Originally Posted by fanoush View Post
You can find fs/cifs/cifs.ko inside http://fanoush.wz.cz/maemo/modules-r....6.21.0.tar.gz
Then I set it up to auto load on bootup, now this is the part i'm not 100% sure on if its the best way to symlink everything (I think its rather messy to clean up), because I for the life of me can't work out to get any modules to autoload.... but this is my script which works perfect for me with only a few modules I use.

This is the contents of my /etc/init.d/user-kmodules
Code:
#!/bin/sh
#Copyleft 2007 NTFreenet.org

start()
{

for modules in $(find /lib/modules -type f |grep .ko)
do
 insmod $modules
done

}

stop()
{

for modules in $(find /lib/modules -type f |grep .ko)
do
 rmmod $modules
done


}

case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        *)

        echo "Usage: <start|stop> - Start will insert user modules in /lib/modules/ stop will remove any modules listed in /lib/modules"

esac
The only way I could get this to run on bootup is to symlink it to each bootup init level in '/etc/rc2.d/', '/etc/rc3.d/', '/etc/rc4.d/', '/etc/rc5.d/'

in each of those init levels I did a symlink back to the /etc/init.d/user-kmodules with the command:

Code:
# cd /etc/rc2.d/
# ln -s ../init.d/user-kmodules S99user-kmodules
I did that for each init level that I mentioned and made sure the main file was executable with a chmod +x /etc/init.d/user-kmodules, I then rebooted the N800 and checked the module was loading on bootup with a

Code:
# lsmod
it should display something like this after bootup

Code:
Module                  Size  Used by
cifs 232004 0 - Live 0xbf058000
After I did that came the fun part of mounting my samba share.

After you have logged in you should be able to run the following command to mount your samba share

I created mine in the MyDocs section (make sure your user has access rights to the folder if you create it as root eg.
#mkdir /home/user/MyDocs/samba
#chown user:users /home/user/MyDocs/samba)


Code:
sudo mount -t cifs //192.168.1.1/samba /home/user/MyDocs/samba -o noperm,sec=none,uid=user,user=foo,password=bar
then you should be able to view the mounted file system

Code:
Nokia-N800-44-4:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/mtdblock4            2.0M      2.0M         0 100% /mnt/initfs
none                    512.0k    104.0k    408.0k  20% /mnt/initfs/tmp
/dev/mtdblock4          251.5M    149.5M    102.0M  59% /
none                    512.0k    104.0k    408.0k  20% /tmp
none                      1.0M     20.0k   1004.0k   2% /dev
tmpfs                     1.0M         0      1.0M   0% /dev/shm
/dev/mmcblk0p1            3.8G      3.2G    645.6M  83% /media/mmc2
/dev/mmcblk1p1            3.7G      1.4G      2.4G  37% /media/mmc1
//192.168.1.1/samba    916.7G    716.2G    154.0G  82% /home/user/MyDocs/samba
Nokia-N800-44-4:~#
There isn't a very elegant file manager on the N800 as far as i'm concerned but it does work and does seem slow (I very much doubt it was designed to handle large files over a CIFS mount), I've been able to copy and paste 700 meg files to my SD card from the samba partition.

but personally I find the command line much faster...

Well I hope this is helpful to someone or gives em an Idea how to do it better, let me know what I have done wrong or screwed up

as you might have noticed I'm not exactly that great at writing long winded posts on how to do something, sorry

Cheers
Rip
 

The Following 3 Users Say Thank You to RipTorn For This Useful Post:
Posts: 323 | Thanked: 118 times | Joined on Nov 2007 @ Australia
#2
Oh as a side note, you should also be able to drop any modules you want into /lib/modules/ and the script on bootup should find them and auto insert them (if they work).

-Rip
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#3
Originally Posted by RipTorn View Post
This is the contents of my /etc/init.d/user-kmodules
2 pedantic comments :-)

- some modules has dependencies so you need to load them in correct order e.g. for ext3 you need to insert mbcache.ko and jbd.ko before ext3.ko. You also need to unload them in opposite order. Fortunately unloading at system shutdown is not really needed so you don't need to figure out how to reverse the list :-)

- it is better to call the directory /lib/modules/kernelversion and when inserting modules use /lib/modules/`uname -r` so you know you are trying to insert modules for same kernel. That will also allow you to have more sets of modules for more kernels.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 

The Following User Says Thank You to fanoush For This Useful Post:
Posts: 323 | Thanked: 118 times | Joined on Nov 2007 @ Australia
#4
Cool, the uname makes sense I'll get around to switching it over in my script, its not a show stopper though I guess,

With the ext3 on inserting the modules I guess you could rename the modules to make them show up in the correct order since its a pretty simple script.. eg, 1-mbcache.ko 2-jbd.ko 3-ext3.ko,

Again the entire process of having to have a script like that isn't ideal, I just couldn't work out any other way of inserting the modules I wanted at bootup.

thanks for the tips!

Cheers
Rip
 
Posts: 452 | Thanked: 522 times | Joined on Nov 2007
#5
Thanks for the init script -- kept me from having to build it. I did build a script that I sudo that mounts it and asks me for my password, I did find that on my server I actually had to pass a couple additional parameters. Otherwise I would get a DFS error.. What a pain.

Nathan
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:02.