If you’ve ever wondered if ChatGPT or any other tool using LLM can install Arch Linux you’ve come to the right place.
This library watches a serial port for the signs of the Arch Linux installer bootloader, and once it detects it, starts it with serial console support.
For loading the LLM bindings you’ll also need my gptel-tool library:
(add-to-list 'load-path "/path/to/gptel-tool-library")
(add-to-list 'load-path "/path/to/this/repo")
(require 'gptel-tool-library)
(dolist (module '("buffer" "arch-installer"))
(gptel-tool-library-load-module module)))
If you’re using a VM instead of a real system connected via serial port you’ll need to add a virtual port connected to a socket, and - as the code expects a pty - use socat to make it one:
socat -d -d pty,raw,echo=0,link=/tmp/kvm-serial UNIX-CONNECT:/tmp/archvm.sock
Now you can start the serial listen process (the virtual port needs to be available!):
(arch-installer-open-serial "/tmp/kvm-serial")
If the port is /dev/ttyS0
the port argument can be omitted. Now you can have whatever system is connected start booting from CD/DVD - it should then automatically boot into the installer console on the serial port. You can observe this in the *arch-installer*
buffer.
Now you can start a gptel session, and request start of the installation. The interactive function arch-installer-insert-default-prompt
will insert a sample prompt into the current buffer. If you’re using ChatGPT and are on tier 1 you should ask it to stop and wait for input after it started installing packages - otherwise you’ll run into rate limiting.
The very first attempt at an installation (running into the rate limits) from before I had the ANSI colours converted is available on YouTube.