Add upgrade scripts 47/192047/2
authorseolheui, kim <s414.kim@samsung.com>
Mon, 29 Oct 2018 07:11:22 +0000 (16:11 +0900)
committerseolheui, kim <s414.kim@samsung.com>
Tue, 30 Oct 2018 09:20:28 +0000 (18:20 +0900)
 - To initialize unsupported vconf values, when the platform upgrade from 3.0 to 4.0

Change-Id: Ie7c434a4ff13efa8eefa913b3d7d438415d3103f
Signed-off-by: seolheui, kim <s414.kim@samsung.com>
fota/500.ode_upgrade.sh [new file with mode: 0755]
fota/CMakeLists.txt
packaging/ode.spec

diff --git a/fota/500.ode_upgrade.sh b/fota/500.ode_upgrade.sh
new file mode 100755 (executable)
index 0000000..a681229
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+# RW Update Script for 3.0 -> 4.0 and 4.0 -> 4.0
+# Update ode status whenever doing FOTA
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+source /usr/share/upgrade/rw-update-macro.inc
+get_version_info
+
+ODE_STATE=`vconftool get -t string db/ode/crypto_state`
+ODE_STATE=${ODE_STATE#*=}
+ODE_STATE=${ODE_STATE%(*}
+
+if [ $ODE_STATE = "notsupported" ]; then
+vconftool set -f -t string db/ode/crypto_state "unencrypted"
+fi
index a23685b..e7d41a0 100755 (executable)
@@ -40,3 +40,4 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-pie")
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${SBIN_DIR})
 INSTALL(FILES ode_softreset.sh DESTINATION ${SOFTRESET_DIR})
+INSTALL(FILES 500.ode_upgrade.sh DESTINATION ${UPGRADE_SCRIPT_DIR})
index 3560243..290f605 100755 (executable)
@@ -23,6 +23,7 @@ Requires: cryptsetup
 
 %global key_storage_plugin_dir %{_libdir}/ode-key-storage-plugin/
 %global softreset_dir /usr/system/RestoreDir/softreset/
+%define upgrade_script_dir /usr/share/upgrade/scripts/
 
 %description
 The ode package provides a daemon which is responsible for encrypting/decryption storages and secure erasing.
@@ -38,6 +39,7 @@ The ode package provides a daemon which is responsible for encrypting/decryption
 %attr(750,root,system_share) %{TZ_SYS_SBIN}/ode-fota
 %{_datadir}/%{name}
 %dir %{key_storage_plugin_dir}
+%attr(755,root,root) %{upgrade_script_dir}/500.ode_upgrade.sh
 
 %prep
 %setup -q
@@ -59,7 +61,8 @@ The ode package provides a daemon which is responsible for encrypting/decryption
          -DAPP_INSTALL_PREFIX="%{TZ_SYS_RO_APP}" \
          -DAPP_SHARE_PACKAGES_DIR="%{TZ_SYS_RO_PACKAGES}" \
          -DSOFTRESET_DIR="%{softreset_dir}" \
-         -DKEY_STORAGE_PLUGIN_DIR="%{key_storage_plugin_dir}"
+         -DKEY_STORAGE_PLUGIN_DIR="%{key_storage_plugin_dir}" \
+         -DUPGRADE_SCRIPT_DIR="%{upgrade_script_dir}"
 
 make %{?jobs:-j%jobs}