From 38f129d8076397476cee0e705a0194c2fd41d523 Mon Sep 17 00:00:00 2001 From: =?utf8?q?K=C3=A9vin=20THIERRY?= Date: Tue, 16 Sep 2014 15:58:17 +0200 Subject: [PATCH] Fix tz-launchers launch MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Following fixes to get Tizen IVI images to boot tz-launchers weren't launched anymore in Tizen Common images. This patch fix this issue. Also clean users and groups creation. Change-Id: I152e7a4fd067b4b54a775b736accf3e2fe213ee0 Signed-off-by: Kévin THIERRY --- .../config-tizen-profiles/config-tizen-common.bb | 6 ++-- .../config-tizen-profiles/config-tizen-ivi.bb | 7 ++-- .../desktop-skin/desktop-skin-extraconf.inc | 3 +- .../user-session-units-extraconf.inc | 5 --- .../weston-common/weston-common-extraconf.inc | 37 +++++++++++++++++++--- .../weston-ivi-shell-extraconf.inc | 10 +++--- recipes-tizen/weston/weston-extraconf.inc | 1 - 7 files changed, 44 insertions(+), 25 deletions(-) diff --git a/recipes-image/config-tizen-profiles/config-tizen-common.bb b/recipes-image/config-tizen-profiles/config-tizen-common.bb index c418776..51e8318 100644 --- a/recipes-image/config-tizen-profiles/config-tizen-common.bb +++ b/recipes-image/config-tizen-profiles/config-tizen-common.bb @@ -2,11 +2,10 @@ LICENSE = "GPL-2.0" LIC_FILES_CHKSUM ??= "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" SRC_URI = "" +ALLOW_EMPTY_${PN} = "1" inherit allarch useradd -ALLOW_EMPTY_${PN} = "1" - USERADD_PACKAGES = "${PN}" GROUPADD_PARAM_${PN} = "-g 191 display; -g 100 users; -g 1004 input; -g 190 systemd-journal; -g 54 lock" @@ -15,5 +14,4 @@ USERADD_PARAM_${PN} = " -d /run/display -m -u 115 -g display -G users,input,t USERADD_PARAM_${PN} += " -d /home/alice -m -u 5001 -g users -G users,display -r -s /bin/sh alice; " USERADD_PARAM_${PN} += " -d /home/bob -m -u 5002 -g users -G users,display -r -s /bin/sh bob; " USERADD_PARAM_${PN} += " -d /home/carol -m -u 5003 -g users -G users,display -r -s /bin/sh carol; " -USERADD_PARAM_${PN} += " -d /home/guest -m -u 9999 -g users -G users,display -r -s /bin/sh guest; " -USERADD_PARAM_${PN} += " -d /home/app -m -u 5000 -g users -G users,display -r -s /bin/sh app " +USERADD_PARAM_${PN} += " -d /home/guest -m -u 9999 -g users -G users,display -r -s /bin/sh guest " diff --git a/recipes-image/config-tizen-profiles/config-tizen-ivi.bb b/recipes-image/config-tizen-profiles/config-tizen-ivi.bb index fc7bfe2..761d0ce 100644 --- a/recipes-image/config-tizen-profiles/config-tizen-ivi.bb +++ b/recipes-image/config-tizen-profiles/config-tizen-ivi.bb @@ -2,15 +2,12 @@ LICENSE = "GPL-2.0" LIC_FILES_CHKSUM ??= "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" SRC_URI = "" - -inherit allarch useradd - - ALLOW_EMPTY_${PN} = "1" +inherit allarch useradd USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "-g 100 users; -g 5000 app; -g 192 weston-launch; -g 54 lock; -g 190 systemd-journal " +GROUPADD_PARAM_${PN} = "-g 100 users; -g 5000 app; -g 54 lock; -g 190 systemd-journal " USERADD_PARAM_${PN} += " -u 5000 -d /home/app -m -g users -G users,weston-launch -r -s /bin/sh app " diff --git a/recipes-tizen/desktop-skin/desktop-skin-extraconf.inc b/recipes-tizen/desktop-skin/desktop-skin-extraconf.inc index d2b1669..3be0c20 100644 --- a/recipes-tizen/desktop-skin/desktop-skin-extraconf.inc +++ b/recipes-tizen/desktop-skin/desktop-skin-extraconf.inc @@ -9,5 +9,4 @@ pkg_postinst_${PN}() { #!/bin/sh -e ln -fs tizen_common.png $D${prefix}/share/backgrounds/tizen/current - -} \ No newline at end of file +} diff --git a/recipes-tizen/user-session-units/user-session-units-extraconf.inc b/recipes-tizen/user-session-units/user-session-units-extraconf.inc index 43db92d..4806585 100644 --- a/recipes-tizen/user-session-units/user-session-units-extraconf.inc +++ b/recipes-tizen/user-session-units/user-session-units-extraconf.inc @@ -5,10 +5,6 @@ inherit pkgconfig do_install_append() { rm -f ${D}/lib/systemd/user/dbus.socket - mkdir -p ${D}/lib/systemd/system/graphical.target.wants - ln -sf ../user-session-launch@.service ${D}/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service - - echo "[Unit]" > ${D}/lib/systemd/user/default.target echo "Description=User session default target" >> ${D}/lib/systemd/user/default.target @@ -18,7 +14,6 @@ do_install_append() { rm -f ${D}/lib/systemd/user/default.target ln -sf weston.target ${D}/lib/systemd/user/default.target - } user-session-units_files += "/lib/systemd/user/*" diff --git a/recipes-tizen/weston-common/weston-common-extraconf.inc b/recipes-tizen/weston-common/weston-common-extraconf.inc index df20a1c..508fcec 100644 --- a/recipes-tizen/weston-common/weston-common-extraconf.inc +++ b/recipes-tizen/weston-common/weston-common-extraconf.inc @@ -5,15 +5,39 @@ SRC_URI += "file://0002-Add-a-script-to-export-UID.patch" SRC_URI += "file://0003-Automatically-restart-display-manager.patch" SRC_URI += "file://0004-Modifications-for-yocto-build.patch" +DEPENDS += "config-tizen-common" +RDEPENDS_${PN} += "config-tizen-common" do_install_append() { install -m 755 uid.sh ${D}/etc/profile.d + mkdir -p ${D}/lib/systemd/user/default.target.wants ln -sf ../weston-user.service ${D}/lib/systemd/user/default.target.wants/weston-user.service + + mkdir -p ${D}/lib/systemd/system/multi-user.target.wants + ln -sf ../user-session-launch@.service ${D}/lib/systemd/system/multi-user.target.wants/user-session-launch@seat0-5001.service + ln -sf ../user-session-launch@.service ${D}/lib/systemd/system/multi-user.target.wants/user-session-launch@seat0-5002.service + ln -sf ../user-session-launch@.service ${D}/lib/systemd/system/multi-user.target.wants/user-session-launch@seat0-5003.service + ln -sf ../user-session-launch@.service ${D}/lib/systemd/system/multi-user.target.wants/user-session-launch@seat0-9999.service + ln -sf ../user-session@.service ${D}/lib/systemd/system/multi-user.target.wants/user-session@5001.service + ln -sf ../user-session@.service ${D}/lib/systemd/system/multi-user.target.wants/user-session@5002.service + ln -sf ../user-session@.service ${D}/lib/systemd/system/multi-user.target.wants/user-session@5003.service + ln -sf ../user-session@.service ${D}/lib/systemd/system/multi-user.target.wants/user-session@9999.service +} + +pkg_preinst_${PN}() { + #!/bin/sh -e + + # setup display manager service + mkdir -p /lib/systemd/system/graphical.target.wants/ + ln -sf ../display-manager.path /lib/systemd/system/graphical.target.wants/ + # setup display manager access (inside user session) + mkdir -p /lib/systemd/user/default.target.requires/ + ln -sf ../weston-user.service /lib/systemd/user/default.target.requires/ } pkg_postinst_${PN} () { - for user in alice bob carol app guest; do + for user in alice bob carol guest; do for appdir in desktop manifest dbspace; do mkdir -p $D/home/$user/.applications/$appdir done @@ -25,6 +49,11 @@ pkg_postinst_${PN} () { weston-common_files += "/lib/systemd/user/default.target.wants/weston-user.service" weston-common_files += "/home/*" -pkg_preinst_${PN}() { - #!/bin/sh -e -} +FILES_${PN} += "/lib/systemd/system/multi-user.target.wants/user-session-launch@seat0-5001.service" +FILES_${PN} += "/lib/systemd/system/multi-user.target.wants/user-session-launch@seat0-5002.service" +FILES_${PN} += "/lib/systemd/system/multi-user.target.wants/user-session-launch@seat0-5003.service" +FILES_${PN} += "/lib/systemd/system/multi-user.target.wants/user-session-launch@seat0-9999.service" +FILES_${PN} += "/lib/systemd/system/multi-user.target.wants/user-session@5001.service" +FILES_${PN} += "/lib/systemd/system/multi-user.target.wants/user-session@5002.service" +FILES_${PN} += "/lib/systemd/system/multi-user.target.wants/user-session@5003.service" +FILES_${PN} += "/lib/systemd/system/multi-user.target.wants/user-session@9999.service" diff --git a/recipes-tizen/weston-ivi-shell/weston-ivi-shell-extraconf.inc b/recipes-tizen/weston-ivi-shell/weston-ivi-shell-extraconf.inc index adf8394..b39fc61 100644 --- a/recipes-tizen/weston-ivi-shell/weston-ivi-shell-extraconf.inc +++ b/recipes-tizen/weston-ivi-shell/weston-ivi-shell-extraconf.inc @@ -31,6 +31,11 @@ do_install_append() { rm -fr ${D}/usr/lib/weston/.debug/desktop-shell.so rm -fr ${D}/usr/lib/weston/gl-renderer.so rm -fr ${D}/usr/lib/weston/.debug/gl-renderer.so + + # Enable a logind session for 'app' user on seat0 (the default seat for + # graphical sessions) + mkdir -p ${D}/lib/systemd/system/graphical.target.wants + ln -sf ../user-session-launch@.service ${D}/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service } pkg_postinst_${PN} () { @@ -52,10 +57,6 @@ pkg_postinst_${PN} () { # home dir must have the same label chsmack -a User /home/app - # Enable a logind session for 'app' user on seat0 (the default seat for - # graphical sessions) - mkdir -p /usr/lib/systemd/system/graphical.target.wants - ln -s ../user-session-launch@.service /usr/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service ln -sf weston.target /usr/lib/systemd/user/default.target # Add over-riding environment to enable the web runtime to @@ -95,5 +96,6 @@ FILES_${PN} += "${prefix}/lib/weston-ivi-shell/weston-desktop-shell" FILES_${PN} += "${prefix}/lib/weston-ivi-shell/weston-screenshooter" FILES_${PN} += "${prefix}/lib/weston-ivi-shell/weston-simple-im" FILES_${PN} += "${prefix}/lib/weston/cms-static.so" +FILES_${PN} += "/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service" FILES_${PN}-dev += "${prefix}/include/weston/ivi-shell-ext.h" diff --git a/recipes-tizen/weston/weston-extraconf.inc b/recipes-tizen/weston/weston-extraconf.inc index 8220a89..fcf909e 100644 --- a/recipes-tizen/weston/weston-extraconf.inc +++ b/recipes-tizen/weston/weston-extraconf.inc @@ -45,4 +45,3 @@ FILES_${PN} += "${prefix}/lib/weston/weston-simple-im" FILES_${PN} += "${prefix}/bin/weston-scaler" FILES_${PN} += "${prefix}/bin/weston-stacking" FILES_${PN} += "${prefix}/bin/weston-multi-resource" - -- 2.7.4