Arch-Linux-Bootstrap: A Script to bootstrap an Arch Linux image
The scripts in this package can be used to generate a minimal disk image of Arch Linux, i.e. as a base for virtual machines. The images are geared towards libvirt/kvm but it shouldn’t be much of a problem to adapt the scripts for other environments.
You can clone the script repository on GitHub: https://github.com/elcamino/arch-linux-bootstrap.
The image includes a fully configured instance of vim with full syntax highlighting and auto-completion for Go, Ruby and many other programming languages supported by vim natively.
The vim setup also includes the airline package for a pretty status line.
Via command line flags the bootstrap script will install the Arch Linux base devel packages, Go, Ruby and Git.
In order to create an image you need to run
bootstrap.sh as root in Arch Linux.
bootstrap.sh supports the following parameters:
--locales="de_DE.UTF-8 en_US.UTF-8"The list of locales to install
--default-locale=de_DE.UTF-8Use this locale as default locale
--console-keymap=de-latin1Use this keymap as the console keymap
--console-font=lat9w-16Use this font as the console font
--user=archbootstrap.sh creates one user with this login name
--password=archthe password for the newly created user
--hostname=arch-minimalthe machine’s hostname
--timezone="Europe/Berlin"the machine’s timezone
--with-goinstall go and set up an environment for the newly created user (default: no)
--with-rubyinstall ruby (default: no)
--with-gitinstall git (default: no)
--with-develinstall the base-devel packages for Arch Linux (default: no)
The default script assumes that the first network interface ist called
ens3 and that
the interface is setup via dhcp.
If your setup is different, place your network configuration files in the network directory and the bootstrap script will install and activate all networks you need.
The image only consists of one filesystem on the entire disk. There are no partitions.
The system is configured to resize /dev/vda to its full extent every time it boots. If
your hard disk has a different name, e.g. /dev/xvda, change /dev/vda to the actual name
SSH is enabled by default. Place all keys that need to be able to log into the machine in ssh/authorized_keys.
sudo ./bootstrap.sh --locales="en_US.UTF-8 fr_FR.UTF-8" \ --default-locale=en_US.UTF-8 \ --user=bob \ --password=bobspassword \ --hostname=bearclaw.scw.systems \ --timezone="America/Los_Angeles" \ --with-go \ --with-ruby \ --with-devel \ --with-git