ShobuArch — Automated Arch Linux Tools (Written in Go)

Lint Status Build Status Go Report Card License

Have you ever wanted to use an IaC (Infrastructure as Code) approach towards automating an Arch Linux environment? If so, this README should help with getting you get what you need.


Why does this exist?

There are other Automated Linux installers, and there’s nothing wrong with them if your needs are met. However, if you’re a ZFS fan most alternatives don’t to account for ZFS on Root, let alone a mirrored configuration!

On a personal level, I’m finally making efforts to run Linux as my daily driver since I believe we are approaching the time of the Linux Desktop. Most tools I enjoy to use these days are written in Go, and I wanted to become a Gopher myself.

In addition, the release of the Steam Deck has motivated me to ensure I get Arch Linux configured exactly the way I want.

Implementing a project like this was practical for me to easily and consistently repeat multiple OS installs while ensuring I improve my skills in another language.


Create Arch ISO or Use Image

Download ArchISO from https://archlinux.org/download/ and put on a USB drive with Etcher, Ventoy, or Rufus

If you’re looking for ZFS on Root, ensure to use an ISO with ZFS packages pre-installed.

Some archiso wrappers include: https://github.com/ShobuPrime/arch-iso-zfs and https://github.com/stevleibelt/arch-linux-live-cd-iso-with-zfs

Another helpful guide can be found at https://michaelabrahamsen.com/posts/arch-linux-iso-zfs/

Planned:

  • Provide offline ISO builder to ShobuArch.

Boot Arch ISO

If running ShobuArch from official repository, run the following commands on a fresh boot of your ISO:

pacman -Sy git
git clone https://github.com/ShobuPrime/ShobuArch.git
cd ShobuArch/_build
chmod +x ShobuArch
./ShobuArch

ShobuArch runs both with and without arguments. Currently, supported flags are:

method_flag := flag.String("method", "m", `'a': Automated, 'm': Manual`)
config_flag := flag.String("config", "n", `'y': Load config, 'n': Fresh config`)

System Description

Depending on arguments used, ShobuArch prompts the user for information deemed important for a coherent OS install:

  • Username
  • Password
  • Filesystem
  • Desktop Environment
  • Window Manager
  • AUR helper
  • etc.

Troubleshooting

Official Arch Installation Guide

Install Ach Linux on ZFS

Arch Linux Installed on ZFS

ShobuArch generates a logfile including every command ran, and its STDOUT and STDERR outputs. If something ended up not working the way you want, you should be able to dig through the logs to find what commands started to Go wonky.

To-Do

  • Add some GIFS or screenshots of the tool working in action

Planned Features

  • Offline ISO builder
  • Verbosity flag, since right now the log is naturally very verbose
  • Implement some sort of resume mechanism if a specific function failed very poorly, so we can continue from where we left off

Known Issues

  • When generating a fresh config through the UI, util-linux v2.38 added new key-value pairs which are being returned incorrectly. A fix was committed, but you will either need to compile util-linux yourself with the changes, or stick to v2.37.* for now
  • Go Report Card badge is failing: There was an error processing your request: Could not analyze the repository: could not download repo: could not get latest module version from https://proxy.golang.org/shobuarch/@latest: bad request: invalid escaped module path "shobuarch": malformed module path "shobuarch": missing dot in first path element

Credits

GitHub

View Github