Skip to content

Commit 08a4ca9

Browse files
Kabuki94claude
andcommitted
fix(build): remove artifact dep from build, make ai-bootstrap fail-soft
artifact (AI manifest generation) was a hard dependency of the build recipe and tried to write automation/manifest.json as root when the repo is mounted at /. Removing it from build deps — it is optional dev tooling, not an OCI build gate. Dropping -e from ai-bootstrap.sh and wrapping each python3 call in || true so a single permission error never blocks the build. Also fixes wsl-firstboot default password: when no MIOS_USER_PASSWORD_HASH is supplied, falls back to generating the sha512crypt hash of 'mios' via openssl passwd -6 rather than leaving the account locked. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6ca91ec commit 08a4ca9

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ lint:
4646
podman run --rm --entrypoint /usr/bin/bootc {{LOCAL}} container lint
4747

4848
# Build OCI image locally
49-
build: artifact preflight flight-status
49+
build: preflight flight-status
5050
podman build --no-cache \
5151
--build-arg BASE_IMAGE={{env_var_or_default("MIOS_BASE_IMAGE", "ghcr.io/ublue-os/ucore-hci:stable-nvidia")}} \
5252
--build-arg MIOS_FLATPAKS={{env_var_or_default("MIOS_FLATPAKS", "")}} \

automation/ai-bootstrap.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# rebuilds the unified knowledge base (RAG snapshot), refreshes user-space
44
# environment configs, and seeds shared agent context. Idempotent.
55

6-
set -euo pipefail
6+
set -uo pipefail
77

88
echo "[ai-bootstrap] Initializing MiOS agent workspace..."
99

@@ -20,24 +20,24 @@ fi
2020
# 1. Generate manifests.
2121
if [[ -f "tools/generate-ai-manifest.py" ]]; then
2222
echo "[ai-bootstrap] Generating directory manifests..."
23-
python3 tools/generate-ai-manifest.py
23+
python3 tools/generate-ai-manifest.py || echo "[ai-bootstrap] WARN: manifest generation failed (non-fatal)"
2424
else
2525
echo "[ai-bootstrap] WARN: tools/generate-ai-manifest.py not found"
2626
fi
2727

2828
# 2. Sync Wiki documentation.
2929
if [[ -f "tools/sync-wiki.py" ]]; then
3030
echo "[ai-bootstrap] Syncing Wiki..."
31-
python3 tools/sync-wiki.py
31+
python3 tools/sync-wiki.py || echo "[ai-bootstrap] WARN: wiki sync failed (non-fatal)"
3232
else
3333
echo "[ai-bootstrap] WARN: tools/sync-wiki.py not found"
3434
fi
3535

3636
# 3. Generate unified knowledge base (RAG snapshot).
3737
if [[ -f "tools/generate-unified-knowledge.py" ]]; then
3838
echo "[ai-bootstrap] Generating unified knowledge base (RAG snapshot)..."
39-
[[ -f "tools/journal-sync.py" ]] && python3 tools/journal-sync.py
40-
python3 tools/generate-unified-knowledge.py
39+
[[ -f "tools/journal-sync.py" ]] && { python3 tools/journal-sync.py || true; }
40+
python3 tools/generate-unified-knowledge.py || echo "[ai-bootstrap] WARN: knowledge base generation failed (non-fatal)"
4141
else
4242
echo "[ai-bootstrap] WARN: tools/generate-unified-knowledge.py not found"
4343
fi

usr/libexec/mios/wsl-firstboot

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ if id "$MIOS_USER" &>/dev/null; then
5757
passwd -u "$MIOS_USER" 2>/dev/null || true
5858
fi
5959

60-
# ── Password hash ──
60+
# ── Password hash (default: 'mios' if none supplied) ──
61+
if [[ -z "$MIOS_USER_HASH" ]] && id "$MIOS_USER" &>/dev/null; then
62+
_log "No password hash supplied — generating default hash for password 'mios'"
63+
MIOS_USER_HASH=$(openssl passwd -6 'mios' 2>/dev/null) || true
64+
fi
65+
6166
if [[ -n "$MIOS_USER_HASH" ]] && id "$MIOS_USER" &>/dev/null; then
6267
if [[ "$MIOS_USER_HASH" =~ ^\$6\$ ]]; then
6368
_log "Setting password hash for $MIOS_USER"
@@ -66,7 +71,7 @@ if [[ -n "$MIOS_USER_HASH" ]] && id "$MIOS_USER" &>/dev/null; then
6671
_log "WARN: MIOS_USER_PASSWORD_HASH is not a valid sha512crypt hash (must start with \$6\$)"
6772
fi
6873
else
69-
_log "WARN: No password hash found — $MIOS_USER will require password reset"
74+
_log "WARN: Could not set password for $MIOS_USER — manual reset required"
7075
fi
7176

7277
# ── Tmpfiles for /var/lib/mios ──

0 commit comments

Comments
 (0)