Apply platform version path: /opt/etc/version 62/141762/2 accepted/tizen/4.0/unified/20170816.012232 accepted/tizen/unified/20170803.075314 submit/tizen/20170802.054958 submit/tizen_4.0/20170811.094300
authorSunmin Lee <sunm.lee@samsung.com>
Tue, 1 Aug 2017 09:17:37 +0000 (18:17 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Wed, 2 Aug 2017 04:26:07 +0000 (13:26 +0900)
Following is generic mechanism

1. The version file (/opt/etc/version) should be created by RO-updater before
 updating RO. (if there are already existed, just verify the file or skipping
 creating file)
2. And then, it should be used by RW upgrade script.
3. And then, it should be updated by RW-updater after upgrade is completed

However, this code makes /opt/etc/version file in image creation instead of
RO-updater. The reason is for supporting HOME BINARY updater
(skipping RO updater)

Thus, Follwing is mechanism for HOME BINARY
1. The version file (/opt/etc/version) should be created by image creation.
2. And then, it should be used by RW upgrade script.
3. And then, it should be updated by RW-updater after upgrade is completed

Basically, if the file (/opt/etc/version) is not existed in old binary,
HOME BINARY updater is not supported.

Commented-by: Kunhoon Baik <knhoon.baik@samsung.com>
Change-Id: Ie298f3e175b34582ffd38189952a6b125eca7cbe
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
upgrade/record-version.sh [new file with mode: 0755]
upgrade/rw-update-macro.inc
upgrade/update.sh

diff --git a/upgrade/record-version.sh b/upgrade/record-version.sh
new file mode 100755 (executable)
index 0000000..9f74a06
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+RW_MACRO=/usr/share/upgrade/rw-update-macro.inc
+
+if [ -e ${RW_MACRO} ]; then
+       source ${RW_MACRO}
+       write_version_info
+fi
index 00946fba48d1644400ad78607bc59fd82e0c3bcf..bd3d3a690de00170a298546d7c9c732ec5dfa79d 100755 (executable)
@@ -4,7 +4,7 @@ OLD_VER=
 NEW_VER=
 OLD_REL=
 NEW_REL=
-OLD_VER_INFO="/inform/version"
+OLD_VER_INFO="/opt/etc/version"
 
 write_version_info() {
        OLD_VER=$(cat /etc/config/model-config.xml | grep platform.version \
index 651f628665eab8b5e609d4525be16754b2df7c21..26545247819db58fbbdfcf096b8f9c0efecd6f39 100755 (executable)
@@ -7,6 +7,8 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
 PATCH_DIR=/usr/share/upgrade/scripts
 RESULT_FILE=/opt/data/recovery/rw_result
 SDB_RULE=/opt/data/recovery/99-sdb-switch.rules
+VERSION_FILE=/opt/etc/version
+RW_MACRO=/usr/share/upgrade/rw-update-macro.inc
 RUN=/bin/sh
 
 # Execute update scripts
@@ -29,5 +31,13 @@ if [ -e ${SDB_RULE} ]; then
        rm ${SDB_RULE}
 fi
 
+if [ -e ${VERSION_FILE} ]; then
+       rm ${VERSION_FILE}
+       if [ -e ${RW_MACRO} ]; then
+               source ${RW_MACRO}
+               write_version_info
+       fi
+fi
+
 # Reboot
 reboot -f