From dc50005d7bdac897c330e5fcc2882fb016ebf9a8 Mon Sep 17 00:00:00 2001 From: Derek Ross Date: Wed, 11 Nov 2026 19:44:43 -0500 Subject: [PATCH] omamobile-firstboot 0.1.5: a first boot without a name or email finishes user setup 0.1.4 (#662) wrote git's name and email in the user-setup step with a bare ${C[FULL_NAME]} and ${C[EMAIL]}. The installer writes those keys only when the owner gave them, so under set -u a blank one ended the step with "unbound variable", before omamobile-setup-user, the credential record and the lock toggles. The step is optional, so firstboot still marked itself done and never retried. Phones that updated are unaffected: firstboot ran on them long ago. The next root image would have carried it. Both keys are now read with a default. The test's no-name case checked only the exit status and that git wasn't called; it now also fails on an unset-key message or a run that ends with warnings, and fails that way against 0.1.4's script. Found by the round 52 review of #662. Co-Authored-By: Claude Fable 5.2 --- .../omamobile-firstboot/bin/omamobile-firstboot | 14 +++++++++----- packages/omamobile-firstboot/test/all | 4 ++++ packages/omamobile-firstboot/version | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/omamobile-firstboot/bin/omamobile-firstboot b/packages/omamobile-firstboot/bin/omamobile-firstboot index 5d44a0d02..298bdb08d 100755 --- a/packages/omamobile-firstboot/bin/omamobile-firstboot +++ b/packages/omamobile-firstboot/bin/omamobile-firstboot @@ -445,12 +445,16 @@ s_user_setup() { # variables as_user passes; Omarchy 4.5's writes only the Compose shortcuts # (its git setup is a command the owner runs). Written here, so the # installer's answers reach git under either; a blank one stays unset, and - # a failure is said but doesn't fail the first boot. - if [[ -n ${C[FULL_NAME]//[[:space:]]/} ]]; then - as_user git config --global user.name "${C[FULL_NAME]}" || echo " git's user.name could not be set" + # a failure is said but doesn't fail the first boot. Both keys are optional + # (the installer writes them only when given), so they are read with a + # default: under set -u a bare ${C[EMAIL]} ended this step before + # omamobile-setup-user and the lock toggles, on a phone whose owner gave none. + local name=${C[FULL_NAME]-} email=${C[EMAIL]-} + if [[ -n ${name//[[:space:]]/} ]]; then + as_user git config --global user.name "$name" || echo " git's user.name could not be set" fi - if [[ -n ${C[EMAIL]//[[:space:]]/} ]]; then - as_user git config --global user.email "${C[EMAIL]}" || echo " git's user.email could not be set" + if [[ -n ${email//[[:space:]]/} ]]; then + as_user git config --global user.email "$email" || echo " git's user.email could not be set" fi if command -v omamobile-setup-user >/dev/null; then as_user omamobile-setup-user || { echo " omamobile-setup-user failed"; failed=1; } diff --git a/packages/omamobile-firstboot/test/all b/packages/omamobile-firstboot/test/all index 38bfc85cf..e9db78351 100755 --- a/packages/omamobile-firstboot/test/all +++ b/packages/omamobile-firstboot/test/all @@ -207,6 +207,10 @@ pass "running again is safe" good | sed '/^WIFI_/d; /^FULL_NAME=/d; /^EMAIL=/d' > "$R/etc/omamobile/firstboot.conf" run || { cat "$t/run.out"; fail "a run without a name and email succeeds"; } grep -c ' git config ' "$CALLS" >/dev/null && fail "without a name and email git's config is not written" +# ... and the rest of user setup still runs: the step is optional, so a death +# in it (an unset key under set -u, 0.1.4) left the run's exit status at 0. +grep -c 'unbound variable' "$t/run.out" >/dev/null && { cat "$t/run.out"; fail "a run without a name and email reads no unset key"; } +grep -c 'with warnings' "$t/run.out" >/dev/null && { cat "$t/run.out"; fail "a run without a name and email ends without warnings"; } pass "the installer's name and email reach git; without them git is left alone" : > "$CALLS" diff --git a/packages/omamobile-firstboot/version b/packages/omamobile-firstboot/version index 845639eef..9faa1b7a7 100644 --- a/packages/omamobile-firstboot/version +++ b/packages/omamobile-firstboot/version @@ -1 +1 @@ -0.1.4 +0.1.5