From af1cf59a0aceb98dc32ccf65b415af988d61d7e3 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 23 Sep 2022 11:53:57 -0700 Subject: [PATCH] set hostname through network manager --- userspace/files/serial-hostname.service | 1 + userspace/usr/comma/set-hostname.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/userspace/files/serial-hostname.service b/userspace/files/serial-hostname.service index d4562a4..6c59594 100644 --- a/userspace/files/serial-hostname.service +++ b/userspace/files/serial-hostname.service @@ -1,5 +1,6 @@ [Unit] Description=Sets the hostname to the device's serial number +After=NetworkManager.service [Service] User=root diff --git a/userspace/usr/comma/set-hostname.sh b/userspace/usr/comma/set-hostname.sh index a1e3180..7b9d228 100755 --- a/userspace/usr/comma/set-hostname.sh +++ b/userspace/usr/comma/set-hostname.sh @@ -3,4 +3,4 @@ set -e SERIAL="$(cat /proc/cmdline | sed -e 's/^.*androidboot.serialno=//' -e 's/ .*$//')" echo "serial: '$SERIAL'" -hostname "tici-$SERIAL" +nmcli general hostname "tici-$SERIAL"