Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH V3 0/1] image.bbclass: add ability to set systemd default target
@ 2013-12-20  2:45 Qi.Chen
  2013-12-20  2:45 ` [PATCH V3 1/1] " Qi.Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Qi.Chen @ 2013-12-20  2:45 UTC (permalink / raw)
  To: openembedded-core

From: Chen Qi <Qi.Chen@windriver.com>

Changes since V2:
1. Fix the commit message.

The following changes since commit 9daa1de753e58b7f678e68cf307f6028c0c79a6a:

  qemu/local.conf.sample: Add sdl PACKAGECONFIG (2013-12-16 12:13:59 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/systemd-default-target
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/systemd-default-target

Chen Qi (1):
  image.bbclass: add ability to set systemd default target

 meta/classes/image.bbclass |   10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
1.7.9.5



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

* [PATCH V3 1/1] image.bbclass: add ability to set systemd default target
  2013-12-20  2:45 [PATCH V3 0/1] image.bbclass: add ability to set systemd default target Qi.Chen
@ 2013-12-20  2:45 ` Qi.Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Qi.Chen @ 2013-12-20  2:45 UTC (permalink / raw)
  To: openembedded-core

From: Chen Qi <Qi.Chen@windriver.com>

Add ability to set the default target for systemd images.

The default target for system is controlled by SYSTEMD_DEFAULT_TARGET.
The default value for this variable is derived from checking whether
IMAGE_FEATURES contains 'x11-base' or not. Each image could override
this value in its own recipe. For now, we don't need to do any change,
because all images that support graphical environment has 'x11-base'
in its IMAGE_FEATURES.

[YOCTO #3816]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/image.bbclass |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index c595721..4c63bc2 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -186,6 +186,9 @@ IMAGE_MANIFEST = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest"
 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 ?= '${@base_contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}'
+ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; ", "", d)}'
 
 # some default locales
 IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
@@ -596,6 +599,13 @@ postinst_enable_logging () {
 	echo "LOGFILE=${POSTINST_LOGFILE}" >> ${IMAGE_ROOTFS}${sysconfdir}/default/postinst
 }
 
+# Modify systemd default target
+set_systemd_default_target () {
+	if [ -d ${IMAGE_ROOTFS}${sysconfdir}/systemd/system -a -e ${IMAGE_ROOTFS}${systemd_unitdir}/system/${SYSTEMD_DEFAULT_TARGET} ]; then
+		ln -sf ${systemd_unitdir}/system/${SYSTEMD_DEFAULT_TARGET} ${IMAGE_ROOTFS}${sysconfdir}/systemd/system/default.target
+	fi
+}
+
 # Turn any symbolic /sbin/init link into a file
 remove_init_link () {
 	if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
-- 
1.7.9.5



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

end of thread, other threads:[~2013-12-20  2:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20  2:45 [PATCH V3 0/1] image.bbclass: add ability to set systemd default target Qi.Chen
2013-12-20  2:45 ` [PATCH V3 1/1] " Qi.Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox