HOWTO INSTALL OPTWARE ON USB WITH SWAP

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


Joined: 21 Aug 2007
Posts: 3
Location: Kalgoorlie, Western Australia

PostPosted: Sun Aug 26, 2007 5:08    Post subject: HOWTO INSTALL OPTWARE ON USB WITH SWAP Reply with quote
I WROTE THIS FOR BEGINNERS LIKE ME NO MORE MEMORY ISSUES.


HOWTO INSTALL OPTWARE ON USB WITH SWAP
FOR ROUTERS WITH USB PORT LIKE MY ASUS WL-500GP

(NOTE THIS IS FOR KERNELS later than 2.4 i.e 2.4.3)
uname -r (at the hyperterminal on telnet or ssh)
/-----------------------------------------------
(NOTE EVERYTHING IN (BRACKETS) ARE NOTES ALL THE REST ARE COMMAND CODES TYPE EXACTLY AS I HAVE)
----------------------------------------------
(PARTITION youR usb stick)
(: partition 1 size to be twice that of on board ram (swap is normally 1.5times) format using ext3 (get knoppix and use qtparted for a great way to do things..Smile
(: partition 2 the rest of the available usb stick format using ext3)
-----------------------------------------------
(Now log in to your router via telnet hyperterminal or ssh you will have to be connected to the internet
(clean and enable jffs)

nvram set jffs_mounted=1
nvram set enable_jffs2=1
nvram set sys_enable_jffs2=1
nvram set clean_jffs2=1
nvram set sys_clean_jffs2=1
nvram commit
----------------------------------------------
(type:)
reboot
----------------------------------------------
(wait a while then log back in 40 secs tops)
----------------------------------------------
ipkg update
----------------------------------------------
ipkg -force-depends install kmod-usb-core kmod-usb2 kmod-usb-storage
----------------------------------------------
ipkg install kmod-vfat kmod-ext2 kmod-ext3 kmod-xfs
----------------------------------------------
mkdir /jffs/opt
----------------------------------------------
mount -o bind /jffs/opt /opt
----------------------------------------------
wget http://pastebin.ca/raw/328107 -O - | tr -d '\r' > /tmp/optware-install.sh
----------------------------------------------
sh /tmp/optware-install.sh
----------------------------------------------
(test it should see a big list:)

/opt/bin/ipkg-opt list
----------------------------------------------
tar czf /tmp/opt-backup.tar.gz /opt
----------------------------------------------
mkdir -p /jffs/etc/config
----------------------------------------------
vi /jffs/etc/config/usb.startup

(add the below to the script press <i> for insert and paste the below then <esc> <:> <w> <q> when done ( right click copy and paste if using hyperterminal telnet or ssh)

#!/bin/sh
insmod /jffs/lib/modules/2.4.30/usbcore.o
insmod /jffs/lib/modules/2.4.30/ehci-hcd.o
insmod /jffs/lib/modules/2.4.30/scsi_mod.o
insmod /jffs/lib/modules/2.4.30/usb-storage.o
# remove the dash (#) from the line below if you use USB 1.1
#insmod /jffs/lib/modules/2.4.30/uhci.o
insmod /jffs/lib/modules/2.4.30/sd_mod.o
# Filesystems
# Ext2
insmod /jffs/lib/modules/2.4.30/ext2.o
# Ext3
insmod /jffs/lib/modules/2.4.30/jbd.o
insmod /jffs/lib/modules/2.4.30/ext3.o
# FAT
insmod /jffs/lib/modules/2.4.30/fat.o
insmod /jffs/lib/modules/2.4.30/vfat.o
# XFS
#insmod /jffs/lib/modules/2.4.30/xfs.o
# Mount Partitions on usb stick
mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt
mount /dev/scsi/host0/bus0/target0/lun0/part2 /jffs/opt

(note: part1 and part2 equals partitions on your usb stick you get the general idea...)

-----------------------------------------------
chmod +x /jffs/etc/config/usb.startup
-----------------------------------------------
rm -rf opt/*
-----------------------------------------------
sh /jffs/etc/config/usb.startup
-----------------------------------------------
cd /
-----------------------------------------------
tar xvzf /tmp/opt-backup.tar.gz
-----------------------------------------------
(test it out should see a big list:)

/opt/bin/ipkg-opt list
-----------------------------------------------
(add this to the end of the /jffs/etc/config/usb.startup script)

vi /jffs/etc/config/usb.startup

(add the below to the end of the script press <i> for insert and copy and paste the below then <esc> <:> <w> <q> when done ( right click copy and paste if using hyperterminal telnet or ssh)

# Opt directory
mount -o bind /jffs/opt /opt
unset LD_LIBRARY_PATH
unset LD_PRELOAD
echo "export PATH=$PATH:/opt/bin:/opt/sbin" > /tmp/root/.profile
[ -e /opt/etc/profile ]


-----------------------------------------------
(type:)
reboot
-----------------------------------------------
(test it out should see a big list:)

/opt/bin/ipkg-opt list
-----------------------------------------------
(now you can install all your optware binaries onto usb and not have to worry about restraints of memory.)
-----------------------------------------------
(swap:)

dd if=/dev/zero of=/mnt/linux.swp
-----------------------------------------------
/opt/bin/ipkg install busybox
-----------------------------------------------
mkswap /mnt/linux.swp
-----------------------------------------------
swapon /mnt/linux.swp
-----------------------------------------------
note utility df memory flash,ram and usb stick

df -h
-----------------------------------------------
note utility free total memory and swap usage

free
-----------------------------------------------
(add this to the end of the /jffs/etc/config/usb.startup script)

vi /jffs/etc/config/usb.startup

(add the below to the end of the script press <i> for insert and copy and paste the below then <esc> <:> <w> <q> when done ( right click copy and paste if using hyperterminal telnet or ssh)

#swap
swapon /mnt/linux.swp
-----------------------------------------------
(total usb.startup script will look like this:)


#!/bin/sh
insmod /jffs/lib/modules/2.4.30/usbcore.o
insmod /jffs/lib/modules/2.4.30/ehci-hcd.o
insmod /jffs/lib/modules/2.4.30/scsi_mod.o
insmod /jffs/lib/modules/2.4.30/usb-storage.o
# remove the dash (#) from the line below if you use USB 1.1
#insmod /jffs/lib/modules/2.4.30/uhci.o
insmod /jffs/lib/modules/2.4.30/sd_mod.o
# Filesystems
# Ext2
insmod /jffs/lib/modules/2.4.30/ext2.o
# Ext3
insmod /jffs/lib/modules/2.4.30/jbd.o
insmod /jffs/lib/modules/2.4.30/ext3.o
# FAT
insmod /jffs/lib/modules/2.4.30/fat.o
insmod /jffs/lib/modules/2.4.30/vfat.o
# XFS
#insmod /jffs/lib/modules/2.4.30/xfs.o
# Mount Partitions on usb stick
mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt
mount /dev/scsi/host0/bus0/target0/lun0/part2 /jffs/opt
# Opt directory
mount -o bind /jffs/opt /opt
unset LD_LIBRARY_PATH
unset LD_PRELOAD

[ -e /opt/etc/profile ]
# swap
swapon /mnt/linux.swp

-----------------------------------------------
the end
-----------------------------------------------

references:

http://www.dd-wrt.com/wiki/index.php/Optware
http://www.dd-wrt.com/wiki/index.php?title=USB
http://www.dd-wrt.com/phpBB2/


[/code]


Last edited by idiosync on Mon Aug 27, 2007 3:20; edited 3 times in total
Sponsor
idiosync
DD-WRT Novice


Joined: 21 Aug 2007
Posts: 3
Location: Kalgoorlie, Western Australia

PostPosted: Sun Aug 26, 2007 5:23    Post subject: EXPORT PATH FOR OPTWARE Reply with quote
Avalanche path has been set see above the only thing im concernd about is ipkg on jffs somehow i have to disable it so it only uses /opt/bin/ipkg and /opt/bin/ipkg-opt do you see what I mean.

I read somewhere i had to delete /jffs/usr directory so the paths dont cross might just add a character to the directory just incase i need it again to install something on router ram instead of usb disc.

Thanks for the heads up i forgot about echo.


Last edited by idiosync on Mon Aug 27, 2007 3:27; edited 1 time in total
avalanche
DD-WRT User


Joined: 16 Jun 2006
Posts: 133
Location: Kolding, Denmark

PostPosted: Sun Aug 26, 2007 15:18    Post subject: Reply with quote
@idiosync
do something like this during startup/in your script:

echo "export PATH=/opt/bin:/opt/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin" > /tmp/root/.profile

or this
http://www.dd-wrt.com/wiki/index.php/Useful_Scripts#Modifying_PATH_at_Startup
skorianez
DD-WRT Novice


Joined: 27 Apr 2007
Posts: 8

PostPosted: Sun Aug 26, 2007 22:10    Post subject: Reply with quote
the jffs2 partition is mounted
Code:

/jffs # mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
none on /dev type devfs (rw)
proc on /proc type proc (rw)
ramfs on /tmp type ramfs (rw)
/dev/mtdblock/4 on /jffs type jffs2 (rw)

but I can't write it.
Code:

/jffs # pwd
/jffs
/jffs # mkdir a
/jffs # ls
/jffs #

NVRAM settings
Code:

/jffs # nvram show | grep jffs
jffs_mounted=1
enable_jffs2=1
sys_enable_jffs2=1
clean_jffs2=0
sys_clean_jffs2=0
size: 29827 bytes (2941 left)
dhcpd_usejffs=0

Code:

/jffs # uname -a
Linux LSKWRT350N 2.4.35 #1930 Wed Aug 22 13:53:03 CEST 2007 mips unknown
idiosync
DD-WRT Novice


Joined: 21 Aug 2007
Posts: 3
Location: Kalgoorlie, Western Australia

PostPosted: Mon Aug 27, 2007 1:13    Post subject: jffs unwriteable Reply with quote
Code:
ls -la | grep jffs

post the reply, is the usb mounted ...? what step did you get up too..?
Eddiie
DD-WRT Novice


Joined: 15 Apr 2007
Posts: 14

PostPosted: Sat Sep 15, 2007 6:29    Post subject: Reply with quote
Thanks for this post! It kicks ass!
nonsenz
DD-WRT Novice


Joined: 12 Nov 2007
Posts: 12

PostPosted: Wed Nov 14, 2007 8:00    Post subject: Reply with quote
WOW ! That really helped! thx alot.

One thing i had to do:
after one or two reboots swapon wasn't available anymore, no i use
Code:
/opt/bin/busybox swapon /mnt/linux.swp
in my script and it works.
Fianlly i have to say: having a great system is cool but having a great system WITH a great documentaion (howtos...) is much cooler !

so thx again and bye
nons
sjorge
DD-WRT User


Joined: 08 Mar 2007
Posts: 149

PostPosted: Wed Nov 14, 2007 8:06    Post subject: Reply with quote
does it actually use swap?

for me on my wrt350n it doesn't.
nonsenz
DD-WRT Novice


Joined: 12 Nov 2007
Posts: 12

PostPosted: Thu Nov 15, 2007 20:09    Post subject: Reply with quote
sjorge wrote:
does it actually use swap?

for me on my wrt350n it doesn't.

yes. when i have 3 enhanced-ctorrent instances i can see that the swap is in use. sadly the dd-wrt v24rc3 crashes after some time because of the high cpu usage. :-(

ciao
nons
sdoboze
DD-WRT User


Joined: 25 Jun 2006
Posts: 72

PostPosted: Wed Aug 13, 2008 12:56    Post subject: Re: HOWTO INSTALL OPTWARE ON USB WITH SWAP Reply with quote
I get to here:
idiosync wrote:

Code:

----------------------------------------------
wget http://pastebin.ca/raw/328107 -O - | tr -d '\r' > /tmp/optware-install.sh
----------------------------------------------
sh /tmp/optware-install.sh
----------------------------------------------
(test it should see a big list:)


And i get:
Code:

Checking system config ...
Using 213.191.64.26 as default gateway.
Using the following nameserver(s):
nameserver 192.168.164.4
Installing package uclibc-opt_0.9.28-12_mipsel.ipk ...
Connecting to ipkg.nslu2-linux.org (140.211.169.169:80)
Installing package ipkg-opt_0.99.163-9_mipsel.ipk ...
Connecting to ipkg.nslu2-linux.org (140.211.169.169:80)
/tmp/optware-install.sh: line 90: /opt/sbin/ldconfig: not found
/tmp/optware-install.sh: line 91: /opt/bin/ipkg: not found
/tmp/optware-install.sh: line 92: /opt/bin/ipkg: not found
/tmp/optware-install.sh: line 93: /opt/bin/ipkg: not found



So i have not been able to go any further.

Edit: I found http://www.dd-wrt.com/wiki/index.php/Optware
The script there works.
cretu22
DD-WRT Novice


Joined: 29 Jan 2011
Posts: 5

PostPosted: Tue Jan 22, 2013 9:36    Post subject: help Reply with quote
I tried to follow the guide, but after command ipkg update,
ipkg -force-depends install kmod-usb-core kmod-usb2 kmod-usb-storage got a lot of errors, and impossible to do something.
Any help please?
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