fix(firecracker): restore agent home ownership at boot
test / integration-docker (pull_request) Successful in 20s
tracker-policy-pr / check-pr (pull_request) Successful in 20s
test / unit (pull_request) Successful in 40s
lint / lint (push) Successful in 55s
test / integration-firecracker (pull_request) Successful in 4m29s
test / coverage (pull_request) Failing after 16s
test / publish-infra (pull_request) Has been skipped

This commit is contained in:
2026-07-21 18:31:15 +00:00
parent c2c934899c
commit 9256bce4d4
4 changed files with 16 additions and 0 deletions
+2
View File
@@ -267,6 +267,8 @@ class AgentProvider(ABC):
# runtime, after every backend's copy/export path has completed.
git_xdg_dir = f"{plan.guest_home}/.config/git"
repair = bottle.exec(
f"chown node:node {shlex.quote(plan.guest_home)} && "
f"chmod 755 {shlex.quote(plan.guest_home)} && "
f"mkdir -p {shlex.quote(git_xdg_dir)} && "
f"chown -R node:node {shlex.quote(f'{plan.guest_home}/.config')} && "
f"chmod -R u+rwX,go+rX {shlex.quote(f'{plan.guest_home}/.config')}",
+6
View File
@@ -373,6 +373,12 @@ mount -o remount,rw / 2>/dev/null
# scratch dirs there — git worktrees, build temp, `git init /tmp/...`, etc.
mkdir -p /tmp && chmod 1777 /tmp
# Rootfs export also maps the image's original owners to the unprivileged
# host build uid. That uid is not guaranteed to be node's uid in the guest;
# restore the home-directory boundary before any SSH provisioning runs.
chown node:node /home/node 2>/dev/null || true
chmod 755 /home/node 2>/dev/null || true
# Install the per-bottle SSH pubkey from the kernel cmdline.
KEY=$(sed -n 's/.*bb_pubkey=\([^ ]*\).*/\1/p' /proc/cmdline | base64 -d 2>/dev/null)
if [ -n "$KEY" ]; then