From eb4ee4917d1464fb92c642289de2a42b63424dac Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 20 Jun 2024 09:44:51 +0200 Subject: [PATCH 1/7] package/curios-httpd: bump to v24.05.0 - Fixes to missing BusyBox tools (cat) - Bump Buildroot to this year's LTS (2024.02) Signed-off-by: Joachim Wiberg --- package/curios-httpd/curios-httpd.hash | 4 ++-- package/curios-httpd/curios-httpd.mk | 2 +- test/infamy/container.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/curios-httpd/curios-httpd.hash b/package/curios-httpd/curios-httpd.hash index 57e9fa25c9..bbb8a3bda0 100644 --- a/package/curios-httpd/curios-httpd.hash +++ b/package/curios-httpd/curios-httpd.hash @@ -1,4 +1,4 @@ # Locally computed sha256 ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6 COPYING -sha256 b47eac9c7a6a25e0e38e8c993b862b88322ddfb226dba59674ee1c37f9ea4749 curios-httpd-oci-arm64-v24.03.0.tar.gz -sha256 36bf6b27b54b1bccc68fd6156f6d6bb3b7e7851df90d56c614b1e4e056e170d9 curios-httpd-oci-amd64-v24.03.0.tar.gz +sha256 988a523bf4be543cb4ea1d3472ce4720e0b92511546817028b90150a3f054e9f curios-httpd-oci-arm64-v24.05.0.tar.gz +sha256 25f94a7c44cdbbceca3f89382b8bea0dcd8d178032c97a9113bb69bbc1770528 curios-httpd-oci-amd64-v24.05.0.tar.gz diff --git a/package/curios-httpd/curios-httpd.mk b/package/curios-httpd/curios-httpd.mk index 8883fe0b69..0298390442 100644 --- a/package/curios-httpd/curios-httpd.mk +++ b/package/curios-httpd/curios-httpd.mk @@ -4,7 +4,7 @@ # ################################################################################ -CURIOS_HTTPD_VERSION = v24.03.0 +CURIOS_HTTPD_VERSION = v24.05.0 CURIOS_HTTPD_SOURCE = curios-httpd-oci-$(GO_GOARCH)-$(CURIOS_HTTPD_VERSION).tar.gz CURIOS_HTTPD_SITE = https://github.com/kernelkit/curiOS/releases/download/$(CURIOS_HTTPD_VERSION) CURIOS_HTTPD_LICENSE = GPL diff --git a/test/infamy/container.py b/test/infamy/container.py index 9f960f7bdb..971e2a9348 100644 --- a/test/infamy/container.py +++ b/test/infamy/container.py @@ -2,7 +2,7 @@ class Container: """Helper methods""" - IMAGE = "curios-httpd-v24.03.0.tar.gz" + IMAGE = "curios-httpd-v24.05.0.tar.gz" def __init__(self, target): self.system = target From eef03879f37dc96c0dc8fceed2e26bd06ae381bb Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 22 Jun 2024 09:55:34 +0200 Subject: [PATCH 2/7] confd: fix warning in call to initctl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ietf-system.c: In function ‘change_hostname’: ietf-system.c:1722:9: warning: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 1722 | system("initctl -nbq touch netbrowse"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Joachim Wiberg --- src/confd/src/ietf-system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/confd/src/ietf-system.c b/src/confd/src/ietf-system.c index 233196488d..72d2eb2786 100644 --- a/src/confd/src/ietf-system.c +++ b/src/confd/src/ietf-system.c @@ -1719,7 +1719,7 @@ static int change_hostname(sr_session_ctx_t *session, uint32_t sub_id, const cha /* Inform any running lldpd and avahi of the change ... */ systemf("lldpcli configure system hostname %s", hostnm); systemf("avahi-set-host-name %s", hostnm); - system("initctl -nbq touch netbrowse"); + systemf("initctl -nbq touch netbrowse"); err: if (hostnm) free(hostnm); From eb0c89b87fdcdb54a154dbcb65b3192ea94c00e4 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 22 Jun 2024 12:08:24 +0200 Subject: [PATCH 3/7] execd: add support for SNN and KNN queue scripts This change makes sure execd calls KNN style scripts before SNN, allowing confd to post teardown jobs that are guaranteed to run before any jobs to create new resources run. Signed-off-by: Joachim Wiberg --- src/execd/execd.c | 73 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 16 deletions(-) diff --git a/src/execd/execd.c b/src/execd/execd.c index 04cd2688ea..d28ff5cd3f 100644 --- a/src/execd/execd.c +++ b/src/execd/execd.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: ISC */ +#include #include #include #include @@ -31,7 +32,7 @@ static int logmask = LOG_UPTO(LOG_NOTICE); static char buffer[BUFSIZ]; static char *done; -static void run_job(char *path, char *file) +static void run_job(const char *path, char *file, int archive) { char cmd[strlen(path) + strlen(file) + 2]; int rc; @@ -57,32 +58,67 @@ static void run_job(char *path, char *file) } dbg("job %s in %s done", file, path); - if (done) + if (done && archive) movefile(cmd, done); else erase(cmd); } -static void run_queue(char *path) +/* + * Allow SNN and KNN style jobs, for inotyify_cb() we also allow + * a type '*' just to figure out if a job should be archived in + * the done directory. + */ +static int check(const char *name, int type, int *archive) +{ + if (!name || strlen(name) < 3) + return -1; + + if (isdigit(name[1]) && isdigit(name[2])) { + if (type == '*') + type = name[0]; + + switch (type) { + case 'K': + *archive = 0; + return 0; + case 'S': + *archive = 1; + return 0; + default: + break; + } + } + + return 1; +} + +static void run_dir(const char *path, int type) { - struct dirent *d; - DIR *dir; + struct dirent **namelist; + int archive = 0; + int n, i; - dir = opendir(path); - if (!dir) { - err("opendir"); + n = scandir(path, &namelist, NULL, alphasort); + if (n < 0) { + err("scandir %s", path); return; } - while ((d = readdir(dir))) { - dbg("Running queue %s entry %s", path, d->d_name); - if (d->d_name[0] == '.') - continue; + for (i = 0; i < n; i++) { + if (!check(namelist[i]->d_name, type, &archive)) + run_job(path, namelist[i]->d_name, archive); - run_job(path, d->d_name); + free(namelist[i]); } - closedir(dir); + free(namelist); +} + +static void run_queue(char *path) +{ + run_dir(path, 'K'); + run_dir(path, 'S'); } static void signal_cb(uev_t *w, void *arg, int _) @@ -113,10 +149,15 @@ static void inotify_cb(uev_t *w, void *arg, int _) for (char *p = buffer; p < buffer + bytes;) { struct inotify_event *event = (struct inotify_event *)p; + char *name = event->name; + int archive; if (event->mask & (IN_CLOSE_WRITE | IN_ATTRIB | IN_MOVED_TO)) { - dbg("Got inotify event %s 0x%04x", event->name, event->mask); - run_job(arg, event->name); + dbg("Got inotify event %s 0x%04x", name, event->mask); + if (check(name, '*', &archive)) + continue; + + run_job(arg, name, archive); } p += sizeof(struct inotify_event) + event->len; From 8f40f90ac2742b3d94fcdbd661e43f7266cd3603 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 22 Jun 2024 12:10:24 +0200 Subject: [PATCH 4/7] confd: when disabling containers, delete in background Instead of potentially blocking sysrepo, which has a 5 second timeout, we move 'container delete' jobs to be run by the execd queue. Fixes #479 Signed-off-by: Joachim Wiberg --- src/confd/src/infix-containers.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/confd/src/infix-containers.c b/src/confd/src/infix-containers.c index 6f9c477c52..c11e66cbc7 100644 --- a/src/confd/src/infix-containers.c +++ b/src/confd/src/infix-containers.c @@ -28,9 +28,9 @@ static int add(const char *name, struct lyd_node *cif) struct lyd_node *node, *nets, *caps; FILE *fp, *ap; - fp = fopenf("w", "%s/%s.sh", INBOX_QUEUE, name); + fp = fopenf("w", "%s/S01-%s.sh", INBOX_QUEUE, name); if (!fp) { - ERRNO("Failed adding job %s.sh to job queue" INBOX_QUEUE, name); + ERRNO("Failed adding job S01-%s.sh to job queue" INBOX_QUEUE, name); return SR_ERR_SYS; } @@ -187,6 +187,7 @@ static int del(const char *name) INBOX_QUEUE, ACTIVE_QUEUE, }; + FILE *fp; /* Remove any pending download/create job first */ for (size_t i = 0; i < NELEMS(queue); i++) { @@ -196,8 +197,21 @@ static int del(const char *name) erase(fn); } - return systemf("container delete %s", name) || - systemf("initctl -bnq disable container@%s.conf", name); + /* Disable service and schedule for deletion. */ + systemf("initctl -bnq disable container@%s.conf", name); + + fp = fopenf("w", "%s/K01-%s.sh", INBOX_QUEUE, name); + if (!fp) { + ERRNO("Failed adding job 00-delete-%s.sh to job queue" INBOX_QUEUE, name); + return SR_ERR_SYS; + } + + fprintf(fp, "#!/bin/sh\n" + "container delete %s\n", name); + fchmod(fileno(fp), 0700); + fclose(fp); + + return SR_ERR_OK; } static int change(sr_session_ctx_t *session, uint32_t sub_id, const char *module, From ddd50d53f6204879e43338dadbe4519f29a5e99f Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 22 Jun 2024 12:40:55 +0200 Subject: [PATCH 5/7] statd: increase port column width for 'show bridge mdb' Fixes #462 Signed-off-by: Joachim Wiberg --- src/statd/python/cli_pretty/cli_pretty.py | 2 +- test/case/cli/cli-output/show-bridge-mdb.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/statd/python/cli_pretty/cli_pretty.py b/src/statd/python/cli_pretty/cli_pretty.py index df45102e4e..214f5aeb3c 100755 --- a/src/statd/python/cli_pretty/cli_pretty.py +++ b/src/statd/python/cli_pretty/cli_pretty.py @@ -14,7 +14,7 @@ class PadMdb: bridge = 7 vlan = 6 group = 20 - ports = 20 + ports = 45 class PadRoute: prefix = 30 diff --git a/test/case/cli/cli-output/show-bridge-mdb.txt b/test/case/cli/cli-output/show-bridge-mdb.txt index 889850f620..31fd481c69 100644 --- a/test/case/cli/cli-output/show-bridge-mdb.txt +++ b/test/case/cli/cli-output/show-bridge-mdb.txt @@ -1,4 +1,4 @@ -BRIDGE VID GROUP PORTS  +BRIDGE VID GROUP PORTS  br0 230.1.32.100 e0 br0 230.1.2.100 e1 br0 01:01:01:01:01:01 e1 From ef8920b6460a868091d498680b7c04b4e11b1695 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 22 Jun 2024 20:55:39 +0200 Subject: [PATCH 6/7] package/klish: bump for improved error message on missing command Replaces: Error: Illegal command with: Error: Command not found, or incomplete. Try ? for help or Tab for completion. Signed-off-by: Joachim Wiberg --- package/klish/klish.hash | 2 +- package/klish/klish.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/klish/klish.hash b/package/klish/klish.hash index 7fad7f0bf7..5b7074e97c 100644 --- a/package/klish/klish.hash +++ b/package/klish/klish.hash @@ -1,3 +1,3 @@ # Locally calculated sha256 9d9d33b873917ca5d0bdcc47a36d2fd385971ab0c045d1472fcadf95ee5bcf5b LICENCE -sha256 c80c2b7eee248d80989fd6218068fe89457d034e3da6db8f0f18cad509e8d52d klish-4afbb469613071503f38c21d54efde97dec86109-br1.tar.gz +sha256 eca394cd4b0e1d5da583e3dd7f7c7b71350f53c10fe5f208b5d00e34a77ea111 klish-1af2393234d0d73d6cc3bbf2dc028174298f3fec-br1.tar.gz diff --git a/package/klish/klish.mk b/package/klish/klish.mk index b16b5014c3..1db8fe0360 100644 --- a/package/klish/klish.mk +++ b/package/klish/klish.mk @@ -4,7 +4,7 @@ # ################################################################################ -KLISH_VERSION = 4afbb469613071503f38c21d54efde97dec86109 +KLISH_VERSION = 1af2393234d0d73d6cc3bbf2dc028174298f3fec KLISH_SITE = https://github.com/kernelkit/klish.git #KLISH_VERSION = tags/3.0.0 #KLISH_SITE = https://src.libcode.org/pkun/klish.git From d885952c142ca0bae555d4d3a3ad7b9834c300ca Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 24 Jun 2024 10:04:59 +0200 Subject: [PATCH 7/7] doc: update changelog for upcoming release Signed-off-by: Joachim Wiberg --- doc/ChangeLog.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index e8426bfc21..4ae1fe5f92 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -14,6 +14,7 @@ All notable changes to the project are documented in this file. ### Changes - Upgrade Buildroot to 2024.02.3 (LTS) - Upgrade Linux kernel to 6.6.34 (LTS) +- Upgrade bundled curiOS httpd container to v24.05.0 - Default web landing page refactored into a Buildroot package to make it possible to overload from customer repos. - Enable DCB support in aarch64 kernel (for EtherType prio override) @@ -60,6 +61,7 @@ All notable changes to the project are documented in this file. - Issue #478: add operational support for ietf-system.yang, reading actual hostname and passwords after issue #435 - Merge infix-shell-types.yang with infix-system.yang +- cli: improved error/warning message on missing or incomplete command [yescrypt]: https://en.wikipedia.org/wiki/Yescrypt) @@ -75,17 +77,21 @@ All notable changes to the project are documented in this file. secure mode, causing the system to end up in an undefined state - Fix #453: fix inconsistent behavior of custom MAC address (interface `phys-address` for VETH pairs. Allows fixed MAC in containers +- Fix #462: increase port column width for CLI `show bridge mdb` - Fix #468: non-admin users can get a POSIX shell as login shell, root cause was buggy Augeas library, replaced with plain C API. - Fix #469: non-admin users added to *any* group get administrator privileges (added to UNIX `wheel` group) - Fix #473: bridge interface with IPv6 SLAAC never get global prefix +- Fix #476: Custom command for containers not working +- Fix #479: timeout from underlying datastore when disabling containers + in configuration. Only disabling (stopping) container now done in the + configuration change, removal of container done in the background - Fix locking issue with standard counter groups on `mv88e6xxx` - Add missing LICENSE hash for factory reset tool - Fix timeout handling in container restart command - Fix MDB/ATU synchronization issue from IGMPv3/MLDv2 reports on `mv88e6xxx` systems -- Fix #476: Custom command for containers not working [v24.04.2][] - 2024-05-15 -------------------------