From b40238f118c57ba745d789a95d7b9c3282a74388 Mon Sep 17 00:00:00 2001 From: Kyungwook Tak Date: Thu, 25 Aug 2016 14:09:39 +0900 Subject: [PATCH] Add script to support platform upgrade scenario Change-Id: Id140e2877d8156019c715143f76947dbb4bb537c Signed-off-by: Kyungwook Tak --- CMakeLists.txt | 1 + data/scripts/csr-upgrade.sh.in | 25 +++++++++++++++++++++++++ packaging/csr-framework.spec | 11 +++++++++++ 3 files changed, 37 insertions(+) create mode 100644 data/scripts/csr-upgrade.sh.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 34cc1e8..28a5d86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,7 @@ IF (PLATFORM_VERSION_3) SET(DECLARE_POPUP_SMACK_PROCESS_LABEL "") CONFIGURE_FILE(packaging/${SERVICE_NAME}.manifest.in ${SERVICE_NAME}.manifest @ONLY) CONFIGURE_FILE(packaging/${SERVICE_NAME}-test.manifest.in ${SERVICE_NAME}-test.manifest @ONLY) + CONFIGURE_FILE(data/scripts/${SERVICE_NAME}-upgrade.sh.in data/scripts/${SERVICE_NAME}-upgrade.sh @ONLY) ELSE (PLATFORM_VERSION_3) SET(DECLARE_POPUP_USER User=app) SET(DECLARE_POPUP_GROUP Group=app) diff --git a/data/scripts/csr-upgrade.sh.in b/data/scripts/csr-upgrade.sh.in new file mode 100644 index 0000000..66b30a3 --- /dev/null +++ b/data/scripts/csr-upgrade.sh.in @@ -0,0 +1,25 @@ +#!/bin/bash +# +# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# @file csr-upgrade.sh.in +# @author Kyungwook Tak (k.tak@samsung.com) +# @brief Create RW data/directory for platform upgrade(2.4->3.0) scenario +# +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +mkdir -p @RW_DBSPACE@ @ENGINE_RW_WORKING_DIR@ +chown @SERVICE_USER@:@SERVICE_GROUP@ @RW_DBSPACE@ @ENGINE_RW_WORKING_DIR@ +chsmack -t -a @SMACK_DOMAIN_NAME@ @RW_DBSPACE@ @ENGINE_RW_WORKING_DIR@ diff --git a/packaging/csr-framework.spec b/packaging/csr-framework.spec index af78217..e0ff04a 100644 --- a/packaging/csr-framework.spec +++ b/packaging/csr-framework.spec @@ -73,6 +73,7 @@ file contents and checking url to prevent malicious items. %global popup_service_env_file_path /run/tizen-system-env %global smack_domain_name System %global popup_unitdir %{_unitdir_user} +%global upgrade_script_dir %{ro_data_dir}/upgrade/scripts %else %global service_user system %global service_group system @@ -212,6 +213,11 @@ mkdir -p %{buildroot}%{rw_db_dir} mkdir -p %{buildroot}%{ro_db_dir} cp data/scripts/*.sql %{buildroot}%{ro_db_dir} +%if "%{?tizen_version}" == "3.0" +mkdir -p %{buildroot}%{upgrade_script_dir} +cp data/scripts/%{service_name}-upgrade.sh %{buildroot}%{upgrade_script_dir} +%endif + mkdir -p %{buildroot}%{engine_dir} mkdir -p %{buildroot}%{engine_rw_working_dir} @@ -294,6 +300,11 @@ chsmack -a "_" %{test_dir}/test_dir/dir1 %dir %{engine_dir} %dir %attr(775, %{service_user}, %{service_group}) %{engine_rw_working_dir} +# RW area platform upgrade script +%if "%{?tizen_version}" == "3.0" +%attr(755, -, -) %{upgrade_script_dir}/%{service_name}-upgrade.sh +%endif + %files -n lib%{name}-common %defattr(-,root,root,-) %manifest %{service_name}-common.manifest -- 2.7.4