From b610e76659cba03ad367aa1ccad02b6451192136 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Apr 2026 23:10:19 +0000 Subject: [PATCH] Fix chpasswd: remove broken chroot from installer, defer to first-boot service Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/e55c1e70-0958-4d77-a222-52dccc9459b2 Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- iso/installer.py | 15 --------------- modules/credentials.nix | 4 ++-- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/iso/installer.py b/iso/installer.py index b427e10..35cad41 100644 --- a/iso/installer.py +++ b/iso/installer.py @@ -1017,21 +1017,6 @@ class InstallerWindow(Adw.ApplicationWindow): raise RuntimeError(proc.stderr.strip() or "Failed to write root-password") run(["sudo", "chmod", "600", "/mnt/var/lib/secrets/root-password"]) - proc = subprocess.run( - ["sudo", "chroot", "/mnt", "/run/current-system/sw/bin/chpasswd"], - input=f"free:{self.free_password}\nroot:{root_password}", - capture_output=True, text=True - ) - if proc.returncode != 0: - proc = subprocess.run( - ["sudo", "chroot", "/mnt", "chpasswd"], - input=f"free:{self.free_password}\nroot:{root_password}", - capture_output=True, text=True - ) - if proc.returncode != 0: - log(proc.stderr) - raise RuntimeError(proc.stderr.strip() or "Failed to set passwords via chpasswd") - GLib.idle_add(self.push_complete) # ── Complete ─────────────────────────────────────────────────────────── diff --git a/modules/credentials.nix b/modules/credentials.nix index 12246aa..b0d096c 100644 --- a/modules/credentials.nix +++ b/modules/credentials.nix @@ -107,10 +107,10 @@ in W3=''${WORD_ARRAY[$((RANDOM % COUNT))]} DIGIT=$((RANDOM % 10)) ROOT_PASS="$W1-$W2-$W3-$DIGIT" - echo "root:$ROOT_PASS" | chpasswd echo "$ROOT_PASS" > "$SECRET_FILE" chmod 600 "$SECRET_FILE" fi + echo "root:$(cat "$SECRET_FILE")" | chpasswd ''; }; @@ -144,10 +144,10 @@ in W3=''${WORD_ARRAY[$((RANDOM % COUNT))]} DIGIT=$((RANDOM % 10)) FREE_PASS="$W1-$W2-$W3-$DIGIT" - echo "free:$FREE_PASS" | chpasswd echo "$FREE_PASS" > "$SECRET_FILE" chmod 600 "$SECRET_FILE" fi + echo "free:$(cat "$SECRET_FILE")" | chpasswd ''; };