ks: %post --nochroot loosened error handling + nochroot trace log

Found via debugfs: overlay copy succeeds (veilor-power, tuned profiles,
sshd-hardening, sudoers, systemd units all present in v0.2.1 rootfs) but
`mkdir + cp assets/scripts` aborted with set -eu — leaves /usr/share/
veilor-os missing → all chroot %post scripts fail. Switch to set +e on cp
plus persist trace log to /var/log/veilor-nochroot.log for next debug.
This commit is contained in:
veilor-org 2026-05-01 15:21:22 +01:00
parent 9c6136f01f
commit 3408841822

View file

@ -131,8 +131,8 @@ fira-code-fonts
%end %end
# ── Post-install (nochroot): copy overlay tree into installed root ── # ── Post-install (nochroot): copy overlay tree into installed root ──
%post --nochroot %post --nochroot --erroronfail
set -eu set -uo pipefail
# DEST: livecd-creator sets INSTALL_ROOT, livemedia-creator uses /mnt/sysimage. # DEST: livecd-creator sets INSTALL_ROOT, livemedia-creator uses /mnt/sysimage.
DEST="${INSTALL_ROOT:-/mnt/sysimage}" DEST="${INSTALL_ROOT:-/mnt/sysimage}"
[[ -d $DEST ]] || { echo "[ERR] DEST=$DEST does not exist (livecd-creator? livemedia-creator?)" >&2; exit 1; } [[ -d $DEST ]] || { echo "[ERR] DEST=$DEST does not exist (livecd-creator? livemedia-creator?)" >&2; exit 1; }
@ -162,11 +162,24 @@ if [[ -z $SRC ]]; then
exit 1 exit 1
fi fi
echo "[INFO] using SRC=$SRC" echo "[INFO] using SRC=$SRC DEST=$DEST"
cp -a "$SRC/overlay/." "$DEST/" set -x
mkdir -p "$DEST/usr/share/veilor-os" cp -a "$SRC/overlay/." "$DEST/" || echo "[ERR] overlay cp failed: $?"
cp -a "$SRC/assets" "$DEST/usr/share/veilor-os/" mkdir -p "$DEST/usr/share/veilor-os" || echo "[ERR] mkdir failed: $?"
cp -a "$SRC/scripts" "$DEST/usr/share/veilor-os/" ls -la "$SRC/assets" "$SRC/scripts" 2>&1 || echo "[ERR] assets/scripts missing in $SRC"
cp -a "$SRC/assets" "$DEST/usr/share/veilor-os/" || echo "[ERR] assets cp failed: $?"
cp -a "$SRC/scripts" "$DEST/usr/share/veilor-os/" || echo "[ERR] scripts cp failed: $?"
ls -la "$DEST/usr/share/veilor-os/" 2>&1 || echo "[ERR] dest dir missing post-cp"
set +x
# Persist nochroot log into installed system for diagnostics
{
echo "=== %post --nochroot trace ==="
date
echo "SRC=$SRC DEST=$DEST"
ls -la "$DEST/usr/share/veilor-os/" 2>&1
ls -la "$DEST/usr/local/sbin/" 2>&1
} > "$DEST/var/log/veilor-nochroot.log" 2>&1 || true
%end %end
# ── Post-install (chroot): apply hardening, theme, branding ── # ── Post-install (chroot): apply hardening, theme, branding ──