mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-01-27 17:37:17 +01:00
commit dmmap on initial refresh instance
This commit is contained in:
parent
583fa5dfb9
commit
f13c2a5a9a
4 changed files with 31 additions and 7 deletions
|
|
@ -2483,14 +2483,14 @@ static int mparam_get_references_db(DMPARAM_ARGS)
|
|||
if (node->is_instanceobj == 0)
|
||||
return 0;
|
||||
|
||||
char full_param[MAX_DM_PATH] = {0};
|
||||
char *value = dmstrdup("");
|
||||
|
||||
snprintf(full_param, sizeof(full_param), "%s%s", node->current_object, leaf->parameter);
|
||||
|
||||
(leaf->getvalue)(full_param, dmctx, data, instance, &value);
|
||||
|
||||
if (leaf->dm_flags & DM_FLAG_LINKER) {
|
||||
char full_param[MAX_DM_PATH] = {0};
|
||||
char *value = dmstrdup("");
|
||||
|
||||
snprintf(full_param, sizeof(full_param), "%s%s", node->current_object, leaf->parameter);
|
||||
|
||||
(leaf->getvalue)(full_param, dmctx, data, instance, &value);
|
||||
|
||||
add_path((struct list_head *)dmctx->addobj_instance, full_param, value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1117,6 +1117,28 @@ int bbfdm_refresh_references(unsigned int dm_type, const char *srv_obj_name)
|
|||
|
||||
bbf_init(&bbf_ctx);
|
||||
int res = bbfdm_cmd_exec(&bbf_ctx, BBF_REFERENCES_DB);
|
||||
|
||||
if (G_SERVICE_BOOTSTRAP == true) {
|
||||
G_SERVICE_BOOTSTRAP = false;
|
||||
|
||||
if (bbf_ctx.modified_uci_head != NULL) {
|
||||
struct dm_modified_uci *m;
|
||||
list_for_each_entry(m, bbf_ctx.modified_uci_head, list) {
|
||||
char *p = NULL;
|
||||
|
||||
if (DM_STRNCMP(m->uci_file, "/etc/bbfdm/dmmap/", 17) != 0)
|
||||
continue;
|
||||
|
||||
p = m->uci_file + 17;
|
||||
if (DM_STRLEN(p) == 0)
|
||||
continue;
|
||||
|
||||
BBF_INFO("Commit dmmap file: %s at INIT on refresh_reference", p);
|
||||
dmuci_commit_package_bbfdm(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bbf_cleanup(&bbf_ctx);
|
||||
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
extern DMOBJ *DEAMON_DM_ROOT_OBJ;
|
||||
extern DM_MAP_OBJ *INTERNAL_ROOT_TREE;
|
||||
extern bool G_SERVICE_BOOTSTRAP;
|
||||
|
||||
bool validate_msglen(bbfdm_data_t *data);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
DMOBJ *DEAMON_DM_ROOT_OBJ = NULL;
|
||||
DM_MAP_OBJ *INTERNAL_ROOT_TREE = NULL;
|
||||
bool G_SERVICE_BOOTSTRAP = true;
|
||||
|
||||
int bbfdm_cmd_exec(struct dmctx *bbf_ctx, int cmd)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue