* [PATCH] connman: Ignore the NFS root network interface in init script
@ 2013-09-06 7:23 Jukka Rissanen
2013-09-09 6:11 ` Yi Zhao
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jukka Rissanen @ 2013-09-06 7:23 UTC (permalink / raw)
To: openembedded-core
The connman init.d script tried to ignore all the network interfaces
if NFS root is configured. We should only ignore the interface
that is used by NFS root.
[YOCTO #4587]
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
---
meta/recipes-connectivity/connman/connman/connman | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-connectivity/connman/connman/connman b/meta/recipes-connectivity/connman/connman/connman
index 67ba7c8..2625ade 100644
--- a/meta/recipes-connectivity/connman/connman/connman
+++ b/meta/recipes-connectivity/connman/connman/connman
@@ -29,8 +29,18 @@ done
do_start() {
EXTRA_PARAM=""
if test $nfsroot -eq 1 ; then
- ethn=`ifconfig | grep eth | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"`
- EXTRA_PARAM="-I $ethn"
+ NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'`
+ NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ ]*\):.*$/\1/p'`
+
+ if [ x$NET_ADDR != x ]; then
+ for i in $NET_DEVS; do
+ ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`
+ if [ "$NET_ADDR" = "$ADDR" ]; then
+ EXTRA_PARAM="-I $i"
+ break
+ fi
+ done
+ fi
fi
if [ -f @LIBDIR@/connman/wired-setup ] ; then
. @LIBDIR@/connman/wired-setup
--
1.7.11.7
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] connman: Ignore the NFS root network interface in init script
2013-09-06 7:23 [PATCH] connman: Ignore the NFS root network interface in init script Jukka Rissanen
@ 2013-09-09 6:11 ` Yi Zhao
2013-09-16 16:08 ` Saul Wold
2013-09-16 18:06 ` Enrico Scholz
2 siblings, 0 replies; 4+ messages in thread
From: Yi Zhao @ 2013-09-09 6:11 UTC (permalink / raw)
To: Jukka Rissanen; +Cc: openembedded-core
This patch can not work on routerstationpro.
After apply this patch, the system can not boot up.
Here is the boot log (I print some variables):
...
Configuring network interfaces... ifup skipped for nfsroot interface eth0
run-parts: /etc/network/if-pre-up.d/nfsroot exited with code 1
Starting rpcbind daemon...done.
hwclock: can't open '/dev/misc/rtc': No such file or directory
Thu Sep 5 22:45:00 UTC 2013
hwclock: can't open '/dev/misc/rtc': No such file or directory
INIT: Entering runlevel: 5
Starting system message bus: dbus.
Starting Connection Manager
NET_DEVS = lo
eth1
sit0
eth0
NET_ADDR = 128.224.165.207:128.224.165.20:128.224.165.1:255.255.255.0::eth0
ADDR = 127.0.0.1
ADDR =
ADDR =
ADDR = 128.224.165.207
eth0: link down
nfs: server 128.224.165.20 not responding, still trying
The system can not boot up since eth0 down.
# cat /proc/cmdline
console=ttyS0,115200 root=/dev/nfs rw
nfsroot=128.224.165.20:/export/pxeboot/vlm-boards/19256/rootfs
ip=128.224.165.207:128.224.165.20:128.224.165.1:255.255.255.0::eth0:off
board=UBNT-RSPRO ethaddr=00.00.00.33.46.63
于 2013年09月06日 15:23, Jukka Rissanen 写道:
> The connman init.d script tried to ignore all the network interfaces
> if NFS root is configured. We should only ignore the interface
> that is used by NFS root.
>
> [YOCTO #4587]
>
> Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
> ---
> meta/recipes-connectivity/connman/connman/connman | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-connectivity/connman/connman/connman b/meta/recipes-connectivity/connman/connman/connman
> index 67ba7c8..2625ade 100644
> --- a/meta/recipes-connectivity/connman/connman/connman
> +++ b/meta/recipes-connectivity/connman/connman/connman
> @@ -29,8 +29,18 @@ done
> do_start() {
> EXTRA_PARAM=""
> if test $nfsroot -eq 1 ; then
> - ethn=`ifconfig | grep eth | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"`
> - EXTRA_PARAM="-I $ethn"
> + NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'`
> + NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ ]*\):.*$/\1/p'`
> +
> + if [ x$NET_ADDR != x ]; then
> + for i in $NET_DEVS; do
> + ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`
> + if [ "$NET_ADDR" = "$ADDR" ]; then
> + EXTRA_PARAM="-I $i"
> + break
> + fi
> + done
> + fi
> fi
> if [ -f @LIBDIR@/connman/wired-setup ] ; then
> . @LIBDIR@/connman/wired-setup
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] connman: Ignore the NFS root network interface in init script
2013-09-06 7:23 [PATCH] connman: Ignore the NFS root network interface in init script Jukka Rissanen
2013-09-09 6:11 ` Yi Zhao
@ 2013-09-16 16:08 ` Saul Wold
2013-09-16 18:06 ` Enrico Scholz
2 siblings, 0 replies; 4+ messages in thread
From: Saul Wold @ 2013-09-16 16:08 UTC (permalink / raw)
To: Jukka Rissanen; +Cc: openembedded-core
On 09/06/2013 12:23 AM, Jukka Rissanen wrote:
> The connman init.d script tried to ignore all the network interfaces
> if NFS root is configured. We should only ignore the interface
> that is used by NFS root.
>
> [YOCTO #4587]
>
> Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
> ---
> meta/recipes-connectivity/connman/connman/connman | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-connectivity/connman/connman/connman b/meta/recipes-connectivity/connman/connman/connman
> index 67ba7c8..2625ade 100644
> --- a/meta/recipes-connectivity/connman/connman/connman
> +++ b/meta/recipes-connectivity/connman/connman/connman
> @@ -29,8 +29,18 @@ done
> do_start() {
> EXTRA_PARAM=""
> if test $nfsroot -eq 1 ; then
> - ethn=`ifconfig | grep eth | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"`
> - EXTRA_PARAM="-I $ethn"
> + NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'`
> + NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ ]*\):.*$/\1/p'`
> +
> + if [ x$NET_ADDR != x ]; then
> + for i in $NET_DEVS; do
> + ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`
> + if [ "$NET_ADDR" = "$ADDR" ]; then
> + EXTRA_PARAM="-I $i"
> + break
> + fi
> + done
> + fi
> fi
> if [ -f @LIBDIR@/connman/wired-setup ] ; then
> . @LIBDIR@/connman/wired-setup
>
This seems to have introduced a different issue, please see
https://bugzilla.yoctoproject.org/show_bug.cgi?id=5176
Can you please look into this.
Thanks
Sau!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] connman: Ignore the NFS root network interface in init script
2013-09-06 7:23 [PATCH] connman: Ignore the NFS root network interface in init script Jukka Rissanen
2013-09-09 6:11 ` Yi Zhao
2013-09-16 16:08 ` Saul Wold
@ 2013-09-16 18:06 ` Enrico Scholz
2 siblings, 0 replies; 4+ messages in thread
From: Enrico Scholz @ 2013-09-16 18:06 UTC (permalink / raw)
To: openembedded-core
Jukka Rissanen <jukka.rissanen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
writes:
> The connman init.d script tried to ignore all the network interfaces
> if NFS root is configured. We should only ignore the interface that is
> used by NFS root.
This does not really work; e.g. here:
1. the cmdline is 'ip=dhcp' and won't be detected by your expression
2. system needs information from dhcp for DNS and NTP
3. system must renew the DHCP lease periodically
I wrote
https://www.cvg.de/people/ensc/0001-added-noipconfig-option.patch
which fixes the last two issues (it's probably too invasive and specific
to be applied upstream). I do not think that point 1 can be solved in a
generic way but requires some customization.
Enrico
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-16 18:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-06 7:23 [PATCH] connman: Ignore the NFS root network interface in init script Jukka Rissanen
2013-09-09 6:11 ` Yi Zhao
2013-09-16 16:08 ` Saul Wold
2013-09-16 18:06 ` Enrico Scholz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox