0dcfe060e5
Replace sed-based PermitRootLogin fix with explicit appends to guarantee root SSH with password works for debugging. .bash_profile now pulls the latest install-kiosk.sh from Gitea before running so fixes take effect without rebuilding the ISO or recreating the VM. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
41 lines
1.4 KiB
Bash
41 lines
1.4 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# Downloaded and run by the preseed late_command after Debian base install.
|
|
# 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"
|
|
|
|
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: 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]
|
|
ExecStart=
|
|
ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM
|
|
EOF
|
|
|
|
echo "==> SeniorNet: configuring setup to run on first login..."
|
|
cat >> /root/.bash_profile << 'EOF'
|
|
|
|
# SeniorNet first-boot setup — always pulls latest from Gitea, runs once
|
|
if [ -f /usr/local/bin/kiosk-setup ]; then
|
|
curl -fsSL https://gitea.jgitta.com/jgitta/senior-kiosk/raw/branch/master/install-kiosk.sh \
|
|
-o /usr/local/bin/kiosk-setup 2>/dev/null || true
|
|
bash /usr/local/bin/kiosk-setup
|
|
fi
|
|
EOF
|
|
|
|
# Allow root SSH login with password for debugging during setup
|
|
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
|
|
echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
|
|
|
|
# Boot to text mode for the setup wizard
|
|
systemctl set-default multi-user.target
|
|
|
|
echo "==> SeniorNet: ready. Setup wizard will run automatically on next reboot."
|