# Runs the Alloy installer on VT1 when booted from the installer ISO. # # Gated on a kernel command line flag rather than shipped disabled and # enabled by the ISO build: the same image is both the live installer and # the system it installs, and an installer that could start on an installed # machine is a way to lose a disk. `alloy.installer` is set only by the # GRUB entries in build/build-iso.sh, so this unit is inert everywhere else. # # Three things want VT1: this, greetd, and getty@tty1. The kernel flag above # settles it, and each of the three answers for itself. # # greetd stays away by its own condition, the negation of this one, in # etc/systemd/system/greetd.service.d/10-installer-medium.conf. That file # carries the history of the two arrangements that did not work, both of # which were versions of this unit reaching across to stop the greeter. # # getty@tty1 is stopped here, from ExecStartPre rather than `Conflicts=`. # `Conflicts=` is applied when the start job is ENQUEUED, before the # condition above is checked, so on an installed machine it would displace # getty even though the installer never runs. ExecStartPre runs only after # the condition has passed. Unlike greetd, getty@tty1 is not pulled by a # target that would restart it, so stopping it once is enough. The leading # `-` keeps stopping a unit that is not running from failing the install # before it starts. [Unit] Description=Alloy installer Documentation=https://git.sr.ht/~maxmj/alloy ConditionKernelCommandLine=alloy.installer After=systemd-user-sessions.service systemd-logind.service Before=getty.target [Service] ExecStartPre=-/usr/bin/systemctl stop getty@tty1.service # Type=idle so the boot's own console output has finished before a # full-screen TUI takes the terminal; without it the first frame draws # over service status lines and the user sees a torn screen. Type=idle ExecStart=/usr/bin/alloy install TTYPath=/dev/tty1 StandardInput=tty StandardOutput=tty StandardError=journal TTYReset=yes TTYVHangup=yes TTYVTDisallocate=yes # A crashed installer must not leave a blank VT with no way forward. It is # also not something to retry forever: the disk may be half written, so # coming back to a fresh wizard would invite a second pass over it. Restart=no [Install] WantedBy=multi-user.target