pyinfra scripts to automate the installation of Chimera Linux on virtual machines.
Find a file
2024-12-09 09:29:39 +10:00
files Initial commit 2024-12-09 09:29:39 +10:00
.gitignore Initial commit 2024-12-09 09:29:39 +10:00
install-bios.py Initial commit 2024-12-09 09:29:39 +10:00
install.py Initial commit 2024-12-09 09:29:39 +10:00
LICENSE Initial commit 2024-12-09 09:29:39 +10:00
README.md Initial commit 2024-12-09 09:29:39 +10:00
requirements.txt Initial commit 2024-12-09 09:29:39 +10:00
ruff.toml Initial commit 2024-12-09 09:29:39 +10:00

Chimera pyinfra Config

Goal: Point these pyinfra operations at a machine booted into the Chimera live CD and install Chimera Linux to a bootable base state.

These scripts are intended for quick, automated installation of Chimera Linux on virtual machines. They've been used against local VMs in virt-manager as well as the web-based VNC console provided by some VPC hosts.

Setup

Initial setup to install pyinfra in a virtual env.

UNIX-like:

python -m venv .venv
. .venv/bin/activate
pip install --require-virtualenv -r requirements.txt

Windows:

python -m venv .venv
.venv\Scripts\Activate.ps1
pip install --require-virtualenv -r requirements.txt

powershell -Command { $env:VCPKG_ROOT="D:\Source\vcpkg"; pip install -r .\requirements.txt }

Configuration

EFI systems will use install.py, BIOS systems will use install-bios.py. Edit files before running.

  1. Add your SSH public key to the user_ssh_key variable.
  2. Review the 'Add swap' step and adjust the amount of swap if desired.

Install

  1. Boot from the Chimera base live CD
  2. Log into the console as root
  3. Bootstrap SSH access with xdotool; replace <key> your-public-ssh-key with your public SSH key:
    • xdotool windowfocus --sync $(xdotool selectwindow) type 'dinitctl start sshd && mkdir ~/.ssh && echo "<key> your-public-ssh-key" > ~/.ssh/authorized_keys && ip addr && fdisk -l'
  4. Note IP address above
  5. Note the name of the disk to install to from above fdisk output
  6. For EFI based systems run the install.py operation against the IP noted in step 5: pyinfra -vvv --user root IP install.py
  7. For BIOS based systems run the install-bios.py operation against the IP noted in step 5: pyinfra -vvv --user root IP install-bios.py
  8. At the beginning of the run after the disk device confirmation note the root password that is printed
  9. Reboot: pyinfra --user root IP exec reboot
  10. Log in and set passwd for regular user (if doas access is required)

Post Install

Perform these steps either manually or by writing pyinfra code.

Troubleshooting

Remount root

If something goes wrong and you want to remount a previous attempt (replace /dev/vda2 as necessary):

xdotool windowfocus --sync $(xdotool selectwindow) type 'mkdir /media/root && mount /dev/vda2 /media/root && mount /dev/vda1 /media/root/boot'

Dropped Characters With Typing With xdotool

Add --delay 100 to the xdotool type command.

Maintenance Status

I'm publishing this code in the hope it's useful to others but maintenance will be limited. I'm unlikely to implement feature requests, but will review smaller contributions and bug reports.

Licence

This code is licenced under terms of the Zero-Clause BSD licence.