1b81ad4914
mkarchiso reuses completed stages in the work dir -> a 'too short' build that ships a stale airootfs. bootstrap now 'rm -rf' the work dir first. Also switch profiledef bootmodes to the non-deprecated names (bios.syslinux, uefi.systemd-boot). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
52 lines
2.3 KiB
Bash
Executable File
52 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Assemble the TANINUX archiso profile = canonical `releng` base + our overrides,
|
|
# then (optionally) build the ISO. Run as your user; mkarchiso uses sudo.
|
|
#
|
|
# sudo pacman -S archiso # once
|
|
# ./bootstrap-profile.sh # assemble ./build-profile/
|
|
# ./bootstrap-profile.sh --build # assemble + mkarchiso -> ./out/
|
|
#
|
|
# Why this approach: we don't hand-maintain the bootloader/mkinitcpio boilerplate
|
|
# (error-prone) — we take it from the authoritative releng profile and only
|
|
# overlay our deltas (profiledef, pacman.conf, packages, airootfs, calamares).
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
RELENG=/usr/share/archiso/configs/releng
|
|
PROFILE="$HERE/build-profile"
|
|
|
|
[ -d "$RELENG" ] || { echo "archiso not installed — run: sudo pacman -S archiso"; exit 1; }
|
|
|
|
echo "==> base: copy releng -> build-profile"
|
|
rm -rf "$PROFILE"
|
|
cp -r "$RELENG" "$PROFILE"
|
|
|
|
echo "==> kernel: live ISO uses linux-zen (matches the target)"
|
|
sed -i 's/^linux$/linux-zen/' "$PROFILE/packages.x86_64"
|
|
# point the live boot entries at the zen kernel images
|
|
grep -rl -e 'vmlinuz-linux' -e 'initramfs-linux' \
|
|
"$PROFILE/efiboot" "$PROFILE/syslinux" "$PROFILE/grub" 2>/dev/null \
|
|
| xargs -r sed -i -e 's/vmlinuz-linux/vmlinuz-linux-zen/g' \
|
|
-e 's/initramfs-linux/initramfs-linux-zen/g'
|
|
|
|
echo "==> branding: Arch Linux -> TANINUX in the boot menus"
|
|
grep -rl 'Arch Linux' "$PROFILE/efiboot" "$PROFILE/syslinux" "$PROFILE/grub" 2>/dev/null \
|
|
| xargs -r sed -i -e 's/Arch Linux/TANINUX/g' -e 's/Archlinux/TANINUX/g'
|
|
|
|
echo "==> overlay TANINUX overrides"
|
|
cat "$HERE/overrides/packages.x86_64" >> "$PROFILE/packages.x86_64"
|
|
install -m644 "$HERE/overrides/profiledef.sh" "$PROFILE/profiledef.sh"
|
|
install -m644 "$HERE/overrides/pacman.conf" "$PROFILE/pacman.conf"
|
|
cp -rT "$HERE/overrides/airootfs" "$PROFILE/airootfs"
|
|
|
|
echo "==> profile ready: $PROFILE"
|
|
WORK=/tmp/tanin-work
|
|
if [ "${1:-}" = "--build" ]; then
|
|
echo "==> clean work dir (mkarchiso reuses stale stages otherwise -> 'too short' builds)"
|
|
sudo rm -rf "$WORK"
|
|
echo "==> building ISO (sudo mkarchiso) … this takes a while (downloads + squashfs)"
|
|
sudo mkarchiso -v -w "$WORK" -o "$HERE/out" "$PROFILE"
|
|
echo "ISO written to $HERE/out/"
|
|
else
|
|
echo "build with: sudo rm -rf $WORK && sudo mkarchiso -v -w $WORK -o \"$HERE/out\" \"$PROFILE\""
|
|
fi
|