Skip to content
Snippets Groups Projects
wrboot-dhcp 1.37 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 the current IP address, i.e. from DHCP

# choose your personal name for zImage
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 (or ipinfo="dhcp" to re-request)
ipinfo="$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask: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