From d62d69108ae8c34b49a2a3cb03d314fbca675c9e Mon Sep 17 00:00:00 2001 From: Sunmin Lee Date: Mon, 18 Mar 2019 15:31:51 +0900 Subject: [PATCH] Revert "Apply TZ_SYS_UPGRADE path to libtota" This reverts commit 51ac92fd026376df3e83cce93568c3f5f1f27379. Change-Id: I147572bea17c1fd57aa97ffb7a13408f2144dd26 --- CMakeLists.txt | 6 ------ packaging/libtota.spec | 16 +++++++++------- ss_engine/{fota_common.h.in => fota_common.h} | 5 ++--- ss_engine/fota_log.c | 3 +-- 4 files changed, 12 insertions(+), 18 deletions(-) rename ss_engine/{fota_common.h.in => fota_common.h} (95%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09abc70..325ee98 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,6 @@ 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 diff --git a/packaging/libtota.spec b/packaging/libtota.spec index 9e8abcd..9e34d36 100755 --- a/packaging/libtota.spec +++ b/packaging/libtota.spec @@ -1,6 +1,6 @@ Name: libtota Summary: fota update library -Version: 1.2.6 +Version: 1.2.7 Release: 0 Group: System License: Apache-2.0 and BSD-2-Clause and BSD-3-Clause and PD @@ -8,7 +8,6 @@ Source0: %{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: pkgconfig(liblzma-tool) -BuildRequires: pkgconfig(libtzplatform-config) %description Fota update agent which update firmware using delta files @@ -32,8 +31,7 @@ mkdir cmake_tmp cd cmake_tmp LDFLAGS="$LDFLAGS" %cmake .. \ - -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DTZ_SYS_UPGRADE_DATA=%TZ_SYS_UPGRADE_DATA + -DCMAKE_INSTALL_PREFIX=%{_prefix} make %{?jobs:-j%jobs} @@ -42,8 +40,12 @@ cd cmake_tmp %make_install #mkdir -p %{buildroot}/usr/lib/ cp libtota.a %{buildroot}%{_libdir}/libtota.a -%define tota_dir %TZ_SYS_UPGRADE_DATA -mkdir -p %{buildroot}%{tota_dir} +%post + +%posttrans +if [ ! -e /opt/data/recovery ]; then + ln -sf /opt/data/update /opt/data/recovery +fi %files @@ -52,7 +54,7 @@ mkdir -p %{buildroot}%{tota_dir} %license LICENSE.BSD-2-Clause %license LICENSE.BSD-3-Clause %{_libdir}/libtota.so.* -%{tota_dir} +#%manifest fota.manifest %files devel %defattr(-,root,root,-) diff --git a/ss_engine/fota_common.h.in b/ss_engine/fota_common.h similarity index 95% rename from ss_engine/fota_common.h.in rename to ss_engine/fota_common.h index 8e6bbe6..8213546 100755 --- a/ss_engine/fota_common.h.in +++ b/ss_engine/fota_common.h @@ -64,8 +64,7 @@ typedef unsigned long long u64; #define SECTOR_SIZE 512 #define SS_KERNEL_DELTA_HEADER 128 -#define SS_COMMON_FOTA_PATH "@TZ_SYS_UPGRADE_DATA@" -#define SS_COMMON_WORKSPACE "/system/" SS_COMMON_FOTA_PATH +#define SS_COMMON_WORKSPACE "/system/opt/usr/data/fota" #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 @@ -77,7 +76,7 @@ typedef unsigned long long u64; #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 SS_COMMON_WORKSPACE "/UP.STATUS" +#define SS_UPDATE_STATUR_PATH "/system/opt/data/recovery/UP.STATUS" #define SS_GZIP_SOURCE "system/bin/gzip" #define SS_STAT_SOURCE "system/usr/bin/stat" diff --git a/ss_engine/fota_log.c b/ss_engine/fota_log.c index c044381..348dba0 100755 --- a/ss_engine/fota_log.c +++ b/ss_engine/fota_log.c @@ -25,9 +25,8 @@ #include #include #include -#include "fota_common.h" -#define LOG_SIZE_OPT_PATH SS_COMMON_FOTA_PATH"/.ua_log_size" +#define LOG_SIZE_OPT_PATH "/opt/data/recovery/.ua_log_size" #define DEF_MAX_LOG_SIZE (2*1024*1024) #define MAX_FILE_PATH 512 -- 2.7.4