Run offline-update.target in ramdisk-recovery 64/311164/2 tizen
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 15 May 2024 14:09:41 +0000 (16:09 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 28 May 2024 16:18:10 +0000 (18:18 +0200)
The system-update.target is a common part of offline and online
upgrade.

Change-Id: I253b80ffc3a350c76f5e511803e2e898eb64f461

packaging/initrd-recovery.spec
src/bootmode-fota/40-fota.list.in
src/bootmode-fota/fota-init.sh

index 12cdf61..4ad124e 100644 (file)
@@ -4,7 +4,6 @@ Version:        7.5.3
 Release:        0
 Group:          System/Utilities
 License:        Apache-2.0
-ExclusiveArch:  %{arm} aarch64 riscv64
 
 Source0:        %{name}-%{version}.tar.gz
 Source1001:     initrd-recovery.manifest
index aa5b07f..8ad567b 100644 (file)
@@ -6,6 +6,7 @@ VERBATIMS="
 @INITRD_RECOVERY_LIBEXEC_DIR@/fota-init.sh
 @INITRD_RECOVERY_LIBEXEC_DIR@/progress_restart.sh
 /bin/verityctl
+/usr/share/upgrade/update-checkpoint-create.sh
 "
 
 WITHLIBS="
index 5fa06a8..038a634 100755 (executable)
@@ -128,6 +128,23 @@ mount_hal() {
 }
 
 #------------------------------------------------
+#       mount_datafs
+#------------------------------------------------
+function mount_datafs()
+{
+    if [ x"${PART_SYSTEM_DATA}" = "x" ]; then
+        # No system data partition
+        return 2;
+    fi
+
+    if ! /usr/share/upgrade/update-checkpoint-create.sh "${FAKE_ROOT}" system-data; then
+        return 1
+    fi
+
+    return 0
+}
+
+#------------------------------------------------
 #       mount_partitions
 #------------------------------------------------
 mount_partitions() {
@@ -138,7 +155,8 @@ mount_partitions() {
     "$MOUNT" -t sysfs none ${FAKE_ROOT}/sys &&
     "$MOUNT" -t devtmpfs devtmpfs ${FAKE_ROOT}/dev &&
     "$MOUNT" -t devpts devpts ${FAKE_ROOT}/dev/pts &&
-    "$MOUNT" -t tmpfs tmpfs ${FAKE_ROOT}/tmp
+    "$MOUNT" -t tmpfs tmpfs ${FAKE_ROOT}/tmp &&
+    mount_datafs
 
     if [ $? -ne 0 ]; then
            return 1
@@ -154,10 +172,10 @@ do_rw_update() {
        echo "Change into rw update mode" >> ${INT_LOG_FILE}
 
        /sbin/progress_restart RW &
-       # Go to system-update.target
+       # Go to offline-update.target
        if [ $$ = 1 ]; then
                cd ${FAKE_ROOT}
-               exec /bin/chroot . /usr/lib/systemd/systemd --unit=system-update.target $@
+               exec /bin/chroot . /usr/lib/systemd/systemd --unit=offline-update.target $@
        fi
        do_reboot
 }