Revert "Apply TZ_SYS_UPGRADE path to initrd scripts" 06/208506/2 accepted/tizen/unified/20190626.114504 submit/tizen/20190626.063141
authorKichan Kwon <k_c.kwon@samsung.com>
Tue, 25 Jun 2019 08:00:26 +0000 (17:00 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Wed, 26 Jun 2019 01:08:57 +0000 (10:08 +0900)
This reverts commit 24eccbbd98802c7d6ccab307b95b35ed62b4cbc8.

Change-Id: I1793aa1e4360a2e1038115446b9e6080dd89387f
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
CMakeLists.txt [deleted file]
packaging/initrd-fota.spec
scripts/fota-init.sh [moved from scripts/fota-init.sh.in with 98% similarity]
scripts/fus_rw-init.sh [moved from scripts/fus_rw-init.sh.in with 93% similarity]
scripts/restore-passwd.sh [moved from scripts/restore-passwd.sh.in with 96% similarity]

diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644 (file)
index 516f9c5..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-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 ffe36fa..74e5e56 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       initrd-fota
 Summary:    package for building ramdisk-recovery.img
-Version:    1.1.2
+Version:    1.1.3
 Release:    0
 Group:      System/Utilities
 License:    Apache-2.0
@@ -8,7 +8,6 @@ Source0:    %{name}-%{version}.tar.gz
 ExclusiveArch: %{arm}
 BuildRequires: cmake
 BuildRequires: gettext-tools
-BuildRequires: pkgconfig(libtzplatform-config)
 
 Requires: util-linux
 Requires: grep
@@ -25,14 +24,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 %TZ_SYS_UPGRADE
+%define upgrade_dir %{_datadir}/upgrade
+
+mkdir -p %{buildroot}/opt/data/update
 
 mkdir -p %{buildroot}%{init_script_dir}
 cp ./scripts/fota-init.sh %{buildroot}%{init_script_dir}/fota-init.sh
@@ -50,3 +49,4 @@ 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.in
rename to scripts/fota-init.sh
index 8cff12a..34ea885 100755 (executable)
@@ -7,13 +7,13 @@ FAKE_ROOT=/system
 UPI_NO_DELTA_ERROR=fb15
 UPI_NO_UA_ERROR=fa17
 
-STATUS_DIR=${FAKE_ROOT}@TZ_SYS_UPGRADE_DATA@
+STATUS_DIR=${FAKE_ROOT}/opt/data/update
 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=@TZ_SYS_UPGRADE_DATA@
+FOTA_LOG_DIR=/opt/data/update
 FOTA_RESULT_DIR=${FOTA_LOG_DIR}
 FOTA_TEMP_DIR=${FOTA_LOG_DIR}
 
similarity index 93%
rename from scripts/fus_rw-init.sh.in
rename to scripts/fus_rw-init.sh
index b58ac9b..7aba163 100755 (executable)
@@ -7,11 +7,9 @@ FAKE_ROOT=/system
 SYNC="/bin/sync"
 REBOOT="/sbin/reboot"
 
-INT_LOG_DIR=${FAKE_ROOT}@TZ_SYS_UPGRADE_DATA@
+INT_LOG_DIR=${FAKE_ROOT}/opt/data/update
 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"
@@ -84,7 +82,7 @@ do_rw_update() {
        echo "Change into rw update mode" >> ${INT_LOG_FILE}
 
        # Pre-patches
-       /bin/chroot ${FAKE_ROOT} /bin/sh -c ${RESTORE_PASSWD_SCRIPT}
+       /bin/chroot ${FAKE_ROOT} /bin/sh -c /usr/share/upgrade/restore-passwd.sh
 
        # Go to system-update.target
        if [ $$ = 1 ]; then
similarity index 96%
rename from scripts/restore-passwd.sh.in
rename to scripts/restore-passwd.sh
index f779bf4..9efb8ed 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-BACKUP_HELPER="@TZ_SYS_UPGRADE@/rw-update-macro.inc"
+BACKUP_HELPER="/usr/share/upgrade/rw-update-macro.inc"
 ETC_DIR="/opt/etc"
 UID_REGULAR_USER_MIN=5001
 UID_REGULAR_USER_MAX=10000