Skip to content

Instantly share code, notes, and snippets.

@akdev1l
Last active August 3, 2023 14:38
Show Gist options
  • Save akdev1l/dfe3a101743167335f8f093236ba2968 to your computer and use it in GitHub Desktop.
Save akdev1l/dfe3a101743167335f8f093236ba2968 to your computer and use it in GitHub Desktop.

Arch Linux SilverBlue - Bootstrap Process

  1. Create an arch linux chroot using podman:
podman run --rm -it \
    -v "$PWD:$PWD" \
    -w "$PWD" \
    archlinux:latest

pacman -Syu --noconfirm \
    && pacman -S --noconfirm arch-install-scripts

mkdir arch-chroot
pacstart -K arch-chroot base linux linux-firmware
  1. Use systemd-nspawn to go into the arch system to get dependencies installed
sudo systemd-nspawn -D arch-chroot
  1. Install dependencies for bootc:
pacman -S --noconfirm pkg-config openssl cargo make ostree
  1. Build bootc with make and copy the resulting bootc binary to /usr/bin
  2. Prepare and commit to the ostree repo
mkdir -p /ostree
ostree init --repo=/ostree/repo

# We need to skip some stuff that is problematic
cat > /tmp/skip-list.txt <<EOF
/dev
/proc
/run
/sys
/sysroot
/var
/tmp
/ostree
EOF

# Create commit with the rootfs already loaded
ostree commit --repo=/ostree/repo --skip-list=/tmp/skip-list.txt --branch main /
  1. Encapsulate the ostree ref into an OCI container via:
# This part needs to be done in Fedora outside of the arch-chroot as archlinux ostree does not have ostree-rs-ext
sudo ostree container encapsulate --repo=arch-chroot/ostree  main  oci:./akdev-arch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment