Posted: Fri May 18, 2007 20:38 Post subject: How To: Linksys WRT350N VPN + USB without JFFS!
I've been trying to get this to work for the past 2 days and it manged to do it!
Requirements:
* Linksys WRT350N (similar routers may work but untested)
* Basic linux knowledge
* access to a linux system (I did it with a gentoo live CD so that should work too)
* dd-wrt v24
How to:
1. download & unpack the Firmware Modification Kit
2. download the latest beta of dd-wrt v24
(I chose the VPN build because I wanted VPN aswel)
3. Create a working directory. I called mine "dd-wrt" and made it inside the Firmware Mod Kit directory
4. run ./extract_firmware.sh dd-wrt.v24_wrt350n.bin dd-wrt/
5. download kmod-usb-uhci, kmod-usb-core, kmod-usb2 & kmod-usb-storage from http://downloads.openwrt.org/whiterussian/packages/
6. install the packages e.g. ./ipkg_install.sh kmod-usb-uhci_2.4.30-brcm-5_mipsel.ipk dd-wrt/ Note: I didn't install any filesystem packages... I use ext2 on my usb key and that is allready include in v24 so there is no need to install it. If you use fat or something else you need to install the packages aswel.
7. Create a new directory where the new firmware images will be placed. I made mine on the same level as the dd-wrt folder and called it "output"
8. lets create the images... ./build_firmware.sh output/ dd-wrt/
Thats it! You new have your new firmware image in the output folder.
You can now use a startup script to load the drivers and mount the disk.
Note: there now longer located in /jffs/lib... but they are now in /lib...
Here is my rc_startup:
Code:
# dd-wrt startup
echo "#!/bin/sh
# load kmod's
for module in usbcore ehci-hcd scsi_mod usb-storage sd_mod ext2; do {
if [ -x \"/lib/modules/2.4.34/\$module.o\" ]; then
insmod /lib/modules/2.4.34/\$module.o
fi
if [ \"\`lsmod | grep -c \$module\`\" == "0" ]; then
insmod /lib/modules/2.4.30/\$module.o
fi
}; done
sleep 5
# boot wait for USB
/tmp/usb_wait &
rm \$0
" > /tmp/load_kmod
echo "#!/bin/sh
# boot wait for USB
if [ \`dmesg | tail | grep -c 'USB Mass Storage device found at ' \` ] ; then
mount /dev/scsi/host0/bus0/target0/lun0/part1 /opt
sleep 2
# configure firewall
/opt/orion.fw
# setup envirement & start services
/opt/run/env-setup
/opt/run/service startup &
rm \$0
else
gpio disable 4
sleep 2
gpio enable 4
sleep 2
\$0 &
fi
" > /tmp/usb_wait
chmod +x /tmp/usb_wait
chmod +x /tmp/load_kmod
/tmp/load_kmod &
Note: Before I create the new firmware image I updated dd-wrt/rootfs/etc/ipkg.conf and added a new destination called usb which points to opt so when I run ipkg -d usb install URL it works :)
As you can see I mount my disk in /opt and have a folder /opt/run with my startup scripts for VPN and some others.
I included run.zip which is my own service manager feel free to edit it to suite your needs.
It requires optware perl as a minimum, a startup script for VPN is included.
also make sure to edit env-setup!
env-setup updates the root username, and does some minor other things like mouting my swap partition so edit it to suit your needs.
I know this ain't perfect but I'm not to great at writing a documentation.
I hope this will help someone or inspire somebody do write a decent wiki artikel on this.
the build_firmare.sh out-puts .bin files that are named the following: custom_image-wrt54g.bin
custom_image-wrt54gs.bin
custom_image-wrt54gsv4.bin
custom_image-wrtsl54gs.bin
Which one should be used? does it matter? is this incorrect?
than i have built the custom image.. and i have taken "custom_image-wrt54g.bin" an now its the question does this work? Or is the kit only for WRT54G ?
can i kill my router by trying to get this image work?
Put up my services manager aswel!
User at own risk though! It requries optware perl.
edit the env-setup script before rebooting. Since I didn't change it before I uploaded (only swapped out my root name )
I use this to setup the envirement, like binding a new profile file and other things like mouting a swap partition...
My startup script runs this before it fires of the service manager.
I've removed all my script and left the openvpn one.
sry this is so chaotic... I really suck at writing documentation and guids
Heres my generic standard build with usb support, most file systems, printer support and a built in startup-script for it all. All you have to do is mount the drive
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=96302#96302 _________________ Asus RT-AC66U - DD-WRT build 23083
Last edited by Rekoil on Wed Aug 01, 2007 9:43; edited 1 time in total
Posted: Thu Jul 19, 2007 18:28 Post subject: Re: How To: Linksys WRT350N VPN + USB without JFFS!
Hi, I am newbie to cook firmware, can anyone tell me where should the rc_startup locate ?
Just putting the script in the one folder below?
/etc/config/
/jffs/etc/config/
/mmc/etc/config/
/tmp/etc/config/
Yeah sjorge thats how I did it. They go in /etc/config and don't forget to make them executable and name them *.startup. _________________ Asus RT-AC66U - DD-WRT build 23083