All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] connman: implement network interface management techniques
@ 2022-06-21 14:00 Muhammad Hamza
  2022-06-21 14:01 ` [OE-core] " Alexander Kanavin
  2022-06-21 16:43 ` Richard Purdie
  0 siblings, 2 replies; 5+ messages in thread
From: Muhammad Hamza @ 2022-06-21 14:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Muhammad Hamza, Srikanth Krishnakar

This is required to obtain a managed network interface before connman
tries to call cleanup_devices function, this will let connman
create new routing table without bringing down the ethernet interface.

Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
Signed-off-by: Muhammad Hamza <muhammad_hamza@mentor.com>
---
 ...t-network-interface-management-techn.patch | 31 +++++++++++++++++++
 .../connman/connman_1.41.bb                   |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch

diff --git a/meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch b/meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch
new file mode 100644
index 0000000000..06695ea566
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch
@@ -0,0 +1,31 @@
+From e6dedb531096f29825bddaf428ca8d3c4ad1df26 Mon Sep 17 00:00:00 2001
+From: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
+Date: Tue, 1 Jul 2014 23:47:15 +0530
+Subject: [PATCH] connman: implement network interface management techniques
+
+This is required to obtain a managed network interface before connman
+tries to call cleanup_devices function, this will let connman
+create new routing table without bringing down the ethernet interface.
+
+Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
+
+---
+ src/connman.service.in | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/connman.service.in b/src/connman.service.in
+index 79e75d6..0e7275a 100644
+--- a/src/connman.service.in
++++ b/src/connman.service.in
+@@ -12,7 +12,10 @@ Conflicts=systemd-resolved.service
+ Type=dbus
+ BusName=net.connman
+ Restart=on-failure
+-ExecStart=@sbindir@/connmand -n
++EnvironmentFile=-/tmp/connman.env
++ExecStartPre=/bin/sh -c "if grep 'nfsroot\|ip=' /proc/cmdline; then ETH_IFACE=$(ip addr | grep 'eth[0-9]:' | grep 'UP' | sed -e 's,\(eth[0-9]\)\(.*\),\1,' -e 's,^.*: ,,' ); NET_ADDR=$(cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'); echo -e 'OPT=-I '$ETH_IFACE'\nOPT2='$ETH_IFACE'\nNET_ADDR='$NET_ADDR' ' > /tmp/connman.env; fi "
++ExecStart=/bin/sh -c "if [ \"$NET_ADDR\" = \"off\" ] || [ \"$NET_ADDR\" = \"none\" ]; then /usr/sbin/connmand -n; else /usr/sbin/connmand -n $OPT; fi"
++ExecStartPost=/bin/sh -c "if [ ! -z \"$OPT\" ] && [ \"$NET_ADDR\" = \"dhcp\" ]; then /sbin/udhcpc -i $OPT2; fi"
+ StandardOutput=null
+ CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_ADMIN
+ ProtectHome=true
diff --git a/meta/recipes-connectivity/connman/connman_1.41.bb b/meta/recipes-connectivity/connman/connman_1.41.bb
index 736b78eaeb..9c09a71f46 100644
--- a/meta/recipes-connectivity/connman/connman_1.41.bb
+++ b/meta/recipes-connectivity/connman/connman_1.41.bb
@@ -5,6 +5,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
            file://0001-connman.service-stop-systemd-resolved-when-we-use-co.patch \
            file://connman \
            file://no-version-scripts.patch \
+           file://0001-connman-implement-network-interface-management-techn.patch \
            "
 
 SRC_URI:append:libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] connman: implement network interface management techniques
  2022-06-21 14:00 [PATCH] connman: implement network interface management techniques Muhammad Hamza
@ 2022-06-21 14:01 ` Alexander Kanavin
  2022-06-21 16:43 ` Richard Purdie
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Kanavin @ 2022-06-21 14:01 UTC (permalink / raw)
  To: Muhammad Hamza; +Cc: OE-core, Srikanth Krishnakar

This looks like it should be going to connman upstream, not to
openembedded-core?

Alex

On Tue, 21 Jun 2022 at 16:01, Muhammad Hamza <Muhammad_Hamza@mentor.com> wrote:
>
> This is required to obtain a managed network interface before connman
> tries to call cleanup_devices function, this will let connman
> create new routing table without bringing down the ethernet interface.
>
> Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
> Signed-off-by: Muhammad Hamza <muhammad_hamza@mentor.com>
> ---
>  ...t-network-interface-management-techn.patch | 31 +++++++++++++++++++
>  .../connman/connman_1.41.bb                   |  1 +
>  2 files changed, 32 insertions(+)
>  create mode 100644 meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch
>
> diff --git a/meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch b/meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch
> new file mode 100644
> index 0000000000..06695ea566
> --- /dev/null
> +++ b/meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch
> @@ -0,0 +1,31 @@
> +From e6dedb531096f29825bddaf428ca8d3c4ad1df26 Mon Sep 17 00:00:00 2001
> +From: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
> +Date: Tue, 1 Jul 2014 23:47:15 +0530
> +Subject: [PATCH] connman: implement network interface management techniques
> +
> +This is required to obtain a managed network interface before connman
> +tries to call cleanup_devices function, this will let connman
> +create new routing table without bringing down the ethernet interface.
> +
> +Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
> +
> +---
> + src/connman.service.in | 5 ++++-
> + 1 file changed, 4 insertions(+), 1 deletion(-)
> +
> +diff --git a/src/connman.service.in b/src/connman.service.in
> +index 79e75d6..0e7275a 100644
> +--- a/src/connman.service.in
> ++++ b/src/connman.service.in
> +@@ -12,7 +12,10 @@ Conflicts=systemd-resolved.service
> + Type=dbus
> + BusName=net.connman
> + Restart=on-failure
> +-ExecStart=@sbindir@/connmand -n
> ++EnvironmentFile=-/tmp/connman.env
> ++ExecStartPre=/bin/sh -c "if grep 'nfsroot\|ip=' /proc/cmdline; then ETH_IFACE=$(ip addr | grep 'eth[0-9]:' | grep 'UP' | sed -e 's,\(eth[0-9]\)\(.*\),\1,' -e 's,^.*: ,,' ); NET_ADDR=$(cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'); echo -e 'OPT=-I '$ETH_IFACE'\nOPT2='$ETH_IFACE'\nNET_ADDR='$NET_ADDR' ' > /tmp/connman.env; fi "
> ++ExecStart=/bin/sh -c "if [ \"$NET_ADDR\" = \"off\" ] || [ \"$NET_ADDR\" = \"none\" ]; then /usr/sbin/connmand -n; else /usr/sbin/connmand -n $OPT; fi"
> ++ExecStartPost=/bin/sh -c "if [ ! -z \"$OPT\" ] && [ \"$NET_ADDR\" = \"dhcp\" ]; then /sbin/udhcpc -i $OPT2; fi"
> + StandardOutput=null
> + CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_ADMIN
> + ProtectHome=true
> diff --git a/meta/recipes-connectivity/connman/connman_1.41.bb b/meta/recipes-connectivity/connman/connman_1.41.bb
> index 736b78eaeb..9c09a71f46 100644
> --- a/meta/recipes-connectivity/connman/connman_1.41.bb
> +++ b/meta/recipes-connectivity/connman/connman_1.41.bb
> @@ -5,6 +5,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
>             file://0001-connman.service-stop-systemd-resolved-when-we-use-co.patch \
>             file://connman \
>             file://no-version-scripts.patch \
> +           file://0001-connman-implement-network-interface-management-techn.patch \
>             "
>
>  SRC_URI:append:libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch"
> --
> 2.25.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#167151): https://lists.openembedded.org/g/openembedded-core/message/167151
> Mute This Topic: https://lists.openembedded.org/mt/91900036/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] connman: implement network interface management techniques
  2022-06-21 14:00 [PATCH] connman: implement network interface management techniques Muhammad Hamza
  2022-06-21 14:01 ` [OE-core] " Alexander Kanavin
@ 2022-06-21 16:43 ` Richard Purdie
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2022-06-21 16:43 UTC (permalink / raw)
  To: Muhammad Hamza, openembedded-core; +Cc: Srikanth Krishnakar

On Tue, 2022-06-21 at 19:00 +0500, Muhammad Hamza wrote:
> This is required to obtain a managed network interface before connman
> tries to call cleanup_devices function, this will let connman
> create new routing table without bringing down the ethernet interface.
> 
> Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
> Signed-off-by: Muhammad Hamza <muhammad_hamza@mentor.com>
> ---
>  ...t-network-interface-management-techn.patch | 31 +++++++++++++++++++
>  .../connman/connman_1.41.bb                   |  1 +
>  2 files changed, 32 insertions(+)
>  create mode 100644 meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch
> 
> diff --git a/meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch b/meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch
> new file mode 100644
> index 0000000000..06695ea566
> --- /dev/null
> +++ b/meta/recipes-connectivity/connman/connman/0001-connman-implement-network-interface-management-techn.patch
> @@ -0,0 +1,31 @@
> +From e6dedb531096f29825bddaf428ca8d3c4ad1df26 Mon Sep 17 00:00:00 2001
> +From: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
> +Date: Tue, 1 Jul 2014 23:47:15 +0530
> +Subject: [PATCH] connman: implement network interface management techniques
> +
> +This is required to obtain a managed network interface before connman
> +tries to call cleanup_devices function, this will let connman
> +create new routing table without bringing down the ethernet interface.
> +
> +Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
> +
> +---
> + src/connman.service.in | 5 ++++-
> + 1 file changed, 4 insertions(+), 1 deletion(-)
> +
> +diff --git a/src/connman.service.in b/src/connman.service.in
> +index 79e75d6..0e7275a 100644
> +--- a/src/connman.service.in
> ++++ b/src/connman.service.in
> +@@ -12,7 +12,10 @@ Conflicts=systemd-resolved.service
> + Type=dbus
> + BusName=net.connman
> + Restart=on-failure
> +-ExecStart=@sbindir@/connmand -n
> ++EnvironmentFile=-/tmp/connman.env
> ++ExecStartPre=/bin/sh -c "if grep 'nfsroot\|ip=' /proc/cmdline; then ETH_IFACE=$(ip addr | grep 'eth[0-9]:' | grep 'UP' | sed -e 's,\(eth[0-9]\)\(.*\),\1,' -e 's,^.*: ,,' ); NET_ADDR=$(cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'); echo -e 'OPT=-I '$ETH_IFACE'\nOPT2='$ETH_IFACE'\nNET_ADDR='$NET_ADDR' ' > /tmp/connman.env; fi "
> ++ExecStart=/bin/sh -c "if [ \"$NET_ADDR\" = \"off\" ] || [ \"$NET_ADDR\" = \"none\" ]; then /usr/sbin/connmand -n; else /usr/sbin/connmand -n $OPT; fi"
> ++ExecStartPost=/bin/sh -c "if [ ! -z \"$OPT\" ] && [ \"$NET_ADDR\" = \"dhcp\" ]; then /sbin/udhcpc -i $OPT2; fi"
> + StandardOutput=null
> + CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_ADMIN
> + ProtectHome=true
> diff --git a/meta/recipes-connectivity/connman/connman_1.41.bb b/meta/recipes-connectivity/connman/connman_1.41.bb
> index 736b78eaeb..9c09a71f46 100644
> --- a/meta/recipes-connectivity/connman/connman_1.41.bb
> +++ b/meta/recipes-connectivity/connman/connman_1.41.bb
> @@ -5,6 +5,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
>             file://0001-connman.service-stop-systemd-resolved-when-we-use-co.patch \
>             file://connman \
>             file://no-version-scripts.patch \
> +           file://0001-connman-implement-network-interface-management-techn.patch \
>             "
>  
>  SRC_URI:append:libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch"

This definitely needs upstream discussion.

I'd love to understand if this is causing some of our intermittent
issues on the autobuilder around connectivity but the description
included here doesn't really let me do that either. Is there any more
information on this anywhere?

Cheers,

Richard






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] connman: implement network interface management techniques
  2022-06-21 16:04 Muhammad Hamza
@ 2022-08-28 14:21 ` Daniel Wagner
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Wagner @ 2022-08-28 14:21 UTC (permalink / raw)
  To: Muhammad Hamza; +Cc: connman

On Tue, Jun 21, 2022 at 09:04:50PM +0500, Muhammad Hamza wrote:
> This is required to obtain a managed network interface before connman
> tries to call cleanup_devices function, this will let connman
> create new routing table without bringing down the ethernet interface.

There is code in connman which should detect this scenario. If it
doesn't work you should look at it and figure out why it doesn't
work.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] connman: implement network interface management techniques
@ 2022-06-21 16:04 Muhammad Hamza
  2022-08-28 14:21 ` Daniel Wagner
  0 siblings, 1 reply; 5+ messages in thread
From: Muhammad Hamza @ 2022-06-21 16:04 UTC (permalink / raw)
  To: connman; +Cc: Muhammad Hamza

This is required to obtain a managed network interface before connman
tries to call cleanup_devices function, this will let connman
create new routing table without bringing down the ethernet interface.

Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com
Signed-off-by: Muhammad Hamza <muhammad_hamza@mentor.com>
---
 src/connman.service.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/connman.service.in b/src/connman.service.in
index 79e75d6..0e7275a 100644
--- a/src/connman.service.in
+++ b/src/connman.service.in
@@ -12,7 +12,10 @@ Conflicts=systemd-resolved.service
 Type=dbus
 BusName=net.connman
 Restart=on-failure
-ExecStart=@sbindir@/connmand -n
+EnvironmentFile=-/tmp/connman.env
+ExecStartPre=/bin/sh -c "if grep 'nfsroot\|ip=' /proc/cmdline; then ETH_IFACE=$(ip addr | grep 'eth[0-9]:' | grep 'UP' | sed -e 's,\(eth[0-9]\)\(.*\),\1,' -e 's,^.*: ,,' ); NET_ADDR=$(cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'); echo -e 'OPT=-I '$ETH_IFACE'\nOPT2='$ETH_IFACE'\nNET_ADDR='$NET_ADDR' ' > /tmp/connman.env; fi "
+ExecStart=/bin/sh -c "if [ \"$NET_ADDR\" = \"off\" ] || [ \"$NET_ADDR\" = \"none\" ]; then /usr/sbin/connmand -n; else /usr/sbin/connmand -n $OPT; fi"
+ExecStartPost=/bin/sh -c "if [ ! -z \"$OPT\" ] && [ \"$NET_ADDR\" = \"dhcp\" ]; then /sbin/udhcpc -i $OPT2; fi"
 StandardOutput=null
 CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_ADMIN
 ProtectHome=true
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-28 14:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21 14:00 [PATCH] connman: implement network interface management techniques Muhammad Hamza
2022-06-21 14:01 ` [OE-core] " Alexander Kanavin
2022-06-21 16:43 ` Richard Purdie
2022-06-21 16:04 Muhammad Hamza
2022-08-28 14:21 ` Daniel Wagner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.