Files
os-build/scripts/check-host-deps.sh
Blake Ridgway 51d87daa7b feat: add disk-deploy core, disk image builder, and installer
- 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.
2026-08-21 13:33:17 -05:00

67 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────────────────────
# Arcline OS — host build-dependency check
#
# scripts/check-host-deps.sh → report what's missing
# scripts/check-host-deps.sh --install → apt-get install what's missing
#
# Builds run debootstrap (rootfs), copy overlays (standard tools), and produce
# a hybrid ISO via grub-mkrescue + mksquashfs.
# ─────────────────────────────────────────────────────────────────────────────
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
NEEDED=(
"debootstrap|debootstrap"
"grub-mkrescue|grub2-common"
"mksquashfs|squashfs-tools"
"xorriso|xorriso"
"cpio|cpio"
"bash|bash"
# disk images / installer
"sgdisk|gdisk"
"partprobe|parted"
"rsync|rsync"
"mkfs.vfat|dosfstools"
"qemu-img|qemu-utils"
"losetup|util-linux"
# vendor packaging + secure boot
"unzip|unzip"
"dpkg-deb|dpkg"
"openssl|openssl"
"sbsign|sbsigntool"
"sbverify|sbsigntool"
)
MISSING=()
for entry in "${NEEDED[@]}"; do
bin="${entry%%|*}"; pkg="${entry##*|}"
if ! command -v "$bin" >/dev/null 2>&1; then
MISSING+=("$pkg")
warn "missing: $bin (package: $pkg)"
fi
done
if [[ ${#MISSING[@]} -eq 0 ]]; then
log "all host build dependencies present ✓"
exit 0
fi
if [[ "${1:-}" == "--install" ]]; then
log "installing: ${MISSING[*]}"
if [[ $EUID -ne 0 ]] && command -v sudo >/dev/null; then
sudo apt-get update
sudo apt-get install -y "${MISSING[@]}"
else
apt-get update
apt-get install -y "${MISSING[@]}"
fi
log "dependencies installed ✓"
else
echo
echo "Run the following to install them:"
echo " sudo apt-get install -y ${MISSING[*]}"
echo "or: scripts/check-host-deps.sh --install"
exit 1
fi