summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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