From 318e018c903fd08fe148d0c3aef13b4fd2e6b413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Fri, 1 Mar 2024 07:21:27 +0100 Subject: [PATCH 1/3] meta-lxatac-bsp: lxatac-factory-data: remove trailing whitespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Leonard Göhrs --- .../lxatac-factory-data/files/lxatac-factory-data.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.sh b/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.sh index 9a5a5a32..0ace1f46 100644 --- a/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.sh +++ b/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.sh @@ -67,4 +67,3 @@ OriginalName=tac-bridge MACAddress=${MAC_BRIDGE} MACAddressPolicy=none EOF - From 894ff6efe585ef9dca3100a98eb6a4c488eafaa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Fri, 1 Mar 2024 07:24:14 +0100 Subject: [PATCH 2/3] meta-lxatac-bsp: lxatac-factory-data: remove reliance on hostnamed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want to pull the exectution of the factory-data script earlier in the boot process, so it runs before udev starts. Relying on a DBus service to get and set the hostname goes against that goal. Just asking the kernel and writing to /etc/hostname is more or less equivalent to what we have done before, so just do that. Signed-off-by: Leonard Göhrs --- .../lxatac-factory-data/files/lxatac-factory-data.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.sh b/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.sh index 0ace1f46..3dce6415 100644 --- a/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.sh +++ b/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.sh @@ -11,14 +11,14 @@ DST_LINK_FILE_BASE="/run/systemd/network/" mkdir -p "${DST_ENVS_BASE}" mkdir -p "${DST_LINK_FILE_BASE}" -# Set the static hostname if it is not set yet -# (The transient hostname is passed via systemd.hostname= commandline) -# -------------------------------------------------------------------- +# If no hostname is set yet persist the one we currently have. +# The hostname is passed in from the bootloader via the +# systemd.hostname= kernel commandline and interpreted by init. +# ------------------------------------------------------------- if [[ ! -e /etc/hostname ]] then - hostname="$(hostnamectl --transient hostname)" - hostnamectl --static hostname "${hostname}" + hostname > /etc/hostname fi # Read Factory Data passed to us by barebox via the devicetree From 07a08bd8495bf824c32071716bb8bed6ee84c21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Fri, 23 Feb 2024 15:18:20 +0100 Subject: [PATCH 3/3] meta-lxatac-bsp: lxatac-factory-data: run script before udev starts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes sure that our tac-bridge.link file is ready before udev reads it. We have previously run into race conditions where the file was not present at the correct point in time, resulting in the bridge interface coming up with the wrong MAC address. Signed-off-by: Leonard Göhrs --- .../lxatac-factory-data/files/lxatac-factory-data.service | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.service b/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.service index afdedb9c..35a6652a 100644 --- a/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.service +++ b/meta-lxatac-bsp/recipes-core/lxatac-factory-data/files/lxatac-factory-data.service @@ -1,10 +1,12 @@ [Unit] Description=Gather and Distribute Factory Data -Before=NetworkManager.service +DefaultDependencies=no +After=systemd-remount-fs.service +Before=systemd-udevd.service [Service] Type=oneshot ExecStart=/usr/sbin/lxatac-factory-data [Install] -WantedBy=multi-user.target +WantedBy=sysinit.target