[OE-core] [PATCH 01/17] connman-conf: ignore eth0 in qemu in a way that is not sysvinit-specific


Richard Purdie
 

Hi Jan-Simon/Scott,

The attached change is going to break meta-agl:

https://autobuilder.yoctoproject.org/typhoon/#/builders/120/builds/1032

I think what OE-Core plans to do with a config file isn't unreasonable and it
does fix autobuilder intermittent failures that are driving us slightly crazy so
I'd really like to merge it ASAP really.

I think there should be options for sorting this on the AGL side. We probably do
need to make this change in kirkstone too.

Cheers,

Richard


Jan Simon Moeller
 

If that fixes a lot of intermittent issues - of course.

Just thinking loud:
What about making main.conf's 'Blacklist' changeable by a config
variable we can set ?
Autobuilder could have this as 'eth0' , we could ignore a different
interface easily then (or none).
Not sure if eth0 should be in the list by default for everyone ?

E.g. we set
meta-agl/meta-agl-core/recipes-connectivity/connman/files/main.conf:NetworkInterfaceBlacklist=vmnet,vboxnet,virbr,ifb,meth

In one case we grep or sed ...
meta-agl-demo/recipes-config/cluster-demo-network-config/files/cluster-demo-network-conf.sh:if
! grep '^NetworkInterfaceBlacklist=' ${CONNMAN_CONF} | grep -q $1;
then
meta-agl-demo/recipes-config/cluster-demo-network-config/files/cluster-demo-network-conf.sh:
sed -i "s/^\(NetworkInterfaceBlacklist=.*\)/\1,$1/" ${CONNMAN_CONF}
meta-agl-demo/recipes-connectivity/connman/connman_agldemo.inc:
sed -i 's/^\(NetworkInterfaceBlacklist=.*\)/\1,eth1/'
${D}${sysconfdir}/connman/main.conf

@Scott, whats your take ?

Best regards,
Jan-Simon

On Fri, Apr 8, 2022 at 9:09 AM Richard Purdie
<richard.purdie@...> wrote:

Hi Jan-Simon/Scott,

The attached change is going to break meta-agl:

https://autobuilder.yoctoproject.org/typhoon/#/builders/120/builds/1032

I think what OE-Core plans to do with a config file isn't unreasonable and it
does fix autobuilder intermittent failures that are driving us slightly crazy so
I'd really like to merge it ASAP really.

I think there should be options for sorting this on the AGL side. We probably do
need to make this change in kirkstone too.

Cheers,

Richard



---------- Forwarded message ----------
From: Alexander Kanavin <alex.kanavin@...>
To: openembedded-core@...
Cc: Alexander Kanavin <alex@...>
Bcc:
Date: Thu, 7 Apr 2022 19:00:13 +0200
Subject: [OE-core] [PATCH 01/17] connman-conf: ignore eth0 in qemu in a way that is not sysvinit-specific
Signed-off-by: Alexander Kanavin <alex@...>
---
meta/recipes-connectivity/connman/connman-conf.bb | 7 +++++--
meta/recipes-connectivity/connman/connman-conf/main.conf | 2 ++
2 files changed, 7 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-connectivity/connman/connman-conf/main.conf

diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
index 6b9207c4cb..7959ed8e50 100644
--- a/meta/recipes-connectivity/connman/connman-conf.bb
+++ b/meta/recipes-connectivity/connman/connman-conf.bb
@@ -6,6 +6,9 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;m

PR = "r2"

+SRC_URI = "file://main.conf \
+ "
+
S = "${WORKDIR}"

PACKAGE_ARCH = "${MACHINE_ARCH}"
@@ -14,6 +17,6 @@ FILES:${PN} = "${sysconfdir}/*"

# Kernel IP-Config is perfectly capable of setting up networking passed in via ip=
do_install:append:qemuall() {
- mkdir -p ${D}${sysconfdir}/default
- echo "export EXTRA_PARAM=\"-I eth0\"" > ${D}${sysconfdir}/default/connman
+ mkdir -p ${D}${sysconfdir}/connman
+ cp ${S}/main.conf ${D}${sysconfdir}/connman/main.conf
}
diff --git a/meta/recipes-connectivity/connman/connman-conf/main.conf b/meta/recipes-connectivity/connman/connman-conf/main.conf
new file mode 100644
index 0000000000..a394e8f25b
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf/main.conf
@@ -0,0 +1,2 @@
+[General]
+NetworkInterfaceBlacklist = eth0
--
2.30.2




Jan Simon Moeller
 

BTW, in our network-booted lava tests, we use this in the initrd even:
The initrd mounts a nbd device as root. Any network blib (down/up)
will make things fail.
Alittle ugly, but works ...

# workaround for connman (avoid bringing down the network interface
used for booting, disable DNS proxy)
if [[ -f /lib/systemd/system/connman.service ]]; then
newopts="-r -n"
iface=$(find_active_interface)
[[ -n "$iface" ]] && newopts="$newopts -I $iface"

log_info "Adjusting Connman command line. Will be: 'connmand $newopts'"
sed -i "s|connmand -n\$|connmand $newopts|g"
/lib/systemd/system/connman.service
fi


Best regards,
Jan-Simon

------
Jan-Simon Möller
AGL Release Manager
The Linux Foundation

Visit us at:
www.automotivegradelinux.org
lists.automotivelinux.org
www.linuxfoundation.org

On Fri, Apr 8, 2022 at 12:55 PM Jan Simon Moeller via
lists.yoctoproject.org
<jsmoeller=linuxfoundation.org@...> wrote:


If that fixes a lot of intermittent issues - of course.

Just thinking loud:
What about making main.conf's 'Blacklist' changeable by a config
variable we can set ?
Autobuilder could have this as 'eth0' , we could ignore a different
interface easily then (or none).
Not sure if eth0 should be in the list by default for everyone ?

E.g. we set
meta-agl/meta-agl-core/recipes-connectivity/connman/files/main.conf:NetworkInterfaceBlacklist=vmnet,vboxnet,virbr,ifb,meth

In one case we grep or sed ...
meta-agl-demo/recipes-config/cluster-demo-network-config/files/cluster-demo-network-conf.sh:if
! grep '^NetworkInterfaceBlacklist=' ${CONNMAN_CONF} | grep -q $1;
then
meta-agl-demo/recipes-config/cluster-demo-network-config/files/cluster-demo-network-conf.sh:
sed -i "s/^\(NetworkInterfaceBlacklist=.*\)/\1,$1/" ${CONNMAN_CONF}
meta-agl-demo/recipes-connectivity/connman/connman_agldemo.inc:
sed -i 's/^\(NetworkInterfaceBlacklist=.*\)/\1,eth1/'
${D}${sysconfdir}/connman/main.conf

@Scott, whats your take ?

Best regards,
Jan-Simon

On Fri, Apr 8, 2022 at 9:09 AM Richard Purdie
<richard.purdie@...> wrote:

Hi Jan-Simon/Scott,

The attached change is going to break meta-agl:

https://autobuilder.yoctoproject.org/typhoon/#/builders/120/builds/1032

I think what OE-Core plans to do with a config file isn't unreasonable and it
does fix autobuilder intermittent failures that are driving us slightly crazy so
I'd really like to merge it ASAP really.

I think there should be options for sorting this on the AGL side. We probably do
need to make this change in kirkstone too.

Cheers,

Richard



---------- Forwarded message ----------
From: Alexander Kanavin <alex.kanavin@...>
To: openembedded-core@...
Cc: Alexander Kanavin <alex@...>
Bcc:
Date: Thu, 7 Apr 2022 19:00:13 +0200
Subject: [OE-core] [PATCH 01/17] connman-conf: ignore eth0 in qemu in a way that is not sysvinit-specific
Signed-off-by: Alexander Kanavin <alex@...>
---
meta/recipes-connectivity/connman/connman-conf.bb | 7 +++++--
meta/recipes-connectivity/connman/connman-conf/main.conf | 2 ++
2 files changed, 7 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-connectivity/connman/connman-conf/main.conf

diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
index 6b9207c4cb..7959ed8e50 100644
--- a/meta/recipes-connectivity/connman/connman-conf.bb
+++ b/meta/recipes-connectivity/connman/connman-conf.bb
@@ -6,6 +6,9 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;m

PR = "r2"

+SRC_URI = "file://main.conf \
+ "
+
S = "${WORKDIR}"

PACKAGE_ARCH = "${MACHINE_ARCH}"
@@ -14,6 +17,6 @@ FILES:${PN} = "${sysconfdir}/*"

# Kernel IP-Config is perfectly capable of setting up networking passed in via ip=
do_install:append:qemuall() {
- mkdir -p ${D}${sysconfdir}/default
- echo "export EXTRA_PARAM=\"-I eth0\"" > ${D}${sysconfdir}/default/connman
+ mkdir -p ${D}${sysconfdir}/connman
+ cp ${S}/main.conf ${D}${sysconfdir}/connman/main.conf
}
diff --git a/meta/recipes-connectivity/connman/connman-conf/main.conf b/meta/recipes-connectivity/connman/connman-conf/main.conf
new file mode 100644
index 0000000000..a394e8f25b
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf/main.conf
@@ -0,0 +1,2 @@
+[General]
+NetworkInterfaceBlacklist = eth0
--
2.30.2







Richard Purdie
 

On Fri, 2022-04-08 at 12:55 +0200, Jan-Simon Moeller wrote:
If that fixes a lot of intermittent issues - of course.

Just thinking loud:
What about making main.conf's 'Blacklist' changeable by a config
variable we can set ?
Autobuilder could have this as 'eth0' , we could ignore a different
interface easily then (or none).
Not sure if eth0 should be in the list by default for everyone ?

E.g. we set
meta-agl/meta-agl-core/recipes-connectivity/connman/files/main.conf:NetworkInterfaceBlacklist=vmnet,vboxnet,virbr,ifb,meth

In one case we grep or sed ...
meta-agl-demo/recipes-config/cluster-demo-network-config/files/cluster-demo-network-conf.sh:if
! grep '^NetworkInterfaceBlacklist=' ${CONNMAN_CONF} | grep -q $1;
then
meta-agl-demo/recipes-config/cluster-demo-network-config/files/cluster-demo-network-conf.sh:
sed -i "s/^\(NetworkInterfaceBlacklist=.*\)/\1,$1/" ${CONNMAN_CONF}
meta-agl-demo/recipes-connectivity/connman/connman_agldemo.inc:
sed -i 's/^\(NetworkInterfaceBlacklist=.*\)/\1,eth1/'
${D}${sysconfdir}/connman/main.conf

@Scott, whats your take ?
The AGL file[1] appears to have another entry in it for FallbackTimeservers. It
is also complicated by oe-core only doing this for qemu* machines. I'm not sure
a single variable is going to work well.

It may be easier for AGL to change to tweaking connman-conf and then you can
just override the OE-Core file?

[1]
https://git.automotivelinux.org/AGL/meta-agl/tree/meta-agl-core/recipes-connectivity/connman/files/main.conf?h=next

Cheers,

Richard