Skip to content
Snippets Groups Projects
wrboot-static-ip 1.45 KiB
#!/bin/sh

# 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.

# write your IP addresses here and your personal name for zImage
  eth0.ipaddr=192.168.16.9
eth0.serverip=192.168.16.1
 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=/dev/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=$wri1_ethaddr"

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