Archiso — Custom Live Installer¶
The archiso build system produces a bootable Arch Linux ISO pre-loaded with the M-Archy installer scripts. Optionally, an answerfile can be embedded so the entire install — base OS + dotfiles — runs with zero user interaction.
Prerequisites¶
sudo pacman -S archiso jq
Building the ISO¶
# Basic build — interactive installer, no answerfile
bash setup/archiso/build.sh
# Specify output directory
bash setup/archiso/build.sh /path/to/output
# Embed an answerfile for automated deployment
bash setup/archiso/build.sh --preconf
# Embed a specific answerfile
bash setup/archiso/build.sh --preconf ~/my-server.json
# Both flags together
bash setup/archiso/build.sh --preconf ~/my-server.json /media/usb/output
| Flag | Effect |
|---|---|
| (none) | Clean ISO, no answerfile |
--preconf |
Embed ~/answerfile.json at /answerfile.json in the ISO |
--preconf FILE |
Embed the specified file instead |
Build artefacts land in ~/m-archy-out/ by default. Override with the OUT_DIR environment variable or by passing a path argument.
Environment Variables¶
| Variable | Default | Purpose |
|---|---|---|
WORK_DIR |
~/m-archy-build |
Scratch space for mkarchiso |
OUT_DIR |
~/m-archy-out |
ISO output directory |
What the Build Does¶
- Copies the upstream
relengArch base profile - Applies the M-Archy overlay (
setup/archiso/overlay/) - Replaces
profiledef.shwith the M-Archy version - Adds extra packages from
packages.extra - Embeds both installer scripts (
arch-autoinstall.sh,archbaseos-guided-install.sh) into/root/installer/ - If
--preconf: copies the answerfile to/answerfile.jsonin the ISO's airootfs - Runs
mkarchisoto produce the final.iso
Extra Packages on the Live System¶
Defined in setup/archiso/overlay/packages.extra:
git
jq
pam-u2f
btop
fastfetch
openssh
These are added on top of the standard Arch releng package set.
Live System Entry Points¶
Once booted from the ISO, the following are available:
install-arch¶
A command placed in /usr/local/bin/:
install-arch # guided mode (default)
install-arch guided # guided interactive install
install-arch auto # automated mode (reads /answerfile.json)
/root/launch.sh¶
Internal dispatcher used by install-arch.
/answerfile.json¶
Only present when built with --preconf. Both installer scripts check for this file on startup. If found, all prompts are answered from it — the only interaction required is the disk-encryption password (passwords are never stored in answerfiles).
Automated Deployment Workflow¶
┌─────────────────────────────────────┐
│ Developer machine │
│ │
│ 1. generate-answerfile.sh │
│ → ~/answerfile.json │
│ │
│ 2. build.sh --preconf │
│ → ~/m-archy-out/m-archy.iso │
│ │
│ 3. dd if=m-archy.iso of=/dev/sdX │
└──────────────┬──────────────────────┘
│ USB
▼
┌─────────────────────────────────────┐
│ Target machine (boots from USB) │
│ │
│ 4. install-arch auto │
│ reads /answerfile.json │
│ installs base OS │
│ runs tui-install.sh in chroot │
│ installs dotfiles & apps │
│ │
│ 5. Reboot → ready system │
└─────────────────────────────────────┘
For multi-machine deployments, the hostname field in the answerfile is combined with the machine's MAC address, so each system gets a unique hostname even though they share the same answerfile.
Overlay Structure¶
setup/archiso/overlay/
├── airootfs/
│ ├── etc/motd # Welcome message
│ ├── root/
│ │ └── launch.sh # Installer entry point
│ └── usr/local/bin/
│ └── install-arch # User-facing CLI command
├── packages.extra # Additional live-system packages
└── profiledef.sh # M-Archy ISO profile definition
The build.sh script also adds at build time:
airootfs/root/installer/
├── arch-autoinstall.sh
└── archbaseos-guided-install.sh
Writing the ISO to USB¶
# Find the USB drive
lsblk
# Write (replace /dev/sdX with your drive — ALL DATA WILL BE ERASED)
sudo dd if=~/m-archy-out/m-archy-*.iso of=/dev/sdX bs=4M status=progress oflag=sync
Or use ventoy / balenaEtcher as alternatives.