Commit 9d94770d authored by Alessandro Rubini's avatar Alessandro Rubini

barebox script: final minor details

parent 8f8394d9
#!/bin/sh
# This script loads a wrboot script from the TFTP server and runs it.
dhcp 5
if [ "x$eth0.ipaddr" = "x" ]; then
dhcp 5;
fi
# fetch wrboot-<MAC> script, or <IP>/wrboot or wrboot
tftp wrboot-$eth0.ethaddr wrboot
if [ "$?" -ne "0" ]; then
sleep 1
tftp $eth0.ipaddr/wrboot wrboot
fi
if [ "$?" -ne "0" ]; then
echo "Cannot obtain IP from DHCP server"
else
# fetch wrboot-<MAC> script
tftp wrboot-$eth0.ethaddr wrboot
if [ "$?" -ne "0" ]; then
sleep 1
tftp $eth0.ipaddr/wrboot wrboot
fi
if [ "$?" -ne "0" ]; then
sleep 1
tftp wrboot wrboot
fi
if [ "$?" -eq "0" ]; then
./wrboot
fi
sleep 1
tftp wrboot wrboot
fi
if [ "$?" -eq "0" ]; then
./wrboot
fi
# If the script doesn't boot return to menu after some time to read output
sleep 2
menu -s boot
#!/bin/sh
## You must use Ctrl+D to Save & Ctrl+C to Exit
## Please type Ctrl+D to Save-and-exit or Ctrl+C to Exit
##eth0.ethaddr corresponds to the MAC address of the switch, it can also be changes using flasher
eth0.ethaddr=02:0B:AD:C0:FF:EE
## use 'dhcp' to do dhcp in barebox and in kernel
ip=dhcp
## or set your networking parameters here
#eth0.serverip=a.b.c.d
#eth0.ipaddr=a.b.c.d
#eth0.netmask=a.b.c.d
#eth0.gateway=a.b.c.d
## You can set your networking parameters here
## If unset, then boot-script will use dhcp
## This is shipped as unset ("if false" below)
if false; then
eth0.serverip=192.168.1.1
eth0.ipaddr=192.168.1.2
eth0.netmask=255.255.255.0
eth0.gateway=192.168.1.254
fi
## Timeout to autoboot in the pre-selected menu
autoboot_timeout="10";
## In case the default boot doesn't work we can use a specified alternative boot
#autoboot_altforced="0";
#autoboot_altmode="2";
## Timeout to show the error Message
#error_timeout="10";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment