Modify script to create policy db at FOTA upgrade 19/133719/4 submit/tizen/20170705.072126
authorYunjin Lee <yunjin-.lee@samsung.com>
Tue, 13 Jun 2017 07:36:28 +0000 (16:36 +0900)
committerYunjin Lee <yunjin-.lee@samsung.com>
Wed, 5 Jul 2017 02:57:50 +0000 (11:57 +0900)
Change-Id: Ibc5f9275b42610cd750a332b4df13a1ddd7971ac
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
capi/res/dbspace/policy_db_updater.sh

index 987c6f6..9d13fbd 100755 (executable)
@@ -5,7 +5,21 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
 . /etc/tizen-platform.conf
 
 DB_NAME=${TZ_SYS_DB}/.policy.db
+DB_NAME_JOURNAL=${TZ_SYS_DB}/.policy.db-journal
 MDM_BLACKLIST=${TZ_SYS_RO_SHARE}/security-config/mdm_blacklist
+if [ ! -e $DB_NAME ]; then
+       echo "Creating $DB_NAME ..."
+       touch $DB_NAME
+       if [ -e $DB_NAME_JOURNAL ]; then
+               rm $DB_NAME_JOURNAL
+       fi
+       touch $DB_NAME_JOURNAL
+
+       echo "Creating PREVENT_LIST table ..."
+       sqlite3 $DB_NAME "CREATE TABLE PREVENT_LIST (UID NUMERIC not null, PACKAGE_TYPE NUMERIC , PRIVILEGE_NAME TEXT not null, UNIQUE(UID, PACKAGE_TYPE, PRIVILEGE_NAME));"
+       echo "Creating DISABLE_LIST table...."
+       sqlite3 $DB_NAME "CREATE TABLE DISABLE_LIST (UID NUMERIC not null, PRIVILEGE_NAME TEXT not null, UNIQUE(UID, PRIVILEGE_NAME));"
+fi
 
 if [ -a $MDM_BLACKLIST ]; then
        echo "mdm blacklist exist"