aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <kazumasa_mitsunari_za@mail.toyota.co.jp>2016-09-23 13:40:16 +0900
committerKazumasa Mitsunari <kazumasa_mitsunari_za@mail.toyota.co.jp>2016-09-23 13:40:16 +0900
commit18bd43272c0eb03ddf403d14cdb15f37695d5374 (patch)
tree2784d67e444090b90cc89a8123b70aef68e6dba7
parent4e5d35db8a03eed001d526be639acb28f39a32b9 (diff)
Add pkgmgr-first-setup for systemd service
There are some settings to use appmgr for aglglobalapp. This is the first set up called at booting systemd. Item: * Language setting * Change owner to aglglobalapp for manage database * Initialize database But wayland socket is owned by root user yet, so an user has to change owner to create displays(surfaces) every time start weston. chown aglglobalapp /run/user/0 /run/user/0/wayland-0 This will be fixed to be changed every time after starting weston before long. Change-Id: I2fa635f35aa8e082973b09f2b8c80175d4f0ced4 Signed-off-by: Kazumasa Mitsunari <kazumasa_mitsunari_za@mail.toyota.co.jp>
-rw-r--r--README31
-rw-r--r--meta-application-manager/recipes-application-framework/pkgmgr/files/pkgmgr-journaldb.patch52
-rw-r--r--meta-application-manager/recipes-others/images/agl-demo-platform-plus-application-manager.bb1
-rwxr-xr-xmeta-application-manager/recipes-others/pkgmgr-first-setup-service/files/pkgmgr-first-setup.service11
-rwxr-xr-xmeta-application-manager/recipes-others/pkgmgr-first-setup-service/files/pkgmgr-first-setup.sh36
-rwxr-xr-xmeta-application-manager/recipes-others/pkgmgr-first-setup-service/pkgmgr-first-setup-service.bb30
6 files changed, 96 insertions, 65 deletions
diff --git a/README b/README
index 1cfc2a3..fd12427 100644
--- a/README
+++ b/README
@@ -16,7 +16,6 @@ Release note
ToDo
------------------
-* Register first setting(vconf etc.) as systemd service
* Documentation
* Dynamicaly enable to install applications
* Support multiple runtime engine
@@ -98,7 +97,8 @@ You can build an image for porter using the following steps:
1. change recipes and security_flags.inc
- You can select the following process to setup. 1.b is better to avoid mistakes.
+ You can select the following process to setup. 1.a is better to reflect agl-community change.
+ The attached security_flag.inc doesn't reflect it.
1.a Add the following setting in security_flags.inc
+SECURITY_CFLAGS_pn-efl = "${SECURITY_NO_PIE_CFLAGS}"
@@ -150,23 +150,28 @@ can be searched from database.
1. Start up porter board and open the weston-terminal
2. Setting
- # vconftool set -t string db/menu_widget/language "en-us"
- # useradd aglglobalapp
- if required to define password, please set the password you like
- # loginctl enable-linger aglglobalapp
- # chmod g+w /usr/share/applications
- # chown aglglobalapp:root /usr/dbspace
+ # passwd aglglobalapp
+ You can put any password you like.
# chown aglglobalapp:root /run/user/0 /run/user/0/wayland-0
3. Launch sample application from user
- # login aglglobalapp
- $ pkg_initdb_user
- $ ail_initdb_user
+ # login aglglobalapp (or # su aglglobalapp)
$ launch_app org.tizen.amhelloworld
- successfull to launch
+ Successfull message is shown.
4. How to start native application
- $ pkgcmd -l // to list all applications available. $ pkginfo --listpkg is also available
+ # cp <your-manifest-file> /usr/share/packages
+ Note:How to write manifest file is here.
+ Put your an application or a script to proper locale designated in manifest file.
+ If you get the message, "Failed to create display (No such file or directory)",
+ confirm XDG_RUNTIME_DIR is set to /run/user/0
+
+ https://developer.tizen.org/development/tools/native-tools/manifest-text-editor/additional-manifest-text-editor-elements#bg-category
+
+ # pkg_initdb
+ # ail_initdb
+ $ pkgcmd -l // to list all applications available.
+ $ ail_list is also available
$ app_launcher -s <appid>
For more information, please access the following URL
diff --git a/meta-application-manager/recipes-application-framework/pkgmgr/files/pkgmgr-journaldb.patch b/meta-application-manager/recipes-application-framework/pkgmgr/files/pkgmgr-journaldb.patch
deleted file mode 100644
index 4773426..0000000
--- a/meta-application-manager/recipes-application-framework/pkgmgr/files/pkgmgr-journaldb.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git a/tool/pkg_createdb.c b/tool/pkg_createdb.c
---- a/tool/pkg_createdb.c
-+++ b/tool/pkg_createdb.c
-@@ -261,15 +261,21 @@
- for (i = 0; files[i]; i++) {
- ret = chown(files[i], GLOBAL_USER, OWNER_ROOT);
- if (ret == -1) {
-+ if (files[i] == journal_file && errno == ENOENT)
-+ continue;
- strerror_r(errno, buf, sizeof(buf));
-- _E("FAIL : chown %s %d.%d, because %s", db_file, GLOBAL_USER, OWNER_ROOT, buf);
-+ _E("FAIL : chown %s %d.%d, because %s", files[i], GLOBAL_USER, OWNER_ROOT, buf);
- return -1;
- }
-
- ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
- if (ret == -1) {
-+ if (files[i] == journal_file && errno == ENOENT)
-+ continue;
- strerror_r(errno, buf, sizeof(buf));
-- _E("FAIL : chmod %s 0664, because %s", db_file, buf);
-+ _E("FAIL : chmod %s 0664, because %s", files[i], buf);
- return -1;
- }
- }
-
---- a/tool/pkg_initdb.c
-+++ b/tool/pkg_initdb.c
-@@ -208,15 +208,21 @@
- for (i = 0; files[i]; i++) {
- ret = chown(files[i], GLOBAL_USER, OWNER_ROOT);
- if (ret == -1) {
-+ if (files[i] == journal_file && errno == ENOENT)
-+ continue;
- strerror_r(errno, buf, sizeof(buf));
-- _E("FAIL : chown %s %d.%d, because %s", db_file, GLOBAL_USER, OWNER_ROOT, buf);
-+ _E("FAIL : chown %s %d.%d, because %s", files[i], GLOBAL_USER, OWNER_ROOT, buf);
- return -1;
- }
-
- ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
- if (ret == -1) {
-+ if (files[i] == journal_file && errno == ENOENT)
-+ continue;
- strerror_r(errno, buf, sizeof(buf));
-- _E("FAIL : chmod %s 0664, because %s", db_file, buf);
-+ _E("FAIL : chmod %s 0664, because %s", files[i], buf);
- return -1;
- }
- }
-
-
diff --git a/meta-application-manager/recipes-others/images/agl-demo-platform-plus-application-manager.bb b/meta-application-manager/recipes-others/images/agl-demo-platform-plus-application-manager.bb
index 7f150e4..c8714a5 100644
--- a/meta-application-manager/recipes-others/images/agl-demo-platform-plus-application-manager.bb
+++ b/meta-application-manager/recipes-others/images/agl-demo-platform-plus-application-manager.bb
@@ -62,5 +62,6 @@ IMAGE_INSTALL_append = " \
dlt-daemon-systemd \
\
amhelloworld \
+ pkgmgr-first-setup-service \
"
diff --git a/meta-application-manager/recipes-others/pkgmgr-first-setup-service/files/pkgmgr-first-setup.service b/meta-application-manager/recipes-others/pkgmgr-first-setup-service/files/pkgmgr-first-setup.service
new file mode 100755
index 0000000..0a3dfd6
--- /dev/null
+++ b/meta-application-manager/recipes-others/pkgmgr-first-setup-service/files/pkgmgr-first-setup.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Package manager first setup script
+Before=weston.service
+After=tmp.mount
+
+[Service]
+Type=oneshot
+ExecStart=/usr/share/pkgmgr-first-setup/pkgmgr-first-setup.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-application-manager/recipes-others/pkgmgr-first-setup-service/files/pkgmgr-first-setup.sh b/meta-application-manager/recipes-others/pkgmgr-first-setup-service/files/pkgmgr-first-setup.sh
new file mode 100755
index 0000000..09cb3de
--- /dev/null
+++ b/meta-application-manager/recipes-others/pkgmgr-first-setup-service/files/pkgmgr-first-setup.sh
@@ -0,0 +1,36 @@
+#!/bin/sh -e
+
+useradd aglglobalapp
+loginctl enable-linger aglglobalapp
+vconftool set -t string db/ail/ail_info "0" -f -s system::vconf_inhouse
+vconftool set -t string db/menuscreen/desktop "0" -f -s system::vconf_inhouse
+vconftool set -f -t string db/menu_widget/language "en_US"
+chsmack -a User /usr/kdb/db/ail
+chsmack -a User /usr/kdb/db/ail/ail_info
+chsmack -a User /usr/kdb/db/menuscreen
+chsmack -a User /usr/kdb/db/menuscreen/desktop
+chsmack -a User /usr/kdb/db/menu_widget
+chsmack -a User /usr/kdb/db/menu_widget/language
+chsmack -a '*' /usr/dbspace
+chsmack -a '*' /usr/apps
+chsmack -a '*' /usr/share/applications
+chsmack -a '*' /usr/share/icons
+chsmack -a '*' /usr/share/icons/default
+chsmack -a '*' /usr/share/icons/default/small/
+chmod g+w /usr/share/applications
+chown aglglobalapp:root /usr/share/applications
+chown aglglobalapp:root /usr/apps
+chown aglglobalapp:root /usr/dbspace
+
+pkg_initdb
+ail_initdb
+
+if [ -e /usr/lib/systemd/system/multi-user.target.wantspkgmgr-first-setup.service ]
+then
+ rm /usr/lib/systemd/system/multi-user.target.wants/pkgmgr-first-setup.service
+fi
+
+if [ -e /lib/systemd/system/multi-user.target.wants/pkgmgr-first-setup.service ]
+then
+ rm /lib/systemd/system/multi-user.target.wants/pkgmgr-first-setup.service
+fi
diff --git a/meta-application-manager/recipes-others/pkgmgr-first-setup-service/pkgmgr-first-setup-service.bb b/meta-application-manager/recipes-others/pkgmgr-first-setup-service/pkgmgr-first-setup-service.bb
new file mode 100755
index 0000000..8613a45
--- /dev/null
+++ b/meta-application-manager/recipes-others/pkgmgr-first-setup-service/pkgmgr-first-setup-service.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Package manager first setup script"
+DESCRIPTION = "Package manager first setup script"
+SECTION = "base"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM ??= "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+PV = "1.0"
+PR = "r1"
+
+SRC_URI = "file://pkgmgr-first-setup.service \
+ file://pkgmgr-first-setup.sh"
+
+inherit systemd
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
+ install -m 0644 ${WORKDIR}/pkgmgr-first-setup.service ${D}${systemd_unitdir}/system/pkgmgr-first-setup.service
+ ln -sf ../pkgmgr-first-setup.service ${D}${systemd_unitdir}/system/multi-user.target.wants/pkgmgr-first-setup.service
+
+ install -d ${D}${prefix}/share/pkgmgr-first-setup
+ install -m 0755 ${WORKDIR}/pkgmgr-first-setup.sh ${D}${prefix}/share/pkgmgr-first-setup/pkgmgr-first-setup.sh
+ fi
+}
+
+FILES_${PN} += " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/pkgmgr-first-setup.service', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/multi-user.target.wants/pkgmgr-first-setup.service', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${prefix}/share/pkgmgr-first-setup/pkgmgr-first-setup.sh', '', d)} \
+ "