mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-08-24 01:33:53 +08:00
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:
+1
-1
@@ -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
|
||||
|
||||
+1
-1
Submodule agnos-kernel-sdm845 updated: de1e2dced7...b9a7dcefc1
+2
-2
@@ -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
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
USERNAME=comma
|
||||
PASSWD=comma
|
||||
HOST=tici
|
||||
HOST=comma
|
||||
|
||||
# Create identification file
|
||||
touch /TICI
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user