packaging: Add data migration script to remove /opt/etc/hal/.hal-backend-compatibility 91/314291/2 accepted/tizen/unified/20240711.163723 accepted/tizen/unified/dev/20240712.055812 accepted/tizen/unified/x/20240715.042500
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 10 Jul 2024 02:18:43 +0000 (11:18 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 10 Jul 2024 02:45:08 +0000 (11:45 +0900)
Remove /opt/etc/hal/.hal-backend-compatibility for data migration of OS
Upgarde to remove the invalid result of hal backend compatibility.

/opt/etc/hal/.hal-backend-compatibility should be created on first
booting by comparing the supported HAL interface version in HAL manifest
with hal-backend version.

Change-Id: Id6980ced56f7f8c2fee0f7b178e6534ad168b1cb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
packaging/500.hal-api-common.sh [new file with mode: 0644]
packaging/hal-api-common.spec

diff --git a/packaging/500.hal-api-common.sh b/packaging/500.hal-api-common.sh
new file mode 100644 (file)
index 0000000..ef15dec
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+if [ -e "/opt/etc/hal/.hal-backend-compatibility" ]; then
+       rm -f /opt/etc/hal/.hal-backend-compatibility
+fi
index 9d8d7904d5de25d0e0afad1936e4efbaced52e2e..d49acc23f1361369ba19b1b4dd211b8002ecc61b 100644 (file)
@@ -18,6 +18,7 @@ Source5:    macros.hal-api
 Source6:    haltest.target
 Source7:    reboot-haltest
 Source8:    reboot-normal
+Source9:    500.%{name}.sh
 
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -77,6 +78,7 @@ install -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/rpm/macros.hal-api
 install -D -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/haltest.target
 install -D -m 0755 %{SOURCE7} %{buildroot}%{_bindir}/reboot-haltest
 install -D -m 0755 %{SOURCE8} %{buildroot}%{_bindir}/reboot-normal
+install -D -m 0755 %{SOURCE9} %{buildroot}%{_datadir}/upgrade/scripts/500.%{name}.sh
 
 %clean
 rm -rf %{buildroot}
@@ -99,6 +101,7 @@ rm -rf %{buildroot}
 %{_sysconfdir}/ld.so.conf.d/libhal-api.conf
 %{_systemdgeneratordir}/systemd-hal-firmware-generator
 %{_systemdgeneratordir}/systemd-hal-compatibility-checker-generator
+%{_datadir}/upgrade/scripts/500.%{name}.sh
 
 %files -n %{devel_name}
 %defattr(-,root,root,-)