The LB000021 Linux Router Mod - Getting it to boot by itselfWith the Midge/Kamikaze roms, you have a system that you can log into and then use ipkg to install programs and drivers. When you get it the way you want it, you can use 'flash save' to store your settings. This works fine - but can confuse things if you re-configure your build. Kamikaze has some options for a usb root file system in its build/config menu - these are yet to be completed, but what is there just needs turning on. I built the rom as usual, except I installed '*' ( rather than Modules 'M' ) any drivers requiored for a usb disk mount. These are usbcore, usb-shci, scsi_mod, sd_mod, usb-storage and file systems ext2, (I want to mount dos/windows drives so) fat and vfat, and loop allows me to store linux file systems on a dos drive. In order to get the whole thing to boot properly, it is necessary to modify the /etc/midge.conf file to insmod the drivers and set things up to mount the drive(s). The make menuconfig will not let us modify the midge.conf file, so I copied one with the relevant settings into'target/linux/image/adm520/basefiles/etc/new-midge.conf' and added file 'S85-EnableUSB' file into the 'target/linux/image/adm520/basefiles/etc/init.d' that simply copies the contents of new-midge.conf to midge.conf before the usb settings are accessed (during the boot process). This does mean that it 'midge.conf' settings are to be changed, they may also need to be changed in 'midge-new.conf', but I intend to make any startup changes in files on the hard drive/memory stick. The Kamikaze/Midge midge.conf and init.d files already scan any hard drive / file system mounted under /mnt/usb for extra init files stored under etc/init.d/ (any file starting with 'SNumber' is run during startup. In this directory, I placed a script to mount a loop filesystem containing a fill install of Samba file sharing under /usr/local/samba, run a small web server with www as its root ( accessed as /mnt/usb/www from a root log in) the example file system also contains a PHP-cgi install. The example file system /etc/init.d/S50USB-Midge also sets up eth0, default route and nameserver settings to suit the network I use - you will need to change this to work with your own network. To try this out, you will need a Sweex router with USB and Serial ports fitted, a memory key or usb hard drive at least 128Mb that you don't mind formatting and to know that before you start, this is all experimental - you do it at your own risk. The procedure for formatting the hard drive / Memory stick depends upon the verion of windows or linux you are using - you need to be able to fdisk the stick/drive with 1 dos partition (I know that some menory sticks come formatted as 1 drive with no partition table - these will need partitioning and re-formatting). I find the process easier with linux fdisk and mkfs.msdos
Once the stick is formatted, you need to mount it and un-tar the example filesystem onto it
You should be left with :-
You can also use 'openwrt-adm5120-2.4-squashfs.bin.csys-with-login-ttyS0' The web pages served by awhttpd are stored under the menory stick/drive directory /www/default. PHP Script names must end '.php' you can change the .conf dile under /www to allow other script or shell files to be used.
|
![]()
A PIC, Linux and a Router |