hostname with serial number (#180)

* hostname with serial number

* add systemd.hostname kernel param

* /etc/hostname is now a symlink

* probably shouldn't have moved that

* fix path

* force symlink

* update kernel load script to support passing in device name

* remove kernel param

* change hostname from tici to comma

* bump kernel
This commit is contained in:
Greg Hogan
2023-11-08 10:53:28 -08:00
committed by GitHub
parent 2bca14de80
commit bc20686ddf
9 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ RUN set -xe
ENV USERNAME=comma
ENV PASSWD=comma
ENV HOST=tici
ENV HOST=comma
# Base system setup
RUN echo "resolvconf resolvconf/linkify-resolvconf boolean false" | debconf-set-selections
+2 -2
View File
@@ -67,8 +67,8 @@ sudo tar -xf $BUILD_DIR/filesystem.tar > /dev/null
# Add hostname and hosts. This cannot be done in the docker container...
echo "Setting network stuff"
HOST=tici
sudo bash -c "echo $HOST > etc/hostname"
HOST=comma
sudo bash -c "ln -sf /proc/sys/kernel/hostname etc/hostname"
sudo bash -c "echo \"127.0.0.1 localhost.localdomain localhost\" > etc/hosts"
sudo bash -c "echo \"127.0.0.1 $HOST\" >> etc/hosts"
+1 -1
View File
@@ -1,7 +1,7 @@
#!/bin/bash -e
cd "$(dirname "$0")"
DEVICE=tici-ethernet
DEVICE=${DEVICE:-comma-ethernet}
scp output/boot.img $DEVICE:/tmp/
ssh $DEVICE "sudo dd if=/tmp/boot.img of=/dev/disk/by-partlabel/boot_a && sudo dd if=/tmp/boot.img of=/dev/disk/by-partlabel/boot_b && sudo reboot"
+2 -2
View File
@@ -1,4 +1,4 @@
#!/bin/bash
scp output/linux-headers*.deb tici:/tmp/
ssh tici "sudo apt install -yq /tmp/linux-headers*.deb"
scp output/linux-headers*.deb comma:/tmp/
ssh comma "sudo apt install -yq /tmp/linux-headers*.deb"
+1 -1
View File
@@ -2,7 +2,7 @@
USERNAME=comma
PASSWD=comma
HOST=tici
HOST=comma
# Create identification file
touch /TICI
+2 -1
View File
@@ -1,6 +1,7 @@
[Unit]
Description=Sets the hostname to the device's serial number
After=NetworkManager.service
After=basic.target
Before=network.target
[Service]
User=root
+1 -2
View File
@@ -8,7 +8,7 @@ systemctl enable cdsprpcd
# Enable our services
systemctl enable fs_setup.service
#systemctl enable serial-hostname.service
systemctl enable serial-hostname.service
systemctl enable comma.service
systemctl enable gpio.service
systemctl enable lte.service
@@ -28,7 +28,6 @@ systemctl enable set_time.service
systemctl enable phantom_touch_logger.service
# Disable some of our services
systemctl disable serial-hostname.service
systemctl disable agnos-tests.service
# Disable third party services
+1 -1
View File
@@ -3,4 +3,4 @@ set -e
SERIAL="$(cat /proc/cmdline | sed -e 's/^.*androidboot.serialno=//' -e 's/ .*$//')"
echo "serial: '$SERIAL'"
hostnamectl set-hostname --transient "tici-$SERIAL"
sysctl kernel.hostname="comma-$SERIAL"