summaryrefslogtreecommitdiffstats
path: root/meta-agl-core/recipes-core/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-core/recipes-core/systemd')
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can-fd.network12
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.link11
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.network (renamed from meta-agl-core/recipes-core/systemd/systemd/canbus-can.network)0
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network5
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb32
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch34
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd/0002-network-add-CAN-Termination-tristate-option.patch107
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd/wait-disable.conf3
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd/wired.network3
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd_aglcore.inc30
10 files changed, 82 insertions, 155 deletions
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can-fd.network b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can-fd.network
new file mode 100644
index 000000000..86042bd90
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can-fd.network
@@ -0,0 +1,12 @@
+[Match]
+Name=can*
+
+[CAN]
+BitRate=500K
+SamplePoint=75%
+DataBitRate=4M
+DataSamplePoint=80%
+FDMode=yes
+
+[Link]
+ActivationPolicy=up
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.link b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.link
new file mode 100644
index 000000000..61fb4d575
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.link
@@ -0,0 +1,11 @@
+[Match]
+Type=can
+OriginalName=can*
+
+[Link]
+TransmitQueueLength=1000
+# Need to duplicate default configuration here, since only first
+# matching .link is applied
+NamePolicy=keep kernel database onboard slot path
+AlternativeNamesPolicy=database onboard slot path
+MACAddressPolicy=persistent
diff --git a/meta-agl-core/recipes-core/systemd/systemd/canbus-can.network b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.network
index ae5514bca..ae5514bca 100644
--- a/meta-agl-core/recipes-core/systemd/systemd/canbus-can.network
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.network
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network
new file mode 100644
index 000000000..cc33d86d6
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network
@@ -0,0 +1,5 @@
+[Match]
+Name=can*
+
+[CAN]
+RestartSec=0.1
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb
new file mode 100644
index 000000000..a23cd839a
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Systemd canbus configuration"
+DESCRIPTION = "Systemd may require slightly different configuration for \
+different machines. This injects configuration for the CAN bus."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PE = "1"
+
+SRC_URI = "\
+ file://canbus-can.network \
+ file://canbus-can-fd.network \
+ file://canbus-virtio.network \
+ file://canbus-can.link \
+"
+
+CANBUS_NETWORK_CONFIG ??= "canbus-can.network"
+CANBUS_NETWORK_CONFIG:virtio-all ?= "canbus-virtio.network"
+
+do_install() {
+ # Install CAN bus network configuration
+ install -d ${D}${nonarch_base_libdir}/systemd/network/
+ install -m 0644 ${WORKDIR}/${CANBUS_NETWORK_CONFIG} ${D}${nonarch_base_libdir}/systemd/network/60-canbus-can.network
+
+ # Install link configuration to bump queue size on physical CAN bus devices
+ install -m 0644 ${WORKDIR}/canbus-can.link ${D}${nonarch_base_libdir}/systemd/network/60-canbus-can.link
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES:${PN} = " \
+ ${nonarch_base_libdir}/systemd/network/ \
+"
diff --git a/meta-agl-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch b/meta-agl-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch
deleted file mode 100644
index 29165b58e..000000000
--- a/meta-agl-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Fix udevd SECLABEL token parsing
-
-The udevd rules parsing rewrite in v243 broke SECLABEL parsing,
-with the result being that udevd crashes when it parses a line
-containing a SECLABEL token. Fix the handling of the attribute
-of SECLABEL tokens when parsing, and add a check to prevent
-crashes if the attribute is missing.
-
-Upstream-Status: Pending
-
-Signed-off-by: Scott Murray <scott.murray@konsulko.com>
-
-diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
-index efea16e5c5..3e757ccb06 100644
---- a/src/udev/udev-rules.c
-+++ b/src/udev/udev-rules.c
-@@ -918,7 +918,7 @@ static int parse_token(UdevRules *rules, const char *key, char *attr, UdevRuleOp
- op = OP_ASSIGN;
- }
-
-- r = rule_line_add_token(rule_line, TK_A_SECLABEL, op, value, NULL);
-+ r = rule_line_add_token(rule_line, TK_A_SECLABEL, op, value, attr);
- } else if (streq(key, "RUN")) {
- if (is_match || op == OP_REMOVE)
- return log_token_invalid_op(rules, key);
-@@ -1927,6 +1927,8 @@ static int udev_rule_apply_token_to_event(
- _cleanup_free_ char *name = NULL, *label = NULL;
- char label_str[UTIL_LINE_SIZE] = {};
-
-+ if (!token->data)
-+ break;
- name = strdup((const char*) token->data);
- if (!name)
- return log_oom();
diff --git a/meta-agl-core/recipes-core/systemd/systemd/0002-network-add-CAN-Termination-tristate-option.patch b/meta-agl-core/recipes-core/systemd/systemd/0002-network-add-CAN-Termination-tristate-option.patch
deleted file mode 100644
index feaff2736..000000000
--- a/meta-agl-core/recipes-core/systemd/systemd/0002-network-add-CAN-Termination-tristate-option.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From 1e6ffb3129340291027d2690631f62eb7d0e0a78 Mon Sep 17 00:00:00 2001
-From: Matt Ranostay <matt.ranostay@konsulko.com>
-Date: Tue, 11 Feb 2020 18:13:45 -0800
-Subject: [PATCH] network: add CAN Termination tristate option
-
-Upstream-Status: Submitted
-Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
----
- src/libsystemd/sd-netlink/netlink-types.c | 1 +
- src/network/networkd-can.c | 13 +++++++++++++
- src/network/networkd-network-gperf.gperf | 1 +
- src/network/networkd-network.c | 1 +
- src/network/networkd-network.h | 1 +
- test/fuzz/fuzz-network-parser/directives.network | 1 +
- 6 files changed, 18 insertions(+)
-
-diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
-index a55460f034..96e211dcf0 100644
---- a/src/libsystemd/sd-netlink/netlink-types.c
-+++ b/src/libsystemd/sd-netlink/netlink-types.c
-@@ -316,6 +316,7 @@ static const NLType rtnl_link_info_data_can_types[] = {
- [IFLA_CAN_BITTIMING] = { .size = sizeof(struct can_bittiming) },
- [IFLA_CAN_RESTART_MS] = { .type = NETLINK_TYPE_U32 },
- [IFLA_CAN_CTRLMODE] = { .size = sizeof(struct can_ctrlmode) },
-+ [IFLA_CAN_TERMINATION] = { .type = NETLINK_TYPE_U16 },
- };
-
- static const NLType rtnl_link_info_data_macsec_types[] = {
-diff --git a/src/network/networkd-can.c b/src/network/networkd-can.c
-index 5755df57bd..3abe8ae2ed 100644
---- a/src/network/networkd-can.c
-+++ b/src/network/networkd-can.c
-@@ -9,6 +9,8 @@
- #include "networkd-manager.h"
- #include "string-util.h"
-
-+#define CAN_TERMINATION_OHM_VALUE 120
-+
- static int link_up_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) {
- int r;
-
-@@ -152,6 +154,17 @@ static int link_set_can(Link *link) {
- return log_link_error_errno(link, r, "Could not append IFLA_CAN_CTRLMODE attribute: %m");
- }
-
-+ if (link->network->can_termination >= 0) {
-+
-+ log_link_debug(link, "%sabling can-termination", link->network->can_termination ? "En" : "Dis");
-+
-+ r = sd_netlink_message_append_u16(m, IFLA_CAN_TERMINATION,
-+ link->network->can_termination ? CAN_TERMINATION_OHM_VALUE : 0);
-+ if (r < 0)
-+ return log_link_error_errno(link, r, "Could not append IFLA_CAN_TERMINATION attribute: %m");
-+
-+ }
-+
- r = sd_netlink_message_close_container(m);
- if (r < 0)
- return log_link_error_errno(link, r, "Failed to close netlink container: %m");
-diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
-index f7e68be181..b3df4f3960 100644
---- a/src/network/networkd-network-gperf.gperf
-+++ b/src/network/networkd-network-gperf.gperf
-@@ -245,6 +245,7 @@ CAN.BitRate, config_parse_si_size,
- CAN.SamplePoint, config_parse_permille, 0, offsetof(Network, can_sample_point)
- CAN.RestartSec, config_parse_sec, 0, offsetof(Network, can_restart_us)
- CAN.TripleSampling, config_parse_tristate, 0, offsetof(Network, can_triple_sampling)
-+CAN.Termination, config_parse_tristate, 0, offsetof(Network, can_termination)
- TrafficControlQueueingDiscipline.Parent, config_parse_tc_qdiscs_parent, 0, 0
- TrafficControlQueueingDiscipline.NetworkEmulatorDelaySec, config_parse_tc_network_emulator_delay, 0, 0
- TrafficControlQueueingDiscipline.NetworkEmulatorDelayJitterSec, config_parse_tc_network_emulator_delay, 0, 0
-diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
-index 6e443975f1..0ea5c05db7 100644
---- a/src/network/networkd-network.c
-+++ b/src/network/networkd-network.c
-@@ -448,6 +448,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
- .keep_configuration = _KEEP_CONFIGURATION_INVALID,
-
- .can_triple_sampling = -1,
-+ .can_termination = -1,
- .ip_service_type = -1,
- };
-
-diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h
-index aa74bb4ae7..6a1f094156 100644
---- a/src/network/networkd-network.h
-+++ b/src/network/networkd-network.h
-@@ -193,6 +193,7 @@ struct Network {
- unsigned can_sample_point;
- usec_t can_restart_us;
- int can_triple_sampling;
-+ int can_termination;
-
- AddressFamily ip_forward;
- bool ip_masquerade;
-diff --git a/test/fuzz/fuzz-network-parser/directives.network b/test/fuzz/fuzz-network-parser/directives.network
-index 5bd80dece8..781269d960 100644
---- a/test/fuzz/fuzz-network-parser/directives.network
-+++ b/test/fuzz/fuzz-network-parser/directives.network
-@@ -194,6 +194,7 @@ SamplePoint=
- BitRate=
- RestartSec=
- TripleSampling=
-+Termination=
- [Address]
- DuplicateAddressDetection=
- AutoJoin=
diff --git a/meta-agl-core/recipes-core/systemd/systemd/wait-disable.conf b/meta-agl-core/recipes-core/systemd/systemd/wait-disable.conf
new file mode 100644
index 000000000..e5d4f4b28
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd/wait-disable.conf
@@ -0,0 +1,3 @@
+[Service]
+ExecStart=
+ExecStart=/usr/bin/true
diff --git a/meta-agl-core/recipes-core/systemd/systemd/wired.network b/meta-agl-core/recipes-core/systemd/systemd/wired.network
index 3559b0155..425610a3f 100644
--- a/meta-agl-core/recipes-core/systemd/systemd/wired.network
+++ b/meta-agl-core/recipes-core/systemd/systemd/wired.network
@@ -1,5 +1,8 @@
[Match]
Name=eth* en*
+KernelCommandLine=!nbdroot
+KernelCommandLine=!nfsroot
+KernelCommandLine=!ip
[Network]
DHCP=yes
diff --git a/meta-agl-core/recipes-core/systemd/systemd_aglcore.inc b/meta-agl-core/recipes-core/systemd/systemd_aglcore.inc
index 51a5ff45f..9681329be 100644
--- a/meta-agl-core/recipes-core/systemd/systemd_aglcore.inc
+++ b/meta-agl-core/recipes-core/systemd/systemd_aglcore.inc
@@ -1,34 +1,36 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/systemd:"
SRC_URI += "\
- file://0002-network-add-CAN-Termination-tristate-option.patch \
file://e2fsck.conf \
- file://canbus-can.network \
- ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','file://wired.network','',d)} \
+ file://wait-disable.conf \
+ file://wired.network \
"
-# enable networkd/resolved support
-PACKAGECONFIG:append:pn-systemd = " \
+# Enable networkd/resolved support if using systemd for network management
+PACKAGECONFIG:append = " \
${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','networkd resolved','',d)} \
+ iptc \
"
+# SPEC-737: connmand also has a NTP client which races with systemd-timesyncd
+PACKAGECONFIG:remove = "timesyncd"
+
+# Enable systemd-coredump when agl-devel is set on
+PACKAGECONFIG:append:agl-devel = " coredump"
+
do_install:append() {
# Install /etc/e2fsck.conf to avoid boot stuck by wrong clock time
install -m 644 -p -D ${WORKDIR}/e2fsck.conf ${D}${sysconfdir}/e2fsck.conf
- # Install canbus network script
- install -m 0644 ${WORKDIR}/canbus-can.network ${D}${nonarch_base_libdir}/systemd/network/60-canbus-can.network
-
- if ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','true','false',d)}; then
+ if [ "${VIRTUAL-RUNTIME_net_manager}" = "systemd" ]; then
# Install DHCP configuration for Ethernet adapters
install -m 644 ${WORKDIR}/wired.network ${D}${sysconfdir}/systemd/network
+ elif [ "${VIRTUAL-RUNTIME_net_manager}" = "connman" ]; then
+ # Disable systemd-networkd-wait-online by default
+ install -d ${D}${systemd_system_unitdir}/systemd-networkd-wait-online.service.d
+ install -m 0644 ${WORKDIR}/wait-disable.conf ${D}${systemd_system_unitdir}/systemd-networkd-wait-online.service.d/
fi
}
FILES:${PN} += "${sysconfdir}/e2fsck.conf "
-# SPEC-737: connmand also has a NTP client which races with systemd-timesyncd
-PACKAGECONFIG:remove = "timesyncd"
-
-# Enable systemd-coredump when agl-devel is set on
-PACKAGECONFIG:append:agl-devel = " coredump"