Apply TZ_SYS_UPGRADE path to initrd scripts 67/185567/1 accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181102.020311 accepted/tizen/unified/20180806.075458 submit/tizen/20180801.085411 submit/tizen/20180803.005755 submit/tizen_5.0/20181101.000004
authorSunmin Lee <sunm.lee@samsung.com>
Thu, 26 Jul 2018 01:02:25 +0000 (10:02 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Wed, 1 Aug 2018 00:43:16 +0000 (09:43 +0900)
The new path config for upgrade is added so apply it.

Change-Id: I0af1caaa7173cb27423dfa7db70b765d72a1515d
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
CMakeLists.txt [new file with mode: 0644]
packaging/initrd-fota.spec
scripts/fota-init.sh.in [moved from scripts/fota-init.sh with 98% similarity]
scripts/fus_rw-init.sh.in [moved from scripts/fus_rw-init.sh with 93% similarity]
scripts/restore-passwd.sh.in [moved from scripts/restore-passwd.sh with 96% similarity]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..516f9c5
--- /dev/null
@@ -0,0 +1,5 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+CONFIGURE_FILE(scripts/fota-init.sh.in scripts/fota-init.sh @ONLY)
+CONFIGURE_FILE(scripts/fus_rw-init.sh.in scripts/fus_rw-init.sh @ONLY)
+CONFIGURE_FILE(scripts/restore-passwd.sh.in scripts/restore-passwd.sh @ONLY)
index b4219c0..ffe36fa 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       initrd-fota
 Summary:    package for building ramdisk-recovery.img
-Version:    1.1.1
+Version:    1.1.2
 Release:    0
 Group:      System/Utilities
 License:    Apache-2.0
@@ -8,6 +8,7 @@ Source0:    %{name}-%{version}.tar.gz
 ExclusiveArch: %{arm}
 BuildRequires: cmake
 BuildRequires: gettext-tools
+BuildRequires: pkgconfig(libtzplatform-config)
 
 Requires: util-linux
 Requires: grep
@@ -24,14 +25,14 @@ package for building partition image for RAMDISK2 (ramdisk-recovery.img)
 %setup -q
 
 %build
-
+%cmake . -DTZ_SYS_UPGRADE_DATA=%TZ_SYS_UPGRADE_DATA \
+        -DTZ_SYS_UPGRADE=%TZ_SYS_UPGRADE
+%__make %{?jobs:-j%jobs}
 
 %install
 
 %define init_script_dir %{_libdir}/initrd-recovery/fota
-%define upgrade_dir %{_datadir}/upgrade
-
-mkdir -p %{buildroot}/opt/data/update
+%define upgrade_dir %TZ_SYS_UPGRADE
 
 mkdir -p %{buildroot}%{init_script_dir}
 cp ./scripts/fota-init.sh %{buildroot}%{init_script_dir}/fota-init.sh
@@ -49,4 +50,3 @@ cp ./scripts/40-fota.list %{buildroot}%{_datadir}/initrd-recovery/initrd.list.d
 %attr(700,root,root) %{init_script_dir}/*.sh
 %attr(700,root,root) %{upgrade_dir}/restore-passwd.sh
 %attr(700,root,root) %{_datadir}/initrd-recovery/initrd.list.d/*.list
-%attr(777,system,system) /opt/data/update
similarity index 98%
rename from scripts/fota-init.sh
rename to scripts/fota-init.sh.in
index 07651c5..8cff12a 100755 (executable)
@@ -1,6 +1,5 @@
 #!/bin/bash
 
-MODULE_MOUNT_FLAG=@MODULE_MOUNT_FLAG@
 WITH_USR_PART=
 
 FAKE_ROOT=/system
@@ -8,13 +7,13 @@ FAKE_ROOT=/system
 UPI_NO_DELTA_ERROR=fb15
 UPI_NO_UA_ERROR=fa17
 
-STATUS_DIR=${FAKE_ROOT}/opt/data/update
+STATUS_DIR=${FAKE_ROOT}@TZ_SYS_UPGRADE_DATA@
 STATUS_FILE=${STATUS_DIR}/RW.STATUS
 DELTA_PATH_FILE=${STATUS_DIR}/DELTA.PATH
 INT_LOG_DIR=${STATUS_DIR}
 INT_LOG_FILE=${INT_LOG_DIR}/fota_internal.log
 
-FOTA_LOG_DIR=/opt/data/update
+FOTA_LOG_DIR=@TZ_SYS_UPGRADE_DATA@
 FOTA_RESULT_DIR=${FOTA_LOG_DIR}
 FOTA_TEMP_DIR=${FOTA_LOG_DIR}
 
similarity index 93%
rename from scripts/fus_rw-init.sh
rename to scripts/fus_rw-init.sh.in
index 7aba163..b58ac9b 100755 (executable)
@@ -7,9 +7,11 @@ FAKE_ROOT=/system
 SYNC="/bin/sync"
 REBOOT="/sbin/reboot"
 
-INT_LOG_DIR=${FAKE_ROOT}/opt/data/update
+INT_LOG_DIR=${FAKE_ROOT}@TZ_SYS_UPGRADE_DATA@
 INT_LOG_FILE=${INT_LOG_DIR}/fota_internal.log
 
+RESTORE_PASSWD_SCRIPT=@TZ_SYS_UPGRADE@/restore-passwd.sh
+
 CAT="/bin/cat"
 MOUNT="/bin/mount"
 UMOUNT="/bin/umount"
@@ -82,7 +84,7 @@ do_rw_update() {
        echo "Change into rw update mode" >> ${INT_LOG_FILE}
 
        # Pre-patches
-       /bin/chroot ${FAKE_ROOT} /bin/sh -c /usr/share/upgrade/restore-passwd.sh
+       /bin/chroot ${FAKE_ROOT} /bin/sh -c ${RESTORE_PASSWD_SCRIPT}
 
        # Go to system-update.target
        if [ $$ = 1 ]; then
similarity index 96%
rename from scripts/restore-passwd.sh
rename to scripts/restore-passwd.sh.in
index 9efb8ed..f779bf4 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-BACKUP_HELPER="/usr/share/upgrade/rw-update-macro.inc"
+BACKUP_HELPER="@TZ_SYS_UPGRADE@/rw-update-macro.inc"
 ETC_DIR="/opt/etc"
 UID_REGULAR_USER_MIN=5001
 UID_REGULAR_USER_MAX=10000