The WG302 Prosafe is a Netgear router (mostly used as a simple access point) based on the Intel IXP425 XScale SoC This old router can very well run the latest Linux kernels. The resident flash is a bit small (just 8MB) but the RAM is 32MB on the WG302 v1 which makes the kernel work fine.
Booting from command prompt
- The router has an accessible RS232 connector, connect it using a zeromodem cable and set the terminal to 9600n8 (9600 baud, no stopbit, 8 bit)
- Plug in the power cable
- When you see text on the terminal, hit CTRL+C to get into RedBoot
- Set up a TFTP server for downloading the kernel image
- Make sure that you have a bootable zImage on your TFTP server
- Boot the kernel using the interactive command prompt (the local 192.168.1.x IP addresses
are just examples from my network):
ip_address -l 192.168.1.35 -h 192.168.1.2 load -r -v -b 0x00080000 -h 192.168.1.2 zImage exec 0x00080000
NFS mounted root
First I set up NFS on my server. I use an /etc/exports file like this:
/var/lib/tftpboot/ixp4xx-root 192.168.1.0/255.255.255.0(rw,sync,no_root_squash,no_subtree_check,no_acl,nohide)
I unpack a rootfs to /var/lib/tftpboot/ixp4xx-root and change the permissions:
cd /var/lib/tftpboot mkdir ixp4xx-root cd ixp4xx-root tar xvfz /tmp/ixp4xx-rootfs.tar.gz
My rootfs has been modified to handle NFS mounts, it is not a vanilla OpenWrt. Also building for IXP4xx BE is not currently possibly other than on custom branches. This is achieved using this script.
I have tried to get NFS root mount to work but didn't get it finished. I added a patch like this to the WG302v1 device tree:
--- a/arch/arm/boot/dts/intel-ixp42x-netgear-wg302v1.dts +++ b/arch/arm/boot/dts/intel-ixp42x-netgear-wg302v1.dts @@ -23,7 +23,7 @@ memory@0 { chosen { /* The RedBoot comes up in 9600 baud so let's keep this */ - bootargs = "console=ttyS0,9600n8"; + bootargs = "console=ttyS0,9600n8 root=/dev/nfs rw nfsroot=192.168.1.144:/var/lib/tftpboot/ixp4xx-root,tcp,v3 ip=dhcp"; stdout-path = "uart1:9600n8"; };
Pre-cooked Bootable Image
These images are pre-configured for the WG302 ATH5k wireless etc.
Compiling the kernel
I use a special ixp4.mak makefile that I put in the root of the kernel directory, edit the makefile to select the right DTB then I type:
make -f ixp4.mak config && make -f ixp4.mak buildAnd this will build the whole kernel, attaching an initramfs and a DTB file, and put the resulting zImage in $HOME as well as in /var/lib/tftpboot if it is writeable. You will need the rootfs-ixp4x.cpio rootfs and ixp4xx-firmware.tar.gz for this to succeed.
The special config options used to mount from NFS:
# This target has 64MB RAM and no space for initramfs, use NFS root! config-wg302: config-base $(CURDIR)/scripts/config --file $(config_file) \ --enable PHYLIB \ --enable NFS_FS \ --disable NFS_V2 \ --enable ROOT_NFS \ --disable BLK_DEV_INITRD