$ show void-linux/void-mklive
This repository contains a collection of shell scripts and supporting files for building Void Linux live ISOs, root filesystem tarballs, platform-specific disk images, netboot tarballs, and an interactive installer. The core scripts (mkrootfs.sh, mkplatformfs.sh, mkimage.sh, mklive.sh, mkiso.sh, mknet.sh) orchestrate XBPS (Void's package manager), dracut, GRUB, syslinux, xorriso, and QEMU user-static to produce bootable images for multiple architectures (x86_64, i686, aarch64, ARM variants) and platforms (generic, Raspberry Pi, Pinebook Pro, GCP, etc.). The repository also includes dracut modules for live environment customization, a dialog-based installer (installer.sh), Packer configurations for cloud and Vagrant images, and GitHub Actions workflows for CI/CD. The code is well-structured with a shared library (lib.sh) handling cross-architecture concerns, binfmt registration, and chroot operations. While tightly coupled to Void Linux's ecosystem, the patterns demonstrated are instructive for anyone building distribution images or live environments.
The LLM identified 4 files worth highlighting for reuse:
A well-crafted shell library providing functions for architecture detection, binfmt registration for QEMU user-mode, pseudofs mount/unmount, chroot execution, and target-native vs cross-compilation detection. It is isolated from the main scripts (sourced via `. ./lib.sh`) and could be reused in other Void Linux or cross-architecture build projects. It demonstrates non-obvious skill in handling foreign architecture chroots and safely managing mounts.
A set of dracut module scripts (module-setup.sh, adduser.sh, display-manager-autologin.sh, locale.sh, getty-serial.sh, accessibility.sh, nomodeset.sh, mtd.sh) that customize the live environment at boot time. They handle user creation, autologin, keyboard layout, locale, serial console, accessibility features (espeakup/brltty), and modesetting. These are self-contained dracut hooks and demonstrate best practices for building live initramfs modules.
A comprehensive, dialog-based interactive installer for Void Linux. It guides the user through keyboard layout, network configuration, hostname, locale, timezone, root password, user account creation, bootloader installation, disk partitioning, filesystem creation, and package installation (from local ISO or network). The script handles both BIOS and UEFI systems, LVM, software RAID, and various filesystems. While tightly coupled to the live environment, it is a well-structured example of a shell-based TUI installer with robust error handling and state persistence.
A script that generates a minimal Void Linux ROOTFS tarball for a specified architecture. It uses XBPS to install base-container-full, configures locales, sets a default root password, and compresses the result. It demonstrates a clean pattern for bootstrapping a root filesystem from a package manager inside a chroot, including handling of cross-architecture builds via QEMU binfmt. The script is parameterized and could serve as a reference for similar system bootstrapping tasks.