NSLU2-Linux
view · edit · print · history

We are using the NSLU2 for an advanced operating systems course at the University of New South Wales. We have modified the NSLU2 by adding a custom-built USB to Serial board which fits inside the case of the NSLU2.

One problem is that our lab machines are set up with 192.168.0.1 on one of their internal interfaces for VMWare?. Redboot, by default, also uses this address. In order to change it, we modify the redboot binary and re-write it to flash.

These steps require the mtd-utils be installed in a working linux installation. Note that this procedure could "brick" your slug if the flash write is not successful, and I take no responsibility, etc, etc.

  1. Read redboot from flash into RAM using MTD cat /dev/mtd0 > /media/ram/redboot.bin
  2. Open up redboot in your favourite hex editor. I used ghex but any decent one should do.
  3. Search for 192.168.0.1 in hex (i.e. C0 A8 00 01). You should find two copies of it (the first is the IP address and the second is the gateway address). For me the first was at offset 0x3B6D4, but I'm guessing this might vary with updated firmware. The 12 bytes in that region are the IP address, the netmask and then the gateway IP. I haven't tried modifying the latter two, but I'm sure it'll work fine.
  4. Modify C0 A8 00 01 to the IP address you'd like. I changed it to be C0 A8 00 02 (i.e. 192.168.0.2). Save your changes.
  5. Say a little prayer and unlock and erase the flash containing redboot. flash_unlock /dev/mtd0; flash_eraseall /dev/mtd0
  6. Write your new copy of redboot to the flash: cat redboot.bin > /dev/mtd0
  7. Verify that it is how you expect it to be: cmp /dev/mtd0 redboot.bin
  8. Re-boot and make sure the IP address has changed.

[ST: Im probably overlooking smthg, but wouldnt it be easier to use RedBoots? "fconfig" command (modifying network parameters) or change the source code and recompile it?] [TS: The Slug's RedBoot appears to be built without fconfig support...]

view · edit · print · history · Last edited by Toby Speight.
Based on work by ST and David Snowdon.
Originally by David Snowdon.
Page last modified on April 22, 2010, at 07:22 AM