From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 3/3] defaultenv-2: automount: use ifup -a1 for NFS/TFTP automounts
Date: Mon, 30 Jan 2023 08:20:57 +0100 [thread overview]
Message-ID: <20230130072057.34349-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230130072057.34349-1-a.fatoum@pengutronix.de>
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>
---
v1 -> v2:
- new patch
---
Documentation/user/automount.rst | 2 +-
defaultenv/defaultenv-2-base/boot/net | 2 +-
defaultenv/defaultenv-2-base/init/automount | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Documentation/user/automount.rst b/Documentation/user/automount.rst
index 1fdeffc66336..b41b41ef021d 100644
--- a/Documentation/user/automount.rst
+++ b/Documentation/user/automount.rst
@@ -15,7 +15,7 @@ TFTP server, the following is required:
.. code-block:: sh
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'
This creates an automountpoint on ``/mnt/tftp``. Whenever this directory is accessed,
the command ``ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp`` is executed.
diff --git a/defaultenv/defaultenv-2-base/boot/net b/defaultenv/defaultenv-2-base/boot/net
index e79432eb277c..98286ff5e050 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 0996cea04df7..39e823489793 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
--
2.30.2
next prev parent reply other threads:[~2023-01-30 17:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 7:20 [PATCH v2 0/3] net: ifup: greatly reduce ifup -a time for multiple network interface Ahmad Fatoum
2023-01-30 7:20 ` [PATCH v2 1/3] net: ifup: have ifup -a poll for link up in parallel Ahmad Fatoum
2023-01-30 7:20 ` [PATCH v2 2/3] net: ifup: have ifup -a1 stop at first DHCP-set global.net.server Ahmad Fatoum
2023-01-30 7:20 ` Ahmad Fatoum [this message]
2023-02-03 8:05 ` [PATCH v2 0/3] net: ifup: greatly reduce ifup -a time for multiple network interface Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230130072057.34349-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox