mirror of
https://dev.iopsys.eu/system/sysmngr.git
synced 2025-12-10 00:06:19 +01:00
Added rest of the module in pipeline
This commit is contained in:
parent
6459edcbe2
commit
db11128cd9
7 changed files with 23 additions and 10 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,3 +1,5 @@
|
|||
src/sysmngr
|
||||
src/*.o
|
||||
src/*.so
|
||||
*.swp
|
||||
*.swo
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
variables:
|
||||
SOURCE_FOLDER: "src"
|
||||
CFLAGS: "-DBBF_VENDOR_PREFIX=\\\"X_IOPSYS_EU_\\\""
|
||||
SYSMNGR_VENDOR_CONFIG_FILE: 'y'
|
||||
SYSMNGR_MEMORY_STATUS: 'y'
|
||||
SYSMNGR_PROCESS_STATUS: 'y'
|
||||
SYSMNGR_SUPPORTED_DATA_MODEL: 'y'
|
||||
SYSMNGR_FIRMWARE_IMAGE: 'y'
|
||||
SYSMNGR_REBOOTS: 'y'
|
||||
SYSMNGR_NETWORK_PROPERTIES: 'y'
|
||||
SYSMNGR_VENDOR_EXTENSIONS: 'y'
|
||||
SYSMNGR_FWBANK_UBUS_SUPPORT: 'y'
|
||||
|
||||
include:
|
||||
- project: 'iopsys/gitlab-ci-pipeline'
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ static char *get_blobmsg_option_value(struct blob_attr *entry, const char *optio
|
|||
option_value = dmstrdup(blobmsg_get_string(tb[7]));
|
||||
else if (DM_STRCMP(sysmngr_bank_policy[8].name, option_name) == 0 && tb[8]) // Status
|
||||
option_value = dmstrdup(blobmsg_get_string(tb[8]));
|
||||
else // Otherwise
|
||||
option_value = "";
|
||||
|
||||
return option_value ? option_value : "";
|
||||
}
|
||||
|
|
@ -652,6 +650,7 @@ static int operate_DeviceInfoFirmwareImage_Activate(char *refparam, struct dmctx
|
|||
return USP_FAULT_COMMAND_FAILURE;
|
||||
|
||||
if (DM_STRLEN(start_time[0])) {
|
||||
// cppcheck-suppress cert-MSC24-C
|
||||
FILE *file = fopen(CRONTABS_ROOT, "a");
|
||||
if (!file)
|
||||
return USP_FAULT_COMMAND_FAILURE;
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@
|
|||
#include "fwbank.h"
|
||||
|
||||
#ifdef SYSMNGR_FWBANK_UBUS_SUPPORT
|
||||
char fw_image_dependency[] = "file:/etc/sysmngr/fwbank";
|
||||
const char fw_image_dependency[] = "file:/etc/sysmngr/fwbank";
|
||||
#define FWBANK_FILE_PATH "/etc/sysmngr/fwbank"
|
||||
#else
|
||||
char fw_image_dependency[] = "file:/usr/libexec/rpcd/fwbank";
|
||||
const char fw_image_dependency[] = "file:/usr/libexec/rpcd/fwbank";
|
||||
#define FWBANK_FILE_PATH "/usr/libexec/rpcd/fwbank"
|
||||
#endif
|
||||
|
||||
|
|
@ -54,8 +54,8 @@ typedef struct sysmngr_task_data {
|
|||
struct uloop_timeout timeoutcb; // Timeout for the task
|
||||
sysmngr_task_callback_t finishcb; // Finish callback for parent process
|
||||
const char *command; // Command to execute
|
||||
int pipe_fds[2];
|
||||
uint32_t bank_id;
|
||||
int pipe_fds[2];
|
||||
} sysmngr_task_data_t;
|
||||
|
||||
struct blobmsg_policy sysmngr_dump_policy[] = {
|
||||
|
|
|
|||
11
src/memory.c
11
src/memory.c
|
|
@ -47,6 +47,7 @@ int sysmngr_meminfo(mem_info *info)
|
|||
char *key = NULL, *val = NULL;
|
||||
char line[256];
|
||||
|
||||
// cppcheck-suppress cert-MSC24-C
|
||||
if ((f = fopen("/proc/meminfo", "r")) == NULL) {
|
||||
BBF_ERR("Failed to open '/proc/meminfo' for reading memory info.");
|
||||
return -1;
|
||||
|
|
@ -60,15 +61,15 @@ int sysmngr_meminfo(mem_info *info)
|
|||
continue;
|
||||
|
||||
if (!strcasecmp(key, "MemTotal"))
|
||||
info->mem_total = atol(val);
|
||||
info->mem_total = strtol(val, NULL, 10);
|
||||
else if (!strcasecmp(key, "MemFree"))
|
||||
info->mem_free = atol(val);
|
||||
info->mem_free = strtol(val, NULL, 10);
|
||||
else if (!strcasecmp(key, "Buffers"))
|
||||
info->buffers = atol(val);
|
||||
info->buffers = strtol(val, NULL, 10);
|
||||
else if (!strcasecmp(key, "Cached"))
|
||||
info->cached = atol(val);
|
||||
info->cached = strtol(val, NULL, 10);
|
||||
else if (!strcasecmp(key, "SReclaimable"))
|
||||
info->sreclaimable = atol(val);
|
||||
info->sreclaimable = strtol(val, NULL, 10);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ static void get_jif_val(jiffy_counts_t *p_jif)
|
|||
char line[128];
|
||||
int ret;
|
||||
|
||||
// cppcheck-suppress cert-MSC24-C
|
||||
if ((file = fopen("/proc/stat", "r"))) {
|
||||
while(fgets(line, sizeof(line), file) != NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ static void get_boot_option_value(const char *option_name, char *buffer, size_t
|
|||
|
||||
buffer[0] = '\0';
|
||||
|
||||
// cppcheck-suppress cert-MSC24-C
|
||||
FILE *file = fopen(RESET_REASON_PATH, "r");
|
||||
if (!file)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue