[OE-core] [PATCH v4] connman: ignore the networking device which nfs for rootfs is working on

Koen Kooi koen at dominion.thruhere.net
Fri Oct 18 08:57:07 UTC 2013


Op 18 okt. 2013, om 10:12 heeft rongqing.li at windriver.com het volgende geschreven:

> From: Roy Li <rongqing.li at windriver.com>
> 
> Create connman-evn.service, which will run a script to compute the networking
> device when nfs root is on, and pass the result to connman.service
> 
> Copy Connmand.service from source code, add ExecStartPre into it to release
> do_configure_append work, use the options which is passed by connman-evn.service
> 
> Signed-off-by: Roy Li <rongqing.li at windriver.com>
> ---
> 
> +++ b/meta/recipes-connectivity/connman/connman/connman-env.service
> @@ -0,0 +1,13 @@
> +[Unit]
> +Description=Generate options for connection service
> +Before=connman.service
> +ConditionKernelCommandLine=root=/dev/nfs

So this only runs when using NFS root and calls...

> +After=syslog.target
> +
> +[Service]
> +Type=oneshot
> +ExecStart=@SBINDIR@/connmand-env

... the above script. Let's see what the script does below ...

> +++ b/meta/recipes-connectivity/connman/connman/connmand-env
> @@ -0,0 +1,42 @@
> +#!/bin/sh
> +
> +nfsroot=0
> +
> +exec 9<&0 < /proc/mounts
> +while read dev mtpt fstype rest; do
> +	if test $mtpt = "/" ; then
> +		case $fstype in
> +		    nfs | nfs4)
> +			nfsroot=1
> +			break
> +			;;
> +		    *)
> +			;;
> +		esac
> +	fi
> +done
> +
> +EXTRA_PARAM=""
> +if test $nfsroot -eq 1 ; then

Ah. A whole lot of tests for a script that only runs *after* NFS root has been detected already. Looks like you can kill that part of the script.





More information about the Openembedded-core mailing list