Hello this is my first contribution to this project. I just bought this router, Netgear wndr3700, and have been trying to work with openwrt backfire 10.3 on it. It was not easy, many information is scattered around the wiki and forum. It’s my sincere hope this helps to at least avoid the initial information gathering that I had to do to get this setup. Comments, suggestions are most welcome. I'll be posting a some more about 3G/UMTS usb modem and this router buttons. Thanks, and here it goes.
1 - Install jffs2 rom image, openwrt-ar71xx-wndr3700-jffs2-factory.img with tftp.
Squashfs works but only if custom built with the usb stuff and rootfs.
2 - Base packages for this router:
#USB Led for wndr3700
kmod-leds-wndr3700-usb
#for Wireless lan
wpad-mini kmod-ath9k
#for usb
kmod-usb2 kmod-ohci kmod-usb-storage
#for rootfs
kmod-ext2 kmod-ext3 e2fsprogs block-mount block-extroot
Install them with:
opkg update
opkg install kmod-leds-wndr3700-usb wpad-mini kmod-ath9k kmod-usb2 kmod-ohci kmod-usb-storage kmod-ext2 kmod-ext3 e2fsprogs block-mount block-extroot
Reboot (reboot) so that all modules get loaded in the correct order.
Optional:
Configure this environment (internal router flash) with some sane defaults for your setup, so that if external usb fails, minimal services will be available, like wireless, dhcp lan and wan access.
3 - Prepare the external usb storage for use.
Create partitions for root, tmp and swap. Use fdisk
Format root and tmp partitions with mkfs.ext3
Prepare the swap partition with mkswap
Note: If you don’t know how to use this tools then you probably need to do some more reading before continuing.
4 - Create / Edit your /etc/config/fstab as:
config global automount
option from_fstab 1
option anon_mount 0
config global autoswap
option from_fstab 1
option anon_swap 0
config mount
option target /mnt/usbroot
option device uuid
option uuid 5c72eb36-d9d8-439d-b91b-c0ab12b686f9
option fstype ext3
option options rw,sync,relatime,errors=remount-ro
option enabled 1
option enabled_fsck 1
option is_rootfs 1
config mount
option target /mnt/usbtmp
option device uuid
option uuid 02d4d4ef-b1ca-463b-ab1b-e7325614517c
option fstype ext3
option options rw,noatime
option enabled 1
option enabled_fsck 1
config swap
option device uuid
option uuid ecaf5815-fbb7-4cd9-8ed2-e8583b7e76a3
option enabled 1
The key here is option is_rootfs 1. That is what makes the selected device your rootfs.
uuid can be checked with blkid command. Create the folders /mnt/usbroot and /mnt/usbtmp.
I chose ext3 because this router, for home use, can and will be turned off at any moment, since ext3 is more resilient to this kind of behavior it is better suited for this. USB pen drives are cheap now so flash wearing is not an issue, it should last a very long time anyway. Just remember to backup if you make any configuration changes so that you don’t have to do it all over again.
More details on fstab and rootfs see:
Fstab Configuration http://wiki.openwrt.org/doc/uci/fstab
Rootfs on External Storage http://wiki.openwrt.org/doc/howto/rootfsonexternalstorage
5 - Reboot (reboot) to get your new and shinny external rootfs.
Check with mount if you are now on external storage, you should have this:
rootfs on / type rootfs (rw)
/dev/root on /rom type jffs2 (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=30988k)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/sda1 on /overlay type ext3 (rw,sync,relatime,errors=remount-ro)
mini_fo:/overlay on / type mini_fo (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sda2 on /mnt/usbtmp type ext2 (rw,noatime,errors=continue)
none on /proc/bus/usb type usbfs (rw,relatime)
So now /rom will be jffs2 and mounted ro. Your external device should be mounted at /overlay, see the line /dev/sda1 on /overlay type ext2 (rw,relatime,errors=remount-ro).
At this point you are now working on the usb external drive. No changes you make from here onward will be done one the router internal flash.
6 - Let’s install some more stuff and replace /tmp on ramdisk (tmpfs) with /tmp on our external drive.
Now create tmp2usb in /etc/init.d/tmp2usb as:
#!/bin/sh /etc/rc.common
START=21
STOP=99
. /lib/functions/mount.sh
start() {
rm -rf /mnt/usbtmp/*
cp -a /tmp/* /mnt/usbtmp/
umount /tmp
[ $? -ne 0 ] && {
umount -l /tmp
echo "tmpfs lazy removed!"
} || echo "tmpfs removed!"
mount --move /mnt/usbtmp/ /tmp
echo "/tmp on usb drive!"
}
stop() {
rm -rf /tmp/*
sync
umount -r /tmp
}
Do /etc/init.d/tmp2usb enable, to create symblinks where needed.
Check that the file was actually created at /overlay//etc/init.d/tmp2usb as expected.
Reboot and check mount again:
rootfs on / type rootfs (rw)
/dev/root on /rom type jffs2 (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/sda1 on /overlay type ext3 (rw,sync,relatime,errors=remount-ro)
mini_fo:/overlay on / type mini_fo (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sda2 on /tmp type ext3 (rw,noatime,errors=continue)
none on /proc/bus/usb type usbfs (rw,relatime)
See that /tmp is now on your external device
7 - I also enabled umount init script, /etc/init.d/umount, just to be on the safe side with manual reboots.
8 - Optional, modify /etc/banner to show that you are running on external rootfs. In my case I just added this to the existing file.
-------------------- On Usb -----------------------
9 - Want a more permanent storage of syslog messages? Remove symbolic link /var to /tmp and mkdir /var. Then uci set system.@system[0].log_type=file.
(Last edited by DavidMorgado on 10 Aug 2010, 10:50)