[Feature]add MT2731_MP2_MR2_SVN388 baseline version
Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/src/lynq/lib/liblynq-log/Makefile b/src/lynq/lib/liblynq-log/Makefile
new file mode 100644
index 0000000..06b216e
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/Makefile
@@ -0,0 +1,63 @@
+PREFIX = ../install
+CROSS = arm-none-linux-
+ROOT = $(PREFIX)/$(CROSS:%-=%)
+
+#For Yocto use
+
+RFX_TEST_CLIENT = false
+RFX_TEST_AOSP = false
+
+$(warning ########## log-riltel BB_TELEFWK_OPTION $(BB_TELEFWK_OPTION) ##########)
+
+
+
+SUBDIRS += log-riltel
+
+
+
+
+
+$(warning ########## log-riltel SUBDIRS $(SUBDIRS) ##########)
+export SIM_COUNT?=1
+
+.PHONY: all build clean pack_rootfs
+
+all: build
+
+build: clean
+
+clean:
+ $(warning ########## clean ril ##########)
+ for i in $(SUBDIRS); do \
+ (cd $$i && make clean); \
+ if [ $$? != 0 ]; then \
+ exit 1; \
+ fi \
+ done
+
+build:
+ $(warning ########## build ril ##########)
+ for i in $(SUBDIRS); do \
+ (cd $$i && make); \
+ if [ $$? != 0 ]; then \
+ exit 1; \
+ fi \
+ done
+
+install:
+ $(warning ########## install ril ##########)
+ for i in $(SUBDIRS); do \
+ (cd $$i && make install); \
+ if [ $$? != 0 ]; then \
+ exit 1; \
+ fi \
+ done
+
+pack_rootfs:
+ $(warning ########## pack_rootfs ril ##########)
+ for i in $(SUBDIRS); do \
+ (cd $$i && make pack_rootfs); \
+ if [ $$? != 0 ]; then \
+ exit 1; \
+ fi \
+ done
diff --git a/src/lynq/lib/liblynq-log/NOTICE b/src/lynq/lib/liblynq-log/NOTICE
new file mode 100644
index 0000000..c5b1efa
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/NOTICE
@@ -0,0 +1,190 @@
+
+ Copyright (c) 2005-2008, The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
diff --git a/src/lynq/lib/liblynq-log/README b/src/lynq/lib/liblynq-log/README
new file mode 100644
index 0000000..9a7e82f
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/README
@@ -0,0 +1,13 @@
+WHAT IT DOES?
+=============
+MTK ril proxy core library
+
+HOW IT WAS BUILT?
+==================
+This module is source code released.
+
+HOW TO USE IT?
+==============
+MTK ril proxy daemon will use this library to communicate with GSM and C2K RILD.
+
+All the source code of this folder were written by MediaTek co..
diff --git a/src/lynq/lib/liblynq-log/include/liblog/liblog.h b/src/lynq/lib/liblynq-log/include/liblog/liblog.h
new file mode 100644
index 0000000..7a36e97
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/include/liblog/liblog.h
@@ -0,0 +1,140 @@
+#ifndef __LIBLOG_H__
+#define __LIBLOG_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+//Log模块是否使能
+#define LOG_ENABLE 1
+
+
+#if LOG_ENABLE
+
+#define ENABLE(X) (1<<(X))
+
+//****************************************************************************//
+//*************************User configuration start**************************//
+//****************************************************************************//
+
+typedef enum
+{
+ LOG_VERBOSE = 0, //从0开始,自行添加
+ LOG_ERROR,
+ LOG_WARNING,
+ LOG_INFO,
+ LOG_DEBUG,
+ LOG_LEVEL_MAX//不可删除
+}log_level_enum;
+
+typedef enum
+{
+ LOG_OTHERS = 0, //从0开始,自行添加
+ LOG_MQTT,
+ LOG_SPI,
+ LOG_THREADTEST_DBUS,
+ LOG_THREADHANDLE,
+ LOG_HTTP,
+ LOG_FTP,
+ LOG_TAG_MAX, //不可删除
+} log_tag_enum;
+
+
+typedef struct
+{
+ char open_log_level;
+ char open_module_log_num;
+ char open_module_log[LOG_TAG_MAX];
+}log_level_str;
+
+
+//Log等级全局使能 ENABLE(LOG_VERBOSE)添加此条件控制是否只执行优先级高的:添加则为只要在模块内调用的都打印,不添加则为执行模块优先级最高的
+#define LOG_LEVEL_ENABLE ENABLE(LOG_VERBOSE)
+//#define LOG_LEVEL_ENABLE ENABLE(LOG_VERBOSE)|ENABLE(LOG_DEBUG)|ENABLE(LOG_INFO)|ENABLE(LOG_WARNING)|ENABLE(LOG_ERROR)
+
+
+//根据Tag枚举索引排序
+static unsigned int LogTagEnableInfoTable[LOG_TAG_MAX] =
+{
+// ENABLE(LOG_VERBOSE)|ENABLE(LOG_DEBUG)|ENABLE(LOG_INFO)|ENABLE(LOG_WARNING)|ENABLE(LOG_ERROR),
+// ENABLE(LOG_VERBOSE),
+// ENABLE(LOG_VERBOSE),
+// ENABLE(LOG_WARNING),
+};
+
+const static char * LogTagNameInfoTable[LOG_TAG_MAX] =
+{
+ "OTHERS",\
+ "MQTT",\
+ "SPI",\
+ "THREADTEST_DBUS",\
+ "THREADHANDLE",\
+ "HTTP",\
+ "FTP",
+};
+
+const static char * LogLevelNameInfoTable[LOG_LEVEL_MAX] =
+{
+ "[VERBOSE]","[ERROR]","[WARNING]","[INFO]","[DEBUG]" //lt add @2021.7.22 for []
+};
+
+#endif //LOG_ENABLE
+
+void lynq_log_global_output(log_level_enum Level,const char *format,...);
+
+/*********************************************************************************************************
+** Function name: lynq_log_output
+** Description lynq_log_output
+** Input parameters: Tag:Tag类型(log_level_enum)
+ Level:Tag下打印level(log_tag_enum)
+ format:printf打印的不定长参数
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+void lynq_log_output(log_tag_enum Tag,log_level_enum Level,const char *format,...);
+
+/*********************************************************************************************************
+** Function name: lynq_update_log_output
+** Description ÖØÐ»ñÈ¡logµÈ¼¶²¢Ê¹ÆäÉúЧ
+** Input parameters: Tag:TagÀàÐÍ(log_level_enum)
+ Level:TagÏ´òÓ¡level(log_tag_enum)
+ format:printf´òÓ¡µÄ²»¶¨³¤²ÎÊý
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+void lynq_update_log_output(log_tag_enum Tag,log_level_enum Level,const char *format,...);
+
+/*********************************************************************************************************
+** Function name: lynq_fget_log_level
+** Description 读取日志配置信息
+** Input parameters: open_log_level:开启log日志等级
+ open_module_log_num:开启日志模块的个数
+ open_module_log:开启日子服务的模块
+** Returned value: 0:成功,-1:失败
+** Created by:
+*********************************************************************************************************/
+int lynq_read_store_log_deploy(log_level_str *log_level_read_level_str);
+
+/*********************************************************************************************************
+** Function name: lynq_enable_log_serve
+** Description 使能日志服务
+** Input parameters: None
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+void lynq_log_printf_output(log_tag_enum Tag,log_level_enum Level,const char *format,...);
+
+
+/********************************************************************************************************
+*********************************************************************************************************/
+
+void lynq_log_configuration_set(char *log_name,char log_data_arr);
+void lynq_log_configuration_init(char *log_name);
+
+void lynq_store_log_test(void);
+void lynq_read_set_log_test(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__LOG_H__
diff --git a/src/lynq/lib/liblynq-log/include/liblog/lynq_deflog.h b/src/lynq/lib/liblynq-log/include/liblog/lynq_deflog.h
new file mode 100644
index 0000000..578800d
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/include/liblog/lynq_deflog.h
@@ -0,0 +1,31 @@
+#ifndef __LYNQ_DEFLOG_H__
+#define __LYNQ_DEFLOG_H__
+#include "liblog.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef USER_LOG_TAG
+#define LYVERBLOG(X...) lynq_log_global_output(LOG_VERBOSE,X)
+#define LYERRLOG(X...) lynq_log_global_output(LOG_ERROR,X)
+#define LYWARNLOG(X...) lynq_log_global_output(LOG_WARNING,X)
+#define LYINFLOG(X...) lynq_log_global_output(LOG_INFO,X)
+#define LYDBGLOG(X...) lynq_log_global_output(LOG_DEBUG,X)
+#define LYLOGSET(a) lynq_log_configuration_set(USER_LOG_TAG,a)
+#define LYLOGEINIT(Y) lynq_log_configuration_init(Y)
+#else
+#define LYVERBLOG(X...)
+#define LYERRLOG(X...)
+#define LYWARNLOG(X...)
+#define LYINFLOG(X...)
+#define LYDBGLOG(X...)
+#define LYLOGSET(a)
+#define LYLOGEINIT(Y)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__LYNQ_DEFLOG_H__
\ No newline at end of file
diff --git a/src/lynq/lib/liblynq-log/include/liblog/lynq_nand.h b/src/lynq/lib/liblynq-log/include/liblog/lynq_nand.h
new file mode 100644
index 0000000..87ef3ee
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/include/liblog/lynq_nand.h
@@ -0,0 +1,18 @@
+#ifndef __LYNQ_NAND_H__
+#define __LYNQ_NAND_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+int lynq_nand_store_log_message(char *log_message,size_t log_message_len);
+int lynq_nand_get_log_message(char *log_message,size_t log_message_len,off_t offset);
+int lynq_nand_read_data_test(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__LYNQ_NAND_H__*/
\ No newline at end of file
diff --git a/src/lynq/lib/liblynq-log/log-riltel/log.c b/src/lynq/lib/liblynq-log/log-riltel/log.c
new file mode 100644
index 0000000..3606536
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/log-riltel/log.c
@@ -0,0 +1,489 @@
+#include "liblog.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <log/log.h>
+
+
+void hextostring(unsigned char val, char *buf);
+
+#define LOG_NAME_LEN 128
+
+static unsigned int log_level = 0; //logµÈ¼¶£¬ÐèÒª¿ª·¢ÈËÔ±¶¯Ì¬ÅäÖÃlogµÈ¼¶£¬Ä¬Èϵȼ¶Îª0
+static unsigned char log_name_arr[LOG_NAME_LEN] = {0};
+/*********************************************************************************************************
+** Function name: lynq_log_output
+** Description lynq_log_output
+** Input parameters: Tag:TagÀàÐÍ(log_level_enum)
+ Level:TagÏ´òÓ¡level(log_tag_enum)
+ format:printf´òÓ¡µÄ²»¶¨³¤²ÎÊý
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+void lynq_log_output(log_tag_enum Tag,log_level_enum Level,const char *format,...)
+{
+#if LOG_ENABLE
+ if((Tag >= LOG_TAG_MAX)||(Level >= LOG_LEVEL_MAX))
+ return;
+// printf("mo:%d---le:%d---Level:%d\n",LogTagEnableInfoTable[Tag],log_level,Level);
+// printf("rmodule:%d---rlevel:%d\n",((LogTagEnableInfoTable[Tag] >> Level)&0x00000001),((log_level >> Level)&0x00000001));
+ if(((LogTagEnableInfoTable[Tag] >> Level)&0x00000001)&((log_level >> Level)&0x00000001))
+ {
+ va_list args;
+
+ //TagName
+ printf("[%s]",LogTagNameInfoTable[Tag]);
+
+ //LevelName
+ printf("[%s]:",LogLevelNameInfoTable[Level]);
+
+ va_start(args,format);
+ vprintf(format,args);
+ va_end(args);
+ }
+ return ;
+#endif //LOG_ENABLE
+}
+
+
+void lynq_log_global_output(log_level_enum Level,const char *format,...)
+{
+#if LOG_ENABLE
+
+ char out_buf[1100] = {0};
+ char buf[1024] = {0};
+
+ if(Level >= LOG_LEVEL_MAX)
+ return;
+ if((log_level >> Level)&0x00000001)
+ {
+ va_list args;
+
+ //TagName
+ if(log_name_arr[0] > 0)
+ {
+ printf("[%s]",log_name_arr);
+ }
+
+ //LevelName
+ printf("%s:",LogLevelNameInfoTable[Level]); //lt dele @2021.7.22 for []
+
+ va_start(args,format);
+ vprintf(format,args);
+ vsnprintf(buf, sizeof(buf), format, args); //lt add @2021.7.22 for write buf
+ va_end(args);
+ printf("\r\n");
+
+ sprintf(out_buf, "%s %s", LogLevelNameInfoTable[Level], buf);//lt add @2021.7.22 for write outbuf
+ __android_log_print(ANDROID_LOG_DEBUG,log_name_arr, "%s",out_buf); //lt add @2021.7.22 for write syslog.log
+ }
+ return ;
+#endif //LOG_ENABLE
+}
+
+
+
+void lynq_log_configuration_set(char *log_name,char log_data_arr)
+{
+ char log_data_buf[LOG_NAME_LEN] = {"persist."};
+ char log_data_str[32] = {0};
+ if(log_name == NULL)
+ {
+ return ;
+ }
+ if(log_data_arr < LOG_LEVEL_MAX)
+ {
+ sprintf(log_data_str,"%d",log_data_arr);
+// printf("log_data_str:%s\n",log_data_str);
+ if((strlen(log_name)) < (LOG_NAME_LEN - 9))
+ {
+ strcat(log_data_buf,log_name);
+ property_set(log_data_buf,log_data_str);
+ }
+ }
+ lynq_log_configuration_init(log_name);
+}
+
+void lynq_deal_with_level(unsigned int get_log_level)
+{
+ switch(get_log_level)
+ {
+ case LOG_DEBUG:
+ log_level |= ENABLE(LOG_DEBUG);
+ case LOG_INFO:
+ log_level |= ENABLE(LOG_INFO);
+ case LOG_WARNING:
+ log_level |= ENABLE(LOG_WARNING);
+ case LOG_ERROR:
+ log_level |= ENABLE(LOG_ERROR);
+ case LOG_VERBOSE:
+ log_level |= ENABLE(LOG_VERBOSE);
+ break;
+ default:
+ log_level |= ENABLE(LOG_VERBOSE);
+ break;
+ }
+}
+
+void lynq_log_configuration_init(char *log_name)
+{
+ char log_data_buf[LOG_NAME_LEN] = {"persist."};
+ char get_propty_log_data[32] ={0};
+ unsigned int get_log_level = 0;
+
+ if(log_name == NULL)
+ {
+ return ;
+ }
+ if((strlen(log_name)) < (LOG_NAME_LEN - 9))
+ {
+ strcpy(log_name_arr,log_name);
+ strcat(log_data_buf,log_name);
+ if(property_get(log_data_buf,(char *)get_propty_log_data,NULL) > 0)
+ {
+ get_log_level = atoi(get_propty_log_data);
+// printf("get_log_level:%d\n",get_log_level);
+ }
+ else
+ {
+ log_level = 0;
+// printf("get propty data fail\n");
+ }
+
+ }
+ lynq_deal_with_level(get_log_level);
+
+}
+
+/*********************************************************************************************************
+** Function name: lynq_update_log_output
+** Description ÖØÐ»ñÈ¡logµÈ¼¶²¢Ê¹ÆäÉúЧ
+** Input parameters: Tag:TagÀàÐÍ(log_level_enum)
+ Level:TagÏ´òÓ¡level(log_tag_enum)
+ format:printf´òÓ¡µÄ²»¶¨³¤²ÎÊý
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+void lynq_update_log_output(log_tag_enum Tag,log_level_enum Level,const char *format,...)
+{
+#if LOG_ENABLE
+ lynq_enable_log_serve();
+ if((Tag >= LOG_TAG_MAX)||(Level >= LOG_LEVEL_MAX))
+ return;
+// printf("mo:%d---le:%d---Level:%d\n",LogTagEnableInfoTable[Tag],log_level,Level);
+// printf("rmodule:%d---rlevel:%d\n",((LogTagEnableInfoTable[Tag] >> Level)&0x00000001),((log_level >> Level)&0x00000001));
+ if(((LogTagEnableInfoTable[Tag] >> Level)&0x00000001)&((log_level >> Level)&0x00000001))
+ {
+ va_list args;
+
+ //TagName
+ printf("[%s]",LogTagNameInfoTable[Tag]);
+
+ //LevelName
+ printf("[%s]:",LogLevelNameInfoTable[Level]);
+
+ va_start(args,format);
+ vprintf(format,args);
+ va_end(args);
+ }
+ return ;
+#endif //LOG_ENABLE
+}
+
+
+/*********************************************************************************************************
+** Function name: lynq_log_printf_output
+** Description ·â×°printf
+** Input parameters: Tag:TagÀàÐÍ(log_level_enum)
+ Level:TagÏ´òÓ¡level(log_tag_enum)
+ format:printf´òÓ¡µÄ²»¶¨³¤²ÎÊý
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+void lynq_log_printf_output(log_tag_enum Tag,log_level_enum Level,const char *format,...)
+{
+#if LOG_ENABLE
+ if((Tag >= LOG_TAG_MAX)||(Level >= LOG_LEVEL_MAX))
+ return;
+
+ va_list args;
+
+ //TagName
+ printf("[%s]",LogTagNameInfoTable[Tag]);
+
+ //LevelName
+ printf("[%s]:",LogLevelNameInfoTable[Level]);
+
+ va_start(args,format);
+ vprintf(format,args);
+ va_end(args);
+
+ return ;
+#endif //LOG_ENABLE
+}
+
+/*********************************************************************************************************
+** Function name: lynq_fget_log_level
+** Description ¿ªÆôlogÈÕÖ¾µÈ¼¶
+** Input parameters: open_log_level:¿ªÆôlogÈÕÖ¾µÈ¼¶
+ open_module_log_num:¿ªÆôÈÕ־ģ¿éµÄ¸öÊý
+ open_module_log:¿ªÆôÈÕ×Ó·þÎñµÄÄ£¿é
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+void lynq_fget_log_level(log_level_str level_str)
+{
+ log_level = 0;
+ switch(level_str.open_log_level)
+ {
+ case LOG_DEBUG:
+ log_level |= ENABLE(LOG_DEBUG);
+ case LOG_INFO:
+ log_level |= ENABLE(LOG_INFO);
+ case LOG_WARNING:
+ log_level |= ENABLE(LOG_WARNING);
+ case LOG_ERROR:
+ log_level |= ENABLE(LOG_ERROR);
+ case LOG_VERBOSE:
+ log_level |= ENABLE(LOG_VERBOSE);
+ break;
+ default:
+ log_level |= ENABLE(LOG_VERBOSE);
+ break;
+ }
+
+ for(int i = 0; i < level_str.open_module_log_num; i++)
+ {
+ LogTagEnableInfoTable[level_str.open_module_log[i]] = ENABLE(LOG_VERBOSE)|ENABLE(LOG_DEBUG)|ENABLE(LOG_INFO)|ENABLE(LOG_WARNING)|ENABLE(LOG_ERROR);
+ }
+ return ;
+}
+
+/*********************************************************************************************************
+** Function name: lynq_store_log_deploy
+** Description ±£´æÈÕÖ¾ÅäÖÃÐÅÏ¢
+** Input parameters: open_log_level:¿ªÆôlogÈÕÖ¾µÈ¼¶
+ open_module_log_num:¿ªÆôÈÕ־ģ¿éµÄ¸öÊý
+ open_module_log:¿ªÆôÈÕ×Ó·þÎñµÄÄ£¿é
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+void lynq_store_log_deploy(log_level_str *log_level_write_level_str)
+{
+ char *log_level_writefile = "persist.store_log_level";
+ char store_log_str_buf[512] = {0};
+
+ store_log_str_buf[0] = '+';
+ hextostring(log_level_write_level_str->open_log_level,&store_log_str_buf[1]);
+ hextostring(log_level_write_level_str->open_module_log_num,&store_log_str_buf[3]);
+ for(int i = 0; i < log_level_write_level_str->open_module_log_num; i++)
+ {
+ hextostring(log_level_write_level_str->open_module_log[i],&store_log_str_buf[5+i*2]);
+ }
+
+ property_set(log_level_writefile,(char *)store_log_str_buf);
+ return ;
+}
+
+/*********************************************************************************************************
+** Function name: lynq_fget_log_level
+** Description ¶ÁÈ¡ÈÕÖ¾ÅäÖÃÐÅÏ¢
+** Input parameters: open_log_level:¿ªÆôlogÈÕÖ¾µÈ¼¶
+ open_module_log_num:¿ªÆôÈÕ־ģ¿éµÄ¸öÊý
+ open_module_log:¿ªÆôÈÕ×Ó·þÎñµÄÄ£¿é
+** Returned value: 0£º³É¹¦£¬-1£ºÊ§°Ü
+** Created by:
+*********************************************************************************************************/
+int lynq_read_store_log_deploy(log_level_str *log_level_read_level_str)
+{
+ char *log_level_readfile = "persist.store_log_level";
+
+ if(property_get(log_level_readfile,(char *)log_level_read_level_str,NULL) > 0)
+ {
+// printf("read log level deploy success!!!\n");
+ return 0;
+ }
+ else
+ {
+// printf("get file error!!!\n");
+ return -1;
+ }
+}
+
+int itoa(int val, char *buf,int size) //16½øÖÆ×ª»»³É×Ö·û´®
+{
+ char *p = buf;
+ char t = '0';
+ int len = 0;
+ int slen = size;
+ while(val > 0 && len < slen) {
+ t = val % 16;
+ val -= t;
+ val /= 16;
+ if (t > 9) {
+ *p++ = t- 10 + 'a';
+ } else {
+ *p++ = t + '0';
+ }
+ ++len;
+ }
+ for (int i = 0;i < len/2;++i) {
+ char c = buf[i];
+ buf[i] = buf[len-1-i];
+ buf[len-1-i] = c;
+ }
+ buf[len] = '\0';
+ return len;
+}
+
+void hextostring(unsigned char val, char *buf)
+{
+ char strbuf[64] = {0};
+ itoa(val,strbuf,2);
+ memcpy(buf,strbuf,3);
+ if((val >= 0) && (val <= 15))
+ {
+ buf[0] = '0';
+ buf[1] = strbuf[0];
+ buf[2] = '\0';
+ }
+}
+
+static int pows(int x, int y)
+{
+ int result = 1;
+
+ while (y--)
+ result *= x;
+ return result;
+}
+
+int string2hex(const char *buffer, int cnt)
+{
+ int c = 0;
+ char t = 0;
+ int count = cnt;
+
+ while (count--) {
+ t = *(buffer + cnt - count - 1);
+ if (t >= 'A' && t <= 'F')
+ c += ((t - 'A') + 10) * pows(16, count);
+ else if (t >= 'a' && t <= 'f')
+ c += ((t - 'a') + 10) * pows(16, count);
+ else if (t >= '0' && t <= '9')
+ c += (t - '0') * pows(16, count);
+ else
+ c = -1;
+ }
+ return c;
+}
+
+int get_hexbuffer(char *data_buffer, char *hex_buffer)
+{
+ char *ptr = data_buffer;
+ int index = 0;
+ int data_offset = 0;
+
+ while (*ptr && *++ptr) {
+ *(hex_buffer + index++) = string2hex(ptr - 1, 2);
+ ptr++;
+ data_offset++;
+ }
+ *(hex_buffer + index) = 0;
+ return data_offset;
+}
+/*********************************************************************************************************
+** Function name: lynq_enable_log_serve
+** Description ʹÄÜÈÕÖ¾·þÎñ
+** Input parameters: None
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+void lynq_enable_log_serve(void)
+{
+ log_level_str read_level_str;
+ int scanf_ret = 0;
+ char read_buf[] = {0};
+ char shift_read_buf[128] = {0};
+ static char stcp_read_buf[128] = {0};
+ char *log_level_readfile = "persist.store_log_level";
+
+ if(property_get(log_level_readfile,&read_buf,NULL) > 0)
+ {
+ if(strcmp(read_buf,stcp_read_buf) == 0)
+ {
+// printf("strcmp(read_buf,stcp_read_buf) == 0\n");
+ return ;
+ }
+ strcpy(stcp_read_buf,read_buf);
+
+ if(read_buf[0] == '+')
+ {
+// printf("start\n");
+ scanf_ret = sscanf(&read_buf[1],"%128s",shift_read_buf);
+// printf("scanf_ret:%s\n",read_buf);
+ if(scanf_ret)
+ {
+
+ get_hexbuffer(shift_read_buf,read_buf);
+ read_level_str.open_log_level = read_buf[0];
+ read_level_str.open_module_log_num = read_buf[1];
+ memcpy(read_level_str.open_module_log,&read_buf[2],read_level_str.open_module_log_num);
+// printf("data:%d %d\n",read_level_str.open_log_level,read_level_str.open_module_log_num);
+ }
+
+ }
+ else
+ {
+ lynq_read_store_log_deploy(&read_level_str);
+ }
+ if((read_level_str.open_log_level < LOG_LEVEL_MAX) && (read_level_str.open_module_log_num < LOG_TAG_MAX))
+ {
+ lynq_fget_log_level(read_level_str);
+ }
+ }
+}
+
+/*********************************************************************************************************
+** Function name: lynq_store_log_test
+** Description ÅäÖÃÈÕÖ¾ÐÅÏ¢£¨ÅäÖÃÍê³Éºó£¬Èô²»ÐÞ¸ÄÅäÖÃÐÅÏ¢£¬¿ÉÒÔºöÂÔ£©
+** Input parameters: None
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+#define MODULE_LOG_NUM 6
+void lynq_store_log_test(void)
+{
+ log_level_str write_level_str;
+ log_level_str read_level_str;
+
+ char open_log_level = LOG_WARNING;
+ char module_log_buf[MODULE_LOG_NUM] = {LOG_MQTT,LOG_SPI,LOG_THREADTEST_DBUS, LOG_THREADHANDLE, LOG_HTTP, LOG_FTP};
+
+ write_level_str.open_log_level = open_log_level;
+ write_level_str.open_module_log_num = MODULE_LOG_NUM;
+ memcpy(write_level_str.open_module_log,module_log_buf,MODULE_LOG_NUM);
+ if(lynq_read_store_log_deploy(&read_level_str) != 0)
+ {
+ lynq_store_log_deploy(&write_level_str);
+ lynq_store_log_deploy(&write_level_str);
+ }
+
+// printf("write log deploy success!!!\n");
+ return ;
+}
+
+/*********************************************************************************************************
+** Function name: lynq_read_set_log_test
+** Description ʹÄÜÅäÖÃÐÅÏ¢
+** Input parameters: None
+** Returned value: None
+** Created by:
+*********************************************************************************************************/
+void lynq_read_set_log_test(void)
+{
+ lynq_enable_log_serve();
+}
+
diff --git a/src/lynq/lib/liblynq-log/log-riltel/lynq_nand.c b/src/lynq/lib/liblynq-log/log-riltel/lynq_nand.c
new file mode 100644
index 0000000..1ab4e01
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/log-riltel/lynq_nand.c
@@ -0,0 +1,240 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <fcntl.h>
+#include <pthread.h>
+
+#include "mtk_device_wrap.h"
+#include "lynq_nand.h"
+
+#if 1
+#define NAND_LOG_PATCH "/dev/mtd19"
+#else
+#define NAND_LOG_PATCH "/dev/mtd19/lynq_log.txt"
+#endif
+
+#define NAND_PRIMITIVE_OFFSET 2*1024
+#define NAND_TOTAL_SIZE 20*1024*1024
+#define NAND_CURRENT_LEN 2*1024
+#define NAND_OLD_CURRENT_LEN 0
+
+static int lynq_nand_offset_global = 0;
+static pthread_mutex_t nand_mutex = PTHREAD_MUTEX_INITIALIZER;
+char nand_count = 0;
+
+void lynq_store_nand_offset_data(char *store_nand_offset_data);
+int lynq_read_nand_offset_data(char *read_nand_offset_data);
+
+
+int lynq_nand_store_log_message(char *log_message,size_t log_message_len)
+{
+ pthread_mutex_lock(&nand_mutex);
+ int fd;
+ int err = 0;
+ char nand_current_buf[NAND_CURRENT_LEN] = {0};
+ unsigned int nand_page = 0;
+ int nand_offset_count = 0;
+ char nand_offset_buf[8] = {0};
+ char read_nand_buf[8] = {0};
+
+ if(log_message_len == 0)
+ {
+ return -1;
+ }
+
+ fd=mtk_device_wrap_open(NAND_LOG_PATCH,O_RDWR);
+ if(fd < 0)
+ {
+ perror("open nand log message error1!!!!");
+ return fd;
+ }
+
+ if(lynq_read_nand_offset_data(nand_offset_buf) == 0)
+ {
+ nand_offset_count = atoi(nand_offset_buf);
+ lynq_nand_offset_global = nand_offset_count;
+ }
+
+ ((log_message_len % 2048) == 0 ) ? (nand_page = log_message_len / 2048) : (nand_page = (log_message_len / 2048)+1);
+//printf("nand_page:%d\n",nand_page);
+ while(1)
+ {
+ err = mtk_device_wrap_seek(fd, lynq_nand_offset_global, SEEK_SET);
+ if(err == -1)
+ {
+ perror("seek nand log message error8!!!!");
+ return err;
+ }
+ mtk_device_wrap_read(fd, read_nand_buf, 8);
+ if(((read_nand_buf[0] == 0xff) && (read_nand_buf[1] == 0xff) && (read_nand_buf[2] == 0xff) &&(read_nand_buf[3] == 0xff)) ||\
+ ((lynq_nand_offset_global % (128 *1024) ) == 0))
+ {
+ for(int i = 0; i < nand_page; i++)
+ {
+ memset(nand_current_buf,0,NAND_CURRENT_LEN);
+ err = mtk_device_wrap_seek(fd, lynq_nand_offset_global, SEEK_SET);
+ if(err == -1)
+ {
+ perror("seek nand log message error8!!!!");
+ return err;
+ }
+ if((i+1) == nand_page)
+ {
+ memcpy(nand_current_buf,&log_message[i*NAND_CURRENT_LEN],(log_message_len-(i*2048)));
+// printf("(i+1) == nand_page---%d\n",(log_message_len-(i*2048)));
+ }
+ else
+ {
+ memcpy(nand_current_buf,&log_message[i*NAND_CURRENT_LEN],NAND_CURRENT_LEN);
+ printf("(i+1) != nand_page\n");
+ }
+
+ err = mtk_device_wrap_write(fd, nand_current_buf, NAND_CURRENT_LEN);
+ if(err == -1)
+ {
+ perror("write nand log message error9!!!!");
+ return err;
+ }
+ lynq_nand_offset_global += NAND_CURRENT_LEN;
+ if(lynq_nand_offset_global > NAND_TOTAL_SIZE)
+ {
+ lynq_nand_offset_global = 0;
+ }
+ }
+ break;
+ }
+//printf("lynq_nand_offset_global:%d---nand_offset_count:%d\n",lynq_nand_offset_global,nand_offset_count);
+ lynq_nand_offset_global += NAND_CURRENT_LEN;
+ if(lynq_nand_offset_global > NAND_TOTAL_SIZE)
+ {
+ lynq_nand_offset_global = 0;
+ }
+ }
+
+ if(nand_count >= 64)
+ {
+ nand_count = 0;
+ sprintf(nand_offset_buf,"%d",lynq_nand_offset_global);
+ lynq_store_nand_offset_data(nand_offset_buf);
+ }
+
+ err = mtk_device_wrap_close(fd);
+
+ pthread_mutex_unlock(&nand_mutex);
+ return 0;
+}
+
+
+int lynq_nand_get_log_message(char *log_message,size_t log_message_len,off_t offset)
+{
+ int fd;
+ int err = 0;
+
+ pthread_mutex_lock(&nand_mutex);
+
+ unsigned int lynq_nand_offset_part = 0;
+
+ fd=mtk_device_wrap_open(NAND_LOG_PATCH,O_RDONLY);
+ if(fd < 0)
+ {
+ perror("open nand log message error!!!!");
+ return fd;
+ }
+
+ lynq_nand_offset_part = NAND_PRIMITIVE_OFFSET + offset;
+//printf("lynq_nand_offset_part 13:%d\n",lynq_nand_offset_part);
+ err = mtk_device_wrap_seek(fd, lynq_nand_offset_part, SEEK_SET);
+//printf("lynq_nand_offset_part 14:%d----nand seek 4:%d\n",lynq_nand_offset_part,err);
+ if(err == -1)
+ {
+ perror("seek nand log message error 15!!!!");
+ return err;
+ }
+
+ mtk_device_wrap_read(fd, log_message, log_message_len);
+
+ err = mtk_device_wrap_close(fd);
+
+ pthread_mutex_unlock(&nand_mutex);
+ return err;
+}
+
+
+int lynq_nand_read_data_test(void)
+{
+ int fd;
+ FILE *file_fd = NULL;
+ int err;
+ char log_data_buf[6*1024] = {0};
+ char log_nand_buf[2048] = {0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99};
+ static unsigned int nand_offset_test = 0;
+ char *filePath = "/usr/local/lnand_log.txt";
+
+ system("touch /usr//local/lnand_log.txt");
+ system("chmod 777 /usr//local/lnand_log.txt");
+
+ fd=mtk_device_wrap_open(NAND_LOG_PATCH,O_RDWR);
+
+ if(fd < 0)
+ {
+ perror("open nand log message error!!!!");
+ return fd;
+ }
+
+ file_fd = fopen(filePath,"rt+");
+ if(NULL == file_fd)
+ {
+ perror("file_fd");
+ return -1;
+ }
+
+ for(int i = 0 ;i < 100; i++)
+ {
+ memset(log_data_buf,0,6*1024);
+ err = mtk_device_wrap_seek(fd, nand_offset_test, SEEK_SET);
+
+
+ if(err == -1)
+ {
+ perror("seek nand log message error!!!!");
+ return err;
+ }
+
+ fseek(file_fd,nand_offset_test,SEEK_SET);
+
+ mtk_device_wrap_read(fd, log_data_buf, 6*1024);
+ nand_offset_test += (6*1024);
+
+ fwrite(&log_data_buf,sizeof(log_data_buf), 1, file_fd);
+
+ }
+
+ fclose(file_fd);
+ mtk_device_wrap_close(fd);
+
+}
+
+
+
+void lynq_store_nand_offset_data(char *store_nand_offset_data)
+{
+ char *log_level_writefile = "persist.store_nand_data";
+ property_set(log_level_writefile,(char *)store_nand_offset_data);
+ return ;
+}
+
+int lynq_read_nand_offset_data(char *read_nand_offset_data)
+{
+ char *log_level_readfile = "persist.store_nand_data";
+
+ if(property_get(log_level_readfile,(char *)read_nand_offset_data,NULL) > 0)
+ {
+// printf("read log level deploy success!!!\n");
+ return 0;
+ }
+ else
+ {
+// printf("get file error!!!\n");
+ return -1;
+ }
+}
\ No newline at end of file
diff --git a/src/lynq/lib/liblynq-log/log-riltel/makefile b/src/lynq/lib/liblynq-log/log-riltel/makefile
new file mode 100644
index 0000000..3f929a2
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/log-riltel/makefile
@@ -0,0 +1,101 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+ -std=gnu++14 \
+ -g -Os \
+ -flto \
+ -DRIL_SHLIB \
+ -DATCI_PARSE \
+ -DKEEP_ALIVE \
+ -DECALL_SUPPORT \
+ -fpermissive \
+
+CFLAGS += -fPIC -O2 $(INCLUDE) -D_LARGEFILE64_SOURCE
+
+$(warning ################# C2K support: $(RAT_CONFIG_C2K_SUPPORT))
+ifeq ($(strip $(RAT_CONFIG_C2K_SUPPORT)), yes)
+ LOCAL_CFLAGS += -DC2K_SUPPORT
+
+endif
+
+ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds)
+ LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \
+ -DANDROID_MULTI_SIM \
+ -DMODE_DSDS
+endif
+
+ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsss)
+ LOCAL_CFLAGS += -DMODE_DSSS
+endif
+
+$(warning ################# TARGET_PLATFORM: $(TARGET_PLATFORM))
+ifeq ($(strip $(TARGET_PLATFORM)), mt2731)
+#$(warning #################add for debug $(ROOT), $(includedir))
+$(warning ################# TARGET_PLATFORM_MT2731)
+ LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2731 \
+ -DMD_93_SUPPORT
+else ifeq ($(strip $(TARGET_PLATFORM)), mt2635)
+$(warning ################# TARGET_PLATFORM_MT2635)
+ LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2635 \
+ -DMD_90_SUPPORT
+endif
+
+$(warning ################# RITA ROOT: $(ROOT),includedir:$(includedir))
+LOCAL_PATH = .
+
+LOCAL_C_INCLUDES = \
+ -I. \
+ -I$(LOCAL_PATH)/../include/liblog \
+ -I$(ROOT)$(includedir) \
+ -I$(ROOT)$(includedir)/logger \
+
+
+
+
+LOCAL_LIBS := \
+ -L. \
+ -ldl \
+ -lstdc++ \
+ -llog \
+ -lcutils \
+ -lutils \
+ -lpower \
+ -lpal \
+ -lnandapi \
+ -lsncfg \
+
+SOURCES = $(wildcard *.c wildcard *.h)
+
+EXECUTABLE = liblynq-log.so
+
+OBJECTS=$(SOURCES:.c=.o)
+
+
+.PHONY: build clean install pack_rootfs
+
+all: build
+$(EXECUTABLE): $(OBJECTS)
+ $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(CFLAGS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
+
+%.o : %.c
+ $(CC) $(LOCAL_C_INCLUDES) $(CFLAGS) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
+
+build: $(EXECUTABLE)
+ $(warning ########## build $(EXECUTABLE) ##########)
+
+install:
+ mkdir -p $(ROOT)$(base_libdir)/
+ install $(EXECUTABLE) $(ROOT)$(base_libdir)/
+ mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
+
+pack_rootfs:
+ mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
+ cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
+ $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
+ mkdir -p $(PACK_TO)$(base_libdir)/
+ cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
+ $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
+.PHONY: clean
+clean:
+ $(RM) $(OBJECTS) $(EXECUTABLE)