V125-260722:(暂时发现DPD/FSSI/网页频谱显示都不正常,临时提交)1.合并增加 Web 端 FPGA .mcs 在线升级功能,支持升级进度及错误状态反馈。2.合并优化 FPGA 升级后的恢复流程,实现无需断电的 FPGA 配置、JESD 链路及 RF 热恢复。3.合并重构 ORx 功率、FSSI 和 FWD 计算;4.合并DPD相关优化和调试日志;5.合并IQ 频谱数据接收由 eth1 调整至 eth0,降低对外部网口连接状态的依赖。

This commit is contained in:
2026-07-22 17:08:03 +08:00
commit c6ab382383
1655 changed files with 516169 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
########################################################################
#
# ORIGIN: OneShu .
# GROUP:
# PROJECT: USED FOR GCC Makefile
# DATE: Nov 2017.
# PURPOSE: Standard application makefile
#
# NOTE: This include makefile assumes the source modules
# are organised into the linux directory structure.
#
# $Revision: $
# $Date: 24 Nov 2017 17:11:38 $
########################################################################
TARGET_APP = logrotateStart
########################################################################
#CROSS_COMPILATION_TOOL_CHAIN=arm-histbv320-linux-
#CC = ${CROSS_COMPILATION_TOOL_CHAIN}gcc
CC = arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/opt/fsl-imx-x11/4.1.15-2.0.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi
C_SOURCE += logrotateStart.c
########################################################################
C_OBJECT = $(patsubst %.c,%.o,$(C_SOURCE))
%.o:%.c
$(CC) $(CFLAGS) -c -g $< -o $@ $(INCLUDES) $(PROJ_CPL_MACRO)
all:$(TARGET_APP)
clean:
rm -rf $(C_OBJECT) $(TARGET_APP)
$(TARGET_APP):$(C_OBJECT)
#$(CC) -o $@ -g $(C_OBJECT) -Wl,--start-group -Wl,--end-group
$(CC) -o $@ -g $(C_OBJECT)
install:$(TARGET_APP)
cp -f $(TARGET_APP) ../../out/upgrade_imx_fs/SMOD/src/usr/sbin/
cp -f $(TARGET_APP) ../../out/rootfs/usr/sbin/
@echo "\n\n\t $(TARGET_APP) intall ok\n\n"
BIN
View File
Binary file not shown.
+163
View File
@@ -0,0 +1,163 @@
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <sys/sysinfo.h>
#include <sys/stat.h>
#include <sys/time.h>
typedef struct _logfile_path_{
char mod[20];
char filename[100];
}LOGFILE_NAME;
#define DATE_TIME_LEN 19
#define MAX_LOG_FILES_NUM 3
#define CMD_START_LOGROTATE "chmod 0644 /etc/logrotate.d/log.conf && logrotate -f /etc/logrotate.d/log.conf &"
static const LOGFILE_NAME g_logfileslist[MAX_LOG_FILES_NUM] = {
{"imx_atsc_app", "/var/module_log/imx_atsc_app.log"},
{"logrotate", "/var/module_log/logrotateStart.log"},
{"daemon_system", "/var/module_log/daemon_system.log"},
};
unsigned long get_file_size(const char *path)
{
unsigned long filesize = -1;
struct stat statbuff;
int ret = 0;
ret = stat(path, &statbuff);
if(ret < 0) {
return filesize;
} else {
filesize = statbuff.st_size;
}
return filesize;
}
void clearBigLogs(void)
{
int i = 0;
unsigned long filesize = 0;
char cmd[100] = {0};
char filename[100] = {0};
for(i = 0; i< MAX_LOG_FILES_NUM; i++) {
memset(filename, 0, 100);
memcpy(filename, g_logfileslist[i].filename, 100);
if(strlen(g_logfileslist[i].filename) != 0) {
filesize = get_file_size(filename);
if(-1 == filesize) {
printf("%s get file size failed, next file\n", filename);
continue;
}
//filesize = filesize/(1024*1024); // MB
filesize = filesize/(1024); // KB
if(filesize > 1024*3) { // 3MB
printf("%s bigger than 3MB, will clear. echo null to file.\n", filename);
sprintf(cmd, "echo ' ' > %s", filename);
system(cmd);
}
}
}
}
/*****************************************************************************
* Function : main
* Description : 启动logrotate处理log文件
* Input : void
* Output : None
* Return :
* Others :
* Record
* 1.Date : 20180412
* Author : WangShu
* Modification: Created function
1. 开机运行10min钟后仍旧未获取到正确时间的, 做一次logrotate;
2. 开机运行10min内正确获取到时间的,正常做logrotate
3. logrotate : >20M 压缩生成一个以系统时间来命令的文件:app.log-20180101.gz .
-- 若 logrotate 运行错误, 检查诸多log文件,超过50M就清空这个log。
-- 超过3个压缩包, logrotate 会清除这些包。
4. 每66分钟循环一次
*****************************************************************************/
int main(void)
{
int ret = 0;
struct tm *pTm;
time_t now;
struct timeval tv;
struct sysinfo info;
char run_time[128];
char dateTime[DATE_TIME_LEN+1];
static int doflag = 0;
setvbuf(stdout, NULL, _IOLBF, 0);
while(1)
{
now = time(NULL);
pTm = localtime((const time_t *)&now);
if(pTm == NULL) {
printf("localtime is NULL!\n");
goto relogrotate;
}
sprintf(dateTime,"%04d-%02d-%02d %02d:%02d:%02d",
pTm->tm_year+1900, pTm->tm_mon+1, pTm->tm_mday, pTm->tm_hour, pTm->tm_min, pTm->tm_sec);
if(pTm->tm_year != 70) {
gettimeofday(&tv, NULL);
ret = system(CMD_START_LOGROTATE);
printf("--------[%s] Every 6Hours+ logrotate cmd return = %d\n", dateTime, ret);
clearBigLogs();
gettimeofday(&tv, NULL);
} else {
if(sysinfo(&info)) {
printf("[%s] Failed to get sysinfo\n", dateTime);
sleep(45);
continue;
}
long timenum = info.uptime;
int runday = timenum/86400;
int runhour = (timenum%86400)/3600;
int runmin = (timenum%3600)/60;
int runsec = timenum%60;
memset(run_time, 0, 128);
sprintf(run_time, "%dDay %dHour %dMin %dSec", runday, runhour, runmin, runsec);
printf("[%s] System run time : %s\n", dateTime, run_time);
if((runday == 0) && (runhour == 0) && (runmin >= 10) && (doflag == 0)) {
ret = system(CMD_START_LOGROTATE);
printf("[%s] Run %s. Every 6Hours+ logrotate. ret= %d\n", dateTime, run_time, ret);
clearBigLogs();
doflag = 1;
} else {
sleep(45);
continue;
}
}
relogrotate:
sleep(6*60*60); // 6 hours
}
}