ks: %post --nochroot — multi-path overlay source detection (/work CI, /run/install/repo virt, kickstart-relative no-virt)
This commit is contained in:
parent
c62a5489f2
commit
5f650d45d8
1 changed files with 30 additions and 6 deletions
|
|
@ -113,14 +113,38 @@ fira-code-fonts
|
|||
# ── Post-install (nochroot): copy overlay tree into installed root ──
|
||||
%post --nochroot
|
||||
set -eu
|
||||
SRC=/run/install/repo/veilor
|
||||
DEST=/mnt/sysimage
|
||||
if [[ -d $SRC/overlay ]]; then
|
||||
cp -a $SRC/overlay/. $DEST/
|
||||
|
||||
# Try multiple source paths:
|
||||
# /run/install/repo/veilor — boot ISO (--virt mode)
|
||||
# /work — bind mount in CI container
|
||||
# $(dirname kickstart)/.. — local --no-virt builds
|
||||
SRC=""
|
||||
for candidate in /run/install/repo/veilor /work /mnt/work; do
|
||||
if [[ -d $candidate/overlay ]]; then
|
||||
SRC=$candidate
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Fallback: derive from kickstart path. Anaconda passes ks via --kickstart=<path>.
|
||||
if [[ -z $SRC ]]; then
|
||||
KS_PATH=$(ps -ef | grep -oP -- '--kickstart[= ]\K[^ ]+' | head -1)
|
||||
if [[ -n $KS_PATH && -d $(dirname "$KS_PATH")/../overlay ]]; then
|
||||
SRC=$(realpath "$(dirname "$KS_PATH")/..")
|
||||
fi
|
||||
fi
|
||||
mkdir -p $DEST/usr/share/veilor-os
|
||||
cp -a $SRC/assets $DEST/usr/share/veilor-os/
|
||||
cp -a $SRC/scripts $DEST/usr/share/veilor-os/
|
||||
|
||||
if [[ -z $SRC ]]; then
|
||||
echo "[ERR] cannot locate veilor-os repo source — overlay/scripts not copied" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[INFO] using SRC=$SRC"
|
||||
cp -a "$SRC/overlay/." "$DEST/"
|
||||
mkdir -p "$DEST/usr/share/veilor-os"
|
||||
cp -a "$SRC/assets" "$DEST/usr/share/veilor-os/"
|
||||
cp -a "$SRC/scripts" "$DEST/usr/share/veilor-os/"
|
||||
%end
|
||||
|
||||
# ── Post-install (chroot): apply hardening, theme, branding ──
|
||||
|
|
|
|||
Loading…
Reference in a new issue