RipTorn
11-30-2007, 10:23 AM
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
You can find fs/cifs/cifs.ko inside http://fanoush.wz.cz/maemo/modules-rx-34-2.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
#!/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:
# 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
# lsmod
it should display something like this after bootup
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)
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
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 :p
Cheers
Rip
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
You can find fs/cifs/cifs.ko inside http://fanoush.wz.cz/maemo/modules-rx-34-2.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
#!/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:
# 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
# lsmod
it should display something like this after bootup
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)
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
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 :p
Cheers
Rip