I personally use Arch Linux everywhere and with the frequency at which I was doing reinstallations increasing, eventually I needed a better solution. What started as a hardening script that was run post-installation has merged into the fully automated installation script that you see before you.
🚧 WARNING
This repository is provided for archival/educational purposes, I am not responsible for any data loss or
damage that may ensue.
AArch or Automated Arch Linux is a template-based automated installer for Arch Linux. This script is the convergence of my Arch Linux Installation along with my Hardening Arch Linux (HAL) articles on my personal wiki.
Before you can start aarch, a moduli must be generated. This will take a
considerable amount of time depending on your CPU, if this is being executed
inside of a virtualized environment it is recommended that you use haveged.
ssh-keygen -M generate -O bits=4096 moduli.c
ssh-keygen -M screen -f moduli.c moduli
rm moduli.cAfter the moduli has been generated the example.aa file can be edited for
a fully automated installation. This file can be named anything you like as long
as it retains it's extension (eg. machine.aa). Without a template file you will
instead be asked to input all of the information to the console when running
aarch.
Boot up the machine and/or vm with an ARCHISO image.
Next decide if you want the script baked into an ISO or if you just want to
scp the script to the installation environment everytime. If you choose to
build your own ARCHISO it will help to follow these guidelines:
- Use
relengas your base template. - Add the
gitandwgetpackages to thepackages.x86_64file so that it will be installed an usable in the installation environment. - Revert to traditional interface names with
ln -s /dev/null airootfs/etc/udev/rules.d/80-net-setup-link.rules aarch,erase_hdd,firstboot.txtandmodulimust be placed into in theairootfs/rootdirectory prior to building.- Include an
.aatemplate file in theairootfs/rootdirectory for script automation. - Also include an wanted packages from the
pkgdirectory. - Modify the
profiledef.shscript to make sureaarch,erase_hddand any packages you included have0:0:755setting, this sets user:group:permissions. - Modify the
airootfs/root/.zloginscript to enable thesshd.serviceon boot by addingsystemctl enable --now sshd.service. Then set a root password with the commandchpasswd <<< "root:moo", with 'moo' being the password.
Instructions for building your own image can be found here.
If instead you choose not to bake the script into an ISO, simply boot an
existing ARCHISO, use the E key to edit the kernel commandline at the bootloader
menu, adding net.ifnames=0 to boot with traditional network interface names.
The ARCHISO will automatically log you into the root account, install git and
wget.
pacman -Syy git wgetThen modify the root password and enable sshd, finally checking the assigned IP.
passwd
systemctl start sshd
ip aFinally SCP over to the machine aarch, erase_hdd, firstboot.txt, moduli
and an .aa template.
In order to run aarch properly you will need all of the following files in
the home directory of the root user in the livecd environment for the machine
or virtual machine you are trying to install.
aarch erase_hdd firstboot.txt moduliIn addition it also pays to have an .aa template.
To run, simply execute the script.
./aarchThis will read the first .aa template found in the current directory. If no
template is found it will prompt the user to input the configuration through
the console.
Absolute automation can be achieved by adding aarch to the .bashrc of the
root user on the ISO in addition to including a pre-filled in .aa template.