- deploy-disk.sh: the shared "write a finished system to a disk" step — partition (GPT bios/efi) -> btrfs layout via btrfs/init.sh -> rsync rootfs -> chroot (real fstab, GRUB, hostname). Carries the optional ARCLINE_SIGN hook; the signing tooling itself lands in a later commit. - apply-fstab.sh: renders the edition fstab template with real root/efi UUIDs and drops the swap line. - build-image.sh: rootfs -> bootable qcow2/raw disk image (sparse file + loop device + deploy), the cloud edition's primary output. - install.sh: scripted installer for a real disk, confirmation-gated. - Makefile: image-<edition> targets (+ minimal variants); build-edition.sh learns the "image" stage; cloud metadata now ships a disk image. - check-host-deps.sh / GitLab CI: add gdisk, parted, rsync, dosfstools, qemu-utils, dpkg, sbsigntool to the build image.
117 lines
5.7 KiB
Makefile
117 lines
5.7 KiB
Makefile
# ─────────────────────────────────────────────────────────────────────────────
|
|
# Arcline OS — top-level build orchestration
|
|
#
|
|
# The Makefile is a thin, readable wrapper around the scripts/ pipeline. It
|
|
# exists so that "make iso-server" is the one command that takes a host with
|
|
# the right build deps to a bootable Arcline OS ISO.
|
|
#
|
|
# Everything that has real logic lives in scripts/ — this file only wires
|
|
# editions to targets and passes through environment.
|
|
#
|
|
# Quick reference:
|
|
# make help → this message
|
|
# make deps → install host build dependencies
|
|
# make check → validate manifests + shell syntax (fast, safe)
|
|
# make rootfs-<edition> → build just the rootfs for an edition
|
|
# make iso-<edition> → build a bootable ISO for an edition
|
|
# make iso → build all editions
|
|
# make toolchain → build the 11 Arcline Go tools into .deb
|
|
# make test → run the smoke tests against a built image
|
|
# make clean → wipe build/
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
SHELL := /bin/bash
|
|
.DEFAULT_GOAL := help
|
|
|
|
include versions.mk
|
|
|
|
# Pass edition + env through to the scripts.
|
|
export DISTRO_NAME DISTRO_ID VERSION RELEASE_NAME
|
|
export DEBIAN_SUITE DEBIAN_MIRROR SECURITY_MIRROR ARCH
|
|
export KERNEL_PACKAGE KERNEL_VERSION
|
|
export BUILD_DIR ROOTFS_DIR IMAGE_DIR DEB_DIR LOG_DIR ARTIFACT_DIR
|
|
export TOOLCHAIN_REPO
|
|
|
|
ROOT := $(CURDIR)
|
|
EDITION := $(filter-out $@,$(MAKECMDGOALS))
|
|
|
|
.PHONY: help deps check toolchain vendor test clean
|
|
|
|
# ── help ────────────────────────────────────────────────────────────────────
|
|
help:
|
|
@echo "Arcline OS build targets"
|
|
@echo "───────────────────────"
|
|
@echo " make deps Install host build dependencies"
|
|
@echo " make check Validate manifests + shell syntax"
|
|
@echo " make rootfs-<edition> Build rootfs (server|workstation|cloud)"
|
|
@echo " make iso-<edition> Build ISO (server|workstation|cloud)"
|
|
@echo " make image-<edition> Build disk image (qcow2; cloud edition)"
|
|
@echo " make iso Build ISO for every edition"
|
|
@echo " make iso-<edition>-minimal Build ISO WITHOUT the Arcline toolchain"
|
|
@echo " make toolchain Build the 11 Go tools into .deb"
|
|
@echo " make vendor Build grafana/loki/promtail .debs"
|
|
@echo " make test Run smoke tests against a built image"
|
|
@echo " make clean Remove build/ artifacts"
|
|
@echo
|
|
@echo "Configuration (see versions.mk):"
|
|
@echo " VERSION=$(VERSION) DEBIAN_SUITE=$(DEBIAN_SUITE) ARCH=$(ARCH)"
|
|
@echo " ARCLINE_TOOLCHAIN=auto|skip|require (toolchain in image builds)"
|
|
|
|
# ── host deps ────────────────────────────────────────────────────────────────
|
|
deps:
|
|
@./scripts/check-host-deps.sh
|
|
|
|
# ── validation (fast, no network, safe on any machine) ──────────────────────
|
|
check:
|
|
@./scripts/validate.sh
|
|
|
|
# ── edition builds ──────────────────────────────────────────────────────────
|
|
# ARCLINE_TOOLCHAIN controls whether the 11 Go tools are included:
|
|
# auto (default) install if build/debs/ has .deb files, else skip
|
|
# skip never install (minimal image)
|
|
# require fail if no .deb files are available
|
|
# The *-minimal targets are a shortcut for ARCLINE_TOOLCHAIN=skip.
|
|
define ISO_RULE
|
|
.PHONY: rootfs-$(1) iso-$(1) image-$(1) clean-$(1) rootfs-$(1)-minimal iso-$(1)-minimal image-$(1)-minimal
|
|
rootfs-$(1):
|
|
@./scripts/build-edition.sh $(1) rootfs
|
|
|
|
iso-$(1):
|
|
@./scripts/build-edition.sh $(1) iso
|
|
|
|
image-$(1):
|
|
@./scripts/build-edition.sh $(1) image
|
|
|
|
rootfs-$(1)-minimal:
|
|
@ARCLINE_TOOLCHAIN=skip ./scripts/build-edition.sh $(1) rootfs
|
|
|
|
iso-$(1)-minimal:
|
|
@ARCLINE_TOOLCHAIN=skip ./scripts/build-edition.sh $(1) iso
|
|
|
|
image-$(1)-minimal:
|
|
@ARCLINE_TOOLCHAIN=skip ./scripts/build-edition.sh $(1) image
|
|
|
|
clean-$(1):
|
|
@rm -rf "$(ROOTFS_DIR)/$(1)" "$(IMAGE_DIR)/$(1)"
|
|
endef
|
|
$(foreach e,$(EDITIONS),$(eval $(call ISO_RULE,$(e))))
|
|
|
|
iso: $(foreach e,$(EDITIONS),iso-$(e))
|
|
|
|
# ── toolchain ───────────────────────────────────────────────────────────────
|
|
toolchain:
|
|
@./toolchain/build-tools.sh
|
|
|
|
# ── vendor packaging (grafana / loki / promtail) ────────────────────────────
|
|
vendor:
|
|
@./toolchain/build-vendor.sh
|
|
|
|
# ── tests ───────────────────────────────────────────────────────────────────
|
|
test:
|
|
@./tests/run-tests.sh
|
|
|
|
# ── clean ───────────────────────────────────────────────────────────────────
|
|
clean:
|
|
@rm -rf "$(BUILD_DIR)"
|
|
@echo "removed $(BUILD_DIR)/"
|