Joined: 21 Aug 2007 Posts: 3 Location: Kalgoorlie, Western Australia
Posted: Sun Aug 26, 2007 5:08 Post subject: HOWTO INSTALL OPTWARE ON USB WITH SWAP
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..
(: 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)
-----------------------------------------------
(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:)
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
Joined: 21 Aug 2007 Posts: 3 Location: Kalgoorlie, Western Australia
Posted: Sun Aug 26, 2007 5:23 Post subject: EXPORT PATH FOR OPTWARE
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
/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 #
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 !
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. :-(
Posted: Wed Aug 13, 2008 12:56 Post subject: Re: HOWTO INSTALL OPTWARE ON USB WITH SWAP
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
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?