add upgrade script for edge-orchestration 28/216928/1 tizen_5.5_tv accepted/tizen/5.5/unified/20191111.105412 submit/tizen_5.5/20191108.041105
authorwansu.yoo <wansu.yoo@samsung.com>
Tue, 5 Nov 2019 03:38:30 +0000 (12:38 +0900)
committerwansu.yoo <wansu.yoo@samsung.com>
Tue, 5 Nov 2019 03:38:30 +0000 (12:38 +0900)
Change-Id: I78d1899fff11df74e0f1a472872213f05e1114e7
Signed-off-by: wansu.yoo <wansu.yoo@samsung.com>
packaging/edge-orchestration.spec
scripts/500.edge-orchestration-upgrade.sh [new file with mode: 0755]

index 3680380..bded75c 100644 (file)
@@ -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 (executable)
index 0000000..05dd24f
--- /dev/null
@@ -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