Use a config path TZ_SYS_UPGRADE rather than hard coded path.
Change-Id: I6b9c508b09858cb44eb1c3d88e0ef3c6e646ccbb
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(tota C)
+CONFIGURE_FILE(
+ ${CMAKE_CURRENT_SOURCE_DIR}/ss_engine/fota_common.h.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/ss_engine/fota_common.h
+ @ONLY
+)
+
SET(SRCS
ss_engine/SS_Common.c
ss_engine/sha1.c
Name: libtota
Summary: fota update library
-Version: 1.2.2
+Version: 1.2.3
Release: 0
Group: System
License: Apache-2.0 and BSD-2-Clause and BSD-3-Clause and PD
BuildRequires: cmake
BuildRequires: pkgconfig(lib7zip)
+BuildRequires: pkgconfig(libtzplatform-config)
%description
Fota update agent which update firmware using delta files
cd cmake_tmp
LDFLAGS="$LDFLAGS"
%cmake .. \
- -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+ -DTZ_SYS_UPGRADE_DATA=%TZ_SYS_UPGRADE_DATA
make %{?jobs:-j%jobs}
%make_install
#mkdir -p %{buildroot}/usr/lib/
cp libtota.a %{buildroot}%{_libdir}/libtota.a
-%post
-
-%posttrans
-if [ ! -e /opt/data/recovery ]; then
- ln -sf /opt/data/update /opt/data/recovery
-fi
+%define tota_dir %TZ_SYS_UPGRADE_DATA
+mkdir -p %{buildroot}%{tota_dir}
%files
%license LICENSE.BSD-2-Clause
%license LICENSE.BSD-3-Clause
%{_libdir}/libtota.so.*
-#%manifest fota.manifest
+%{tota_dir}
%files devel
%defattr(-,root,root,-)
#define SECTOR_SIZE 512
#define SS_KERNEL_DELTA_HEADER 128
-#define SS_COMMON_WORKSPACE "/system/opt/usr/data/fota"
+#define SS_COMMON_FOTA_PATH "@TZ_SYS_UPGRADE_DATA@"
+#define SS_COMMON_WORKSPACE "/system/" SS_COMMON_FOTA_PATH
#define SS_KERNEL_UNPACK_SCRIPT "unpack.sh"
#define SS_KERN_UNPK_SCRIPT_PATH SS_COMMON_WORKSPACE "/" SS_KERNEL_UNPACK_SCRIPT
#define SS_BACKUP_SOURCE SS_COMMON_WORKSPACE "/saved.file" //How to make sure there is SPACE
#define SS_STAT_TARGET SS_KERNEL_WORKSPACE "/stat"
#define SS_DD_TARGET SS_KERNEL_WORKSPACE "/dd"
//#define SS_UPDATE_STATUR_PATH SS_COMMON_WORKSPACE "/UP.STATUS"
-#define SS_UPDATE_STATUR_PATH "/system/opt/data/recovery/UP.STATUS"
+#define SS_UPDATE_STATUR_PATH SS_COMMON_WORKSPACE "/UP.STATUS"
#define SS_GZIP_SOURCE "system/bin/gzip"
#define SS_STAT_SOURCE "system/usr/bin/stat"
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
+#include "fota_common.h"
-#define LOG_SIZE_OPT_PATH "/opt/data/recovery/.ua_log_size"
+#define LOG_SIZE_OPT_PATH SS_COMMON_FOTA_PATH"/.ua_log_size"
#define DEF_MAX_LOG_SIZE (2*1024*1024)
#define MAX_FILE_PATH 512