summaryrefslogtreecommitdiff
path: root/defaultenv
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-01-30 08:20:57 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2023-02-03 09:05:26 +0100
commite272497bf5096408f5648d185d18b2131453f188 (patch)
tree785b77c299ce0460e516150ef3cf2285fc8bbc5c /defaultenv
parent855c2aae12bdcc3af2d5a51ad795346e7f6316ca (diff)
downloadbarebox-e272497bf5096408f5648d185d18b2131453f188.tar.gz
defaultenv-2: automount: use ifup -a1 for NFS/TFTP automounts
The ifup -a in the automounts has too big a scope: The remote server is specified at mount time, so we could stop bringing up interfaces once $global.net.server becomes resolvable. For the common case, where $global.net.server is initially empty and then set via DHCP, ifup provides the new -1 option to early-exit once $global.net.server was set. For setups where one, but not all, Ethernet interfaces have a cable attached, this normally reduces ifup -a time from 10s to 1s. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230130072057.34349-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv')
-rw-r--r--defaultenv/defaultenv-2-base/boot/net2
-rw-r--r--defaultenv/defaultenv-2-base/init/automount4
2 files changed, 3 insertions, 3 deletions
diff --git a/defaultenv/defaultenv-2-base/boot/net b/defaultenv/defaultenv-2-base/boot/net
index e79432eb27..98286ff5e0 100644
--- a/defaultenv/defaultenv-2-base/boot/net
+++ b/defaultenv/defaultenv-2-base/boot/net
@@ -3,7 +3,7 @@
path="/mnt/tftp"
# global.net.server and global.hostname may be set by DHCP, so trigger it first
-ifup -a
+ifup -a1
global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
diff --git a/defaultenv/defaultenv-2-base/init/automount b/defaultenv/defaultenv-2-base/init/automount
index 0996cea04d..39e8234897 100644
--- a/defaultenv/defaultenv-2-base/init/automount
+++ b/defaultenv/defaultenv-2-base/init/automount
@@ -3,12 +3,12 @@
# automount tftp server
mkdir -p /mnt/tftp
-automount /mnt/tftp 'ifup -a && mount -t tftp $global.net.server /mnt/tftp'
+automount /mnt/tftp 'ifup -a1 && mount -t tftp $global.net.server /mnt/tftp'
# automount nfs server's nfsroot
mkdir -p /mnt/nfs
-automount /mnt/nfs 'ifup -a && mount -t nfs ${global.net.server}:/home/${global.user}/nfsroot/${global.hostname} /mnt/nfs'
+automount /mnt/nfs 'ifup -a1 && mount -t nfs ${global.net.server}:/home/${global.user}/nfsroot/${global.hostname} /mnt/nfs'
# FAT on usb disk example