Update buildroot
Update buildroot (branch cesnet/2023-06-12). This also contains a patch
to fix libcurl build[1] which I had on my local dev machine.
New buildroot also builds systemd 252.4 so necessary patch update added.
Also added perl-English package to our CI machines to silence the
following build error:
2023-06-12 12:42:55.964693 | w | Your Perl installation is not complete enough; at least the following
2023-06-12 12:42:55.964825 | w | modules are missing:
2023-06-12 12:42:55.964844 | w |
2023-06-12 12:42:55.964856 | w | English
2023-06-12 12:42:55.964866 | w |
Systemd 252 added naming scheme for net links with devicetree
aliases[2]. This renames our eth{0,1} to end{1,2} which is undesirable
because the boxes physical ports are labelled eth{0,1,2}. Oh and I forgot:
The network does not start after the boot because we expect the names
to be eth{0,1}. So let's make sure our names stay eth{0,1,2}.
[1] https://bugs.buildroot.org/show_bug.cgi?id=15181
[2] https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html
Change-Id: I6a59388216fde516b58b080f8aafdfb5136981d2
diff --git a/.zuul.yaml b/.zuul.yaml
index 6386059..58b5008 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -1,6 +1,7 @@
- job:
name: czechlight-clearfog
parent: run-ci-build-sh-f38
+ pre-run: ci/pre.yaml
timeout: 3600
post-timeout: 600
vars:
diff --git a/board/czechlight/clearfog/overlay/usr/lib/systemd/system-generators/osc b/board/czechlight/clearfog/overlay/usr/lib/systemd/system-generators/eth-links
similarity index 70%
rename from board/czechlight/clearfog/overlay/usr/lib/systemd/system-generators/osc
rename to board/czechlight/clearfog/overlay/usr/lib/systemd/system-generators/eth-links
index ffaa6d1..a6f45ae 100755
--- a/board/czechlight/clearfog/overlay/usr/lib/systemd/system-generators/osc
+++ b/board/czechlight/clearfog/overlay/usr/lib/systemd/system-generators/eth-links
@@ -4,6 +4,21 @@
mkdir -p /run/systemd/network
+# custom names for ethernet ports (bypassing systemd's predictive naming)
+cat > /run/systemd/network/30-eth0.link <<EOF
+[Match]
+Path=platform-f1070000.ethernet
+[Link]
+Name=eth0
+EOF
+
+cat > /run/systemd/network/30-eth1.link <<EOF
+[Match]
+Path=platform-f1030000.ethernet
+[Link]
+Name=eth1
+EOF
+
# custom names for OSC channels
if grep -q '\<czechlight=sdn-roadm-line.*\>' /proc/cmdline; then
ETH2_NAME=osc
@@ -11,6 +26,8 @@
ETH2_NAME=oscW
ETH3_NAME=oscE
ETH4_NAME=sfp3
+else
+ ETH2_NAME=eth2
fi
if [[ -n "${ETH2_NAME+set}" ]] ; then
diff --git a/board/czechlight/common/patches/systemd/0001-network-Serialize-LLDP-neighbor-to-JSON-format.patch b/board/czechlight/common/patches/systemd/0001-network-Serialize-LLDP-neighbor-to-JSON-format.patch
index 79fcb9d..b0c1d62 100644
--- a/board/czechlight/common/patches/systemd/0001-network-Serialize-LLDP-neighbor-to-JSON-format.patch
+++ b/board/czechlight/common/patches/systemd/0001-network-Serialize-LLDP-neighbor-to-JSON-format.patch
@@ -1,7 +1,7 @@
-From 8d3bd15463b31c5b3347239317fcf1f41d467838 Mon Sep 17 00:00:00 2001
+From dadca2c91fa18a18445659b41f182b0793dce566 Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@users.noreply.github.com>
Date: Thu, 7 Oct 2021 11:16:57 +0200
-Subject: [PATCH 1/9] network: Serialize LLDP neighbor to JSON format
+Subject: [PATCH 1/7] network: Serialize LLDP neighbor to JSON format
Add functions serializing LLDP neighbors to JSON (JsonVariant).
@@ -15,7 +15,7 @@
3 files changed, 71 insertions(+), 1 deletion(-)
diff --git a/src/libsystemd-network/lldp-neighbor.c b/src/libsystemd-network/lldp-neighbor.c
-index 44847b2b92..cacad8adea 100644
+index 6672409d75..5fb7669e09 100644
--- a/src/libsystemd-network/lldp-neighbor.c
+++ b/src/libsystemd-network/lldp-neighbor.c
@@ -5,6 +5,7 @@
@@ -26,14 +26,14 @@
#include "lldp-neighbor.h"
#include "memory-util.h"
#include "missing_network.h"
-@@ -790,3 +791,24 @@ int sd_lldp_neighbor_get_timestamp(sd_lldp_neighbor *n, clockid_t clock, uint64_
+@@ -794,3 +795,24 @@ int sd_lldp_neighbor_get_timestamp(sd_lldp_neighbor *n, clockid_t clock, uint64_
*ret = triple_timestamp_by_clock(&n->timestamp, clock);
return 0;
}
+
+_public_ int sd_lldp_neighbor_build_json(sd_lldp_neighbor *n, JsonVariant **ret) {
+ const char *chassis_id = NULL, *port_id = NULL, *system_name = NULL, *port_description = NULL;
-+ uint16_t cc;
++ uint16_t cc = 0;
+ bool valid_cc;
+
+ (void) sd_lldp_neighbor_get_chassis_id_as_string(n, &chassis_id);
@@ -52,7 +52,7 @@
+ JSON_BUILD_PAIR_CONDITION(port_description, "portDescription", JSON_BUILD_STRING(port_description))))));
+}
diff --git a/src/libsystemd-network/sd-lldp-rx.c b/src/libsystemd-network/sd-lldp-rx.c
-index 34bdcb644b..ae4d2d599c 100644
+index 0479cff5f5..ec1a0bae54 100644
--- a/src/libsystemd-network/sd-lldp-rx.c
+++ b/src/libsystemd-network/sd-lldp-rx.c
@@ -10,6 +10,7 @@
@@ -63,7 +63,7 @@
#include "lldp-neighbor.h"
#include "lldp-network.h"
#include "lldp-rx-internal.h"
-@@ -492,7 +493,50 @@ int sd_lldp_rx_get_neighbors(sd_lldp_rx *lldp_rx, sd_lldp_neighbor ***ret) {
+@@ -491,7 +492,50 @@ int sd_lldp_rx_get_neighbors(sd_lldp_rx *lldp_rx, sd_lldp_neighbor ***ret) {
return k;
}
@@ -116,7 +116,7 @@
assert_return(m > 0, -EINVAL);
diff --git a/src/systemd/sd-lldp-rx.h b/src/systemd/sd-lldp-rx.h
-index bfeac14ce3..8a538b2444 100644
+index 504d7f59c1..ec9b8edf76 100644
--- a/src/systemd/sd-lldp-rx.h
+++ b/src/systemd/sd-lldp-rx.h
@@ -32,6 +32,8 @@ _SD_BEGIN_DECLARATIONS;
@@ -125,7 +125,7 @@
+typedef struct JsonVariant JsonVariant;
+
- typedef enum sd_lldp_rx_event_t {
+ __extension__ typedef enum sd_lldp_rx_event_t {
SD_LLDP_RX_EVENT_ADDED,
SD_LLDP_RX_EVENT_REMOVED,
@@ -67,10 +69,12 @@ int sd_lldp_rx_match_capabilities(sd_lldp_rx *lldp_rx, uint16_t mask);
@@ -142,5 +142,5 @@
/* Access to LLDP frame metadata */
int sd_lldp_neighbor_get_source_address(sd_lldp_neighbor *n, struct ether_addr* address);
--
-2.35.1
+2.41.0
diff --git a/board/czechlight/common/patches/systemd/0002-network-Add-varlink-server.patch b/board/czechlight/common/patches/systemd/0002-network-Add-varlink-server.patch
index 6302127..bb16f0c 100644
--- a/board/czechlight/common/patches/systemd/0002-network-Add-varlink-server.patch
+++ b/board/czechlight/common/patches/systemd/0002-network-Add-varlink-server.patch
@@ -1,25 +1,25 @@
-From 210ae903e7f5e4813feaea9bbac1f03fa3be42cc Mon Sep 17 00:00:00 2001
+From 00b203ad445b40faf5836a3ca9a6c1ec89165c23 Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@users.noreply.github.com>
Date: Tue, 24 Aug 2021 14:59:40 +0200
-Subject: [PATCH 2/9] network: Add varlink server
+Subject: [PATCH 2/7] network: Add varlink server
Add a varlink server. In the next commits, we will implement a method
that queries the LLDP neighbors.
---
src/network/meson.build | 2 ++
src/network/networkd-manager.c | 7 +++++++
- src/network/networkd-manager.h | 3 +++
+ src/network/networkd-manager.h | 11 +++++++----
src/network/networkd-varlink.c | 34 ++++++++++++++++++++++++++++++++++
src/network/networkd-varlink.h | 7 +++++++
- 5 files changed, 53 insertions(+)
+ 5 files changed, 57 insertions(+), 4 deletions(-)
create mode 100644 src/network/networkd-varlink.c
create mode 100644 src/network/networkd-varlink.h
diff --git a/src/network/meson.build b/src/network/meson.build
-index 48d185195c..d93e815fdf 100644
+index b09c18dbbd..90ae4ed238 100644
--- a/src/network/meson.build
+++ b/src/network/meson.build
-@@ -137,6 +137,8 @@ sources = files(
+@@ -145,6 +145,8 @@ sources = files(
'networkd-sysctl.h',
'networkd-util.c',
'networkd-util.h',
@@ -27,20 +27,20 @@
+ 'networkd-varlink.h',
'networkd-wifi.c',
'networkd-wifi.h',
- 'tc/cake.c',
+ 'networkd-wiphy.c',
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
-index 9d790224cc..5e4c5e38b4 100644
+index cdfd29bc0e..9f859408a1 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
-@@ -41,6 +41,7 @@
+@@ -44,6 +44,7 @@
#include "networkd-routing-policy-rule.h"
#include "networkd-speed-meter.h"
#include "networkd-state-file.h"
+#include "networkd-varlink.h"
#include "networkd-wifi.h"
+ #include "networkd-wiphy.h"
#include "ordered-set.h"
- #include "path-lookup.h"
-@@ -544,6 +545,8 @@ Manager* manager_free(Manager *m) {
+@@ -667,6 +668,8 @@ Manager* manager_free(Manager *m) {
m->fw_ctx = fw_ctx_free(m->fw_ctx);
@@ -49,7 +49,7 @@
return mfree(m);
}
-@@ -553,6 +556,10 @@ int manager_start(Manager *m) {
+@@ -676,6 +679,10 @@ int manager_start(Manager *m) {
assert(m);
@@ -61,7 +61,7 @@
if (r < 0)
return log_error_errno(r, "Failed to initialize speed meter: %m");
diff --git a/src/network/networkd-manager.h b/src/network/networkd-manager.h
-index 36313589a3..a0c0336ce5 100644
+index 40e6092f85..dfdd44baf8 100644
--- a/src/network/networkd-manager.h
+++ b/src/network/networkd-manager.h
@@ -16,6 +16,7 @@
@@ -72,15 +72,37 @@
struct Manager {
sd_netlink *rtnl;
-@@ -95,6 +96,8 @@ struct Manager {
- FirewallContext *fw_ctx;
+@@ -62,8 +63,8 @@ struct Manager {
+ bool has_product_uuid;
+ bool product_uuid_requested;
+- char* dynamic_hostname;
+- char* dynamic_timezone;
++ char *dynamic_hostname;
++ char *dynamic_timezone;
+
+ Set *rules;
+
+@@ -100,10 +101,12 @@ struct Manager {
OrderedSet *request_queue;
+
+ Hashmap *tuntap_fds_by_name;
+
+ VarlinkServer *varlink_server;
};
int manager_new(Manager **ret, bool test_mode);
+-Manager* manager_free(Manager *m);
++Manager *manager_free(Manager *m);
+
+ int manager_setup(Manager *m);
+ int manager_start(Manager *m);
+@@ -115,4 +118,4 @@ int manager_enumerate(Manager *m);
+ int manager_set_hostname(Manager *m, const char *hostname);
+ int manager_set_timezone(Manager *m, const char *timezone);
+
+-DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
++DEFINE_TRIVIAL_CLEANUP_FUNC(Manager *, manager_free);
diff --git a/src/network/networkd-varlink.c b/src/network/networkd-varlink.c
new file mode 100644
index 0000000000..57d8acb967
@@ -135,5 +157,5 @@
+int manager_varlink_init(Manager *m);
+void manager_varlink_done(Manager *m);
--
-2.35.1
+2.41.0
diff --git a/board/czechlight/common/patches/systemd/0003-network-Add-LLDP-neighbors-method-to-varlink-server.patch b/board/czechlight/common/patches/systemd/0003-network-Add-LLDP-neighbors-method-to-varlink-server.patch
index 95bb683..dd32934 100644
--- a/board/czechlight/common/patches/systemd/0003-network-Add-LLDP-neighbors-method-to-varlink-server.patch
+++ b/board/czechlight/common/patches/systemd/0003-network-Add-LLDP-neighbors-method-to-varlink-server.patch
@@ -1,7 +1,7 @@
-From 2196678308d40ac4bb236776f5d9c23b87480759 Mon Sep 17 00:00:00 2001
+From a4a99d8b33b07401f5f5098b668398dddb5321d3 Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@users.noreply.github.com>
Date: Wed, 1 Sep 2021 08:30:20 +0200
-Subject: [PATCH 3/9] network: Add LLDP neighbors method to varlink server
+Subject: [PATCH 3/7] network: Add LLDP neighbors method to varlink server
Add a method to varlink server that will allow streaming the list of
LLDP neighbors on a particular link. The method's argument is the ifindex
@@ -114,5 +114,5 @@
}
--
-2.35.1
+2.41.0
diff --git a/board/czechlight/common/patches/systemd/0004-varlink-Implement-varlink_observe_complete.patch b/board/czechlight/common/patches/systemd/0004-varlink-Implement-varlink_observe_complete.patch
index a181c0e..b2b337f 100644
--- a/board/czechlight/common/patches/systemd/0004-varlink-Implement-varlink_observe_complete.patch
+++ b/board/czechlight/common/patches/systemd/0004-varlink-Implement-varlink_observe_complete.patch
@@ -1,7 +1,7 @@
-From 072ebba1de115cb31a71f6398c17a1bfdb383ee8 Mon Sep 17 00:00:00 2001
+From 542b30b98c67c7407053bd5526ab080cc8090fb2 Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@users.noreply.github.com>
Date: Thu, 9 Sep 2021 09:19:05 +0200
-Subject: [PATCH 4/9] varlink: Implement varlink_observe_complete
+Subject: [PATCH 4/7] varlink: Implement varlink_observe_complete
In some cases one doesn't want to run the sd_event loop just to obtain
results from varlink replies in the "continues" mode.
@@ -16,10 +16,10 @@
2 files changed, 32 insertions(+)
diff --git a/src/shared/varlink.c b/src/shared/varlink.c
-index e0038dfd28..7e5c9657f8 100644
+index 4f7ac97689..d7892693d1 100644
--- a/src/shared/varlink.c
+++ b/src/shared/varlink.c
-@@ -1440,6 +1440,37 @@ int varlink_observeb(Varlink *v, const char *method, ...) {
+@@ -1450,6 +1450,37 @@ int varlink_observeb(Varlink *v, const char *method, ...) {
return varlink_observe(v, method, parameters);
}
@@ -58,7 +58,7 @@
Varlink *v,
const char *method,
diff --git a/src/shared/varlink.h b/src/shared/varlink.h
-index 66a1ff630e..9bc836e1f9 100644
+index 9518cd9098..a424411ce6 100644
--- a/src/shared/varlink.h
+++ b/src/shared/varlink.h
@@ -92,6 +92,7 @@ int varlink_invokeb(Varlink *v, const char *method, ...);
@@ -70,5 +70,5 @@
/* Enqueue a final reply */
int varlink_reply(Varlink *v, JsonVariant *parameters);
--
-2.35.1
+2.41.0
diff --git a/board/czechlight/common/patches/systemd/0007-networkctl-lldp-now-uses-varlink-call.patch b/board/czechlight/common/patches/systemd/0005-networkctl-lldp-now-uses-varlink-call.patch
similarity index 76%
rename from board/czechlight/common/patches/systemd/0007-networkctl-lldp-now-uses-varlink-call.patch
rename to board/czechlight/common/patches/systemd/0005-networkctl-lldp-now-uses-varlink-call.patch
index 44d0f82..3511700 100644
--- a/board/czechlight/common/patches/systemd/0007-networkctl-lldp-now-uses-varlink-call.patch
+++ b/board/czechlight/common/patches/systemd/0005-networkctl-lldp-now-uses-varlink-call.patch
@@ -1,16 +1,16 @@
-From 1e805d15da85b85dfd54684557da1415b0294903 Mon Sep 17 00:00:00 2001
+From ed72d91efb80888846267f72e9214470eaca4ce6 Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@users.noreply.github.com>
Date: Wed, 15 Sep 2021 14:42:34 +0200
-Subject: [PATCH 7/9] networkctl: lldp now uses varlink call
+Subject: [PATCH 5/7] networkctl: lldp now uses varlink call
`networkctl lldp` now uses varlink call to the networkd to query LLDP
neighbor data.
---
- src/network/networkctl.c | 215 +++++++++++++++++++++++++--------------
- 1 file changed, 139 insertions(+), 76 deletions(-)
+ src/network/networkctl.c | 183 ++++++++++++++++++++++++++-------------
+ 1 file changed, 123 insertions(+), 60 deletions(-)
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
-index 46c08b5549..a10f3f3fc7 100644
+index a2e216e779..bab6cf5433 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -36,6 +36,7 @@
@@ -29,7 +29,7 @@
#include "verbs.h"
#include "wifi-util.h"
-@@ -2479,14 +2481,103 @@ static void lldp_capabilities_legend(uint16_t x) {
+@@ -2439,14 +2441,103 @@ static void lldp_capabilities_legend(uint16_t x) {
puts("");
}
@@ -136,23 +136,23 @@
r = sd_netlink_open(&rtnl);
if (r < 0)
return log_error_errno(r, "Failed to connect to netlink: %m");
-@@ -2497,103 +2588,75 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
+@@ -2457,80 +2548,52 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
pager_open(arg_pager_flags);
- table = table_new("link",
-- "chassis id",
-- "system name",
+- "chassis-id",
+- "system-name",
- "caps",
-- "port id",
-- "port description");
+- "port-id",
+- "port-description");
- if (!table)
+ udata.table = table_new("link",
-+ "chassis id",
-+ "system name",
++ "chassis-id",
++ "system-name",
+ "caps",
-+ "port id",
-+ "port description");
++ "port-id",
++ "port-description");
+ if (!udata.table)
return log_oom();
@@ -161,58 +161,15 @@
+ table_set_width(udata.table, 0);
- table_set_header(table, arg_legend);
-+ table_set_header(udata.table, arg_legend);
-
-- assert_se(cell = table_get_cell(table, 0, 0));
-- table_set_minimum_width(table, cell, 16);
-- table_set_maximum_width(table, cell, 16);
-+ assert_se(cell = table_get_cell(udata.table, 0, 0));
-+ table_set_minimum_width(udata.table, cell, 16);
-+ table_set_maximum_width(udata.table, cell, 16);
-
-- assert_se(cell = table_get_cell(table, 0, 1));
-- table_set_minimum_width(table, cell, 17);
-- table_set_maximum_width(table, cell, 17);
-+ assert_se(cell = table_get_cell(udata.table, 0, 1));
-+ table_set_minimum_width(udata.table, cell, 17);
-+ table_set_maximum_width(udata.table, cell, 17);
-
-- assert_se(cell = table_get_cell(table, 0, 2));
-- table_set_minimum_width(table, cell, 16);
-- table_set_maximum_width(table, cell, 16);
-+ assert_se(cell = table_get_cell(udata.table, 0, 2));
-+ table_set_minimum_width(udata.table, cell, 16);
-+ table_set_maximum_width(udata.table, cell, 16);
-
+-
- assert_se(cell = table_get_cell(table, 0, 3));
- table_set_minimum_width(table, cell, 11);
-- table_set_maximum_width(table, cell, 11);
-+ assert_se(cell = table_get_cell(udata.table, 0, 3));
-+ table_set_minimum_width(udata.table, cell, 11);
-+ table_set_maximum_width(udata.table, cell, 11);
-
-- assert_se(cell = table_get_cell(table, 0, 4));
-- table_set_minimum_width(table, cell, 17);
-- table_set_maximum_width(table, cell, 17);
-+ assert_se(cell = table_get_cell(udata.table, 0, 4));
-+ table_set_minimum_width(udata.table, cell, 17);
-+ table_set_maximum_width(udata.table, cell, 17);
-
-- assert_se(cell = table_get_cell(table, 0, 5));
-- table_set_minimum_width(table, cell, 16);
-- table_set_maximum_width(table, cell, 16);
-+ assert_se(cell = table_get_cell(udata.table, 0, 5));
-+ table_set_minimum_width(udata.table, cell, 16);
-+ table_set_maximum_width(udata.table, cell, 16);
-
-- if (table_set_empty_string(table, "n/a") < 0)
-+ if (table_set_empty_string(udata.table, "n/a") < 0)
- return log_oom();
+- table_set_ersatz_string(table, TABLE_ERSATZ_DASH);
++ table_set_header(udata.table, arg_legend);
- for (int i = 0; i < c; i++) {
- _cleanup_fclose_ FILE *f = NULL;
-+ varlink_set_userdata(link, &udata);
-
+-
- r = open_lldp_neighbors(links[i].ifindex, &f);
- if (r == -ENOENT)
- continue;
@@ -220,13 +177,17 @@
- log_warning_errno(r, "Failed to open LLDP data for %i, ignoring: %m", links[i].ifindex);
- continue;
- }
--
++ assert_se(cell = table_get_cell(udata.table, 0, 3));
++ table_set_minimum_width(udata.table, cell, 11);
++ table_set_ersatz_string(udata.table, TABLE_ERSATZ_DASH);
+
- for (;;) {
-- _cleanup_free_ char *capabilities = NULL;
- const char *chassis_id = NULL, *port_id = NULL, *system_name = NULL, *port_description = NULL;
- _cleanup_(sd_lldp_neighbor_unrefp) sd_lldp_neighbor *n = NULL;
+- _cleanup_free_ char *capabilities = NULL;
- uint16_t cc;
--
++ varlink_set_userdata(link, &udata);
+
- r = next_lldp_neighbor(f, &n);
- if (r < 0) {
- log_warning_errno(r, "Failed to read neighbor data: %m");
@@ -286,5 +247,5 @@
return 0;
--
-2.35.1
+2.41.0
diff --git a/board/czechlight/common/patches/systemd/0005-networkctl-lldp-uses-table_empty_string-instead-of-s.patch b/board/czechlight/common/patches/systemd/0005-networkctl-lldp-uses-table_empty_string-instead-of-s.patch
deleted file mode 100644
index ed0db4f..0000000
--- a/board/czechlight/common/patches/systemd/0005-networkctl-lldp-uses-table_empty_string-instead-of-s.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From d17ff9b2b0f3f0d2bfb54f9e3e965874e6df1974 Mon Sep 17 00:00:00 2001
-From: Tomas Pecka <peckato1@users.noreply.github.com>
-Date: Thu, 7 Oct 2021 14:11:45 +0200
-Subject: [PATCH 5/9] networkctl: lldp uses table_empty_string instead of strna
-
----
- src/network/networkctl.c | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/src/network/networkctl.c b/src/network/networkctl.c
-index 68dd4b185c..30cd75eec0 100644
---- a/src/network/networkctl.c
-+++ b/src/network/networkctl.c
-@@ -2529,6 +2529,9 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
- assert_se(cell = table_get_cell(table, 0, 5));
- table_set_minimum_width(table, cell, 16);
-
-+ if (table_set_empty_string(table, "n/a") < 0)
-+ return log_oom();
-+
- for (int i = 0; i < c; i++) {
- _cleanup_fclose_ FILE *f = NULL;
-
-@@ -2590,11 +2593,11 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
-
- r = table_add_many(table,
- TABLE_STRING, links[i].name,
-- TABLE_STRING, strna(chassis_id),
-- TABLE_STRING, strna(system_name),
-- TABLE_STRING, strna(capabilities),
-- TABLE_STRING, strna(port_id),
-- TABLE_STRING, strna(port_description));
-+ TABLE_STRING, chassis_id,
-+ TABLE_STRING, system_name,
-+ TABLE_STRING, capabilities,
-+ TABLE_STRING, port_id,
-+ TABLE_STRING, port_description);
- if (r < 0)
- return table_log_add_error(r);
-
---
-2.35.1
-
diff --git a/board/czechlight/common/patches/systemd/0008-networkctl-allow-format-LLDP-capabilities-string-wit.patch b/board/czechlight/common/patches/systemd/0006-networkctl-allow-format-LLDP-capabilities-string-wit.patch
similarity index 85%
rename from board/czechlight/common/patches/systemd/0008-networkctl-allow-format-LLDP-capabilities-string-wit.patch
rename to board/czechlight/common/patches/systemd/0006-networkctl-allow-format-LLDP-capabilities-string-wit.patch
index 8e89013..2b318a1 100644
--- a/board/czechlight/common/patches/systemd/0008-networkctl-allow-format-LLDP-capabilities-string-wit.patch
+++ b/board/czechlight/common/patches/systemd/0006-networkctl-allow-format-LLDP-capabilities-string-wit.patch
@@ -1,7 +1,7 @@
-From de6ad887e413ee3e66e368f707e08ea84aa72a91 Mon Sep 17 00:00:00 2001
+From a36487ec3e3a5d1bbfb11747bf48354c962a097a Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@users.noreply.github.com>
Date: Wed, 15 Sep 2021 14:30:19 +0200
-Subject: [PATCH 8/9] networkctl: allow format LLDP capabilities string without
+Subject: [PATCH 6/7] networkctl: allow format LLDP capabilities string without
dots
Allows formatting the LLDP capabilities string without the dots
@@ -11,10 +11,10 @@
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
-index a10f3f3fc7..9fbeed6908 100644
+index bab6cf5433..04a89e015f 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
-@@ -2431,21 +2431,24 @@ static int link_status(int argc, char *argv[], void *userdata) {
+@@ -2391,21 +2391,24 @@ static int link_status(int argc, char *argv[], void *userdata) {
return 0;
}
@@ -44,7 +44,7 @@
return ret;
}
-@@ -2537,7 +2540,7 @@ static int lldp_neighbors_varlink_reply(Varlink *link, JsonVariant *parameters,
+@@ -2497,7 +2500,7 @@ static int lldp_neighbors_varlink_reply(Varlink *link, JsonVariant *parameters,
return r;
if (udata->table) {
@@ -54,5 +54,5 @@
r = table_add_many(udata->table,
TABLE_STRING, udata->link_name,
--
-2.35.1
+2.41.0
diff --git a/board/czechlight/common/patches/systemd/0006-networkctl-lldp-table-now-ellpsizes-via-table-functi.patch b/board/czechlight/common/patches/systemd/0006-networkctl-lldp-table-now-ellpsizes-via-table-functi.patch
deleted file mode 100644
index 9b5b54c..0000000
--- a/board/czechlight/common/patches/systemd/0006-networkctl-lldp-table-now-ellpsizes-via-table-functi.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 5aa44bfdab3215cf495442fb931a23f88a66d1c7 Mon Sep 17 00:00:00 2001
-From: Tomas Pecka <peckato1@users.noreply.github.com>
-Date: Thu, 7 Oct 2021 14:16:53 +0200
-Subject: [PATCH 6/9] networkctl: lldp table now ellpsizes via table functions
-
-Tables can now ellipize on their own so there is no need to manually
-call ellpsize on the table data.
-
-To achieve compatibility with previous versions the table columns are
-set to have the exact same size as before, therefore the minimum and
-maximum widths for the columns in the output.
----
- src/network/networkctl.c | 32 +++++++-------------------------
- 1 file changed, 7 insertions(+), 25 deletions(-)
-
-diff --git a/src/network/networkctl.c b/src/network/networkctl.c
-index 30cd75eec0..46c08b5549 100644
---- a/src/network/networkctl.c
-+++ b/src/network/networkctl.c
-@@ -2513,21 +2513,27 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
-
- assert_se(cell = table_get_cell(table, 0, 0));
- table_set_minimum_width(table, cell, 16);
-+ table_set_maximum_width(table, cell, 16);
-
- assert_se(cell = table_get_cell(table, 0, 1));
- table_set_minimum_width(table, cell, 17);
-+ table_set_maximum_width(table, cell, 17);
-
- assert_se(cell = table_get_cell(table, 0, 2));
- table_set_minimum_width(table, cell, 16);
-+ table_set_maximum_width(table, cell, 16);
-
- assert_se(cell = table_get_cell(table, 0, 3));
- table_set_minimum_width(table, cell, 11);
-+ table_set_maximum_width(table, cell, 11);
-
- assert_se(cell = table_get_cell(table, 0, 4));
- table_set_minimum_width(table, cell, 17);
-+ table_set_maximum_width(table, cell, 17);
-
- assert_se(cell = table_get_cell(table, 0, 5));
- table_set_minimum_width(table, cell, 16);
-+ table_set_maximum_width(table, cell, 16);
-
- if (table_set_empty_string(table, "n/a") < 0)
- return log_oom();
-@@ -2544,7 +2550,7 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
- }
-
- for (;;) {
-- _cleanup_free_ char *cid = NULL, *pid = NULL, *sname = NULL, *pdesc = NULL, *capabilities = NULL;
-+ _cleanup_free_ char *capabilities = NULL;
- const char *chassis_id = NULL, *port_id = NULL, *system_name = NULL, *port_description = NULL;
- _cleanup_(sd_lldp_neighbor_unrefp) sd_lldp_neighbor *n = NULL;
- uint16_t cc;
-@@ -2562,30 +2568,6 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
- (void) sd_lldp_neighbor_get_system_name(n, &system_name);
- (void) sd_lldp_neighbor_get_port_description(n, &port_description);
-
-- if (chassis_id) {
-- cid = ellipsize(chassis_id, 17, 100);
-- if (cid)
-- chassis_id = cid;
-- }
--
-- if (port_id) {
-- pid = ellipsize(port_id, 17, 100);
-- if (pid)
-- port_id = pid;
-- }
--
-- if (system_name) {
-- sname = ellipsize(system_name, 16, 100);
-- if (sname)
-- system_name = sname;
-- }
--
-- if (port_description) {
-- pdesc = ellipsize(port_description, 16, 100);
-- if (pdesc)
-- port_description = pdesc;
-- }
--
- if (sd_lldp_neighbor_get_enabled_capabilities(n, &cc) >= 0) {
- capabilities = lldp_capabilities_to_string(cc);
- all |= cc;
---
-2.35.1
-
diff --git a/board/czechlight/common/patches/systemd/0009-networkctl-JSON-output-in-networkctl-lldp.patch b/board/czechlight/common/patches/systemd/0007-networkctl-JSON-output-in-networkctl-lldp.patch
similarity index 61%
rename from board/czechlight/common/patches/systemd/0009-networkctl-JSON-output-in-networkctl-lldp.patch
rename to board/czechlight/common/patches/systemd/0007-networkctl-JSON-output-in-networkctl-lldp.patch
index fc6a699..460af8d 100644
--- a/board/czechlight/common/patches/systemd/0009-networkctl-JSON-output-in-networkctl-lldp.patch
+++ b/board/czechlight/common/patches/systemd/0007-networkctl-JSON-output-in-networkctl-lldp.patch
@@ -1,19 +1,19 @@
-From 2fda28e34623cd24752ecad2dcea14f7ab46cb02 Mon Sep 17 00:00:00 2001
+From 49cc847aeedacaabdb285b7cdea0e6ccede6042e Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@users.noreply.github.com>
Date: Wed, 6 Oct 2021 10:11:31 +0200
-Subject: [PATCH 9/9] networkctl: JSON output in networkctl lldp
+Subject: [PATCH 7/7] networkctl: JSON output in networkctl lldp
`networkctl lldp` now outputs also in JSON format when `--json=*`
argument passed. The LLDP neighbors are listed in per interface lists.
---
- src/network/networkctl.c | 118 ++++++++++++++++++++++++++-------------
- 1 file changed, 79 insertions(+), 39 deletions(-)
+ src/network/networkctl.c | 84 +++++++++++++++++++++++++++++-----------
+ 1 file changed, 62 insertions(+), 22 deletions(-)
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
-index 9fbeed6908..0f48aa4bf7 100644
+index 04a89e015f..2eb21ad4ff 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
-@@ -2507,12 +2507,14 @@ typedef struct LLDPUserdata {
+@@ -2467,12 +2467,14 @@ typedef struct LLDPUserdata {
uint16_t capabilities_all;
Table *table;
@@ -28,7 +28,7 @@
}
static int lldp_neighbors_varlink_reply(Varlink *link, JsonVariant *parameters, const char *error_id, VarlinkReplyFlags flags, void *userdata) {
-@@ -2556,6 +2558,34 @@ static int lldp_neighbors_varlink_reply(Varlink *link, JsonVariant *parameters,
+@@ -2516,6 +2518,34 @@ static int lldp_neighbors_varlink_reply(Varlink *link, JsonVariant *parameters,
udata->neighbors_count += 1;
udata->capabilities_all |= entry.capabilities;
@@ -63,7 +63,7 @@
return 0;
}
-@@ -2568,7 +2598,6 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
+@@ -2528,7 +2558,6 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
_cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL;
_cleanup_(link_info_array_freep) LinkInfo *links = NULL;
_cleanup_(lldp_userdata_freep) LLDPUserdata udata = {};
@@ -71,7 +71,7 @@
r = varlink_connect_address(&link, address);
if (r < 0)
-@@ -2590,47 +2619,54 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
+@@ -2550,24 +2579,31 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
return c;
pager_open(arg_pager_flags);
@@ -79,77 +79,37 @@
+ TableCell *cell;
+
+ udata.table = table_new("link",
-+ "chassis id",
-+ "system name",
++ "chassis-id",
++ "system-name",
+ "caps",
-+ "port id",
-+ "port description");
++ "port-id",
++ "port-description");
+ if (!udata.table)
+ return log_oom();
- udata.table = table_new("link",
-- "chassis id",
-- "system name",
+- "chassis-id",
+- "system-name",
- "caps",
-- "port id",
-- "port description");
+- "port-id",
+- "port-description");
- if (!udata.table)
- return log_oom();
--
-- if (arg_full)
-- table_set_width(udata.table, 0);
+ if (arg_full)
+ table_set_width(udata.table, 0);
-- table_set_header(udata.table, arg_legend);
+- if (arg_full)
+- table_set_width(udata.table, 0);
+ table_set_header(udata.table, arg_legend);
-- assert_se(cell = table_get_cell(udata.table, 0, 0));
-- table_set_minimum_width(udata.table, cell, 16);
-- table_set_maximum_width(udata.table, cell, 16);
-+ assert_se(cell = table_get_cell(udata.table, 0, 0));
-+ table_set_minimum_width(udata.table, cell, 16);
-+ table_set_maximum_width(udata.table, cell, 16);
-
-- assert_se(cell = table_get_cell(udata.table, 0, 1));
-- table_set_minimum_width(udata.table, cell, 17);
-- table_set_maximum_width(udata.table, cell, 17);
-+ assert_se(cell = table_get_cell(udata.table, 0, 1));
-+ table_set_minimum_width(udata.table, cell, 17);
-+ table_set_maximum_width(udata.table, cell, 17);
-
-- assert_se(cell = table_get_cell(udata.table, 0, 2));
-- table_set_minimum_width(udata.table, cell, 16);
-- table_set_maximum_width(udata.table, cell, 16);
-+ assert_se(cell = table_get_cell(udata.table, 0, 2));
-+ table_set_minimum_width(udata.table, cell, 16);
-+ table_set_maximum_width(udata.table, cell, 16);
-
+- table_set_header(udata.table, arg_legend);
+-
- assert_se(cell = table_get_cell(udata.table, 0, 3));
- table_set_minimum_width(udata.table, cell, 11);
-- table_set_maximum_width(udata.table, cell, 11);
+- table_set_ersatz_string(udata.table, TABLE_ERSATZ_DASH);
+ assert_se(cell = table_get_cell(udata.table, 0, 3));
+ table_set_minimum_width(udata.table, cell, 11);
-+ table_set_maximum_width(udata.table, cell, 11);
-
-- assert_se(cell = table_get_cell(udata.table, 0, 4));
-- table_set_minimum_width(udata.table, cell, 17);
-- table_set_maximum_width(udata.table, cell, 17);
-+ assert_se(cell = table_get_cell(udata.table, 0, 4));
-+ table_set_minimum_width(udata.table, cell, 17);
-+ table_set_maximum_width(udata.table, cell, 17);
-
-- assert_se(cell = table_get_cell(udata.table, 0, 5));
-- table_set_minimum_width(udata.table, cell, 16);
-- table_set_maximum_width(udata.table, cell, 16);
-+ assert_se(cell = table_get_cell(udata.table, 0, 5));
-+ table_set_minimum_width(udata.table, cell, 16);
-+ table_set_maximum_width(udata.table, cell, 16);
-
-- if (table_set_empty_string(udata.table, "n/a") < 0)
-- return log_oom();
-+ if (table_set_empty_string(udata.table, "n/a") < 0)
-+ return log_oom();
++ table_set_ersatz_string(udata.table, TABLE_ERSATZ_DASH);
+ } else {
+ r = json_build(&udata.json, JSON_BUILD_EMPTY_OBJECT);
+ if (r < 0)
@@ -158,7 +118,7 @@
varlink_set_userdata(link, &udata);
-@@ -2653,13 +2689,17 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
+@@ -2590,13 +2626,17 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
return r;
}
@@ -183,5 +143,5 @@
return 0;
--
-2.35.1
+2.41.0
diff --git a/ci/pre.yaml b/ci/pre.yaml
new file mode 100644
index 0000000..344c91e
--- /dev/null
+++ b/ci/pre.yaml
@@ -0,0 +1,7 @@
+- hosts: all
+ tasks:
+ - name: install perl-English
+ package:
+ name: perl-English
+ state: present
+ become: true
diff --git a/submodules/buildroot b/submodules/buildroot
index 8be83c1..09b6443 160000
--- a/submodules/buildroot
+++ b/submodules/buildroot
@@ -1 +1 @@
-Subproject commit 8be83c1c817c47e0a9c2192e2926a0a75fff1317
+Subproject commit 09b6443ee92e6d9f7597e1cfa45686a16759fac5