diff --git a/scripts/build-live.sh b/scripts/build-live.sh index db3d5b0..aed0b9e 100755 --- a/scripts/build-live.sh +++ b/scripts/build-live.sh @@ -55,12 +55,15 @@ chroot_run() { chroot "$LIVE_ROOT" /bin/bash -c "$*"; } # ── 2. install live session packages ──────────────────────────────────────── log "[1/4] installing live-boot + X + installer dependencies" mount_pseudo +# deploy tooling (gdisk parted dosfstools btrfs-progs rsync) is needed by +# deploy-disk.sh, which the graphical installer runs against the target disk. chroot_run "export DEBIAN_FRONTEND=noninteractive apt-get update -qq apt-get install -y --no-install-recommends \ live-boot live-config-systemd live-tools \ xserver-xorg x11-xserver-utils openbox \ - python3-gi gir1.2-gtk-3.0 gdisk parted dosfstools \ + python3-gi gir1.2-gtk-3.0 \ + gdisk parted dosfstools btrfs-progs rsync \ | tee /tmp/live-packages.log" # Modern Xorg refuses to run as root, so the live session runs as a dedicated diff --git a/scripts/check-host-deps.sh b/scripts/check-host-deps.sh index ab5a05d..0157368 100755 --- a/scripts/check-host-deps.sh +++ b/scripts/check-host-deps.sh @@ -33,6 +33,12 @@ NEEDED=( "sbverify|sbsigntool" # hybrid ISO: mtools builds the embedded EFI image that grub-mkrescue uses "mformat|mtools" + # deploy path (deploy-disk.sh): partition, btrfs, and copy tooling + "mkfs.btrfs|btrfs-progs" + "btrfs|btrfs-progs" + # toolchain / vendor downloads + "curl|curl" + "git|git" ) MISSING=() diff --git a/scripts/deploy-disk.sh b/scripts/deploy-disk.sh index f97a50a..9094013 100755 --- a/scripts/deploy-disk.sh +++ b/scripts/deploy-disk.sh @@ -42,10 +42,26 @@ validate_edition "$EDITION" [[ -d "$ROOTFS" ]] || die "rootfs '$ROOTFS' does not exist (build it first: make rootfs-$EDITION)" [[ -e "$DEV" ]] || die "device '$DEV' does not exist" -for tool in sgdisk mkfs.btrfs rsync; do - command -v "$tool" >/dev/null || die "missing host tool '$tool' (run: scripts/check-host-deps.sh --install)" +# ── deploy tool pre-flight ───────────────────────────────────────────────── +# Report EVERY missing tool at once (no one-at-a-time whack-a-mole), with the +# exact install command. Runs on the build host for image/install builds and +# inside the live image for the graphical installer. +declare -A TOOL_PKG=( + [sgdisk]=gdisk [partprobe]=parted + [mkfs.btrfs]=btrfs-progs [btrfs]=btrfs-progs + [rsync]=rsync [wipefs]=util-linux [truncate]=coreutils + [mkfs.vfat]=dosfstools +) +MISSING_TOOLS=() +for tool in sgdisk partprobe mkfs.btrfs btrfs rsync wipefs truncate mkfs.vfat; do + [[ "$tool" == "mkfs.vfat" && "$BOOT" != "efi" ]] && continue + command -v "$tool" >/dev/null 2>&1 || MISSING_TOOLS+=("$tool") done -[[ "$BOOT" == "efi" ]] && { command -v mkfs.vfat >/dev/null || die "missing 'mkfs.vfat' (package: dosfstools)"; } +if [[ ${#MISSING_TOOLS[@]} -gt 0 ]]; then + pkgs="" + for t in "${MISSING_TOOLS[@]}"; do pkgs+=" ${TOOL_PKG[$t]}"; done + die "missing deploy tools: ${MISSING_TOOLS[*]} — install: apt-get install -y${pkgs} (or: scripts/check-host-deps.sh --install)" +fi # device + partition naming: /dev/sda → /dev/sda1, /dev/nvme0n1 → /dev/nvme0n1p1, /dev/loop0 → /dev/loop0p1 part_of() {