summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwansu.yoo <wansu.yoo@samsung.com>2019-11-04 19:39:27 +0900
committerwansu.yoo <wansu.yoo@samsung.com>2019-11-04 19:40:28 +0900
commit1d40600aa6e45fea419334fe587f643c8139b4f3 (patch)
tree30e66eb0913dd3656767794be3eec9217a521fa7
parentb49aaf7050e4c8449856cc865feccd4a5d4d44bb (diff)
downloadedge-orchestration-1d40600aa6e45fea419334fe587f643c8139b4f3.tar.gz
edge-orchestration-1d40600aa6e45fea419334fe587f643c8139b4f3.tar.bz2
edge-orchestration-1d40600aa6e45fea419334fe587f643c8139b4f3.zip
Change-Id: I707360a9c37396c65e57cab936002b65313bd841 Signed-off-by: wansu.yoo <wansu.yoo@samsung.com>
-rw-r--r--packaging/edge-orchestration.spec5
-rwxr-xr-xscripts/500.edge-orchestration-upgrade.sh28
2 files changed, 33 insertions, 0 deletions
diff --git a/packaging/edge-orchestration.spec b/packaging/edge-orchestration.spec
index 3680380..bded75c 100644
--- a/packaging/edge-orchestration.spec
+++ b/packaging/edge-orchestration.spec
@@ -27,6 +27,8 @@ Requires(post): dbus
Requires(post): /sbin/ldconfig, /usr/bin/systemctl
Requires(postun): /sbin/ldconfig, /usr/bin/systemctl
+%define upgrade_script_path /usr/share/upgrade/scripts
+
%description
Technologies for Device/Service management.
Edge service deployment/monitoring and data sharing in home environment with limited available H/W resources.
@@ -90,6 +92,8 @@ make build-dbus-client %{?_smp_mflags}
export BASE_DIR=.
export ARCH=arm
%make_install
+mkdir -p %{buildroot}%{upgrade_script_path}
+cp -f scripts/500.edge-orchestration-upgrade.sh %{buildroot}%{upgrade_script_path}
%post
systemctl daemon-reload
@@ -110,6 +114,7 @@ systemctl restart %{name}
%attr(755,system_fw,system_fw)%dir /var/%{name}/data/cert
%attr(755,system_fw,system_fw)%dir /var/%{name}/user
%attr(755,system_fw,system_fw)%dir /var/%{name}/device
+%attr(755,root,root)%{_datadir}/upgrade/scripts/500.edge-orchestration-upgrade.sh
%files -n libedge-orchestration
%manifest lib%{name}.manifest
diff --git a/scripts/500.edge-orchestration-upgrade.sh b/scripts/500.edge-orchestration-upgrade.sh
new file mode 100755
index 0000000..05dd24f
--- /dev/null
+++ b/scripts/500.edge-orchestration-upgrade.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+#--------------------------------------#
+# edge-orchestration patch for upgrade #
+#--------------------------------------#
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+EDGE_CONF_PATH_LIST=(
+ "/var/edge-orchestration"
+ "/var/edge-orchestration/log"
+ "/var/edge-orchestration/apps"
+ "/var/edge-orchestration/data"
+ "/var/edge-orchestration/data/db"
+ "/var/edge-orchestration/data/cert"
+ "/var/edge-orchestration/user"
+ "/var/edge-orchestration/device"
+)
+
+idx=1
+for path in "${EDGE_CONF_PATH_LIST[@]}"; do
+ if [ ! -d "$path" ]; then
+ mkdir -p $path
+ chmod 755 $path
+ chown system_fw:system_fw $path
+ chsmack -a "_" $path
+ fi
+ idx=$((idx+1))
+done