2026-05-02 03:20:42 +01:00
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
# veilor-os installer — TUI wrapper around anaconda kickstart install.
|
|
|
|
|
|
# Runs on tty1 in place of getty (live ISO boot path).
|
|
|
|
|
|
#
|
|
|
|
|
|
# Flow:
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# 1. ASCII banner (assets/installer/banner.txt)
|
|
|
|
|
|
# 2. Menu: Install / Live desktop / Live shell / Reboot / Power off
|
|
|
|
|
|
# 3. If Install: collect answers via gum (disk, hostname, LUKS pw,
|
2026-05-02 03:20:42 +01:00
|
|
|
|
# admin pw, locale)
|
|
|
|
|
|
# 4. Generate /run/install/veilor-generated.ks from template + answers
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# (full veilor-os install: package list + overlay + scripts + harden)
|
2026-05-02 03:20:42 +01:00
|
|
|
|
# 5. Exec anaconda --kickstart=/run/install/veilor-generated.ks
|
|
|
|
|
|
# 6. On finish: reboot into installed system
|
|
|
|
|
|
#
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# v0.5.1 — gum (charm.sh) replaces whiptail; whiptail kept as fallback.
|
|
|
|
|
|
# Generated kickstart now installs full veilor-os (matches live ks).
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
set -uo pipefail
|
|
|
|
|
|
export TERM="${TERM:-linux}"
|
|
|
|
|
|
LOG=/var/log/veilor-installer.log
|
2026-05-02 06:22:47 +01:00
|
|
|
|
|
|
|
|
|
|
# require_tty MUST run before the tee redirect — process substitution
|
|
|
|
|
|
# replaces fd1 with a pipe, breaking `[[ -t 1 ]]`.
|
|
|
|
|
|
require_tty() {
|
|
|
|
|
|
if ! [[ -t 0 && -t 1 ]]; then
|
|
|
|
|
|
echo "[ERR] veilor-installer must run on a real tty" >&2
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
|
|
require_tty
|
|
|
|
|
|
|
|
|
|
|
|
# Now safe to tee output for log persistence — tty detection already passed.
|
2026-05-02 03:20:42 +01:00
|
|
|
|
exec > >(tee -a "$LOG") 2>&1
|
|
|
|
|
|
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# ── Branded styling for gum ─────────────────────────────────────────────
|
|
|
|
|
|
# colors.gum sets GUM_* env vars — pure-black palette from veilor-black KDE.
|
|
|
|
|
|
# Sourced at top so every prompt below picks up branded colors.
|
|
|
|
|
|
COLORS=/usr/share/veilor-os/assets/installer/colors.gum
|
|
|
|
|
|
[[ -r $COLORS ]] && source "$COLORS"
|
|
|
|
|
|
|
|
|
|
|
|
BANNER_FILE=/usr/share/veilor-os/assets/installer/banner.txt
|
|
|
|
|
|
|
|
|
|
|
|
# Detect TUI backend once. gum is preferred; whiptail is the fallback so the
|
|
|
|
|
|
# installer keeps working on minimal images or if /usr/local/bin/gum is
|
|
|
|
|
|
# missing (e.g. broken vendored binary, /usr remount issues).
|
|
|
|
|
|
if command -v gum >/dev/null 2>&1; then
|
|
|
|
|
|
TUI=gum
|
|
|
|
|
|
elif command -v whiptail >/dev/null 2>&1; then
|
|
|
|
|
|
TUI=whiptail
|
|
|
|
|
|
else
|
|
|
|
|
|
echo "[ERR] neither gum nor whiptail available — cannot run TUI" >&2
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
2026-05-02 03:20:42 +01:00
|
|
|
|
banner() {
|
|
|
|
|
|
clear
|
2026-05-03 03:46:36 +01:00
|
|
|
|
# Read version + date for version line. /etc/os-release has VERSION_ID.
|
|
|
|
|
|
local ver=""
|
|
|
|
|
|
[[ -r /etc/os-release ]] && ver=$(. /etc/os-release; echo "${VERSION_ID:-0.0}")
|
|
|
|
|
|
local d
|
|
|
|
|
|
d=$(date +%Y-%m-%d)
|
|
|
|
|
|
local vline="veilor-os ${ver} · ${d} · live"
|
|
|
|
|
|
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
if [[ -r $BANNER_FILE ]]; then
|
|
|
|
|
|
if [[ $TUI == gum ]]; then
|
2026-05-03 03:46:36 +01:00
|
|
|
|
# gum style: rounded border, banner + blank line + version line.
|
|
|
|
|
|
gum style --border rounded --margin "0 2" --padding "1 3" \
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
--border-foreground "${VEILOR_DIM:-240}" \
|
|
|
|
|
|
--foreground "${VEILOR_FG:-15}" \
|
2026-05-03 03:46:36 +01:00
|
|
|
|
"$(cat "$BANNER_FILE")" \
|
|
|
|
|
|
"" \
|
|
|
|
|
|
"$vline"
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
else
|
|
|
|
|
|
cat "$BANNER_FILE"
|
|
|
|
|
|
echo
|
2026-05-03 03:46:36 +01:00
|
|
|
|
echo " $vline"
|
|
|
|
|
|
echo
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
fi
|
|
|
|
|
|
else
|
|
|
|
|
|
# Fallback ASCII if banner.txt missing (older overlay).
|
2026-05-03 03:46:36 +01:00
|
|
|
|
cat << EOF
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
veilor-os installer
|
2026-05-03 03:46:36 +01:00
|
|
|
|
$vline
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
EOF
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
fi
|
2026-05-02 03:20:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# ── TUI wrapper functions ───────────────────────────────────────────────
|
|
|
|
|
|
# Each prompt_* call abstracts gum / whiptail. Always emit the chosen value
|
|
|
|
|
|
# on stdout; non-zero exit on cancel/ESC. Callers use `||` to propagate.
|
|
|
|
|
|
|
|
|
|
|
|
# prompt_choose <header> <opt1> [opt2 ...]
|
|
|
|
|
|
# Single-select menu. Returns the selected option literal on stdout.
|
|
|
|
|
|
prompt_choose() {
|
|
|
|
|
|
local header=$1; shift
|
|
|
|
|
|
if [[ $TUI == gum ]]; then
|
|
|
|
|
|
gum choose --header "$header" "$@"
|
|
|
|
|
|
else
|
|
|
|
|
|
# whiptail menu needs tag/desc pairs. Use the option as both.
|
|
|
|
|
|
local args=()
|
|
|
|
|
|
local opt
|
|
|
|
|
|
for opt in "$@"; do args+=("$opt" "$opt"); done
|
|
|
|
|
|
whiptail --title "veilor-os" --menu "$header" 18 70 8 \
|
|
|
|
|
|
"${args[@]}" 3>&1 1>&2 2>&3
|
|
|
|
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# prompt_choose_pairs <header> <tag1> <desc1> [tag2 desc2 ...]
|
|
|
|
|
|
# Tag/description menu. Returns the chosen tag.
|
|
|
|
|
|
# Used when display label differs from machine-readable value (e.g. disk
|
|
|
|
|
|
# path /dev/nvme0n1 vs description "476G WDC PC SN740").
|
|
|
|
|
|
prompt_choose_pairs() {
|
|
|
|
|
|
local header=$1; shift
|
|
|
|
|
|
if [[ $TUI == gum ]]; then
|
|
|
|
|
|
# gum has no tag/desc concept — render "tag — desc" lines, parse.
|
|
|
|
|
|
local lines=() i=1
|
|
|
|
|
|
while (( i <= $# )); do
|
|
|
|
|
|
local tag=${!i}; ((i++))
|
|
|
|
|
|
local desc=${!i}; ((i++))
|
|
|
|
|
|
lines+=("$tag — $desc")
|
|
|
|
|
|
done
|
|
|
|
|
|
local picked
|
|
|
|
|
|
picked=$(printf '%s\n' "${lines[@]}" | gum choose --header "$header") || return 1
|
|
|
|
|
|
# Strip " — desc" suffix to recover the tag.
|
|
|
|
|
|
echo "${picked%% — *}"
|
|
|
|
|
|
else
|
|
|
|
|
|
whiptail --title "veilor-os" --menu "$header" 18 70 8 \
|
|
|
|
|
|
"$@" 3>&1 1>&2 2>&3
|
|
|
|
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# prompt_input <header> [default]
|
|
|
|
|
|
prompt_input() {
|
|
|
|
|
|
local header=$1 default=${2:-}
|
|
|
|
|
|
if [[ $TUI == gum ]]; then
|
|
|
|
|
|
gum input --header "$header" --value "$default"
|
|
|
|
|
|
else
|
|
|
|
|
|
whiptail --title "veilor-os" --inputbox "$header" 10 60 "$default" \
|
|
|
|
|
|
3>&1 1>&2 2>&3
|
|
|
|
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# prompt_password <header>
|
|
|
|
|
|
prompt_password() {
|
|
|
|
|
|
local header=$1
|
|
|
|
|
|
if [[ $TUI == gum ]]; then
|
|
|
|
|
|
gum input --password --header "$header"
|
|
|
|
|
|
else
|
|
|
|
|
|
whiptail --title "veilor-os" --passwordbox "$header" 10 60 \
|
|
|
|
|
|
3>&1 1>&2 2>&3
|
|
|
|
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# prompt_confirm <message>
|
|
|
|
|
|
# Exits 0 on yes, 1 on no — matches whiptail --yesno semantics.
|
|
|
|
|
|
prompt_confirm() {
|
|
|
|
|
|
local msg=$1
|
|
|
|
|
|
if [[ $TUI == gum ]]; then
|
|
|
|
|
|
gum confirm "$msg"
|
|
|
|
|
|
else
|
|
|
|
|
|
whiptail --title "Confirm" --yesno "$msg" 16 60
|
|
|
|
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# prompt_message <message>
|
|
|
|
|
|
# Non-blocking notice. gum has no msgbox; print styled + sleep.
|
|
|
|
|
|
prompt_message() {
|
|
|
|
|
|
local msg=$1
|
|
|
|
|
|
if [[ $TUI == gum ]]; then
|
|
|
|
|
|
gum style --foreground "${VEILOR_FG:-15}" --border rounded \
|
|
|
|
|
|
--border-foreground "${VEILOR_DIM:-240}" --padding "1 2" -- "$msg"
|
|
|
|
|
|
sleep 2
|
|
|
|
|
|
else
|
|
|
|
|
|
whiptail --title "veilor-os" --msgbox "$msg" 10 60
|
|
|
|
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# prompt_error <message>
|
|
|
|
|
|
# Same as message but with a red foreground for visibility.
|
|
|
|
|
|
prompt_error() {
|
|
|
|
|
|
local msg=$1
|
|
|
|
|
|
if [[ $TUI == gum ]]; then
|
|
|
|
|
|
gum style --foreground 1 --border rounded --border-foreground 1 \
|
|
|
|
|
|
--padding "1 2" -- "$msg"
|
|
|
|
|
|
sleep 2
|
|
|
|
|
|
else
|
|
|
|
|
|
whiptail --title "Error" --msgbox "$msg" 10 60
|
|
|
|
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-02 03:20:42 +01:00
|
|
|
|
main_menu() {
|
2026-05-03 03:46:36 +01:00
|
|
|
|
# Empty header — banner already provides context. `──────` line splits
|
|
|
|
|
|
# primary actions (top) from session controls (bottom). Cursor `❯` set
|
|
|
|
|
|
# via GUM_CHOOSE_CURSOR in colors.gum.
|
|
|
|
|
|
prompt_choose "" \
|
2026-05-02 21:10:04 +01:00
|
|
|
|
"Install" \
|
2026-05-03 03:46:36 +01:00
|
|
|
|
"live · KDE" \
|
|
|
|
|
|
"live · shell" \
|
|
|
|
|
|
"──────" \
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
"Reboot" \
|
|
|
|
|
|
"Power off"
|
2026-05-02 03:20:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
collect_answers() {
|
|
|
|
|
|
local disk hostname luks_pw admin_pw locale
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
local disks_pairs
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
# ── Disk ──
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# Build whiptail-style "tag desc" pairs. prompt_choose_pairs reshapes
|
|
|
|
|
|
# for gum if needed.
|
|
|
|
|
|
# shellcheck disable=SC2207
|
|
|
|
|
|
disks_pairs=($(lsblk -dpno NAME,SIZE,MODEL | grep -E '^/dev/(sd|nvme|vd|mmcblk)' | \
|
|
|
|
|
|
awk '{name=$1; size=$2; $1=""; $2=""; sub(/^ +/,""); gsub(/ /,"_"); model=$0; if(model=="")model="unknown"; print name, size"_"model}'))
|
|
|
|
|
|
if [[ ${#disks_pairs[@]} -eq 0 ]]; then
|
|
|
|
|
|
prompt_error "No installable disks found."
|
2026-05-02 03:20:42 +01:00
|
|
|
|
return 1
|
|
|
|
|
|
fi
|
2026-05-03 03:46:36 +01:00
|
|
|
|
disk=$(prompt_choose_pairs "[1/4] Select install disk · WILL BE ERASED" "${disks_pairs[@]}") || return 1
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
# ── Hostname ──
|
2026-05-02 21:10:04 +01:00
|
|
|
|
# Hardcoded for branded consistency. Post-install: `hostnamectl set-hostname`.
|
|
|
|
|
|
hostname="veilor"
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
|
|
|
|
|
|
# Reject shell-special and sed-special chars in passwords. Generated
|
|
|
|
|
|
# kickstart writes them via heredoc + sed substitution; bare $, ", \, `
|
|
|
|
|
|
# would corrupt the ks line or partially expand at heredoc time.
|
|
|
|
|
|
# &, |, /, newline are sed-special: & expands to the matched pattern
|
|
|
|
|
|
# (so `aA1!@#%^&*()` becomes `aA1!@#%^__ADMIN_PW__*()`), | is our
|
|
|
|
|
|
# delimiter, / would match if delimiter changes, newline breaks the
|
|
|
|
|
|
# sed expression. sed_escape() below adds defense-in-depth, but we
|
|
|
|
|
|
# also reject these at input so the user sees an immediate error
|
|
|
|
|
|
# rather than a corrupted ks file. 8-char min for entropy.
|
2026-05-02 03:42:15 +01:00
|
|
|
|
validate_pw() {
|
|
|
|
|
|
local pw=$1 label=$2
|
|
|
|
|
|
if [[ ${#pw} -lt 8 ]]; then
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
prompt_error "Weak $label — minimum 8 characters."
|
2026-05-02 03:42:15 +01:00
|
|
|
|
return 1
|
|
|
|
|
|
fi
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
if [[ $pw =~ [\"\$\\\`\&\|/$'\n'] ]]; then
|
|
|
|
|
|
prompt_error "Invalid $label — cannot contain: \" \$ \\ \` & | / newline"
|
2026-05-02 03:42:15 +01:00
|
|
|
|
return 1
|
|
|
|
|
|
fi
|
|
|
|
|
|
return 0
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-02 03:20:42 +01:00
|
|
|
|
# ── LUKS passphrase ──
|
2026-05-03 03:46:36 +01:00
|
|
|
|
luks_pw=$(prompt_password "[2/4] Encryption · LUKS2 passphrase (min 8)") || return 1
|
2026-05-02 03:42:15 +01:00
|
|
|
|
validate_pw "$luks_pw" "passphrase" || return 1
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
# ── Admin password ──
|
2026-05-03 03:46:36 +01:00
|
|
|
|
admin_pw=$(prompt_password "[3/4] Admin user · password for 'admin'") || return 1
|
2026-05-02 03:42:15 +01:00
|
|
|
|
validate_pw "$admin_pw" "password" || return 1
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
# ── Locale ──
|
2026-05-03 03:46:36 +01:00
|
|
|
|
locale=$(prompt_choose "[4/4] Locale" \
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
"en_GB.UTF-8" \
|
2026-05-02 21:10:04 +01:00
|
|
|
|
"en_US.UTF-8") || return 1
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
# ── Confirmation ──
|
2026-05-03 03:46:36 +01:00
|
|
|
|
# Render summary box + danger lines via gum style, then gum confirm.
|
|
|
|
|
|
# Whiptail fallback: simple yesno.
|
|
|
|
|
|
if [[ $TUI == gum ]]; then
|
|
|
|
|
|
clear
|
|
|
|
|
|
gum style --border rounded --margin "1 2" --padding "1 3" \
|
|
|
|
|
|
--border-foreground "${VEILOR_DIM:-240}" \
|
|
|
|
|
|
--foreground "${VEILOR_FG:-15}" \
|
|
|
|
|
|
"Confirm install" \
|
|
|
|
|
|
"" \
|
|
|
|
|
|
" Disk $disk $(gum style --foreground 1 'WILL BE ERASED')" \
|
|
|
|
|
|
" Locale $locale" \
|
|
|
|
|
|
" LUKS ✓ set" \
|
|
|
|
|
|
" Admin ✓ set" \
|
|
|
|
|
|
"" \
|
|
|
|
|
|
"$(gum style --foreground 3 'This action is irreversible.')"
|
|
|
|
|
|
gum confirm --affirmative "Yes, install" --negative "Cancel" "Proceed?" || return 1
|
|
|
|
|
|
else
|
|
|
|
|
|
whiptail --title "Confirm install" --yesno \
|
|
|
|
|
|
"About to install veilor-os:
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
2026-05-03 03:46:36 +01:00
|
|
|
|
Disk: $disk (WILL BE ERASED)
|
2026-05-02 03:20:42 +01:00
|
|
|
|
Locale: $locale
|
|
|
|
|
|
LUKS: set
|
|
|
|
|
|
Admin pw: set
|
|
|
|
|
|
|
2026-05-03 03:46:36 +01:00
|
|
|
|
This action is irreversible.
|
|
|
|
|
|
|
|
|
|
|
|
Proceed?" 16 60 || return 1
|
|
|
|
|
|
fi
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
# Export to caller via globals
|
|
|
|
|
|
SEL_DISK=$disk
|
|
|
|
|
|
SEL_HOSTNAME=$hostname
|
|
|
|
|
|
SEL_LUKS_PW=$luks_pw
|
|
|
|
|
|
SEL_ADMIN_PW=$admin_pw
|
|
|
|
|
|
SEL_LOCALE=$locale
|
|
|
|
|
|
return 0
|
|
|
|
|
|
}
|
|
|
|
|
|
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# sed_escape — escape sed special chars in a replacement string.
|
|
|
|
|
|
# Replacement-side metacharacters: & (matched pattern), \ (escape),
|
|
|
|
|
|
# | (our chosen delimiter), / (alternate delimiter — escape too in case
|
|
|
|
|
|
# delimiter ever changes). Newline is rejected in validate_pw because
|
|
|
|
|
|
# escaping it portably across BSD/GNU sed is fiddly.
|
|
|
|
|
|
# Order matters: \ must be escaped FIRST so we don't double-escape the
|
|
|
|
|
|
# backslashes we're about to emit for &, |, /.
|
|
|
|
|
|
sed_escape() {
|
|
|
|
|
|
printf '%s' "$1" | sed -e 's/[\\&|/]/\\&/g'
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-03 14:35:36 +01:00
|
|
|
|
# detect_seed_pubkey — search attached cdroms for a NoCloud cidata seed
|
|
|
|
|
|
# with an ssh_authorized_keys entry. Returns the first key on stdout, or
|
|
|
|
|
|
# empty string if none found. Used by both auto-install.sh (cloud-init
|
|
|
|
|
|
# seed pre-built with host pubkey) and humans (drop a seed iso next to
|
|
|
|
|
|
# the install media).
|
|
|
|
|
|
detect_seed_pubkey() {
|
|
|
|
|
|
local dev label tmpmnt key=""
|
|
|
|
|
|
for dev in /dev/sr0 /dev/sr1 /dev/sr2 /dev/sr3; do
|
|
|
|
|
|
[ -b "$dev" ] || continue
|
|
|
|
|
|
label=$(blkid -o value -s LABEL "$dev" 2>/dev/null)
|
|
|
|
|
|
if [[ $label == "cidata" || $label == "CIDATA" ]]; then
|
|
|
|
|
|
tmpmnt=$(mktemp -d)
|
|
|
|
|
|
if mount -o ro "$dev" "$tmpmnt" 2>/dev/null; then
|
|
|
|
|
|
# NoCloud user-data format:
|
|
|
|
|
|
# ssh_authorized_keys:
|
|
|
|
|
|
# - ssh-ed25519 AAAA... user@host
|
|
|
|
|
|
# Extract first ssh-* line, strip leading '- '.
|
|
|
|
|
|
key=$(grep -E '^\s*-\s+ssh-' "$tmpmnt/user-data" 2>/dev/null \
|
|
|
|
|
|
| head -1 | sed -e 's/^\s*-\s*//' -e 's/[[:space:]]*$//')
|
|
|
|
|
|
umount "$tmpmnt" 2>/dev/null
|
|
|
|
|
|
fi
|
|
|
|
|
|
rmdir "$tmpmnt" 2>/dev/null
|
|
|
|
|
|
[[ -n $key ]] && { printf '%s' "$key"; return 0; }
|
|
|
|
|
|
fi
|
|
|
|
|
|
done
|
|
|
|
|
|
return 1
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-02 03:20:42 +01:00
|
|
|
|
generate_ks() {
|
|
|
|
|
|
# Build kickstart for actual disk install.
|
|
|
|
|
|
# NOTE: passwords go in via --plaintext to avoid storing crypted hash
|
|
|
|
|
|
# collisions; anaconda hashes per /etc/login.defs at install time.
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
#
|
|
|
|
|
|
# %packages mirrors live ks lines 63-141 (full hardening pkg list,
|
|
|
|
|
|
# minus livesys/anaconda-live which are live-only).
|
|
|
|
|
|
# %post --nochroot copies overlay + scripts + assets from boot ISO.
|
|
|
|
|
|
# %post (chroot) runs the same hardening scripts the live build runs.
|
2026-05-02 03:20:42 +01:00
|
|
|
|
local out=/run/install/veilor-generated.ks
|
2026-05-02 03:42:15 +01:00
|
|
|
|
local disk_basename
|
|
|
|
|
|
disk_basename=$(basename "$SEL_DISK")
|
2026-05-02 03:20:42 +01:00
|
|
|
|
mkdir -p /run/install
|
2026-05-02 03:42:15 +01:00
|
|
|
|
# Single-quoted heredoc → no shell expansion. Substitute placeholders
|
|
|
|
|
|
# via sed afterwards. Bulletproof against $/`/" in passwords.
|
|
|
|
|
|
cat > "$out" << 'KSEOF' || return 1
|
2026-05-02 03:20:42 +01:00
|
|
|
|
# veilor-os installer-generated kickstart
|
|
|
|
|
|
# DO NOT commit this file — secrets inline.
|
|
|
|
|
|
url --mirrorlist="https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-43&arch=x86_64"
|
|
|
|
|
|
repo --name=fedora --baseurl="https://download.fedoraproject.org/pub/fedora/linux/releases/43/Everything/x86_64/os/" --install
|
|
|
|
|
|
repo --name=updates --baseurl="https://download.fedoraproject.org/pub/fedora/linux/updates/43/Everything/x86_64/" --install
|
|
|
|
|
|
|
|
|
|
|
|
keyboard --xlayouts='us'
|
2026-05-02 03:42:15 +01:00
|
|
|
|
lang __LOCALE__
|
2026-05-02 03:20:42 +01:00
|
|
|
|
timezone Europe/London --utc
|
|
|
|
|
|
|
|
|
|
|
|
firstboot --disable
|
|
|
|
|
|
eula --agreed
|
|
|
|
|
|
selinux --enforcing
|
|
|
|
|
|
services --enabled=sshd,fail2ban,usbguard,tuned,auditd,firewalld,chronyd,sddm
|
|
|
|
|
|
|
2026-05-02 03:42:15 +01:00
|
|
|
|
network --bootproto=dhcp --device=link --activate --hostname=__HOSTNAME__
|
2026-05-02 03:20:42 +01:00
|
|
|
|
firewall --enabled --service=ssh
|
|
|
|
|
|
|
|
|
|
|
|
rootpw --lock
|
2026-05-02 03:42:15 +01:00
|
|
|
|
user --name=admin --groups=wheel --gecos="veilor admin" --password=__ADMIN_PW__ --plaintext
|
2026-05-03 14:35:36 +01:00
|
|
|
|
__SSHKEY_DIRECTIVE__
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
# Full hardening cmdline (installed system, not live):
|
2026-05-02 03:42:15 +01:00
|
|
|
|
# --location=none: anaconda auto-places bootloader (UEFI grub2-efi or BIOS).
|
2026-05-03 06:32:32 +01:00
|
|
|
|
bootloader --append="lockdown=integrity slab_nomerge init_on_alloc=1 init_on_free=1 randomize_kstack_offset=on vsyscall=none plymouth.enable=0 rd.plymouth=0"
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
2026-05-03 02:45:16 +01:00
|
|
|
|
# Disk: zero, LUKS2 (argon2id), btrfs subvolumes (no LVM intermediary).
|
|
|
|
|
|
# Native btrfs-on-LUKS matches Fedora KDE Spin defaults; LVM+btrfs combo
|
|
|
|
|
|
# triggered "mount failed: wrong fs type, bad option, bad superblock"
|
|
|
|
|
|
# under anaconda --cmdline. btrfs subvols give us the snapshot/rollback
|
|
|
|
|
|
# story without LVM's added complexity.
|
2026-05-02 03:20:42 +01:00
|
|
|
|
zerombr
|
2026-05-02 03:42:15 +01:00
|
|
|
|
clearpart --all --initlabel --drives=__DISK_BASENAME__
|
|
|
|
|
|
part /boot/efi --fstype=efi --size=600
|
|
|
|
|
|
part /boot --fstype=ext4 --size=1024
|
2026-05-03 02:45:16 +01:00
|
|
|
|
part btrfs.veilor --grow --encrypted --luks-version=luks2 --pbkdf=argon2id --passphrase=__LUKS_PW__
|
|
|
|
|
|
btrfs none --label=veilor btrfs.veilor
|
|
|
|
|
|
btrfs / --subvol --name=root LABEL=veilor
|
|
|
|
|
|
btrfs /home --subvol --name=home LABEL=veilor
|
2026-05-02 03:20:42 +01:00
|
|
|
|
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# ── Packages — mirrors live ks (kickstart/veilor-os.ks 63-141), minus
|
|
|
|
|
|
# live-only entries (livesys-scripts, anaconda-live, @anaconda-tools,
|
|
|
|
|
|
# dracut-live, isomd5sum, xorriso) which are pointless on a real disk.
|
2026-05-02 03:20:42 +01:00
|
|
|
|
%packages --excludedocs
|
|
|
|
|
|
@^kde-desktop-environment
|
|
|
|
|
|
@kde-apps
|
|
|
|
|
|
@core
|
|
|
|
|
|
@hardware-support
|
|
|
|
|
|
@standard
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
|
|
|
|
|
|
kernel-modules
|
|
|
|
|
|
kernel-modules-extra
|
|
|
|
|
|
glibc-all-langpacks
|
|
|
|
|
|
dracut-config-generic
|
|
|
|
|
|
kernel
|
|
|
|
|
|
grub2-efi-x64
|
|
|
|
|
|
grub2-efi-x64-modules
|
|
|
|
|
|
grub2-pc
|
|
|
|
|
|
grub2-pc-modules
|
|
|
|
|
|
grub2-tools
|
|
|
|
|
|
grub2-tools-extra
|
|
|
|
|
|
shim-x64
|
|
|
|
|
|
efibootmgr
|
|
|
|
|
|
syslinux
|
|
|
|
|
|
|
|
|
|
|
|
# veilor-installer dependencies (kept on installed system so
|
|
|
|
|
|
# `sudo veilor-installer` from a recovery shell still works).
|
|
|
|
|
|
newt
|
|
|
|
|
|
parted
|
|
|
|
|
|
cryptsetup
|
|
|
|
|
|
lvm2
|
|
|
|
|
|
btrfs-progs
|
|
|
|
|
|
|
|
|
|
|
|
# core hardening tools
|
2026-05-02 03:20:42 +01:00
|
|
|
|
fail2ban
|
|
|
|
|
|
fail2ban-firewalld
|
|
|
|
|
|
usbguard
|
|
|
|
|
|
usbguard-tools
|
|
|
|
|
|
audit
|
|
|
|
|
|
policycoreutils-python-utils
|
|
|
|
|
|
tuned
|
|
|
|
|
|
chrony
|
|
|
|
|
|
firewalld
|
2026-05-03 11:12:35 +01:00
|
|
|
|
# plymouth: removed in v0.5.13. Splash unreliable in QEMU; LUKS prompt
|
|
|
|
|
|
# falls back to systemd-tty-ask-password-agent on tty1 (text). Cleaner
|
|
|
|
|
|
# boot, smaller initramfs, fewer moving parts.
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
|
|
|
|
|
|
# admin essentials
|
2026-05-02 03:20:42 +01:00
|
|
|
|
git
|
|
|
|
|
|
vim-enhanced
|
|
|
|
|
|
tmux
|
|
|
|
|
|
htop
|
|
|
|
|
|
podman
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
skopeo
|
2026-05-02 03:20:42 +01:00
|
|
|
|
NetworkManager
|
|
|
|
|
|
NetworkManager-wifi
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
|
|
|
|
|
|
# fonts
|
2026-05-02 03:20:42 +01:00
|
|
|
|
fontconfig
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
freetype
|
2026-05-02 03:20:42 +01:00
|
|
|
|
fira-code-fonts
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
|
|
|
|
|
|
# zram (no swap-on-disk)
|
2026-05-02 03:20:42 +01:00
|
|
|
|
zram-generator
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
|
|
|
|
|
|
# remove fluff
|
|
|
|
|
|
# Note: KDE Plasma 6 hard-deps on cups/geoclue2/ModemManager/PackageKit
|
|
|
|
|
|
# transitively; daemons disabled at runtime via 20-harden-kernel.sh.
|
2026-05-02 03:20:42 +01:00
|
|
|
|
-abrt*
|
|
|
|
|
|
-snapd
|
|
|
|
|
|
-kde-connect
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
-open-vm-tools-desktop
|
2026-05-02 03:20:42 +01:00
|
|
|
|
-mlocate
|
2026-05-03 11:12:35 +01:00
|
|
|
|
-plymouth
|
|
|
|
|
|
-plymouth-plugin-label
|
|
|
|
|
|
-plymouth-system-theme
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
|
|
|
|
|
|
%end
|
|
|
|
|
|
|
|
|
|
|
|
# ── Post-install (nochroot): copy overlay + scripts + assets from boot ISO.
|
|
|
|
|
|
# Mirror of live ks 144-196 trimmed to single-source: ISO mounted at
|
|
|
|
|
|
# /run/install/repo, veilor/ subtree contains overlay/, scripts/, assets/.
|
|
|
|
|
|
# (See build/Containerfile — ISO build copies the repo into veilor/.)
|
|
|
|
|
|
%post --nochroot --erroronfail
|
|
|
|
|
|
set -uo pipefail
|
|
|
|
|
|
DEST="${INSTALL_ROOT:-/mnt/sysimage}"
|
|
|
|
|
|
[[ -d $DEST ]] || { echo "[ERR] DEST=$DEST does not exist" >&2; exit 1; }
|
|
|
|
|
|
|
|
|
|
|
|
SRC=/run/install/repo/veilor
|
|
|
|
|
|
if [[ ! -d $SRC/overlay ]]; then
|
|
|
|
|
|
echo "[ERR] $SRC/overlay missing — boot ISO did not include veilor/ tree" >&2
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "[INFO] using SRC=$SRC DEST=$DEST"
|
|
|
|
|
|
set -x
|
|
|
|
|
|
cp -a "$SRC/overlay/." "$DEST/" || echo "[ERR] overlay cp failed: $?"
|
|
|
|
|
|
mkdir -p "$DEST/usr/share/veilor-os" || echo "[ERR] mkdir failed: $?"
|
|
|
|
|
|
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"
|
|
|
|
|
|
# Force root ownership on everything we copied — `cp -a` preserves
|
|
|
|
|
|
# CI runner uid (1001), which makes sudo refuse to read /etc/sudoers.d.
|
2026-05-02 05:33:22 +01:00
|
|
|
|
chown -R 0:0 "$DEST/etc" "$DEST/usr/share/veilor-os" "$DEST/usr/local/bin" 2>&1 || echo "[WARN] chown failed"
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
set +x
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
echo "=== %post --nochroot trace ==="
|
|
|
|
|
|
date
|
|
|
|
|
|
echo "SRC=$SRC DEST=$DEST"
|
|
|
|
|
|
ls -la "$DEST/usr/share/veilor-os/" 2>&1
|
2026-05-02 05:33:22 +01:00
|
|
|
|
ls -la "$DEST/usr/local/bin/" 2>&1
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
} > "$DEST/var/log/veilor-nochroot.log" 2>&1 || true
|
|
|
|
|
|
%end
|
|
|
|
|
|
|
|
|
|
|
|
# ── Post-install (chroot): apply hardening, theme, branding ────────────
|
|
|
|
|
|
%post
|
|
|
|
|
|
set -uo pipefail
|
|
|
|
|
|
exec > >(tee -a /var/log/veilor-install.log) 2>&1
|
|
|
|
|
|
|
|
|
|
|
|
echo "════════════════════════════════════════════════════════"
|
|
|
|
|
|
echo " veilor-os install — %post (real install)"
|
|
|
|
|
|
echo "════════════════════════════════════════════════════════"
|
|
|
|
|
|
|
|
|
|
|
|
REPO=/usr/share/veilor-os
|
|
|
|
|
|
chmod +x $REPO/scripts/*.sh $REPO/scripts/selinux/*.sh \
|
2026-05-02 05:33:22 +01:00
|
|
|
|
/usr/local/bin/veilor-power /usr/local/bin/veilor-firstboot \
|
|
|
|
|
|
/usr/local/bin/veilor-installer 2>/dev/null || true
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
|
|
|
|
|
|
# /etc/machine-id reset on first boot
|
|
|
|
|
|
> /etc/machine-id
|
|
|
|
|
|
|
|
|
|
|
|
# Apply hardening
|
|
|
|
|
|
bash $REPO/scripts/10-harden-base.sh
|
|
|
|
|
|
bash $REPO/scripts/20-harden-kernel.sh
|
|
|
|
|
|
|
|
|
|
|
|
# Build SELinux module
|
|
|
|
|
|
bash $REPO/scripts/selinux/build-policy.sh || echo "[WARN] SELinux build failed; load on first boot"
|
|
|
|
|
|
|
|
|
|
|
|
# Apply KDE theme + DuckSans + os-release branding
|
|
|
|
|
|
bash $REPO/scripts/kde-theme-apply.sh
|
|
|
|
|
|
|
2026-05-03 10:10:46 +01:00
|
|
|
|
# Disable plymouth at TWO layers:
|
|
|
|
|
|
#
|
|
|
|
|
|
# 1. Initramfs (the boot stage where LUKS unlock happens). Plymouth is
|
|
|
|
|
|
# a dracut module; masking units in /etc/systemd/ has zero effect
|
|
|
|
|
|
# here because dracut bundles its own copies into initramfs/.
|
|
|
|
|
|
# Solution: omit_dracutmodules in dracut.conf.d, then regenerate
|
|
|
|
|
|
# initramfs so the new config takes effect.
|
|
|
|
|
|
#
|
|
|
|
|
|
# 2. Real root (post-pivot, before SDDM). /dev/null symlinks mask all
|
|
|
|
|
|
# plymouth services + the path-activated ask-password unit so they
|
|
|
|
|
|
# never start when systemd is up.
|
|
|
|
|
|
#
|
|
|
|
|
|
# After both, LUKS prompt falls back to systemd-tty-ask-password-agent
|
|
|
|
|
|
# on tty1 — text "Please enter passphrase for disk... :" — works in
|
|
|
|
|
|
# QEMU sendkey AND on real hardware.
|
|
|
|
|
|
|
|
|
|
|
|
# Layer 1: initramfs
|
|
|
|
|
|
mkdir -p /etc/dracut.conf.d
|
|
|
|
|
|
cat > /etc/dracut.conf.d/99-veilor-no-plymouth.conf << 'EOF'
|
|
|
|
|
|
omit_dracutmodules+=" plymouth "
|
|
|
|
|
|
EOF
|
|
|
|
|
|
# Regenerate initramfs for the installed kernel(s).
|
|
|
|
|
|
for kver in /lib/modules/*/; do
|
|
|
|
|
|
kver=$(basename "$kver")
|
|
|
|
|
|
dracut --force --kver "$kver" 2>/dev/null || true
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# Layer 2: real-root masks
|
2026-05-03 09:08:36 +01:00
|
|
|
|
mkdir -p /etc/systemd/system
|
|
|
|
|
|
for unit in \
|
|
|
|
|
|
plymouth-start.service \
|
|
|
|
|
|
plymouth-quit.service \
|
|
|
|
|
|
plymouth-quit-wait.service \
|
|
|
|
|
|
plymouth-read-write.service \
|
|
|
|
|
|
plymouth-switch-root.service \
|
|
|
|
|
|
systemd-ask-password-plymouth.path \
|
|
|
|
|
|
systemd-ask-password-plymouth.service \
|
|
|
|
|
|
; do
|
|
|
|
|
|
ln -sf /dev/null /etc/systemd/system/$unit
|
|
|
|
|
|
done
|
2026-05-03 07:37:00 +01:00
|
|
|
|
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# Symlink display-manager.service → sddm.service. (Anaconda usually
|
|
|
|
|
|
# handles this when sddm is the only DM, but be explicit.)
|
|
|
|
|
|
ln -sf /usr/lib/systemd/system/sddm.service /etc/systemd/system/display-manager.service
|
|
|
|
|
|
|
|
|
|
|
|
# Real install boots straight to SDDM (NOT to TTY1 installer like live).
|
|
|
|
|
|
systemctl set-default graphical.target
|
|
|
|
|
|
|
|
|
|
|
|
# zram swap (no disk swap; keys never leak to platter)
|
|
|
|
|
|
cat > /etc/systemd/zram-generator.conf << 'EOF'
|
|
|
|
|
|
[zram0]
|
|
|
|
|
|
zram-size = min(ram, 8192)
|
|
|
|
|
|
compression-algorithm = zstd
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
# Enable services
|
|
|
|
|
|
systemctl enable veilor-firstboot.service 2>/dev/null || true
|
|
|
|
|
|
systemctl enable veilor-modules-lock.service 2>/dev/null || true
|
|
|
|
|
|
systemctl enable sshd fail2ban usbguard tuned auditd firewalld chronyd sddm
|
|
|
|
|
|
|
|
|
|
|
|
# Default tuned profile = balanced (AC/battery udev rule will override)
|
|
|
|
|
|
tuned-adm profile veilor-balanced 2>/dev/null || true
|
|
|
|
|
|
|
|
|
|
|
|
# Force admin to set a fresh password on first login. The `user` directive
|
|
|
|
|
|
# above already created the account with the user's chosen password —
|
|
|
|
|
|
# `chage -d 0` expires it so SDDM/passwd prompts for change immediately.
|
|
|
|
|
|
chage -d 0 admin 2>/dev/null || true
|
|
|
|
|
|
|
|
|
|
|
|
# Lock root explicitly (kickstart --lock should already do this)
|
|
|
|
|
|
passwd -l root
|
|
|
|
|
|
|
|
|
|
|
|
# Sanity: zero references to onyx / personal IPs in installed system
|
|
|
|
|
|
if grep -rqi 'onyx\|192\.168\.0\.\|fedora\.local' /etc/veilor* /etc/tuned/profiles/veilor-* 2>/dev/null; then
|
|
|
|
|
|
echo "[ERR] brand leak detected in /etc — investigate"
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "════════════════════════════════════════════════════════"
|
|
|
|
|
|
echo " veilor-os install complete"
|
|
|
|
|
|
echo "════════════════════════════════════════════════════════"
|
2026-05-02 03:20:42 +01:00
|
|
|
|
%end
|
|
|
|
|
|
|
|
|
|
|
|
# Reboot when done
|
|
|
|
|
|
reboot
|
2026-05-02 03:42:15 +01:00
|
|
|
|
KSEOF
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# Substitute placeholders. Use | as sed delimiter. validate_pw()
|
|
|
|
|
|
# already rejects "$\`&|/\n at input — sed_escape() is defence in
|
|
|
|
|
|
# depth in case future code paths feed unsanitised values (e.g.
|
|
|
|
|
|
# locale/hostname from a file, or a relaxed validator).
|
2026-05-03 14:35:36 +01:00
|
|
|
|
# Detect cloud-init seed pubkey (if attached) → embed as anaconda
|
|
|
|
|
|
# `sshkey --username=admin` directive. Adds key to admin's
|
|
|
|
|
|
# authorized_keys at install time so SSH validation works first boot.
|
|
|
|
|
|
# No seed = empty directive line (anaconda treats blank line as no-op).
|
|
|
|
|
|
local seed_pubkey sshkey_directive=""
|
|
|
|
|
|
seed_pubkey=$(detect_seed_pubkey 2>/dev/null) || true
|
|
|
|
|
|
if [[ -n $seed_pubkey ]]; then
|
|
|
|
|
|
echo "[INFO] using cloud-init seed pubkey for admin authorized_keys"
|
|
|
|
|
|
# sshkey directive — quote pubkey, no shell meta in pubkeys.
|
|
|
|
|
|
sshkey_directive="sshkey --username=admin \"${seed_pubkey}\""
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
2026-05-02 03:42:15 +01:00
|
|
|
|
sed -i \
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
-e "s|__LOCALE__|$(sed_escape "$SEL_LOCALE")|" \
|
|
|
|
|
|
-e "s|__HOSTNAME__|$(sed_escape "$SEL_HOSTNAME")|" \
|
|
|
|
|
|
-e "s|__DISK_BASENAME__|$(sed_escape "$disk_basename")|" \
|
|
|
|
|
|
-e "s|__LUKS_PW__|$(sed_escape "$SEL_LUKS_PW")|" \
|
|
|
|
|
|
-e "s|__ADMIN_PW__|$(sed_escape "$SEL_ADMIN_PW")|" \
|
2026-05-03 14:35:36 +01:00
|
|
|
|
-e "s|__SSHKEY_DIRECTIVE__|$(sed_escape "$sshkey_directive")|" \
|
2026-05-02 03:42:15 +01:00
|
|
|
|
"$out"
|
2026-05-02 03:20:42 +01:00
|
|
|
|
echo "[INFO] generated kickstart at $out"
|
|
|
|
|
|
return 0
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
run_install() {
|
2026-05-03 03:46:36 +01:00
|
|
|
|
# Anaconda env setup (see comments below).
|
2026-05-03 00:06:54 +01:00
|
|
|
|
export LANG="${SEL_LOCALE:-en_GB.UTF-8}"
|
|
|
|
|
|
export LC_ALL="$LANG"
|
2026-05-03 03:46:36 +01:00
|
|
|
|
# LANG / LC_ALL: anaconda's keyboard.activate_keyboard() raises
|
|
|
|
|
|
# AnacondaError: 'LANG' if missing. tty1 inherits no locale by default.
|
|
|
|
|
|
# XDG_RUNTIME_DIR: anaconda's display.setup_display() probes
|
|
|
|
|
|
# os.getenv("XDG_RUNTIME_DIR") + Wayland socket and crashes with
|
|
|
|
|
|
# TypeError on None. We're running unattended so no display needed,
|
|
|
|
|
|
# but env var still has to exist.
|
2026-05-03 01:35:52 +01:00
|
|
|
|
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
|
|
|
|
|
|
mkdir -p "$XDG_RUNTIME_DIR"
|
|
|
|
|
|
chmod 0700 "$XDG_RUNTIME_DIR"
|
2026-05-03 03:46:36 +01:00
|
|
|
|
|
|
|
|
|
|
if [[ $TUI == gum ]]; then
|
|
|
|
|
|
clear
|
|
|
|
|
|
# gum spin runs anaconda as subprocess. --show-output forwards
|
|
|
|
|
|
# stdout/stderr to /tmp/anaconda-cmdline.log so we can debug.
|
|
|
|
|
|
# --title shows live-updating header. --spinner dot is minimal.
|
|
|
|
|
|
local rc=0
|
|
|
|
|
|
gum spin --spinner dot \
|
|
|
|
|
|
--title "Installing veilor-os to $SEL_DISK · this takes 10-30 min · logs on tty2" \
|
|
|
|
|
|
--show-output \
|
|
|
|
|
|
-- bash -c 'anaconda --cmdline --kickstart=/run/install/veilor-generated.ks 2>&1 | tee /tmp/anaconda-cmdline.log' || rc=$?
|
|
|
|
|
|
if [[ $rc -eq 0 ]]; then
|
|
|
|
|
|
gum style --foreground 2 --border rounded --margin "1 2" --padding "1 3" \
|
|
|
|
|
|
"✓ Install complete" \
|
|
|
|
|
|
"" \
|
|
|
|
|
|
"System will reboot in 5 seconds." \
|
|
|
|
|
|
"Remove the install media."
|
|
|
|
|
|
sleep 5
|
|
|
|
|
|
systemctl reboot
|
|
|
|
|
|
else
|
|
|
|
|
|
prompt_error "Anaconda exited non-zero (status $rc).
|
|
|
|
|
|
Logs at /tmp/anaconda.log + /var/log/veilor-installer.log.
|
|
|
|
|
|
Press OK to drop to shell."
|
|
|
|
|
|
return 1
|
|
|
|
|
|
fi
|
2026-05-02 03:20:42 +01:00
|
|
|
|
else
|
2026-05-03 03:46:36 +01:00
|
|
|
|
prompt_message "Installing veilor-os to $SEL_DISK ...
|
|
|
|
|
|
This will take 10-30 minutes.
|
|
|
|
|
|
Logs: /var/log/veilor-installer.log + /tmp/anaconda.log"
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
if anaconda --cmdline --kickstart=/run/install/veilor-generated.ks; then
|
|
|
|
|
|
prompt_message "Install complete. System will reboot.
|
|
|
|
|
|
Remove the install media after shutdown."
|
|
|
|
|
|
sleep 3
|
|
|
|
|
|
systemctl reboot
|
|
|
|
|
|
else
|
|
|
|
|
|
prompt_error "Anaconda exited non-zero.
|
2026-05-02 03:20:42 +01:00
|
|
|
|
Logs at /tmp/anaconda.log + /var/log/veilor-installer.log.
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
Press OK to drop to shell."
|
2026-05-03 03:46:36 +01:00
|
|
|
|
return 1
|
|
|
|
|
|
fi
|
2026-05-02 03:20:42 +01:00
|
|
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
drop_to_shell() {
|
|
|
|
|
|
clear
|
|
|
|
|
|
cat << 'EOF'
|
|
|
|
|
|
═══════════════════════════════════════════════════
|
|
|
|
|
|
veilor-os live shell
|
|
|
|
|
|
═══════════════════════════════════════════════════
|
|
|
|
|
|
|
|
|
|
|
|
You are in a live, in-memory environment.
|
|
|
|
|
|
Nothing persists across reboot.
|
|
|
|
|
|
|
|
|
|
|
|
Re-run the installer: sudo veilor-installer
|
|
|
|
|
|
Reboot: sudo systemctl reboot
|
|
|
|
|
|
Power off: sudo systemctl poweroff
|
|
|
|
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
exec /bin/bash --login
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
launch_desktop() {
|
|
|
|
|
|
clear
|
|
|
|
|
|
echo "Launching KDE Plasma..."
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
systemctl isolate graphical.target
|
|
|
|
|
|
# systemd-isolate switches target; sddm spawns on tty1.
|
|
|
|
|
|
# If user logs out, they come back here. Loop continues.
|
|
|
|
|
|
}
|
|
|
|
|
|
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
# ── Entry ──
|
2026-05-02 06:22:47 +01:00
|
|
|
|
# (require_tty already called above before exec redirect — see top of file)
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
banner
|
|
|
|
|
|
|
2026-05-02 03:20:42 +01:00
|
|
|
|
while true; do
|
|
|
|
|
|
case "$(main_menu)" in
|
2026-05-02 21:10:04 +01:00
|
|
|
|
"Install")
|
2026-05-02 03:20:42 +01:00
|
|
|
|
if collect_answers && generate_ks; then
|
|
|
|
|
|
run_install || continue
|
|
|
|
|
|
fi
|
|
|
|
|
|
;;
|
2026-05-03 03:46:36 +01:00
|
|
|
|
"live · KDE") launch_desktop ;;
|
|
|
|
|
|
"live · shell") drop_to_shell ;;
|
|
|
|
|
|
"──────") banner ;; # separator clicked: redraw, no-op
|
v0.5.1: gum installer + full veilor-os kickstart generation (#9)
* v0.5.1: gum installer + full veilor-os ks generation
Two changes, one commit (matches v0.5.1 milestone):
1. Swap whiptail → gum (charm.sh)
- Source /usr/share/veilor-os/assets/installer/colors.gum at top so all
prompts pick up branded GUM_* env vars.
- Render banner.txt via `gum style --border rounded`.
- Wrap every prompt behind prompt_choose / prompt_input / prompt_password
/ prompt_confirm / prompt_message / prompt_error helpers that dispatch
gum→whiptail based on `command -v gum`. Defensive: minimal images
without /usr/local/bin/gum still get a working TUI.
- Main menu items now use literal labels (case-matched), not 1..5 tags.
2. Generated kickstart now installs full veilor-os
Previously emitted a vanilla F43 KDE + ~12 hardening packages with no
overlay/scripts/branding. Now mirrors live ks (kickstart/veilor-os.ks
63-141) for %packages, plus:
- %post --nochroot copies overlay/, scripts/, assets/ from
/run/install/repo/veilor (single source — boot ISO mount path).
- %post (chroot) runs scripts/10-harden-base.sh, 20-harden-kernel.sh,
selinux/build-policy.sh, kde-theme-apply.sh.
- `chage -d 0 admin` so first login forces password change. (Account
itself is created by anaconda from the `user` directive — admin pw
collected via gum is passed through --plaintext.)
- `systemctl set-default graphical.target` (real install boots SDDM,
not the TTY1 installer like live).
- Drops live-only entries (livesys-scripts, anaconda-live, dracut-live,
isomd5sum, xorriso, livesys.service enables).
Tested: bash -n clean; ksvalidator on a substituted-placeholder copy
exits 0.
gum binary itself (/usr/local/bin/gum) is vendored by a separate
build-side change — not in this PR.
* fix: escape sed special chars + reject & | / in passwords
Reviewer found a password like aA1!@#%^&*()_-+={}[] becomes
aA1!@#%^__ADMIN_PW__*()_-+={}[] because sed expands & to matched
pattern. Two layers of defense:
1. validate_pw rejects & | / newline at input
2. sed_escape() helper escapes any remaining special chars before
substitution
---------
Co-authored-by: veilor-org <admin@veilor.org>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 04:39:27 +01:00
|
|
|
|
"Reboot") systemctl reboot ;;
|
|
|
|
|
|
"Power off") systemctl poweroff ;;
|
2026-05-03 03:46:36 +01:00
|
|
|
|
"") banner ;; # ESC/cancel from menu: redraw
|
|
|
|
|
|
*) banner ;;
|
2026-05-02 03:20:42 +01:00
|
|
|
|
esac
|
|
|
|
|
|
done
|