diff --git a/install-kiosk.sh b/install-kiosk.sh index 2e3faf5..fc4bc40 100755 --- a/install-kiosk.sh +++ b/install-kiosk.sh @@ -146,9 +146,13 @@ chown -R "$KIOSK_USER:$KIOSK_USER" \ "$HOME_DIR" \ "$CHROMIUM_PROFILE" -# ── Enable LightDM, remove first-boot service ───────────────────── +# ── Enable LightDM, remove first-boot setup ─────────────────────── systemctl enable lightdm systemctl set-default graphical.target +# Remove auto-login and setup script so root doesn't auto-login after kiosk is running +rm -f /etc/systemd/system/getty@tty1.service.d/autologin.conf +rm -f /usr/local/bin/kiosk-setup +# Legacy cleanup (no-op if not present) systemctl disable kiosk-firstboot 2>/dev/null || true rm -f /etc/systemd/system/kiosk-firstboot.service systemctl daemon-reload diff --git a/preseed-bootstrap.sh b/preseed-bootstrap.sh index 9240605..b668763 100644 --- a/preseed-bootstrap.sh +++ b/preseed-bootstrap.sh @@ -2,9 +2,8 @@ set -e # Downloaded and run by the preseed late_command after Debian base install. -# Fetches install-kiosk.sh and installs it as a first-boot setup service. -# The service runs interactively on the first reboot, prompts for name/username, -# then installs the kiosk and reboots into kiosk mode. +# Fetches install-kiosk.sh, configures getty@tty1 to auto-login as root, +# and runs the setup wizard automatically on first reboot. REPO_BASE="https://gitea.jgitta.com/jgitta/senior-kiosk/raw/branch/master" @@ -12,30 +11,24 @@ echo "==> SeniorNet: downloading setup script..." curl -fsSL "$REPO_BASE/install-kiosk.sh" -o /usr/local/bin/kiosk-setup chmod +x /usr/local/bin/kiosk-setup -echo "==> SeniorNet: installing first-boot service..." -cat > /etc/systemd/system/kiosk-firstboot.service << 'EOF' -[Unit] -Description=SeniorNet Kiosk First-Boot Setup -After=network-online.target -Wants=network-online.target -Conflicts=getty@tty1.service -After=getty@tty1.service - +echo "==> SeniorNet: configuring auto-login on TTY1..." +mkdir -p /etc/systemd/system/getty@tty1.service.d +cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << 'EOF' [Service] -Type=oneshot -ExecStart=/usr/local/bin/kiosk-setup -StandardInput=tty -TTYPath=/dev/tty1 -TTYReset=yes -IgnoreSIGPIPE=no -RemainAfterExit=no - -[Install] -WantedBy=multi-user.target +ExecStart= +ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM EOF -systemctl enable kiosk-firstboot -# Boot to text mode for the first-boot wizard, then kiosk setup switches to graphical +echo "==> SeniorNet: configuring setup to run on first login..." +cat >> /root/.bash_profile << 'EOF' + +# SeniorNet first-boot setup — runs once then removes itself +if [ -x /usr/local/bin/kiosk-setup ]; then + /usr/local/bin/kiosk-setup +fi +EOF + +# Boot to text mode for the setup wizard systemctl set-default multi-user.target -echo "==> SeniorNet: ready. First-boot setup will run on next reboot." +echo "==> SeniorNet: ready. Setup wizard will run automatically on next reboot."