OPTWARE with CIFS

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
netfer
DD-WRT Novice


Joined: 14 Nov 2006
Posts: 10

PostPosted: Thu Dec 04, 2008 9:32    Post subject: OPTWARE with CIFS Reply with quote
Grettings, I have a no USB router, I would like to know If I can install this packages in cifs mount disk in the network.

Thanks.
Sponsor
azuretech
DD-WRT User


Joined: 29 Oct 2007
Posts: 103

PostPosted: Fri Feb 20, 2009 18:24    Post subject: install optware on CIFS mounted share Reply with quote
The issue is CIFS does not support symbolic links... fortunately there is a solution.

I have successfully used a SMB share for /opt, well, actually used a CIFS share, but the technique is the same, regardless. The trick is to create an ext2 partition inside of a file on the CIFS/SMB share, and mount that using the loop device. I have this working on v24. The technique is as follows:

First, you must have a successfully mounted SMB or CIFS share Next, you need to install a few necessary packages

Code:
ipkg install kmod-loop
ipkg install kmod-ext2

I'm told ipkg should automatically insmod the loop and ext2 modules, but in my experience, it does not, so we can easily take care of that with:

Code:
insmod /jffs/lib/modules/2.4.30/loop.o
insmod /jffs/lib/modules/2.4.30/ext2.o

then create a container file on your cifs share, in my case I'm creating a 10MB file below.

Code:
dd if=/dev/zero of=/tmp/smbshare/opt.ext2 bs=1 seek=10M

Now we need to format the empty file as an ext2 file system

Code:
echo y | mke2fs -L optware /tmp/smbshare/opt.ext2

Now that the file is formatted, all we need to do is mount the file:

Code:
mount -o loop /tmp/smbshare/opt.ext2 /opt

then get the optware install script:

Code:
wget http://www.3iii.dk/linux/optware/optware-install-ddwrt.sh -O - | tr -d '\r' > /tmp/optware-install.sh

and install it:

Code:
sh /tmp/optware-install.sh

And there you have it, optware is installed onto your CIFS or SMB directory.

Now that this part is complete, so long as you don't wipe your /jffs directory, you won't need to re-complete this every time you boot, since optware is stored safely on your CIFS file system, I simply added the following to a startup script in my CIFS share that will execute once the CIFS share is mounted.

Code:
insmod /jffs/lib/modules/2.4.30/loop.o
insmod /jffs/lib/modules/2.4.30/ext2.o
mount -o loop /tmp/smbshare/opt.ext2 /opt

Special thanks to whoever the author of the information at http://forum.x-wrt.org/index.php?topic=428.0;wap2 is, as it was incredibly helpful in figuring out how to accomplish this. There is also information here on using the above technique to create a nice big swap space for all those opt-ware apps as well.
azuretech
DD-WRT User


Joined: 29 Oct 2007
Posts: 103

PostPosted: Sun Aug 30, 2009 5:23    Post subject: Significant changes Reply with quote
The information I gave above has become quite outdated... I've updated the wiki at http://www.dd-wrt.com/wiki/index.php/Optware#Optware_on_CIFS_-_Partition_in_a_file with the correct procedure including how to create a swap file in the CIFS mounted share as well, through v24-sp2 build 12672
KenNashua
DD-WRT Novice


Joined: 03 Feb 2008
Posts: 2

PostPosted: Thu Mar 25, 2010 0:10    Post subject: Reply with quote
Thanks for updating the wiki, however the details on creating the file on the CIFS partition above may be useful for people (like me) who are casual linux users.

Would be nice if the wiki included the dd steps as I had to google to get here.

I'm also finding that if I use the Administrator page to reboot my router, my CIFS doesn't get remounted -- is this normal?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum