diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b48047f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +.iso +iso-output +docs/_site diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..3ca77b0 --- /dev/null +++ b/Containerfile @@ -0,0 +1,56 @@ +# Antergos NeXT ISO build container +# +# Build an Antergos NeXT ISO inside an Artix Linux container. This is the +# same path GitHub Actions uses, so anyone can produce a release ISO without +# running an Artix/Arch system (works on Gentoo, Fedora, anything with podman). +# +# Usage: +# podman build -t antergos-build . +# podman run --rm --privileged \ +# -v /var/lib/artools-buildiso:/var/lib/artools/buildiso \ +# -v "$(pwd)/iso-output:/workspace/iso-output" \ +# -e WORKSPACE_DIR=/workspace \ +# antergos-build +# +# --privileged is required: artools' chroot (via basestrap) mounts devtmpfs, +# proc and sysfs into the target, which rootless containers cannot do. +# +# The finished ISO is written to /workspace/iso-output (bind-mounted above). + +FROM docker.io/artixlinux/artixlinux:base + +ENV INITSYS=dinit \ + WORKSPACE_DIR=/workspace \ + CHROOTS_DIR=/var/lib/artools + +# Full dependency set for an ISO build: artools (base + iso tools), squashfs +# for the .sfs layers, mkinitcpio for the initramfs, grub + xorriso for the +# bootable image, git/python for CI tooling and the Internet Archive uploader. +RUN pacman -Syu --noconfirm --needed --overwrite='*' \ + artools \ + git \ + squashfs-tools \ + sudo \ + python \ + python-pip \ + xorriso \ + dosfstools \ + syslinux \ + gptfdisk \ + mtools + +# This repo's buildiso and profiles become the default build payload. Mounting +# a live checkout over /workspace at runtime replaces these with the user's copy. +WORKDIR /workspace +COPY . . + +# Point artools at the Antergos package repository. CI copies the profile's +# pacman.conf into both the user config dir (first match) and artools' defaults. +RUN mkdir -p /root/.config/artools/pacman.conf.d \ + && cp pacman.conf.d/iso-x86_64.conf /root/.config/artools/pacman.conf.d/iso-x86_64.conf \ + && cp pacman.conf.d/iso-x86_64.conf /usr/share/artools/pacman.conf.d/iso-x86_64.conf + +# The modified buildiso lives in this repo and must be used instead of +# /usr/bin/buildiso (which lacks --overwrite='*'). +ENTRYPOINT ["/workspace/buildiso"] +CMD ["-p", "antergos"] diff --git a/README.md b/README.md index 79b2cf4..eae4297 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,57 @@ The Antergos NeXT project prefers init system flexibility over systemd lock-in. ## Building -Requires an **Artix-based** system: +### Option A: Build in a container (non-pacman distros — recommended) + +No Artix/Arch needed. Works on Gentoo, Fedora, Debian — anything **without +pacman** that has podman. This is the same path GitHub Actions CI uses. ```bash -# Install build deps +# Build the image (installs artools + deps inside an Artix container) +podman build -t antergos-build . + +# Build the ISO (rootful podman required — artools chroots mount devtmpfs, +# which rootless containers cannot do) +sudo podman run --rm --privileged \ + -v /var/lib/artools-buildiso:/var/lib/artools/buildiso \ + -v "$(pwd)/iso-output:/workspace/iso-output" \ + -e WORKSPACE_DIR=/workspace \ + antergos-build +``` + +Or use the helper script: + +```bash +./build-iso-podman.sh +``` + +The finished `.iso` lands in `iso-output/`. + +### Option B: Native build (just pacman + artools) + +You do **not** need an Artix-based system — `buildiso` is plain bash on top of +`pacman`. You need: + +- `pacman` (native on Arch/Artix/**KaOS**; on other distros, install it or + extract the `.pkg.tar.zst` files) +- the artools libraries from the Artix repo: `artools-base` (provides + `basestrap`, `artix-chroot`, `fstabgen`) and `artools-iso` (provides + `buildiso`) plus their deps +- `squashfs-tools`, `grub`, `xorriso`/`libisoburn`, `dosfstools`, `mtools` + +```bash +# On Arch/Artix: pacman -S artools squashfs-tools modprobe loop +# On KaOS (pacman native, but artools not in KaOS repos — extract from Artix): +pacman -S squashfs-tools +# grab artools-base/artools-iso from the Artix repo and extract over / + +# On other distros: grab the packages from the Artix repo and extract +# them over / (e.g. into /usr/share/artools and /usr/bin), then install +# pacman and the deps listed above. + # Clone and enter git clone https://github.com/Antergos-NeXT/antergos-iso.git cd antergos-iso @@ -59,6 +103,11 @@ The `.iso` appears in `/var/lib/artools/buildiso/iso/antergos/`. First build pulls ~5 GB from the internet. Subsequent builds use pacman cache. +> **Which option do I use?** +> +> - **Arch / Artix / KaOS / any pacman-based distro** → Option B (native). +> - **Anything else** (Gentoo, Fedora, Debian, ...) → Option A (podman). + ### Custom packages The ISO pulls custom packages (branding, Calamares config, wallpapers) from our repo. Add it to your system: diff --git a/build-iso-podman.sh b/build-iso-podman.sh new file mode 100755 index 0000000..9a1ee7b --- /dev/null +++ b/build-iso-podman.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -euo pipefail + +# Antergos NeXT ISO build inside the Artix container (see Containerfile). +# Rootful podman is required: artools' chroot mounts devtmpfs, which rootless +# containers cannot do. + +cd "$(dirname "$0")" + +# 1. Ensure the build image exists +if ! podman image exists localhost/antergos-build:latest; then + podman build -t antergos-build . +fi + +# 2. Run the build (privileged, workspace mounted, tmpfs workdir, ISO exported) +sudo podman run --rm --privileged \ + -v "$(pwd):/workspace" \ + -e WORKSPACE_DIR=/workspace \ + -e INITSYS=dinit \ + antergos-build sh -c ' + set -euo pipefail + mkdir -p /var/lib/artools/buildiso + mount -t tmpfs -o size=12G,exec,suid,dev tmpfs /var/lib/artools/buildiso + /workspace/buildiso -p antergos + echo "=== BUILD FINISHED ===" + mkdir -p /workspace/iso-output + cp -a /var/lib/artools/buildiso/iso/antergos/. /workspace/iso-output/ 2>/dev/null || true + ls -la /workspace/iso-output/ | head -20 + '