On 2019/7/6 下午8:31, [email protected] wrote:
On Sat, 2019-07-06 at 12:53 +0300, Adrian Bunk wrote:
On Thu, Jul 04, 2019 at 09:45:19PM +0800, [email protected]
wrote:
From: Kai Kang <[email protected]>

Introduce a new variable INIT_MANAGER and create 3 init-manager-
*.inc
files to configure init manager settings. Available values of
INIT_MANAGER are sysvinit, systemd and mdev-busybox. 'sysvinit' is
set
by default for compatibility.
...
--- a/meta/conf/distro/defaultsetup.conf
+++ b/meta/conf/distro/defaultsetup.conf
@@ -23,3 +23,6 @@ PACKAGE_CLASSES ?= "package_ipk"
  INHERIT_BLACKLIST = "blacklist"
  INHERIT_DISTRO ?= "debian devshell sstate license remove-libtool"
  INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO}
${INHERIT_BLACKLIST}"
+
+INIT_MANAGER ??= "sysvinit"
+require conf/distro/include/init-manager-${INIT_MANAGER}.inc
...
--- /dev/null
+++ b/meta/conf/distro/include/init-manager-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"
I am not sure whether this can be fixed better, but this does break
existing configurations that use a non-default init system.

I just ran into a build issue with
   VIRTUAL-RUNTIME_init_manager = "systemd"
since this now resulted in both sysvinit and systemd being attempted
to
be installed to the image.

This was fixable in my configuration with
   -VIRTUAL-RUNTIME_init_manager = "systemd"
   +INIT_MANAGER = "systemd"

This at least needs to be properly documented as a breaking change.
This change also didn't quite work out for some of our selftests. I've
a patch in master-next which tried to improve things and that fixed the
selftests.

The only other way we could do this is to default INIT_MANAGER to say
"unset" and have an empty file for that. That will of course break my
patch and need the defaults adding back into the recipe. Unless we put
those defaults into the unset version.

How about keep a empty INIT_MANAGER by default, and check if INIT_MANAGER is set, then overwrite other configs such as VIRTUAL-RUNTIME_init_manager whether is from user config or predefined value from config files or recipes? It could be done
in a anonymous function.

Regards,
Kai



Not sure quite what we should do here...

Cheers,

Richard




--
Kai Kang

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to