Skip to content

Commit

Permalink
ota: fix some build failures
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkie committed Dec 4, 2019
1 parent 9438c45 commit e78372f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 32 deletions.
14 changes: 9 additions & 5 deletions framework/libs/ota/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ cmake_minimum_required(VERSION 2.8)
project(unpack)

INCLUDE(GNUInstallDirs)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I.. -Iinclude -std=c++11 -O2 -g \
-DROKIDOS_BOARDCONFIG_STORAGE_DEVICETYPE=1 -DADB_HOST=0 -Wall -Wno-unused-parameter -D_XOPEN_SOURCE -D_GNU_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I.. -Iinclude -std=c++11 -O2 -g \
-DROKIDOS_BOARDCONFIG_STORAGE_DEVICETYPE=1 \
-DADB_HOST=0 -Wall -Wno-unused-parameter \
-D_XOPEN_SOURCE -D_GNU_SOURCE")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I.. -Iinclude -O2 -g -DADB_HOST=0 \
-DROKIDOS_BOARDCONFIG_STORAGE_DEVICETYPE=1 -Wall -Wno-unused-parameter -D_XOPEN_SOURCE -D_GNU_SOURCE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I.. -Iinclude -O2 -g -DADB_HOST=0 \
-DROKIDOS_BOARDCONFIG_STORAGE_DEVICETYPE=1 \
-Wall -Wno-unused-parameter \
-D_XOPEN_SOURCE -D_GNU_SOURCE")

MESSAGE(STATUS "This is BINARY dir " ${CMAKE_C_FLAGS})

Expand All @@ -28,7 +32,7 @@ add_executable(unpack_cli ./demo/ota_demo.c)
add_library(recovery SHARED ./recovery/recovery.c)
add_library(libunpack SHARED ./unpack.c ./sha1.c)

target_link_libraries(libunpack recovery signv)
target_link_libraries(libunpack recovery)
target_link_libraries(unpack recovery libunpack)
target_link_libraries(unpack_cli recovery libunpack)

Expand Down
33 changes: 6 additions & 27 deletions openwrt/package/yodaos/ota_unpack/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ PKG_NAME:=ota_unpack
PKG_VERSION:=
PKG_RELEASE:=1
PKG_SOURCE_DIR:=$(ROKID_DIR)/framework/libs/ota
PKG_CONFIG_DIR:=$(TOPDIR)/../products/$(CONFIG_PRODUCT_PATHNAME)/ota
PKG_AUTH_DIR:=$(TOPDIR)/../products/$(CONFIG_PRODUCT_PATHNAME)/auth
PKG_CONFIG_DIR:=$(ROKID_DIR)/$(CONFIG_PRODUCT_PATHNAME)/ota
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPL-2.0+
Expand All @@ -24,20 +23,15 @@ else
CMAKE_OPTIONS += -DARCH_COMMON=ON
endif

ifeq ($(CONFIG_OTA_AUTH),y)
CMAKE_OPTIONS += -DOTA_AUTH=ON
endif

define Package/ota_unpack/config
source "$(SOURCE)/Config.in"
source "$(SOURCE)/Config.in"
endef


define Package/ota_unpack
SECTION:=libs
CATEGORY:=rokid
TITLE:=ota_unpack
DEPENDS+= +libpthread +libsignv
DEPENDS+= +libpthread
endef

define Package/ota_unpack/description
Expand All @@ -50,17 +44,8 @@ define Build/Prepare
$(CP) $(PKG_SOURCE_DIR)/* $(PKG_BUILD_DIR)
endef

#CMAKE_OPTIONS += \
# -DROKIDOS_BOARDCONFIG_STORAGE_DEVICETYPE=$(CONIFG_ROKIDOS_BOARDCONFIG_STORAGE_DEVICETYPE)


CMAKE_OPTIONS += \
-DROKIDOS_BOARDCONFIG_STORAGE_DEVICETYPE=1

#define Build/Configure
# echo configure
#endef

-DROKIDOS_BOARDCONFIG_STORAGE_DEVICETYPE=1

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
Expand All @@ -69,17 +54,11 @@ define Build/InstallDev
$(CP) $(PKG_BUILD_DIR)/recovery/recovery.h $(1)/usr/include/recovery/
endef



define Package/ota_unpack/install

ifeq ($(CONFIG_YODABASE_RECOVERY_BOOT),y)
$(INSTALL_DIR) $(1)/etc/rc.d/
$(CP) $(PKG_BUILD_DIR)/S12otaunpack $(1)/etc/rc.d/
endif
ifeq ($(CONFIG_OTA_AUTH),y)
$(INSTALL_DIR) $(1)/etc/
$(CP) $(PKG_AUTH_DIR)/rsa_public_key.pem $(1)/etc/rsa_public_key.pem
$(INSTALL_DIR) $(1)/etc/rc.d/
$(CP) $(PKG_BUILD_DIR)/S12otaunpack $(1)/etc/rc.d/
endif

$(INSTALL_DIR) $(1)/usr/bin
Expand Down

0 comments on commit e78372f

Please sign in to comment.