[OE-core] [PATCH 3/9] image.bbclass: set the proper default target

Valentin Popa valentin.popa at intel.com
Tue Jul 15 08:00:46 UTC 2014


Check also for "wayland" presence in DISTRO_FEATURES
before creating default.target.

Signed-off-by: Valentin Popa <valentin.popa at intel.com>
---
 meta/classes/image.bbclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index a03b880..04aa14b 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -153,7 +153,6 @@ ROOTFS_POSTPROCESS_COMMAND =+ "write_image_manifest ; "
 # Set default postinst log file
 POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log"
 # Set default target for systemd images
-SYSTEMD_DEFAULT_TARGET ?= '${@bb.utils.contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}'
 ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; ", "", d)}'
 
 # some default locales
@@ -171,6 +170,17 @@ do_rootfs[cleandirs] += "${S}"
 # task, so that we have a single fakeroot context for the whole process.
 do_rootfs[umask] = "022"
 
+def determine_default_target(d):
+      graphical_target =  bb.utils.contains("IMAGE_FEATURES", "x11-base", True, False, d) or \
+                       bb.utils.contains("DISTRO_FEATURES", "wayland", True, False, d)
+      if graphical_target:
+         return "graphical.target"
+      else:
+        return "multi-user.target"
+
+
+SYSTEMD_DEFAULT_TARGET ?= '${@determine_default_target(d)}'
+
 # A hook function to support read-only-rootfs IMAGE_FEATURES
 # Currently, it only supports sysvinit system.
 read_only_rootfs_hook () {
-- 
1.9.1




More information about the Openembedded-core mailing list