set hostname to tici-<serial_number> (#89)

* set hostname to tici-<serial_number>

* runs as root
This commit is contained in:
Adeeb Shihadeh
2022-09-22 20:57:16 -07:00
committed by GitHub
parent 06db92b2fa
commit acedbed308
3 changed files with 17 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=Sets the hostname to the device's serial number
[Service]
User=root
Type=oneshot
ExecStart=/usr/comma/set-hostname.sh
[Install]
WantedBy=multi-user.target
+1
View File
@@ -8,6 +8,7 @@ systemctl enable cdsprpcd
# Enable our services
systemctl enable fs_setup.service
systemctl enable serial-hostname.service
systemctl enable comma.service
systemctl enable gpio.service
systemctl enable lte.service
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
SERIAL="$(cat /proc/cmdline | sed -e 's/^.*androidboot.serialno=//' -e 's/ .*$//')"
echo "serial: '$SERIAL'"
hostname "tici-$SERIAL"