diff --git a/src/swmod.c b/src/swmod.c index d1938af5ac157e08f17c9b364eb277ad3b11c957..c1f09b8a9b4c55138d34b5c5f70af37570acbfbb 100644 --- a/src/swmod.c +++ b/src/swmod.c @@ -553,8 +553,6 @@ swmod_du_list(struct ubus_context *ctx, struct ubus_object *obj, void *a; unsigned int eid = get_eid_from_blob(msg); - synchronize_deployment_units_with_map_du_file(); - memset(&bb, 0, sizeof(struct blob_buf)); blob_buf_init(&bb, 0); diff --git a/src/swmod_lxc.c b/src/swmod_lxc.c index 4edc69f53256f6503916bc1f1931e25b1678e721..42390db4ee5d2dd7a98945f8f96ea4ac7d9f120f 100644 --- a/src/swmod_lxc.c +++ b/src/swmod_lxc.c @@ -675,6 +675,12 @@ int swmod_lxc_install_update_remove_package(const char *package_path, int cid, i sscanf(g_lxc_buff, "pkg_name=%63s pkg_version=%63s", package_name, package_version); } + + char root[512]; + snprintf(root, 512, "%s/%s/rootfs", lxcpath, ct->name); + PRINT_DEBUG("Reading from container[%s] path[%s]", ct->name, root); + populate_opkg_deployment_unit(cid + 2, root, ct->name); + FREE(g_lxc_buff); err = 0; } diff --git a/src/swmod_opkg.c b/src/swmod_opkg.c index 22d0b33285cfb620612d23ca0ecc9eb2413b2c58..2432d6c57788ad76ab40241f6551cbdd4164bd90 100644 --- a/src/swmod_opkg.c +++ b/src/swmod_opkg.c @@ -60,6 +60,11 @@ static int swmod_host_system_install_package(const char *package_path) pclose(log); } + if (err == 0) { + /* du unit installed, now update the du list */ + PRINT_DEBUG("Populate du for eid 1\n"); + populate_opkg_deployment_unit(1, NULL, NULL); + } return err; } @@ -88,6 +93,11 @@ static int swmod_host_system_update_package(const char *package_path) package_version[len - 3] = '\0'; } + if (err == 0) { + /* du unit updated, now update the du list */ + PRINT_DEBUG("Populate du for eid 1\n"); + populate_opkg_deployment_unit(1, NULL, NULL); + } return err; } @@ -110,6 +120,11 @@ int swmod_host_system_remove_package(const char *pname) pclose(log); } + if (err == 0) { + /* du unit removed, now update the du list */ + PRINT_DEBUG("Populate du for eid 1\n"); + populate_opkg_deployment_unit(1, NULL, NULL); + } return err; } @@ -220,7 +235,7 @@ int swmod_remove_package(const char *pname, int eid) bool is_opkg_service(const char *opkg_info, char *pkg_name) { /* Get Config from package_name.list */ - bool service = true; + bool service = false; char pkg_path[128] = {0}; snprintf(pkg_path, sizeof(pkg_path), "%s/%s.list", opkg_info, pkg_name);