Use adduser class mechanism to create system user such as tizenglobalapp & buxton 09/41509/2
authorBaptiste Durand <baptiste.durand@open.eurogiciel.org>
Mon, 4 May 2015 07:59:59 +0000 (09:59 +0200)
committerJean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Tue, 16 Jun 2015 12:31:25 +0000 (14:31 +0200)
Change-Id: Ie23fbda18c9f7cc0562b11d0cab735ea4afa9c0a
Signed-off-by: Baptiste Durand <baptiste.durand@open.eurogiciel.org>
meta-tizen-common-base/recipes-application-framework/ail/ail.inc
meta-tizen-common-base/recipes-security/buxton/buxton-extraconf.inc
meta-tizen-common-base/recipes-security/buxton/buxton.inc
meta-tizen-common-demo/recipes-image/images/tizen-common-core-image-crosswalk.bb

index 7cafb1c..50fcfc5 100644 (file)
@@ -8,7 +8,7 @@ SRC_URI = ""
 
 S = "${WORKDIR}/git"
 
-inherit manifest autotools-brokensep
+inherit manifest autotools-brokensep useradd
 
 BBCLASSEXTEND = ""
 PROVIDES = ""
@@ -122,7 +122,6 @@ pkg_postinst_${PN}() {
 
     ldconfig
     # Create tizenglobalapp user needed for global installation
-    useradd -d $D${prefix}/apps -m tizenglobalapp -r -c "system user for common applications" -g root
     #mkdir -p %TZ_SYS_RW_APP/.config/xwalk-service/applications
     #cd %TZ_SYS_RW_APP/
     #ln -s .config/xwalk-service/applications/
@@ -143,14 +142,13 @@ pkg_postinst_${PN}() {
     chsmack -a '*' $D${prefix}/share/icons/default/small/
     chmod g+w $D${prefix}/share/applications
     chmod g+w $D${prefix}/share/applications
-    chown tizenglobalapp:root $D${prefix}/share/applications
-    chown tizenglobalapp:root $D${prefix}/share/applications
-    chown tizenglobalapp:root $D${prefix}/apps
-    chown tizenglobalapp:root $D${prefix}/dbspace
-    chown tizenglobalapp:root $D${prefix}/dbspace
-    chown tizenglobalapp:root -R $D${prefix}/share/icons
+    chown 9998:root $D${prefix}/share/applications
+    chown 9998:root $D${prefix}/share/applications
+    chown 9998:root $D${prefix}/apps
+    chown 9998:root $D${prefix}/dbspace
+    chown 9998:root $D${prefix}/dbspace
+    chown 9998:root -R $D${prefix}/share/icons
     ail_createdb 2>/dev/null
-    ail_syncdb 2>/dev/null
     chsmack -a '*' $D${prefix}/dbspace/.app_info.db*
      
 
@@ -207,3 +205,8 @@ PKG_ail-vconf-dev= "ail-vconf-dev"
 
 require ail-extraconf.inc
 
+USERADD_PACKAGES = "ail"
+
+USERADD_PARAM_${PN} = "   -u 9998  -m  -d ${prefix}/apps -r  -c 'system user for common applications' -g users tizenglobalapp"
+
+
index b04e01e..a126fa8 100644 (file)
@@ -12,6 +12,7 @@ RDEPENDS_${PN}_class-native = ""
 RDEPENDS_${PN}_class-native += "coreutils"
 RDEPENDS_${PN}_class-native += "smack"
 
+inherit useradd
 
 do_prep_class-native() {
  cd ${S}
@@ -39,3 +40,7 @@ do_compile_class-native() {
   
   
 }
+
+USERADD_PACKAGES = "buxton"
+
+USERADD_PARAM_${PN} = " -u 9997  -m buxton"
index e16ceae..abc93c6 100644 (file)
@@ -116,8 +116,8 @@ pkg_postinst_${PN}() {
     #!/bin/sh -e
 
     [ "x$D" == "x" ] && ldconfig
+    [ "x$D" != "x" ] && exit 1
     #buxtond runs as user buxton, which much be created
-    useradd buxton
     buxtonctl create-db base
     buxtonctl create-db isp
     if [ "$1" -eq 1 ] ; then
index b002e30..3648a20 100644 (file)
@@ -4,6 +4,7 @@ SUMMARY = "A Wayland image with a terminal and crosswalk"
 
 LICENSE = "MIT"
 
+inherit extrausers
 DESCRIPTION = "A weston image with Tizen common ."
 
 # Crosswalk
@@ -11,3 +12,6 @@ CORE_IMAGE_EXTRA_INSTALL += "packagegroup-tizen-crosswalk"
 
 # Time zone
 CORE_IMAGE_EXTRA_INSTALL += "tzdata security-manager"
+
+EXTRA_USERS_PARAMS = "usermod -g root tizenglobalapp;"
+