summaryrefslogtreecommitdiffstats
path: root/defaultenv
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@gmail.com>2019-01-18 19:50:18 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2019-01-21 09:56:50 +0100
commitd90948f2bd1f9462a765c665c45c643ab4a15deb (patch)
treedad443ea18b6c3a927e0c3475e8c9178f87f150e /defaultenv
parent830ab7cb6633dadfbfbe870693508d07351f3dc8 (diff)
downloadbarebox-d90948f2bd1f9462a765c665c45c643ab4a15deb.tar.gz
barebox-d90948f2bd1f9462a765c665c45c643ab4a15deb.tar.xz
defaultenv-2: trigger DHCP before booting 'net'
Some variables may be set from DHCP requests, as shown below: barebox@ZII VF610 Development Board, Rev C:/ echo $global.hostname dev-rev-c barebox@ZII VF610 Development Board, Rev C:/ echo $global.net.server 0.0.0.0 barebox@ZII VF610 Development Board, Rev C:/ dhcp eth0: 100Mbps full duplex link detected T T T eth0: DHCP client bound to address 192.168.203.31 barebox@ZII VF610 Development Board, Rev C:/ echo $global.hostname zii-dev-rev-c-1 barebox@ZII VF610 Development Board, Rev C:/ echo $global.net.server 192.168.203.1 barebox@ZII VF610 Development Board, Rev C:/ These variables are used by the boot/net script, so it is necessary to trigger DHCP before we set the TFTP file paths, otherwise booting from net will fail like below and will need to be triggered twice: running /env/bin/init... Hit m for menu or any key to stop autoboot: 1 booting 'net' eth0: 100Mbps full duplex link detected T T T eth0: DHCP client bound to address 192.168.203.31 WARNING: eth1: No MAC address set. Using random address 8a:ee:18:f5:98:e7 T T T T T T T T T T T T T T T T T T T T could not open /mnt/tftp/none-linux-dev-rev-c: No such file or directory ERROR: Booting 'net' failed: No such file or directory boot: No such file or directory type exit to get to the menu barebox@ZII VF610 Development Board, Rev C:/ boot booting 'net' Loading ARM Linux zImage '/mnt/tftp/none-linux-zii-dev-rev-c-1' Loaded initrd unknown '/mnt/tftp/none-initramfs-zii-dev-rev-c-1' initrd is at 0x82509000-0x835593ff Loading devicetree from '/mnt/tftp/none-oftree-zii-dev-rev-c-1' commandline: console=ttyLP0,115200n8 ip=dhcp Ucompressing Linux... done, booting the kernel. To fix this, bring the interfaces up before setting up tftpboot. Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv')
-rw-r--r--defaultenv/defaultenv-2-base/boot/net3
1 files changed, 3 insertions, 0 deletions
diff --git a/defaultenv/defaultenv-2-base/boot/net b/defaultenv/defaultenv-2-base/boot/net
index f8895290ad..26e931ce63 100644
--- a/defaultenv/defaultenv-2-base/boot/net
+++ b/defaultenv/defaultenv-2-base/boot/net
@@ -2,6 +2,9 @@
path="/mnt/tftp"
+# global.net.server and global.hostname may be set by DHCP, so trigger it first
+ifup -a
+
global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
oftree="${path}/${global.user}-oftree-${global.hostname}"