[Update] Adding Tizen IoT Platform to common.yaml 53/157953/2
authorwchang kim <wchang.kim@samsung.com>
Fri, 27 Oct 2017 03:37:21 +0000 (12:37 +0900)
committerwchang kim <wchang.kim@samsung.com>
Fri, 27 Oct 2017 03:53:41 +0000 (12:53 +0900)
1. Adding Tizen IoT Platform to common.yaml
2. Change the file name.
   common-cleanup-rpi3 -> common-cleanup-directory

Change-Id: I26211ba67e514fd5c1c43b651dfa1000c701d2d6

common.yaml
scripts/common-cleanup-directory.post [moved from scripts/common-cleanup-rpi3.post with 61% similarity]
scripts/common-crosswalk.post
scripts/common-wayland.post
scripts/iot-headless-base.post [new file with mode: 0644]

index 9590a07..3455117 100644 (file)
@@ -207,7 +207,7 @@ RPi3 Headless:
         - common-crosswalk
         - common-license
         - generic-security
-        - common-cleanup-rpi3
+        - common-cleanup-directory
     Repos: []
     NoChrootScripts:
         - buildname
@@ -232,7 +232,7 @@ RPi3 Docker:
         - common-crosswalk
         - common-license
         - generic-security
-        - common-cleanup-rpi3
+        - common-cleanup-directory
     Repos: []
     NoChrootScripts:
         - buildname
@@ -258,7 +258,29 @@ Artik530_710 Headless:
         - common-crosswalk
         - common-license
         - generic-security
-        - common-cleanup-rpi3
+        - common-cleanup-directory
+    Repos: []
+    NoChrootScripts:
+        - buildname
+Tizen IoT:
+    Part: common-3parts-ramdisk
+    Groups:
+        - IoT Headless Base
+    PostScripts:
+        - generic-adaptation
+        - generic-base
+        - iot-headless-base
+        - generic-wayland
+        - generic-middleware
+        - generic-applications
+        - generic-bluetooth
+        - generic-multimedia
+        - generic-desktop-applications
+        - generic-crosswalk
+        - common-crosswalk
+        - common-license
+        - generic-security
+        - common-cleanup-directory
     Repos: []
     NoChrootScripts:
         - buildname
similarity index 61%
rename from scripts/common-cleanup-rpi3.post
rename to scripts/common-cleanup-directory.post
index aac98e7..bad61fe 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-echo "############### common-cleanup-rpi3.post ################"
+echo "############### common-cleanup-directory.post ################"
 
 # remove manuals, docs and headers
 rm -rf /usr/include
index 83b6f13..c9511cb 100644 (file)
@@ -2,5 +2,9 @@
 echo "############### common-crosswalk.post ################"
 
 # start wrt widgets preinstall
+rpm -qa | grep wrt-widget
+if [ $? = 0 ]
+then
 prepare_widgets.sh
+fi
 
index 99a63a9..c4ddae0 100644 (file)
@@ -4,7 +4,7 @@ echo "#################### common-wayland.post ##################"
 # add users to display group
 for user in alice bob carol guest developer owner; do
        if generic_base_user_exists $user; then
-               /usr/sbin/groupmod -A $user display
+               /usr/sbin/usermod -G display $user
        fi
 done
 
diff --git a/scripts/iot-headless-base.post b/scripts/iot-headless-base.post
new file mode 100644 (file)
index 0000000..8fa9285
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+echo "############### iot-headless-base.post ################"
+
+######### multiuser mode: create additional users and fix their homedirs
+if ! generic_base_user_exists owner; then
+       gum-utils --offline --add-user --username=owner --usertype=admin --usecret=tizen
+fi
+
+if ! generic_base_user_exists guest; then
+       gum-utils --offline --add-user --username=guest --usertype=normal --usecret=tizen
+fi
+
+######### add 'guest' user that runs bt-service daemon to vconf_bt group
+function mygetid() { sed '/^'"$1"':/!d;s/^\([^:]*:\)\{2\}\([^:]*\):.*$/\2/' "$2"; }
+function mygetuid() { mygetid "$1" /etc/passwd; }
+function mygetgid() { mygetid "$1" /etc/group; }
+
+gum-utils --offline --add-member --gid=$(mygetgid vconf_bt) --mem_uid=$(mygetuid guest)
+
+######### Execute pkg_initdb if there is no pkgmgr-tool pacakge
+rpm -qa | grep pkgmgr-tool
+if [ $? != 0 ]
+then
+pkg_initdb --ro
+fi
+