The new path config for upgrade is added so apply it.
Change-Id: I0af1caaa7173cb27423dfa7db70b765d72a1515d
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
--- /dev/null
+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)
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
ExclusiveArch: %{arm}
BuildRequires: cmake
BuildRequires: gettext-tools
+BuildRequires: pkgconfig(libtzplatform-config)
Requires: util-linux
Requires: grep
%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
%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
#!/bin/bash
-MODULE_MOUNT_FLAG=@MODULE_MOUNT_FLAG@
WITH_USR_PART=
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}
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"
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
#!/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