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/.appends.core0
-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.network6
-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-conf_%.bbappend1
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf_aglcore.inc4
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd/e2fsck.conf3
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd/wait-disable.conf3
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd/wired.network8
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd_%.bbappend1
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd_aglcore.inc36
13 files changed, 122 insertions, 0 deletions
diff --git a/meta-agl-core/recipes-core/systemd/.appends.core b/meta-agl-core/recipes-core/systemd/.appends.core
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/.appends.core
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-conf-canbus/canbus-can.network b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.network
new file mode 100644
index 000000000..ae5514bca
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.network
@@ -0,0 +1,6 @@
+[Match]
+Name=can*
+
+[CAN]
+BitRate=500K
+RestartSec=0.1
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-conf_%.bbappend b/meta-agl-core/recipes-core/systemd/systemd-conf_%.bbappend
new file mode 100644
index 000000000..980783236
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf_aglcore.inc b/meta-agl-core/recipes-core/systemd/systemd-conf_aglcore.inc
new file mode 100644
index 000000000..a539d1826
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf_aglcore.inc
@@ -0,0 +1,4 @@
+do_install:append() {
+ # Remove ethernet script deployed by upstream unconditionally (SPEC-3221)
+ rm -rf ${D}${systemd_unitdir}/network/80-wired.network || true
+} \ No newline at end of file
diff --git a/meta-agl-core/recipes-core/systemd/systemd/e2fsck.conf b/meta-agl-core/recipes-core/systemd/systemd/e2fsck.conf
new file mode 100644
index 000000000..b774f9ebf
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd/e2fsck.conf
@@ -0,0 +1,3 @@
+[options]
+# This will prevent e2fsck from stopping boot just because the clock is wrong
+broken_system_clock = 1
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
new file mode 100644
index 000000000..425610a3f
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd/wired.network
@@ -0,0 +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_%.bbappend b/meta-agl-core/recipes-core/systemd/systemd_%.bbappend
new file mode 100644
index 000000000..980783236
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-core/systemd/systemd_aglcore.inc b/meta-agl-core/recipes-core/systemd/systemd_aglcore.inc
new file mode 100644
index 000000000..9681329be
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd_aglcore.inc
@@ -0,0 +1,36 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/systemd:"
+
+SRC_URI += "\
+ file://e2fsck.conf \
+ file://wait-disable.conf \
+ file://wired.network \
+"
+
+# 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
+
+ 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 "
+