Add a root shell on UART console

Until I implement some kind of self-provisioning process for these
machines (supposing I ever do), I need a way to log in and
configure/troubleshoot.  I don't think there's any particular security
concern by having an auto-logged-in root shell on the UART console, as
accessing it needs physical access to the machine.
dev/new
Dustin 2025-08-30 19:29:19 -05:00
parent 025bf8be34
commit 153a8071a9
3 changed files with 28 additions and 0 deletions

View File

@ -6,6 +6,7 @@ BR2_GLOBAL_PATCH_DIR="board/raspberrypi/patches"
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
BR2_TARGET_GENERIC_HOSTNAME="airplaypi"
BR2_INIT_SYSTEMD=y
BR2_ROOTFS_OVERLAY="$(WORKSPACE)/rootfs-overlay"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_AIMEEOS_PATH)/board/raspberrypi3/post-image.sh"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y

View File

@ -0,0 +1 @@
enable root-shell@.service ttyAMA0

View File

@ -0,0 +1,26 @@
[Unit]
Description=root shell on %I
After=sshd.service
Conflicts=shutdown.target
Conflicts=getty@%i.service serial-getty@%i.service
[Service]
Type=idle
Environment=TERM=linux
ExecStart=/bin/sh
Restart=always
RestartSec=0
StandardInput=tty
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
KillSignal=SIGHUP
# Unset locale for the console getty since the console has problems
# displaying some internationalized messages.
UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
[Install]
WantedBy=multi-user.target