* [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network
@ 2019-06-02 14:55 kai.kang
2019-06-02 14:55 ` [meta-poky][PATCH v6 1/2] poky.conf: make systemd as default init manager kai.kang
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: kai.kang @ 2019-06-02 14:55 UTC (permalink / raw)
To: richard.purdie; +Cc: poky, openembedded-core
From: Kai Kang <kai.kang@windriver.com>
v6:
* create .inc files as Richard suggested, and include them according to POKY_INIT_MANAGER
Kai Kang (2):
poky.conf: make systemd as default init manager
systemd-conf: configure wired network with dhcp
.../conf/distro/include/init-template-mdev-busybox.inc | 7 +++++++
.../conf/distro/include/init-template-systemd-compat.inc | 7 +++++++
meta-poky/conf/distro/include/init-template-systemd.inc | 5 +++++
meta-poky/conf/distro/include/init-template-sysvinit.inc | 6 ++++++
meta-poky/conf/distro/poky-tiny.conf | 8 +-------
meta-poky/conf/distro/poky.conf | 6 ++++++
meta/recipes-core/systemd/systemd-conf/wired.network | 9 +++++++++
meta/recipes-core/systemd/systemd-conf_242.bb | 6 ++++++
8 files changed, 47 insertions(+), 7 deletions(-)
create mode 100644 meta-poky/conf/distro/include/init-template-mdev-busybox.inc
create mode 100644 meta-poky/conf/distro/include/init-template-systemd-compat.inc
create mode 100644 meta-poky/conf/distro/include/init-template-systemd.inc
create mode 100644 meta-poky/conf/distro/include/init-template-sysvinit.inc
create mode 100644 meta/recipes-core/systemd/systemd-conf/wired.network
--
2.20.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [meta-poky][PATCH v6 1/2] poky.conf: make systemd as default init manager
2019-06-02 14:55 [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network kai.kang
@ 2019-06-02 14:55 ` kai.kang
2019-06-02 14:55 ` [meta-poky][PATCH v6 2/2] systemd-conf: configure wired network with dhcp kai.kang
2019-06-03 12:30 ` [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network richard.purdie
2 siblings, 0 replies; 5+ messages in thread
From: kai.kang @ 2019-06-02 14:55 UTC (permalink / raw)
To: richard.purdie; +Cc: poky, openembedded-core
From: Kai Kang <kai.kang@windriver.com>
Introduce a new variable POKY_INIT_MANAGER and create 4 .inc files to
configure init manager settings. Var POKY_INIT_MANAGER accepts 4 values:
sysvinit, systemd, systemd-compat and mdev-busybox. Set systemd by
default for DISTRO poky. And set mdev-busybox for DISTRO poky-tiny
which doesn't change its init manger settings.
[YOCTO #13031]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
.../conf/distro/include/init-template-mdev-busybox.inc | 7 +++++++
.../conf/distro/include/init-template-systemd-compat.inc | 7 +++++++
meta-poky/conf/distro/include/init-template-systemd.inc | 5 +++++
meta-poky/conf/distro/include/init-template-sysvinit.inc | 6 ++++++
meta-poky/conf/distro/poky-tiny.conf | 8 +-------
meta-poky/conf/distro/poky.conf | 6 ++++++
6 files changed, 32 insertions(+), 7 deletions(-)
create mode 100644 meta-poky/conf/distro/include/init-template-mdev-busybox.inc
create mode 100644 meta-poky/conf/distro/include/init-template-systemd-compat.inc
create mode 100644 meta-poky/conf/distro/include/init-template-systemd.inc
create mode 100644 meta-poky/conf/distro/include/init-template-sysvinit.inc
diff --git a/meta-poky/conf/distro/include/init-template-mdev-busybox.inc b/meta-poky/conf/distro/include/init-template-mdev-busybox.inc
new file mode 100644
index 0000000000..b07d9de5b4
--- /dev/null
+++ b/meta-poky/conf/distro/include/init-template-mdev-busybox.inc
@@ -0,0 +1,7 @@
+# enable mdev/busybox for init
+DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " systemd sysvinit"
+VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
+VIRTUAL-RUNTIME_init_manager = "busybox"
+VIRTUAL-RUNTIME_initscripts = "initscripts"
+VIRTUAL-RUNTIME_keymaps = "keymaps"
+VIRTUAL-RUNTIME_login_manager = "busybox"
diff --git a/meta-poky/conf/distro/include/init-template-systemd-compat.inc b/meta-poky/conf/distro/include/init-template-systemd-compat.inc
new file mode 100644
index 0000000000..22151f8866
--- /dev/null
+++ b/meta-poky/conf/distro/include/init-template-systemd-compat.inc
@@ -0,0 +1,7 @@
+# Don't append sysvinit to DISTRO_FEATURES here because it has been set
+# in DISTRO_FEATURES_BACKFILL. And then this .inc file could be used by
+# init-template-systemd.inc
+DISTRO_FEATURES_append = " systemd"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
+VIRTUAL-RUNTIME_login_manager = "shadow-base"
diff --git a/meta-poky/conf/distro/include/init-template-systemd.inc b/meta-poky/conf/distro/include/init-template-systemd.inc
new file mode 100644
index 0000000000..d04847028c
--- /dev/null
+++ b/meta-poky/conf/distro/include/init-template-systemd.inc
@@ -0,0 +1,5 @@
+# Use systemd for system initialization
+
+require init-template-systemd-compat.inc
+
+DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " sysvinit"
diff --git a/meta-poky/conf/distro/include/init-template-sysvinit.inc b/meta-poky/conf/distro/include/init-template-sysvinit.inc
new file mode 100644
index 0000000000..7725b30e1e
--- /dev/null
+++ b/meta-poky/conf/distro/include/init-template-sysvinit.inc
@@ -0,0 +1,6 @@
+# Use sysvinit for system initialization
+DISTRO_FEATURES_append = " sysvinit"
+DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " systemd"
+VIRTUAL-RUNTIME_init_manager = "sysvinit"
+VIRTUAL-RUNTIME_initscripts = "initscripts"
+VIRTUAL-RUNTIME_login_manager = "busybox"
diff --git a/meta-poky/conf/distro/poky-tiny.conf b/meta-poky/conf/distro/poky-tiny.conf
index 1f8b6e8ff3..8ba0b9a4bb 100644
--- a/meta-poky/conf/distro/poky-tiny.conf
+++ b/meta-poky/conf/distro/poky-tiny.conf
@@ -81,13 +81,7 @@ DISTRO_FEATURES_append_libc-musl = " largefile"
DISTRO_FEATURES_class-native = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}"
DISTRO_FEATURES_class-nativesdk = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}"
-# enable mdev/busybox for init
-VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
-VIRTUAL-RUNTIME_login_manager = "busybox"
-VIRTUAL-RUNTIME_init_manager = "busybox"
-VIRTUAL-RUNTIME_initscripts = "initscripts"
-VIRTUAL-RUNTIME_keymaps = "keymaps"
-DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+POKY_INIT_MANAGER ?= "mdev-busybox"
# FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in
# packagegroup-core-base to select modutils-initscripts or not. Similar with "net" and
diff --git a/meta-poky/conf/distro/poky.conf b/meta-poky/conf/distro/poky.conf
index 78621e6dbf..e544f7e52c 100644
--- a/meta-poky/conf/distro/poky.conf
+++ b/meta-poky/conf/distro/poky.conf
@@ -84,3 +84,9 @@ require conf/distro/include/no-static-libs.inc
require conf/distro/include/yocto-uninative.inc
require conf/distro/include/security_flags.inc
INHERIT += "uninative"
+
+# Make systemd as default init manager for poky
+# and set sysvinit for musl consider security
+POKY_INIT_MANAGER ??= "systemd"
+POKY_INIT_MANAGER_libc-musl = "sysvinit"
+require conf/distro/include/init-template-${POKY_INIT_MANAGER}.inc
--
2.20.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [meta-poky][PATCH v6 2/2] systemd-conf: configure wired network with dhcp
2019-06-02 14:55 [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network kai.kang
2019-06-02 14:55 ` [meta-poky][PATCH v6 1/2] poky.conf: make systemd as default init manager kai.kang
@ 2019-06-02 14:55 ` kai.kang
2019-06-03 12:30 ` [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network richard.purdie
2 siblings, 0 replies; 5+ messages in thread
From: kai.kang @ 2019-06-02 14:55 UTC (permalink / raw)
To: richard.purdie; +Cc: poky, openembedded-core
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. And do not install it for qemu bsps.
Refer to
https://github.com/YoeDistro/meta-yoe/tree/master/recipes-core/systemd
[YOCTO #13057]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
meta/recipes-core/systemd/systemd-conf/wired.network | 9 +++++++++
meta/recipes-core/systemd/systemd-conf_242.bb | 6 ++++++
2 files changed, 15 insertions(+)
create mode 100644 meta/recipes-core/systemd/systemd-conf/wired.network
diff --git a/meta/recipes-core/systemd/systemd-conf/wired.network b/meta/recipes-core/systemd/systemd-conf/wired.network
new file mode 100644
index 0000000000..253aee9382
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-conf/wired.network
@@ -0,0 +1,9 @@
+[Match]
+Name=en* eth*
+
+[Network]
+DHCP=yes
+
+[DHCP]
+RouteMetric=10
+ClientIdentifier=mac
diff --git a/meta/recipes-core/systemd/systemd-conf_242.bb b/meta/recipes-core/systemd/systemd-conf_242.bb
index 96beea53a7..d9ec023bfd 100644
--- a/meta/recipes-core/systemd/systemd-conf_242.bb
+++ b/meta/recipes-core/systemd/systemd-conf_242.bb
@@ -10,17 +10,22 @@ SRC_URI = "\
file://logind.conf \
file://system.conf \
file://system.conf-qemuall \
+ file://wired.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}/wired.network ${D}${systemd_unitdir}/network/80-wired.network
}
# Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52
do_install_append_qemuall() {
install -D -m0644 ${WORKDIR}/system.conf-qemuall ${D}${systemd_unitdir}/system.conf.d/01-${PN}.conf
+
+ # Do not install wired.network for qemu bsps
+ rm -rf ${D}${systemd_unitdir}/network
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
@@ -29,4 +34,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] 5+ messages in thread
* Re: [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network
2019-06-02 14:55 [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network kai.kang
2019-06-02 14:55 ` [meta-poky][PATCH v6 1/2] poky.conf: make systemd as default init manager kai.kang
2019-06-02 14:55 ` [meta-poky][PATCH v6 2/2] systemd-conf: configure wired network with dhcp kai.kang
@ 2019-06-03 12:30 ` richard.purdie
2019-06-04 7:06 ` Kang Kai
2 siblings, 1 reply; 5+ messages in thread
From: richard.purdie @ 2019-06-03 12:30 UTC (permalink / raw)
To: kai.kang; +Cc: poky, openembedded-core
On Sun, 2019-06-02 at 10:55 -0400, kai.kang@windriver.com wrote:
> From: Kai Kang <kai.kang@windriver.com>
>
> v6:
> * create .inc files as Richard suggested, and include them according
> to POKY_INIT_MANAGER
>
> Kai Kang (2):
> poky.conf: make systemd as default init manager
> systemd-conf: configure wired network with dhcp
This is looking good, I do agree with Peter about the file naming. I
ran it through the autobuilder to see where we are at runtime and the
results were not so good:
https://autobuilder.yoctoproject.org/typhoon/#/builders/85/builds/484
We may need to reduce some of the free space in the ptest image and it
looks like there is an NFS startup failure issue in the sdk images.
There may be other issues in there too but those were the two I
immediately saw.
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network
2019-06-03 12:30 ` [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network richard.purdie
@ 2019-06-04 7:06 ` Kang Kai
0 siblings, 0 replies; 5+ messages in thread
From: Kang Kai @ 2019-06-04 7:06 UTC (permalink / raw)
To: richard.purdie; +Cc: poky, openembedded-core
On 2019/6/3 下午8:30, richard.purdie@linuxfoundation.org wrote:
> On Sun, 2019-06-02 at 10:55 -0400, kai.kang@windriver.com wrote:
>> From: Kai Kang <kai.kang@windriver.com>
>>
>> v6:
>> * create .inc files as Richard suggested, and include them according
>> to POKY_INIT_MANAGER
>>
>> Kai Kang (2):
>> poky.conf: make systemd as default init manager
>> systemd-conf: configure wired network with dhcp
> This is looking good, I do agree with Peter about the file naming.
OK.
> I
> ran it through the autobuilder to see where we are at runtime and the
> results were not so good:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/85/builds/484
>
> We may need to reduce some of the free space in the ptest image and it
> looks like there is an NFS startup failure issue in the sdk images.
> There may be other issues in there too but those were the two I
> immediately saw.
I'll check the issues one by one.
Regards,
Kai
>
> Cheers,
>
> Richard
>
>
--
Kai Kang
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-06-04 7:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-02 14:55 [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network kai.kang
2019-06-02 14:55 ` [meta-poky][PATCH v6 1/2] poky.conf: make systemd as default init manager kai.kang
2019-06-02 14:55 ` [meta-poky][PATCH v6 2/2] systemd-conf: configure wired network with dhcp kai.kang
2019-06-03 12:30 ` [meta-poky][PATCH v6 0/2] Make systemd as default init manager and configure wired network richard.purdie
2019-06-04 7:06 ` Kang Kai
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.