arch-zbm
Helper script to install Arch Linux with ZFSBootMenu from within a running Arch Linux live CD ISO image
Prep
We expect minimal prep on your end. Please make sure that before execution the following conditions are met.
- Arch Linux live CD ISO image sees exactly one partition with partition type code
BF00("Solaris root") - Arch Linux live CD ISO image sees exactly one partition with partition type code
EF00("EFI system partition") - No ZFS zpool exists
The script will create a single ZFS zpool zpool on the BF00 partition with dataset child zpool/root which itself has one child zpool/root/archlinux, that's where Arch Linux gets installed. Parallel to zpool/root it'll create zpool/data with a zpool/data/home child dataset that gets mounted at /home.
The script will use the EF00 partition to install a ZFSBootMenu EFI executable if efibootmgr says that no such ZFSBootMenu entry exists. If ZFSBootMenu gets added to the EFI partition it'll become primary boot option.
How to run this?
- Boot an Arch Linux live CD ISO image
- Run:
During execution the script will call itself when it changes into its
export SCRIPT_URL='https://quico.space/quico-os-setup/arch-zbm/raw/branch/main/setup.sh' curl -s "${SCRIPT_URL}" | bashchroot, that's why weexport SCRIPT_URL. Feel free to update"${SCRIPT_URL}"with whatever branch or revision you want to use from quico.space/quico-os-setup/arch-zbm. Typically.../branch/main/setup.shas shown above is what you want.
Steps
The scripts takes the following installation steps.
- Install ZFS tools and kernel module with github.com/eoli3n/archiso-zfs
- Create one encrypted ZFS zpool on top of
BF00partition, passwordpassword - Create dataset for Arch Linux and
/home - Install Arch Linux into pool
- Add ZFSBootMenu to
EF00partition if it doesn't exist already - Exit into Arch Linux live CD ISO image shell for you to
rebootand frolick
Flavor choices
We make the following opinionated flavor choices. Feel free to change them to your liking.
- Arch Linux locale is set to
en_US.UTF-8 - Keymap is
de-latin1- Consult
/etc/vconsole.conf - Change
zfs set org.zfsbootmenu:commandline=...
- Consult
- No X.Org Server, Wayland compositors or other GUI elements get installed
- Timezone is
Etc/UTC- Check
timedatectl set-timezone <tzdata-zone>
- Check
Post-run manual steps
After installation you're going to want to at least touch these points in your new Arch Linux install:
- Package manager hook:
pacmandoes not have a hook to do ZFS snapshots- See this GitHub gist and zfs-snapshotter.bash for inspiration
- Hostname: Installation chose a pseudo-randomly generated 8-character string with
pwgen - Unprivileged user accounts: The OS was installed with
rootand unprivilegedbuildusers - Passwords
- ZFS: The password for all datasets underneath
zpoolispassword. - Local
rootaccount: The localrootaccount's password ispassword.
- ZFS: The password for all datasets underneath
- Arch User Repository (AUR) helper: We installed paru as our AUR helper, we installed from GitHub via
makepkg -si.
Development
Conventional commits
This project uses Conventional Commits for its commit messages.
Commit types
Commit types besides fix and feat are:
build: Project structure, directory layout, build instructions for roll-outrefactor: Keeping functionality while streamlining or otherwise improving function flowtest: Working on test coveragedocs: Documentation for project or components
Commit scopes
The following scopes are known for this project. A Conventional Commits commit message may optionally use one of the following scopes or none:
iso: Changing Arch Linux ISO CDzbm: Adjusting ZFSBootMenu's behaviorzfs: A change to how ZFS interacts with the system, either a pool or a datasetos: Getting an perating system set up to correctly work in a ZFS boot environmentmeta: Affects the project's repo layout, readme content, file names etc.
Credits
Most of what's here was shamelessly copied and slightly adapted for personal use from Jonathan Kirszling at GitHub.
Thanks to:
- Jonathan Kirszling:
- Maurizio Oliveri:
- Zach Dykstra, Andrew J. Hesford and all other ZFSBootMenu contributors:
- github.com/kongkrit: