Browse Source

auc: small improvements

Detect if calling rpc-sys packagelist fails due to the method not
being provided by rpcd.
Mark package as experimental.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
lilik-openwrt-22.03
Daniel Golle 7 years ago
parent
commit
123ddf66ae
2 changed files with 11 additions and 24 deletions
  1. +2
    -2
      utils/auc/Makefile
  2. +9
    -22
      utils/auc/src/auc.c

+ 2
- 2
utils/auc/Makefile View File

@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=auc
PKG_VERSION:=0.0.1
PKG_VERSION:=0.0.2
PKG_RELEASE=1
PKG_LICENSE:=GPL-3.0
@ -15,7 +15,7 @@ include $(INCLUDE_DIR)/cmake.mk
define Package/auc
SECTION:=base
CATEGORY:=Base system
TITLE:=attended sysupgrade (CLI version)
TITLE:=Attended sysUpgrade CLI (EXPERIMENTAL)
DEPENDS:=+attendedsysupgrade-common +libblobmsg-json +libubox +libubus \
+libuci +libuclient +rpcd-mod-rpcsys
endef


+ 9
- 22
utils/auc/src/auc.c View File

@ -683,17 +683,15 @@ int main(int args, char *argv[]) {
blobmsg_buf_init(&imgbuf);
blobmsg_buf_init(&upgbuf);
if (!ubus_lookup_id(ctx, "system", &id)) {
ubus_invoke(ctx, id, "board", NULL, board_cb, &checkbuf, 3000);
} else {
if (ubus_lookup_id(ctx, "system", &id) ||
ubus_invoke(ctx, id, "board", NULL, board_cb, &checkbuf, 3000)) {
fprintf(stderr, "cannot request board info from procd\n");
rc=-1;
goto freebufs;
}
if (!ubus_lookup_id(ctx, "rpc-sys", &id)) {
ubus_invoke(ctx, id, "packagelist", NULL, pkglist_cb, &checkbuf, 3000);
} else {
if (ubus_lookup_id(ctx, "rpc-sys", &id) ||
ubus_invoke(ctx, id, "packagelist", NULL, pkglist_cb, &checkbuf, 3000)) {
fprintf(stderr, "cannot request packagelist from rpcd\n");
rc=-1;
goto freeboard;
@ -741,10 +739,7 @@ int main(int args, char *argv[]) {
}
if (retry || queuepos) {
if (imgbuf.buf)
free(imgbuf.buf);
memset(&imgbuf, '\0', sizeof(imgbuf));
blob_buf_free(&imgbuf);
blobmsg_buf_init(&imgbuf);
sleep(3);
}
@ -828,19 +823,11 @@ freeboard:
free(version);
free(revision);
freebufs:
if (checkbuf.buf)
free(checkbuf.buf);
if (reqbuf.buf)
free(reqbuf.buf);
if (imgbuf.buf)
free(imgbuf.buf);
if (upgbuf.buf)
free(upgbuf.buf);
blob_buf_free(&checkbuf);
blob_buf_free(&reqbuf);
blob_buf_free(&imgbuf);
blob_buf_free(&upgbuf);
freessl:
if (ssl_ctx)


Loading…
Cancel
Save