All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Configure wired network interface with dhcp
@ 2019-05-20  9:46 kai.kang
  2019-05-20  9:46 ` [PATCH 1/1] systemd-conf: configure wired network " kai.kang
  0 siblings, 1 reply; 11+ messages in thread
From: kai.kang @ 2019-05-20  9:46 UTC (permalink / raw)
  To: openembedded-core; +Cc: paul.eggleton

From: Kai Kang <kai.kang@windriver.com>

Configure wired network interface with dhcp when use systemd as default init
manager.

Test steps:
1 $ . oe-init-build-env
2 set MACHINE and systemd as default int manager in local.conf
  DISTRO_FEATURES_append = " systemd"
  DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
  VIRTUAL-RUNTIME_login_manager = "shadow-base"
  VIRTUAL-RUNTIME_init_manager = "systemd"
  VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
  MACHINE ?= "genericx86-64"

3 bitbake core-image-minial
4 show ip status:
$ ip ad
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host 
         valid_lft forever preferred_lft forever
  2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
      link/ether f4:4d:30:66:fb:fd brd ff:ff:ff:ff:ff:ff
      inet 128.224.162.241/23 brd 128.224.163.255 scope global dynamic enp0s25
         valid_lft 13520sec preferred_lft 13520sec
      inet6 fe80::f64d:30ff:fe66:fbfd/64 scope link 
         valid_lft forever preferred_lft forever
  3: sit0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1000
      link/sit 0.0.0.0 brd 0.0.0.0

5 when connman is installed, 2 dynamic ips are allocated for enp0s25 and both work:
$ ip ad
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host 
         valid_lft forever preferred_lft forever
  2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
      link/ether f4:4d:30:66:fb:fd brd ff:ff:ff:ff:ff:ff
      inet 128.224.162.241/23 brd 128.224.163.255 scope global dynamic enp0s25
         valid_lft 13908sec preferred_lft 13908sec
      inet 128.224.163.143/23 brd 128.224.163.255 scope global secondary enp0s25
         valid_lft forever preferred_lft forever
      inet6 fe80::f64d:30ff:fe66:fbfd/64 scope link 
         valid_lft forever preferred_lft forever
  3: sit0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1000
      link/sit 0.0.0.0 brd 0.0.0.0


Kai Kang (1):
  systemd-conf: configure wired network with dhcp

 meta/recipes-core/systemd/systemd-conf/dhcp.network | 5 +++++
 meta/recipes-core/systemd/systemd-conf_242.bb       | 3 +++
 2 files changed, 8 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd-conf/dhcp.network

--
2.20.0



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

* [PATCH 1/1] systemd-conf: configure wired network with dhcp
  2019-05-20  9:46 [PATCH 0/1] Configure wired network interface with dhcp kai.kang
@ 2019-05-20  9:46 ` kai.kang
  2019-05-20 17:45   ` Alex Kiernan
  2019-05-20 18:05   ` Khem Raj
  0 siblings, 2 replies; 11+ messages in thread
From: kai.kang @ 2019-05-20  9:46 UTC (permalink / raw)
  To: openembedded-core; +Cc: paul.eggleton

From: Kai Kang <kai.kang@windriver.com>

Add a configure file for systemd.networkd to configure wired network
interfaces with dhcp. It works with common network interfaces such eth0
and eno1.

[YOCTO #13057]

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/recipes-core/systemd/systemd-conf/dhcp.network | 5 +++++
 meta/recipes-core/systemd/systemd-conf_242.bb       | 3 +++
 2 files changed, 8 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd-conf/dhcp.network

diff --git a/meta/recipes-core/systemd/systemd-conf/dhcp.network b/meta/recipes-core/systemd/systemd-conf/dhcp.network
new file mode 100644
index 0000000000..81f36ebaa5
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-conf/dhcp.network
@@ -0,0 +1,5 @@
+[Match]
+Name=en* eth*
+
+[Network]
+DHCP=yes
diff --git a/meta/recipes-core/systemd/systemd-conf_242.bb b/meta/recipes-core/systemd/systemd-conf_242.bb
index 96beea53a7..094f03e195 100644
--- a/meta/recipes-core/systemd/systemd-conf_242.bb
+++ b/meta/recipes-core/systemd/systemd-conf_242.bb
@@ -10,12 +10,14 @@ SRC_URI = "\
     file://logind.conf \
     file://system.conf \
     file://system.conf-qemuall \
+    file://dhcp.network \
 "
 
 do_install() {
 	install -D -m0644 ${WORKDIR}/journald.conf ${D}${systemd_unitdir}/journald.conf.d/00-${PN}.conf
 	install -D -m0644 ${WORKDIR}/logind.conf ${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf
 	install -D -m0644 ${WORKDIR}/system.conf ${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf
+	install -D -m0644 ${WORKDIR}/dhcp.network ${D}${systemd_unitdir}/network/80-dhcp.network
 }
 
 # Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52
@@ -29,4 +31,5 @@ FILES_${PN} = "\
     ${systemd_unitdir}/journald.conf.d/ \
     ${systemd_unitdir}/logind.conf.d/ \
     ${systemd_unitdir}/system.conf.d/ \
+    ${systemd_unitdir}/network/ \
 "
-- 
2.20.0



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

* Re: [PATCH 1/1] systemd-conf: configure wired network with dhcp
  2019-05-20  9:46 ` [PATCH 1/1] systemd-conf: configure wired network " kai.kang
@ 2019-05-20 17:45   ` Alex Kiernan
  2019-05-21  1:33     ` Kang Kai
  2019-05-20 18:05   ` Khem Raj
  1 sibling, 1 reply; 11+ messages in thread
From: Alex Kiernan @ 2019-05-20 17:45 UTC (permalink / raw)
  To: kai.kang; +Cc: paul.eggleton, Patches and discussions about the oe-core layer

On Mon, May 20, 2019 at 10:47 AM <kai.kang@windriver.com> wrote:
>
> From: Kai Kang <kai.kang@windriver.com>
>
> Add a configure file for systemd.networkd to configure wired network
> interfaces with dhcp. It works with common network interfaces such eth0
> and eno1.
>
> [YOCTO #13057]
>

I'm really not convinced about this - yes it's initially surprising,
but should base packages have this kind of assumptions/policy baked
into them?


--
Alex Kiernan


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

* Re: [PATCH 1/1] systemd-conf: configure wired network with dhcp
  2019-05-20  9:46 ` [PATCH 1/1] systemd-conf: configure wired network " kai.kang
  2019-05-20 17:45   ` Alex Kiernan
@ 2019-05-20 18:05   ` Khem Raj
  2019-05-21  2:54     ` Kang Kai
  1 sibling, 1 reply; 11+ messages in thread
From: Khem Raj @ 2019-05-20 18:05 UTC (permalink / raw)
  To: kai.kang, openembedded-core; +Cc: paul.eggleton



On 5/20/19 2:46 AM, kai.kang@windriver.com wrote:
> From: Kai Kang <kai.kang@windriver.com>
> 
> Add a configure file for systemd.networkd to configure wired network
> interfaces with dhcp. It works with common network interfaces such eth0
> and eno1.
> 
> [YOCTO #13057]
> 
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>   meta/recipes-core/systemd/systemd-conf/dhcp.network | 5 +++++
>   meta/recipes-core/systemd/systemd-conf_242.bb       | 3 +++
>   2 files changed, 8 insertions(+)
>   create mode 100644 meta/recipes-core/systemd/systemd-conf/dhcp.network
> 
> diff --git a/meta/recipes-core/systemd/systemd-conf/dhcp.network b/meta/recipes-core/systemd/systemd-conf/dhcp.network
> new file mode 100644
> index 0000000000..81f36ebaa5
> --- /dev/null
> +++ b/meta/recipes-core/systemd/systemd-conf/dhcp.network
> @@ -0,0 +1,5 @@
> +[Match]
> +Name=en* eth*
> +
> +[Network]
> +DHCP=yes
> diff --git a/meta/recipes-core/systemd/systemd-conf_242.bb b/meta/recipes-core/systemd/systemd-conf_242.bb
> index 96beea53a7..094f03e195 100644
> --- a/meta/recipes-core/systemd/systemd-conf_242.bb
> +++ b/meta/recipes-core/systemd/systemd-conf_242.bb
> @@ -10,12 +10,14 @@ SRC_URI = "\
>       file://logind.conf \
>       file://system.conf \
>       file://system.conf-qemuall \
> +    file://dhcp.network \
>   "
>   
>   do_install() {
>   	install -D -m0644 ${WORKDIR}/journald.conf ${D}${systemd_unitdir}/journald.conf.d/00-${PN}.conf
>   	install -D -m0644 ${WORKDIR}/logind.conf ${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf
>   	install -D -m0644 ${WORKDIR}/system.conf ${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf
> +	install -D -m0644 ${WORKDIR}/dhcp.network ${D}${systemd_unitdir}/network/80-dhcp.network
>   }
>   
>   # Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52
> @@ -29,4 +31,5 @@ FILES_${PN} = "\
>       ${systemd_unitdir}/journald.conf.d/ \
>       ${systemd_unitdir}/logind.conf.d/ \
>       ${systemd_unitdir}/system.conf.d/ \
> +    ${systemd_unitdir}/network/ \
>   "
> 

Please look into

https://github.com/YoeDistro/meta-yoe/tree/master/recipes-core/systemd

this also means we need to enable networkd and resolved for this to work


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

* Re: [PATCH 1/1] systemd-conf: configure wired network with dhcp
  2019-05-20 17:45   ` Alex Kiernan
@ 2019-05-21  1:33     ` Kang Kai
  2019-05-21  4:49       ` Alex Kiernan
  0 siblings, 1 reply; 11+ messages in thread
From: Kang Kai @ 2019-05-21  1:33 UTC (permalink / raw)
  To: Alex Kiernan
  Cc: paul.eggleton, Patches and discussions about the oe-core layer

On 2019/5/21 上午1:45, Alex Kiernan wrote:
> On Mon, May 20, 2019 at 10:47 AM <kai.kang@windriver.com> wrote:
>> From: Kai Kang <kai.kang@windriver.com>
>>
>> Add a configure file for systemd.networkd to configure wired network
>> interfaces with dhcp. It works with common network interfaces such eth0
>> and eno1.
>>
>> [YOCTO #13057]
>>
> I'm really not convinced about this - yes it's initially surprising,
> but should base packages have this kind of assumptions/policy baked
> into them?

I have considered whether systemd or systemd-conf should contain such 
configure file. Compare to Fedora and Debian,
no such kind of pre-configured network setting provided by systemd, so I 
added the configure file to systemd-config.

If systemd should be preferred, I'll update in v2.

Kai



>
>
> --
> Alex Kiernan
>

-- 
Kai Kang



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

* Re: [PATCH 1/1] systemd-conf: configure wired network with dhcp
  2019-05-20 18:05   ` Khem Raj
@ 2019-05-21  2:54     ` Kang Kai
  2019-05-21  5:03       ` Kang Kai
  2019-05-21  5:27       ` Khem Raj
  0 siblings, 2 replies; 11+ messages in thread
From: Kang Kai @ 2019-05-21  2:54 UTC (permalink / raw)
  To: Khem Raj, openembedded-core; +Cc: paul.eggleton

On 2019/5/21 上午2:05, Khem Raj wrote:
>
>
> On 5/20/19 2:46 AM, kai.kang@windriver.com wrote:
>> From: Kai Kang <kai.kang@windriver.com>
>>
>> Add a configure file for systemd.networkd to configure wired network
>> interfaces with dhcp. It works with common network interfaces such eth0
>> and eno1.
>>
>> [YOCTO #13057]
>>
>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>> ---
>>   meta/recipes-core/systemd/systemd-conf/dhcp.network | 5 +++++
>>   meta/recipes-core/systemd/systemd-conf_242.bb       | 3 +++
>>   2 files changed, 8 insertions(+)
>>   create mode 100644 meta/recipes-core/systemd/systemd-conf/dhcp.network
>>
>> diff --git a/meta/recipes-core/systemd/systemd-conf/dhcp.network 
>> b/meta/recipes-core/systemd/systemd-conf/dhcp.network
>> new file mode 100644
>> index 0000000000..81f36ebaa5
>> --- /dev/null
>> +++ b/meta/recipes-core/systemd/systemd-conf/dhcp.network
>> @@ -0,0 +1,5 @@
>> +[Match]
>> +Name=en* eth*
>> +
>> +[Network]
>> +DHCP=yes
>> diff --git a/meta/recipes-core/systemd/systemd-conf_242.bb 
>> b/meta/recipes-core/systemd/systemd-conf_242.bb
>> index 96beea53a7..094f03e195 100644
>> --- a/meta/recipes-core/systemd/systemd-conf_242.bb
>> +++ b/meta/recipes-core/systemd/systemd-conf_242.bb
>> @@ -10,12 +10,14 @@ SRC_URI = "\
>>       file://logind.conf \
>>       file://system.conf \
>>       file://system.conf-qemuall \
>> +    file://dhcp.network \
>>   "
>>     do_install() {
>>       install -D -m0644 ${WORKDIR}/journald.conf 
>> ${D}${systemd_unitdir}/journald.conf.d/00-${PN}.conf
>>       install -D -m0644 ${WORKDIR}/logind.conf 
>> ${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf
>>       install -D -m0644 ${WORKDIR}/system.conf 
>> ${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf
>> +    install -D -m0644 ${WORKDIR}/dhcp.network 
>> ${D}${systemd_unitdir}/network/80-dhcp.network
>>   }
>>     # Based on change from YP bug 8141, OE commit 
>> 5196d7bacaef1076c361adaa2867be31759c1b52
>> @@ -29,4 +31,5 @@ FILES_${PN} = "\
>>       ${systemd_unitdir}/journald.conf.d/ \
>>       ${systemd_unitdir}/logind.conf.d/ \
>>       ${systemd_unitdir}/system.conf.d/ \
>> +    ${systemd_unitdir}/network/ \
>>   "
>>
>
> Please look into
>
> https://github.com/YoeDistro/meta-yoe/tree/master/recipes-core/systemd
>
> this also means we need to enable networkd and resolved for this to work
>

I checked the repo you post,

1) package config 'networkd' and 'resolved' have been involved in 
default package config in systemd_242.bb

2) I suspect wireless.network is not necessary. Unlike wired network, we 
can't predict the ap name and connect it automatically.

3) the configure file doesn't work with qemu tap mode. I'll update with it.

4) Do the configure of section [DHCP] in wired.network necessary?

[DHCP]
RouteMetric=10
ClientIdentifier=mac


Thanks.


-- 
Kai Kang



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

* Re: [PATCH 1/1] systemd-conf: configure wired network with dhcp
  2019-05-21  1:33     ` Kang Kai
@ 2019-05-21  4:49       ` Alex Kiernan
  2019-05-21  5:02         ` Kang Kai
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Kiernan @ 2019-05-21  4:49 UTC (permalink / raw)
  To: Kang Kai; +Cc: paul.eggleton, Patches and discussions about the oe-core layer

On Tue, May 21, 2019 at 2:34 AM Kang Kai <Kai.Kang@windriver.com> wrote:
>
> On 2019/5/21 上午1:45, Alex Kiernan wrote:
> > On Mon, May 20, 2019 at 10:47 AM <kai.kang@windriver.com> wrote:
> >> From: Kai Kang <kai.kang@windriver.com>
> >>
> >> Add a configure file for systemd.networkd to configure wired network
> >> interfaces with dhcp. It works with common network interfaces such eth0
> >> and eno1.
> >>
> >> [YOCTO #13057]
> >>
> > I'm really not convinced about this - yes it's initially surprising,
> > but should base packages have this kind of assumptions/policy baked
> > into them?
>
> I have considered whether systemd or systemd-conf should contain such
> configure file. Compare to Fedora and Debian,
> no such kind of pre-configured network setting provided by systemd, so I
> added the configure file to systemd-config.
>
> If systemd should be preferred, I'll update in v2.
>

No, systemd-conf is the right place for it, since this is machine
specific configuration. My question is really if this piece of
configuration should exist at all in OE-Core; but I'm not totally
opposed to it.

I could live with the kind of construction in meta-yoe (but with the
files added to systemd-conf as you already have)

-- 
Alex Kiernan


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

* Re: [PATCH 1/1] systemd-conf: configure wired network with dhcp
  2019-05-21  4:49       ` Alex Kiernan
@ 2019-05-21  5:02         ` Kang Kai
  2019-05-21  9:41           ` Alex Kiernan
  0 siblings, 1 reply; 11+ messages in thread
From: Kang Kai @ 2019-05-21  5:02 UTC (permalink / raw)
  To: Alex Kiernan
  Cc: paul.eggleton, Patches and discussions about the oe-core layer

On 2019/5/21 下午12:49, Alex Kiernan wrote:
> On Tue, May 21, 2019 at 2:34 AM Kang Kai <Kai.Kang@windriver.com> wrote:
>> On 2019/5/21 上午1:45, Alex Kiernan wrote:
>>> On Mon, May 20, 2019 at 10:47 AM <kai.kang@windriver.com> wrote:
>>>> From: Kai Kang <kai.kang@windriver.com>
>>>>
>>>> Add a configure file for systemd.networkd to configure wired network
>>>> interfaces with dhcp. It works with common network interfaces such eth0
>>>> and eno1.
>>>>
>>>> [YOCTO #13057]
>>>>
>>> I'm really not convinced about this - yes it's initially surprising,
>>> but should base packages have this kind of assumptions/policy baked
>>> into them?
>> I have considered whether systemd or systemd-conf should contain such
>> configure file. Compare to Fedora and Debian,
>> no such kind of pre-configured network setting provided by systemd, so I
>> added the configure file to systemd-config.
>>
>> If systemd should be preferred, I'll update in v2.
>>
> No, systemd-conf is the right place for it, since this is machine
> specific configuration. My question is really if this piece of
> configuration should exist at all in OE-Core; but I'm not totally
> opposed to it.
>
> I could live with the kind of construction in meta-yoe (but with the
> files added to systemd-conf as you already have)


The original requirement is from [Bug 13057 - No default network 
configuration for systemd-networkd ] which blocks to make systemd as
default init manager. If add this to meta-yoe, it still no working 
network if no connman/networkmanager installed(but this is same as
Fedora 29 and Debian 9).


Regards,
Kai


>

-- 
Kai Kang



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

* Re: [PATCH 1/1] systemd-conf: configure wired network with dhcp
  2019-05-21  2:54     ` Kang Kai
@ 2019-05-21  5:03       ` Kang Kai
  2019-05-21  5:27       ` Khem Raj
  1 sibling, 0 replies; 11+ messages in thread
From: Kang Kai @ 2019-05-21  5:03 UTC (permalink / raw)
  To: Khem Raj, openembedded-core; +Cc: paul.eggleton

On 2019/5/21 上午10:54, Kang Kai wrote:
> On 2019/5/21 上午2:05, Khem Raj wrote:
>>
>>
>> On 5/20/19 2:46 AM, kai.kang@windriver.com wrote:
>>> From: Kai Kang <kai.kang@windriver.com>
>>>
>>> Add a configure file for systemd.networkd to configure wired network
>>> interfaces with dhcp. It works with common network interfaces such eth0
>>> and eno1.
>>>
>>> [YOCTO #13057]
>>>
>>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>>> ---
>>>   meta/recipes-core/systemd/systemd-conf/dhcp.network | 5 +++++
>>>   meta/recipes-core/systemd/systemd-conf_242.bb       | 3 +++
>>>   2 files changed, 8 insertions(+)
>>>   create mode 100644 
>>> meta/recipes-core/systemd/systemd-conf/dhcp.network
>>>
>>> diff --git a/meta/recipes-core/systemd/systemd-conf/dhcp.network 
>>> b/meta/recipes-core/systemd/systemd-conf/dhcp.network
>>> new file mode 100644
>>> index 0000000000..81f36ebaa5
>>> --- /dev/null
>>> +++ b/meta/recipes-core/systemd/systemd-conf/dhcp.network
>>> @@ -0,0 +1,5 @@
>>> +[Match]
>>> +Name=en* eth*
>>> +
>>> +[Network]
>>> +DHCP=yes
>>> diff --git a/meta/recipes-core/systemd/systemd-conf_242.bb 
>>> b/meta/recipes-core/systemd/systemd-conf_242.bb
>>> index 96beea53a7..094f03e195 100644
>>> --- a/meta/recipes-core/systemd/systemd-conf_242.bb
>>> +++ b/meta/recipes-core/systemd/systemd-conf_242.bb
>>> @@ -10,12 +10,14 @@ SRC_URI = "\
>>>       file://logind.conf \
>>>       file://system.conf \
>>>       file://system.conf-qemuall \
>>> +    file://dhcp.network \
>>>   "
>>>     do_install() {
>>>       install -D -m0644 ${WORKDIR}/journald.conf 
>>> ${D}${systemd_unitdir}/journald.conf.d/00-${PN}.conf
>>>       install -D -m0644 ${WORKDIR}/logind.conf 
>>> ${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf
>>>       install -D -m0644 ${WORKDIR}/system.conf 
>>> ${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf
>>> +    install -D -m0644 ${WORKDIR}/dhcp.network 
>>> ${D}${systemd_unitdir}/network/80-dhcp.network
>>>   }
>>>     # Based on change from YP bug 8141, OE commit 
>>> 5196d7bacaef1076c361adaa2867be31759c1b52
>>> @@ -29,4 +31,5 @@ FILES_${PN} = "\
>>>       ${systemd_unitdir}/journald.conf.d/ \
>>>       ${systemd_unitdir}/logind.conf.d/ \
>>>       ${systemd_unitdir}/system.conf.d/ \
>>> +    ${systemd_unitdir}/network/ \
>>>   "
>>>
>>
>> Please look into
>>
>> https://github.com/YoeDistro/meta-yoe/tree/master/recipes-core/systemd
>>
>> this also means we need to enable networkd and resolved for this to work
>>
>
> I checked the repo you post,
>
> 1) package config 'networkd' and 'resolved' have been involved in 
> default package config in systemd_242.bb
>
> 2) I suspect wireless.network is not necessary. Unlike wired network, 
> we can't predict the ap name and connect it automatically.
>
> 3) the configure file doesn't work with qemu tap mode. I'll update 
> with it.



>
> 4) Do the configure of section [DHCP] in wired.network necessary?
>
> [DHCP]
> RouteMetric=10
> ClientIdentifier=mac
>
Ignore 4). I have checked the commit message and know why.

Regards,
Kai


>
> Thanks.
>
>

-- 
Kai Kang



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

* Re: [PATCH 1/1] systemd-conf: configure wired network with dhcp
  2019-05-21  2:54     ` Kang Kai
  2019-05-21  5:03       ` Kang Kai
@ 2019-05-21  5:27       ` Khem Raj
  1 sibling, 0 replies; 11+ messages in thread
From: Khem Raj @ 2019-05-21  5:27 UTC (permalink / raw)
  To: Kang Kai; +Cc: Paul Eggleton, Patches and discussions about the oe-core layer

On Mon, May 20, 2019 at 7:55 PM Kang Kai <Kai.Kang@windriver.com> wrote:
>
> On 2019/5/21 上午2:05, Khem Raj wrote:
> >
> >
> > On 5/20/19 2:46 AM, kai.kang@windriver.com wrote:
> >> From: Kai Kang <kai.kang@windriver.com>
> >>
> >> Add a configure file for systemd.networkd to configure wired network
> >> interfaces with dhcp. It works with common network interfaces such eth0
> >> and eno1.
> >>
> >> [YOCTO #13057]
> >>
> >> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> >> ---
> >>   meta/recipes-core/systemd/systemd-conf/dhcp.network | 5 +++++
> >>   meta/recipes-core/systemd/systemd-conf_242.bb       | 3 +++
> >>   2 files changed, 8 insertions(+)
> >>   create mode 100644 meta/recipes-core/systemd/systemd-conf/dhcp.network
> >>
> >> diff --git a/meta/recipes-core/systemd/systemd-conf/dhcp.network
> >> b/meta/recipes-core/systemd/systemd-conf/dhcp.network
> >> new file mode 100644
> >> index 0000000000..81f36ebaa5
> >> --- /dev/null
> >> +++ b/meta/recipes-core/systemd/systemd-conf/dhcp.network
> >> @@ -0,0 +1,5 @@
> >> +[Match]
> >> +Name=en* eth*
> >> +
> >> +[Network]
> >> +DHCP=yes
> >> diff --git a/meta/recipes-core/systemd/systemd-conf_242.bb
> >> b/meta/recipes-core/systemd/systemd-conf_242.bb
> >> index 96beea53a7..094f03e195 100644
> >> --- a/meta/recipes-core/systemd/systemd-conf_242.bb
> >> +++ b/meta/recipes-core/systemd/systemd-conf_242.bb
> >> @@ -10,12 +10,14 @@ SRC_URI = "\
> >>       file://logind.conf \
> >>       file://system.conf \
> >>       file://system.conf-qemuall \
> >> +    file://dhcp.network \
> >>   "
> >>     do_install() {
> >>       install -D -m0644 ${WORKDIR}/journald.conf
> >> ${D}${systemd_unitdir}/journald.conf.d/00-${PN}.conf
> >>       install -D -m0644 ${WORKDIR}/logind.conf
> >> ${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf
> >>       install -D -m0644 ${WORKDIR}/system.conf
> >> ${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf
> >> +    install -D -m0644 ${WORKDIR}/dhcp.network
> >> ${D}${systemd_unitdir}/network/80-dhcp.network
> >>   }
> >>     # Based on change from YP bug 8141, OE commit
> >> 5196d7bacaef1076c361adaa2867be31759c1b52
> >> @@ -29,4 +31,5 @@ FILES_${PN} = "\
> >>       ${systemd_unitdir}/journald.conf.d/ \
> >>       ${systemd_unitdir}/logind.conf.d/ \
> >>       ${systemd_unitdir}/system.conf.d/ \
> >> +    ${systemd_unitdir}/network/ \
> >>   "
> >>
> >
> > Please look into
> >
> > https://github.com/YoeDistro/meta-yoe/tree/master/recipes-core/systemd
> >
> > this also means we need to enable networkd and resolved for this to work
> >
>
> I checked the repo you post,
>
> 1) package config 'networkd' and 'resolved' have been involved in
> default package config in systemd_242.bb
>
> 2) I suspect wireless.network is not necessary. Unlike wired network, we
> can't predict the ap name and connect it automatically.
>
> 3) the configure file doesn't work with qemu tap mode. I'll update with it.
>

right your patch failed to set IP for qemux86 on my system.

> 4) Do the configure of section [DHCP] in wired.network necessary?
>
> [DHCP]
> RouteMetric=10
> ClientIdentifier=mac
>

yes they work totally fine and also makes sure that IP is not changing
all the time
for phys which happens for so many boards where you get new IP every boot



>
> Thanks.
>
>
> --
> Kai Kang
>


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

* Re: [PATCH 1/1] systemd-conf: configure wired network with dhcp
  2019-05-21  5:02         ` Kang Kai
@ 2019-05-21  9:41           ` Alex Kiernan
  0 siblings, 0 replies; 11+ messages in thread
From: Alex Kiernan @ 2019-05-21  9:41 UTC (permalink / raw)
  To: Kang Kai; +Cc: paul.eggleton, Patches and discussions about the oe-core layer

On Tue, May 21, 2019 at 6:04 AM Kang Kai <Kai.Kang@windriver.com> wrote:
>
> On 2019/5/21 下午12:49, Alex Kiernan wrote:
> > On Tue, May 21, 2019 at 2:34 AM Kang Kai <Kai.Kang@windriver.com> wrote:
> >> On 2019/5/21 上午1:45, Alex Kiernan wrote:
> >>> On Mon, May 20, 2019 at 10:47 AM <kai.kang@windriver.com> wrote:
> >>>> From: Kai Kang <kai.kang@windriver.com>
> >>>>
> >>>> Add a configure file for systemd.networkd to configure wired network
> >>>> interfaces with dhcp. It works with common network interfaces such eth0
> >>>> and eno1.
> >>>>
> >>>> [YOCTO #13057]
> >>>>
> >>> I'm really not convinced about this - yes it's initially surprising,
> >>> but should base packages have this kind of assumptions/policy baked
> >>> into them?
> >> I have considered whether systemd or systemd-conf should contain such
> >> configure file. Compare to Fedora and Debian,
> >> no such kind of pre-configured network setting provided by systemd, so I
> >> added the configure file to systemd-config.
> >>
> >> If systemd should be preferred, I'll update in v2.
> >>
> > No, systemd-conf is the right place for it, since this is machine
> > specific configuration. My question is really if this piece of
> > configuration should exist at all in OE-Core; but I'm not totally
> > opposed to it.
> >
> > I could live with the kind of construction in meta-yoe (but with the
> > files added to systemd-conf as you already have)
>
>
> The original requirement is from [Bug 13057 - No default network
> configuration for systemd-networkd ] which blocks to make systemd as
> default init manager. If add this to meta-yoe, it still no working
> network if no connman/networkmanager installed(but this is same as
> Fedora 29 and Debian 9).
>

I guess it's the requirement I'm questioning, equally you've got it
systemd-conf, which is explicitly machine specific and so I'd struggle
to say it shouldn't go in.


--
Alex Kiernan


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

end of thread, other threads:[~2019-05-21  9:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-20  9:46 [PATCH 0/1] Configure wired network interface with dhcp kai.kang
2019-05-20  9:46 ` [PATCH 1/1] systemd-conf: configure wired network " kai.kang
2019-05-20 17:45   ` Alex Kiernan
2019-05-21  1:33     ` Kang Kai
2019-05-21  4:49       ` Alex Kiernan
2019-05-21  5:02         ` Kang Kai
2019-05-21  9:41           ` Alex Kiernan
2019-05-20 18:05   ` Khem Raj
2019-05-21  2:54     ` Kang Kai
2019-05-21  5:03       ` Kang Kai
2019-05-21  5:27       ` Khem Raj

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.