veilor-os/kickstart/install-ostreecontainer-installer.ks

124 lines
4 KiB
Text
Raw Normal View History

# veilor-os installer kickstart — v0.7 CI build variant
#
# Derived from kickstart/install-ostreecontainer.ks by stripping all
# __PLACEHOLDER__ tokens that the runtime gum TUI substitutes at install
# time. Anaconda's interactive TUI handles disk selection, LUKS passphrase,
# and user account creation in their place.
#
# Consumed by livemedia-creator --make-iso to produce
# veilor-os-installer-43-*.iso. Do NOT add __PLACEHOLDER__ tokens here —
# they cannot be filled at build time. See install-ostreecontainer.ks
# for the runtime template the gum TUI fills in.
# ── Locale / keyboard / time ──
keyboard --xlayouts='us'
lang en_US.UTF-8
timezone Europe/London --utc
# ── Install mode ──
text
firstboot --disable
eula --agreed
selinux --enforcing
# ── Network ──
network --bootproto=dhcp --device=link --activate --hostname=veilor-install
firewall --enabled --service=ssh
# ── Identity ──
# rootpw --lock only. No user directive — Anaconda's user spoke handles
# admin account creation interactively. Runtime ks substitutes
# --password=__ADMIN_PW__ for unattended installs.
rootpw --lock
# ── Disk / partitioning ──
# Intentionally absent. Anaconda's disk spoke presents interactive
# disk + LUKS + btrfs selection. Runtime ks (gum TUI) provides the
# full partition spec at real-install time.
# ── Packages for the LIVE BOOT ENVIRONMENT ──
# These are NOT installed on the target system. They populate the
# squashfs that boots Anaconda. The target is populated by
# `ostreecontainer` below from the OCI image.
%packages
@^minimal-environment
@core
@anaconda-tools
anaconda-live
anaconda-tui
livesys-scripts
dracut-live
dracut-config-generic
kernel
kernel-modules
kernel-modules-extra
glibc-all-langpacks
ostree
rpm-ostree
bootupd
grub2-efi-x64
grub2-efi-x64-modules
grub2-pc
grub2-pc-modules
grub2-tools
grub2-tools-extra
shim-x64
efibootmgr
syslinux
isomd5sum
xorriso
%end
# ── ostreecontainer: populate / from veilor-os OCI ──
ostreecontainer --url=ghcr.io/veilor-org/veilor-os:43 --transport=registry
# ── %post (chroot) ──
%post
set -uo pipefail
echo veilor-install > /etc/hostname
chage -d 0 admin 2>/dev/null || true
%end
# ── %post --nochroot — persist install logs to USB (toggle: veilor.install_logs=on|off) ──
#
# Runs OUTSIDE the target chroot so /tmp/anaconda.log etc. on the live
# ramdisk are accessible alongside /mnt/sysroot. Calls the helper that
# ships in the veilor-os OCI image overlay; if the helper is missing
# (corrupt overlay, stripped image, etc.) we fall back to a minimal
# inline copy. NEVER fail the install over log persistence.
#
# Default: ON until v1.0 final. Disable per-boot:
# edit GRUB / press 'e', append: veilor.install_logs=off
%post --nochroot --erroronfail=no
set -uo pipefail
VEILOR_HELPER="/mnt/sysroot/usr/share/veilor-os/scripts/persist-install-logs.sh"
[ -x "$VEILOR_HELPER" ] || VEILOR_HELPER="/mnt/sysimage/usr/share/veilor-os/scripts/persist-install-logs.sh"
if [ -x "$VEILOR_HELPER" ]; then
"$VEILOR_HELPER" || true
else
# Inline fallback — toggle-aware, backup-only (no USB write attempt).
TS="$(date -u +%Y-%m-%dT%H-%M-%SZ)"
SR=/mnt/sysroot; [ -d "$SR" ] || SR=/mnt/sysimage
DST="${SR}/var/log/veilor-install-logs/${TS}"
TOGGLE=on
for tok in $(cat /proc/cmdline 2>/dev/null); do
case "$tok" in veilor.install_logs=off|veilor.install_logs=0|veilor.install_logs=false|veilor.install_logs=no) TOGGLE=off ;; esac
done
if [ "$TOGGLE" = "on" ]; then
mkdir -p "$DST" 2>/dev/null || true
for f in /tmp/anaconda.log /tmp/program.log /tmp/storage.log \
/tmp/packaging.log /tmp/syslog /tmp/dnf.log \
/tmp/ks.cfg /run/veilor-installer.log; do
[ -e "$f" ] && cp -a "$f" "$DST/" 2>/dev/null || true
done
dmesg > "$DST/dmesg.txt" 2>/dev/null || true
journalctl --no-pager -b > "$DST/journalctl-b.txt" 2>/dev/null || true
echo "[veilor] inline fallback used — helper missing at $VEILOR_HELPER" \
> "$DST/manifest.txt"
fi
fi
exit 0
%end