From: seolheui, kim Date: Mon, 29 Oct 2018 07:11:22 +0000 (+0900) Subject: Add upgrade scripts X-Git-Tag: submit/tizen_4.0/20181129.005525~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b53f041e77e9d48e551346fc6092a3e81fe204b3;p=platform%2Fcore%2Fsecurity%2Fode.git Add upgrade scripts - To initialize unsupported vconf values, when the platform upgrade from 3.0 to 4.0 Change-Id: Ie7c434a4ff13efa8eefa913b3d7d438415d3103f Signed-off-by: seolheui, kim --- diff --git a/fota/500.ode_upgrade.sh b/fota/500.ode_upgrade.sh new file mode 100755 index 0000000..a681229 --- /dev/null +++ b/fota/500.ode_upgrade.sh @@ -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 diff --git a/fota/CMakeLists.txt b/fota/CMakeLists.txt index a23685b..e7d41a0 100755 --- a/fota/CMakeLists.txt +++ b/fota/CMakeLists.txt @@ -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}) diff --git a/packaging/ode.spec b/packaging/ode.spec index 3560243..290f605 100755 --- a/packaging/ode.spec +++ b/packaging/ode.spec @@ -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}