summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2013-12-20 10:45:52 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-06 11:13:54 +0000
commit655b432ac397409432ac9c5ba2dfdb6c194effa1 (patch)
treea94673b8888e73478bcac69c7cec4c17e5d82164 /meta/classes
parent19254bd43554e3f6ca6869eea93686bafb98bebc (diff)
downloadpoky-655b432ac397409432ac9c5ba2dfdb6c194effa1.tar.gz
image.bbclass: add ability to set systemd default target
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] (From OE-Core rev: 049f89155b1e80875aad6e53b21808b827c06915) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/image.bbclass10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index c59572104d..4c63bc28fd 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -186,6 +186,9 @@ IMAGE_MANIFEST = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest"
186ROOTFS_POSTPROCESS_COMMAND =+ "write_image_manifest ; " 186ROOTFS_POSTPROCESS_COMMAND =+ "write_image_manifest ; "
187# Set default postinst log file 187# Set default postinst log file
188POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log" 188POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log"
189# Set default target for systemd images
190SYSTEMD_DEFAULT_TARGET ?= '${@base_contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}'
191ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; ", "", d)}'
189 192
190# some default locales 193# some default locales
191IMAGE_LINGUAS ?= "de-de fr-fr en-gb" 194IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
@@ -596,6 +599,13 @@ postinst_enable_logging () {
596 echo "LOGFILE=${POSTINST_LOGFILE}" >> ${IMAGE_ROOTFS}${sysconfdir}/default/postinst 599 echo "LOGFILE=${POSTINST_LOGFILE}" >> ${IMAGE_ROOTFS}${sysconfdir}/default/postinst
597} 600}
598 601
602# Modify systemd default target
603set_systemd_default_target () {
604 if [ -d ${IMAGE_ROOTFS}${sysconfdir}/systemd/system -a -e ${IMAGE_ROOTFS}${systemd_unitdir}/system/${SYSTEMD_DEFAULT_TARGET} ]; then
605 ln -sf ${systemd_unitdir}/system/${SYSTEMD_DEFAULT_TARGET} ${IMAGE_ROOTFS}${sysconfdir}/systemd/system/default.target
606 fi
607}
608
599# Turn any symbolic /sbin/init link into a file 609# Turn any symbolic /sbin/init link into a file
600remove_init_link () { 610remove_init_link () {
601 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then 611 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then