Patchwork [V3,2/2] connman-conf: configures connman in qemu machines

login
register
mail settings
Submitter Cristian Iorga
Date Jan. 11, 2013, 10:53 a.m.
Message ID <1357901618-21786-3-git-send-email-cristian.iorga@intel.com>
Download mbox | patch
Permalink /patch/42489/
State New
Headers show

Comments

Cristian Iorga - Jan. 11, 2013, 10:53 a.m.
For qemu machines, connman should not configure
virtual wired interfaces. Wired interfaces (eth0)
are assigned static IP addresses by the virtual machine
manager (qemu). This packages places the eth0 interface in
a list of blacklisted interfaces, forbiding connman
administering wired interfaces for qemu machines.

Fixes [YOCTO #3227].

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
---
 meta/conf/layer.conf                                 |    1 +
 meta/conf/machine/include/qemu.inc                   |    2 ++
 meta/recipes-connectivity/connman/connman-conf.bb    |   18 ++++++++++++++++++
 .../connman/connman-conf/qemuall/main.conf           |    3 +++
 4 files changed, 24 insertions(+)
 create mode 100644 meta/recipes-connectivity/connman/connman-conf.bb
 create mode 100644 meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
Martin Jansa - Jan. 11, 2013, 11:27 a.m.
On Fri, Jan 11, 2013 at 12:53:38PM +0200, Cristian Iorga wrote:
> For qemu machines, connman should not configure
> virtual wired interfaces. Wired interfaces (eth0)
> are assigned static IP addresses by the virtual machine
> manager (qemu). This packages places the eth0 interface in
> a list of blacklisted interfaces, forbiding connman
> administering wired interfaces for qemu machines.

This should be applied before 1/2 which is RRECOMMENDING this.

Cheers,

> Fixes [YOCTO #3227].
> 
> Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
> ---
>  meta/conf/layer.conf                                 |    1 +
>  meta/conf/machine/include/qemu.inc                   |    2 ++
>  meta/recipes-connectivity/connman/connman-conf.bb    |   18 ++++++++++++++++++
>  .../connman/connman-conf/qemuall/main.conf           |    3 +++
>  4 files changed, 24 insertions(+)
>  create mode 100644 meta/recipes-connectivity/connman/connman-conf.bb
>  create mode 100644 meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
> 
> diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
> index 78ceae9..3259e5c 100644
> --- a/meta/conf/layer.conf
> +++ b/meta/conf/layer.conf
> @@ -22,6 +22,7 @@ SIGGEN_EXCLUDERECIPES_ABISAFE += " \
>    shadow-securetty \
>    opkg-config-base \
>    netbase \
> +  connman-conf \
>    formfactor \
>    xserver-xf86-config \
>    pointercal \
> diff --git a/meta/conf/machine/include/qemu.inc b/meta/conf/machine/include/qemu.inc
> index 5d59a7f..c1012ab 100644
> --- a/meta/conf/machine/include/qemu.inc
> +++ b/meta/conf/machine/include/qemu.inc
> @@ -10,6 +10,8 @@ XSERVER ?= "xserver-xorg \
>  
>  MACHINE_FEATURES = "apm alsa pcmcia bluetooth irda usbgadget screen"
>  
> +MACHINEOVERRIDES .= ":qemuall"
> +
>  IMAGE_FSTYPES += "tar.bz2 ext3"
>  
>  ROOT_FLASH_SIZE = "280"
> diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
> new file mode 100644
> index 0000000..7c7ef26
> --- /dev/null
> +++ b/meta/recipes-connectivity/connman/connman-conf.bb
> @@ -0,0 +1,18 @@
> +#connman config to ignore wired interfaces on qemu machines
> +
> +LICENSE = "GPLv2"
> +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
> +
> +SRC_URI_append_qemuall = " file://main.conf"
> +
> +PR = "r0"
> +
> +PACKAGE_ARCH = "${MACHINE_ARCH}"
> +
> +do_install() {
> +    #Blacklist ethn network interface in case of qemu* machines
> +    if test -e ${WORKDIR}/main.conf; then
> +        install -d ${D}${sysconfdir}/connman
> +        install -m 0644 ${WORKDIR}/main.conf ${D}${sysconfdir}/connman
> +    fi
> +}
> diff --git a/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf b/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
> new file mode 100644
> index 0000000..01973e7
> --- /dev/null
> +++ b/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
> @@ -0,0 +1,3 @@
> +[General]
> +
> +NetworkInterfaceBlacklist = eth
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Cristian Iorga - Jan. 11, 2013, 12:01 p.m.
Yes, I think I missed that. Should I resend the patches?

-----Original Message-----
From: Martin Jansa [mailto:martin.jansa@gmail.com] 
Sent: Friday, January 11, 2013 1:28 PM
To: Iorga, Cristian
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH V3 2/2] connman-conf: configures connman in qemu machines

On Fri, Jan 11, 2013 at 12:53:38PM +0200, Cristian Iorga wrote:
> For qemu machines, connman should not configure virtual wired 
> interfaces. Wired interfaces (eth0) are assigned static IP addresses 
> by the virtual machine manager (qemu). This packages places the eth0 
> interface in a list of blacklisted interfaces, forbiding connman 
> administering wired interfaces for qemu machines.

This should be applied before 1/2 which is RRECOMMENDING this.

Cheers,

> Fixes [YOCTO #3227].
> 
> Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
> ---
>  meta/conf/layer.conf                                 |    1 +
>  meta/conf/machine/include/qemu.inc                   |    2 ++
>  meta/recipes-connectivity/connman/connman-conf.bb    |   18 ++++++++++++++++++
>  .../connman/connman-conf/qemuall/main.conf           |    3 +++
>  4 files changed, 24 insertions(+)
>  create mode 100644 meta/recipes-connectivity/connman/connman-conf.bb
>  create mode 100644 
> meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
> 
> diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf index 
> 78ceae9..3259e5c 100644
> --- a/meta/conf/layer.conf
> +++ b/meta/conf/layer.conf
> @@ -22,6 +22,7 @@ SIGGEN_EXCLUDERECIPES_ABISAFE += " \
>    shadow-securetty \
>    opkg-config-base \
>    netbase \
> +  connman-conf \
>    formfactor \
>    xserver-xf86-config \
>    pointercal \
> diff --git a/meta/conf/machine/include/qemu.inc 
> b/meta/conf/machine/include/qemu.inc
> index 5d59a7f..c1012ab 100644
> --- a/meta/conf/machine/include/qemu.inc
> +++ b/meta/conf/machine/include/qemu.inc
> @@ -10,6 +10,8 @@ XSERVER ?= "xserver-xorg \
>  
>  MACHINE_FEATURES = "apm alsa pcmcia bluetooth irda usbgadget screen"
>  
> +MACHINEOVERRIDES .= ":qemuall"
> +
>  IMAGE_FSTYPES += "tar.bz2 ext3"
>  
>  ROOT_FLASH_SIZE = "280"
> diff --git a/meta/recipes-connectivity/connman/connman-conf.bb 
> b/meta/recipes-connectivity/connman/connman-conf.bb
> new file mode 100644
> index 0000000..7c7ef26
> --- /dev/null
> +++ b/meta/recipes-connectivity/connman/connman-conf.bb
> @@ -0,0 +1,18 @@
> +#connman config to ignore wired interfaces on qemu machines
> +
> +LICENSE = "GPLv2"
> +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
> +
> +SRC_URI_append_qemuall = " file://main.conf"
> +
> +PR = "r0"
> +
> +PACKAGE_ARCH = "${MACHINE_ARCH}"
> +
> +do_install() {
> +    #Blacklist ethn network interface in case of qemu* machines
> +    if test -e ${WORKDIR}/main.conf; then
> +        install -d ${D}${sysconfdir}/connman
> +        install -m 0644 ${WORKDIR}/main.conf ${D}${sysconfdir}/connman
> +    fi
> +}
> diff --git 
> a/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf 
> b/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
> new file mode 100644
> index 0000000..01973e7
> --- /dev/null
> +++ b/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
> @@ -0,0 +1,3 @@
> +[General]
> +
> +NetworkInterfaceBlacklist = eth
> --
> 1.7.10.4
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Enrico Scholz - Jan. 11, 2013, 12:22 p.m.
Cristian Iorga <cristian.iorga-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
writes:

> For qemu machines, connman should not configure virtual wired interfaces.

This is not a qemu-only problem but affects all platforms with nfs
rootfs, isn't it?

Setup whether to disable configuration of interface should be done
dynamically and based on e.g. whether rootfs is on nfs and/or if kernel
cmdline contains 'ip=...'.


> Wired interfaces (eth0) are assigned static IP addresses by the virtual
> machine manager (qemu). This packages places the eth0 interface in a
> list of blacklisted interfaces, forbiding connman administering wired
> interfaces for qemu machines.

Unfortunatly, this breaks DNS in the machine because DNS server information
are not retrieved from DHCP anymore :(



Enrico
Cristian Iorga - Jan. 11, 2013, 1 p.m.
Hello Enrico, see my answers below.

Regards,
Cristian

-----Original Message-----
From: Enrico Scholz [mailto:enrico.scholz@sigma-chemnitz.de] 
Sent: Friday, January 11, 2013 2:23 PM
To: openembedded-core@lists.openembedded.org
Cc: Cristian Iorga
Subject: Re: [PATCH V3 2/2] connman-conf: configures connman in qemu machines



Cristian Iorga <cristian.iorga-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
writes:

> For qemu machines, connman should not configure virtual wired interfaces.

This is not a qemu-only problem but affects all platforms with nfs rootfs, isn't it?
	In this particular case, it's only related to qemu in the network environment presented to a virtual machine.
	There is a separate patch for the $nfsroot issue.

Setup whether to disable configuration of interface should be done dynamically and based on e.g. whether rootfs is on nfs and/or if kernel cmdline contains 'ip=...'.
	In my opinion, that's debatable. Qemu images for sure won't have a DHCP to send request too (as the setup is done now); as such, the build system can decide in advance to blacklist ethn to connman.
	To me, the $nfsroot fix is OK. It is done dynamically done, and on need by need base.



> Wired interfaces (eth0) are assigned static IP addresses by the 
> virtual machine manager (qemu). This packages places the eth0 
> interface in a list of blacklisted interfaces, forbiding connman 
> administering wired interfaces for qemu machines.

Unfortunatly, this breaks DNS in the machine because DNS server information are not retrieved from DHCP anymore :(
	In which machine? qemu*? Is there a DHCP server to work with? That's the main problem that I am seeing, that there is no DHCP server, and, in the end, connman will assign a Zeroconf IP address to eth0.
	As far as I know, there will be no DNS server set if Zeroconf is used.



Enrico

Patch

diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
index 78ceae9..3259e5c 100644
--- a/meta/conf/layer.conf
+++ b/meta/conf/layer.conf
@@ -22,6 +22,7 @@  SIGGEN_EXCLUDERECIPES_ABISAFE += " \
   shadow-securetty \
   opkg-config-base \
   netbase \
+  connman-conf \
   formfactor \
   xserver-xf86-config \
   pointercal \
diff --git a/meta/conf/machine/include/qemu.inc b/meta/conf/machine/include/qemu.inc
index 5d59a7f..c1012ab 100644
--- a/meta/conf/machine/include/qemu.inc
+++ b/meta/conf/machine/include/qemu.inc
@@ -10,6 +10,8 @@  XSERVER ?= "xserver-xorg \
 
 MACHINE_FEATURES = "apm alsa pcmcia bluetooth irda usbgadget screen"
 
+MACHINEOVERRIDES .= ":qemuall"
+
 IMAGE_FSTYPES += "tar.bz2 ext3"
 
 ROOT_FLASH_SIZE = "280"
diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
new file mode 100644
index 0000000..7c7ef26
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf.bb
@@ -0,0 +1,18 @@ 
+#connman config to ignore wired interfaces on qemu machines
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI_append_qemuall = " file://main.conf"
+
+PR = "r0"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+    #Blacklist ethn network interface in case of qemu* machines
+    if test -e ${WORKDIR}/main.conf; then
+        install -d ${D}${sysconfdir}/connman
+        install -m 0644 ${WORKDIR}/main.conf ${D}${sysconfdir}/connman
+    fi
+}
diff --git a/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf b/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
new file mode 100644
index 0000000..01973e7
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
@@ -0,0 +1,3 @@ 
+[General]
+
+NetworkInterfaceBlacklist = eth