wrboot-static-ip 1.45 KB
Newer Older
1 2
#!/bin/sh

3 4 5 6 7 8 9 10 11 12 13 14 15
# This is an example wrboot script.  The switch first does a DHCP pass
# to get this script while using a valid IP address. You can
# keep that address or replace it from within the script itself.
#
# A few "wrboot" scripts are provided in wr-switch-sw/binaries/ Your
# script should be placed in your /tftpboot or equivalent directory,
# using one of the following names, that are tried in this order:
#
# wrboot-$eth0.ethaddr     (i.e. using the specific MAC address of the wrs)
# $eth0.ipaddr/wrboot      (i.e. in the default filesystem for your DHCP IP)
# wrboot                   (a generic catch-all name)

#### This example uses static IP addresses. I personally use this.
16

17 18
# write your IP addresses here and your personal name for zImage
  eth0.ipaddr=192.168.16.9
19
eth0.serverip=192.168.16.1
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
 eth0.gateway=192.168.16.2
   kernelname=zImage-wrs4

# Since this is for development, verbose is better than quiet (default)
bootargs="verbose console=ttyS0,115200 panic=10"

# Pass IP information to the kernel
ipinfo="$eth0.ipaddr:$eth0.serverip:$eth0.gateway:255.255.255.0:wrs:eth0"
bootargs="$bootargs root=nfs rw ip=$ipinfo"

# I you want, specify a non-default root directory
bootargs="$bootargs nfsroot=/opt/root/wrs,tcp"

# And pass the WR base MAC address, that barebox retrieved from SDB
bootargs="$bootargs wr_nic.macaddr=$wr0_ethaddr"
35

36 37
# Load the kernel using the personal name chosen above, and boot it
tftp $kernelname /dev/mem.kernel; bootz /dev/mem.kernel