From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] system: Fix for NFS booting with interface config via DHCP
Date: Sun, 8 Nov 2015 14:57:23 +0100 [thread overview]
Message-ID: <20151108145723.49e07124@free-electrons.com> (raw)
In-Reply-To: <1446841557.4553.32.camel@rtred1test09.kymeta.local>
Dear Trent Piepho,
Thanks for working on this issue and proposing a solution for it!
On Fri, 6 Nov 2015 20:25:56 +0000, Trent Piepho wrote:
> Configuring the network interface with DHCP via
> /etc/network/interfaces generally does work when NFS booting. The
Isn't there a missing "not" in this sentence ?
> diff --git a/package/skeleton/nfs_check b/package/skeleton/nfs_check
> new file mode 100755
> index 0000000..1914404
> --- /dev/null
> +++ b/package/skeleton/nfs_check
I think this should be in the initscripts package, not the skeleton
package. The initscripts package is the one that installs S40network,
which is the initscript calling ifup.
However, it's true that the skeleton package is currently the one that
generates the 'interfaces' file. Does that make sense? Is systemd using
the interfaces file at all?
> @@ -0,0 +1,7 @@
> +#!/bin/sh
> +
> +nfsip=`awk '$3=="nfs" && $2=="/"{ sub(/:.*/,"",$1); print $1; }' /proc/mounts`
> +if [ -n "$nfsip" ] && ip route get to "$nfsip" | grep -q "dev $IFACE"; then
> + echo Skipping $IFACE, used for NFS from $nfsip
> + exit 1
I think we generally use tabs for indentation in shell scripts.
> +config BR2_SYSTEM_IFUP_NFS_ROOT
> + bool "Have network interface configuration cope with NFS root boot"
> + default y
> + depends on BR2_SYSTEM_DHCP != ""
> + help
> + This allows NFS booting to work while also enabling the
> + option to configure the network interface via DHCP.
> + Otherwise, a NFS booted system will likely hang during DHCP
> + configuration.
> +
> + Attempting to configure the network interface used for NFS
> + will initially bring that network down. Since the root
> + filesystem is accessed over this network, the system hangs.
> +
> + This option will add a script to the ifup system that will
> + attempt to detect if a NFS root mount uses the interface to
> + be configured, and if so does not configure it. This should
> + allow the same build to be disk/flash booted or NFS booted.
Like Arnout said, I'm not sure this option is really needed. Just
always install this script when DHCP is used. You can put this text as
a big comment at the beginning of the nfs-check script, or inside
the .mk file above the command that installs this script to TARGET_DIR.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2015-11-08 13:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 20:25 [Buildroot] [PATCH] system: Fix for NFS booting with interface config via DHCP Trent Piepho
2015-11-07 0:55 ` Arnout Vandecappelle
2015-11-07 1:44 ` Trent Piepho
2015-11-08 23:44 ` Arnout Vandecappelle
2015-11-09 21:29 ` Trent Piepho
2015-11-08 13:57 ` Thomas Petazzoni [this message]
2015-11-09 20:37 ` Trent Piepho
2015-11-09 22:16 ` [Buildroot] [PATCH v2] " Trent Piepho
2015-11-10 22:10 ` Arnout Vandecappelle
2015-11-18 21:16 ` Thomas Petazzoni
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=20151108145723.49e07124@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/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