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>
--- /dev/null
+#!/bin/sh
+RW_MACRO=/usr/share/upgrade/rw-update-macro.inc
+
+if [ -e ${RW_MACRO} ]; then
+ source ${RW_MACRO}
+ write_version_info
+fi
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 \
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
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