From 8e5e63facbc4244ae821f80d6e5f0e633f0f7ac5 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Sat, 30 May 2026 21:30:35 +0100 Subject: [PATCH] fix(installed-summary): drop compgen (absent in wrapped bash) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Booting the VM showed "line 31: compgen: command not found" from nomarchy-installed-summary on first boot. compgen is a bash programmable-completion builtin, and the non-interactive bash the script gets wrapped with (via makeWrapper + patchShebangs) is compiled without progcomp. Beyond the visible error, the battery-presence check silently failed to the else branch, so a laptop was always reported as "desktop". Replace `compgen -G` with a nullglob array (a shopt, always available). The installer's identical check runs under the ISO's interactive bash, so it was unaffected — this script is the only compgen user. Co-Authored-By: Claude Opus 4.8 --- features/scripts/utils/nomarchy-installed-summary | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/features/scripts/utils/nomarchy-installed-summary b/features/scripts/utils/nomarchy-installed-summary index 0363912..aad28e0 100755 --- a/features/scripts/utils/nomarchy-installed-summary +++ b/features/scripts/utils/nomarchy-installed-summary @@ -26,9 +26,14 @@ tz=$(jq_or_empty "$SYS_STATE" '.timezone') dns=$(jq_or_empty "$SYS_STATE" '.dns') hybrid_gpu=$(jq_or_empty "$SYS_STATE" '.features.hybridGPU') -# Form factor: same battery-presence check the installer uses to auto-set -# nomarchy.{system.,}formFactor. -if compgen -G "/sys/class/power_supply/BAT*" >/dev/null; then +# Form factor: battery presence (same signal the installer uses to auto-set +# nomarchy.{system.,}formFactor). `compgen` is a bash programmable-completion +# builtin, and the non-interactive bash this script gets wrapped with is +# compiled without it — so a glob into a nullglob array, not `compgen -G`. +shopt -s nullglob +batteries=( /sys/class/power_supply/BAT* ) +shopt -u nullglob +if (( ${#batteries[@]} )); then form_factor="laptop" else form_factor="desktop"