Skip to content

Fix file permission bug in init --reference#92

Merged
mobileoverlord merged 1 commit intomainfrom
fix/init-ref-file-permissions
Feb 25, 2026
Merged

Fix file permission bug in init --reference#92
mobileoverlord merged 1 commit intomainfrom
fix/init-ref-file-permissions

Conversation

@bbrock25
Copy link
Contributor

Summary

  • avocado init --reference downloads files from GitHub but never set the execute bit on scripts (e.g., rubicon-usb-gadget-setup got 644 instead of 755), causing boot failures
  • Root cause: file_modes keys are relative paths (stripped of references/<name>/ prefix), but the lookup used item.path which retains the full GitHub API path — so the lookup never matched
  • Fix: use relative_path instead of item.path for the file_modes lookup (one-line change)

Test plan

  • Added unit test test_file_modes_lookup_uses_relative_path proving the fix works and the old code was broken
  • Full test suite passes (551+ tests, no regressions)
  • End-to-end verified: avocado init --reference rubicon now sets rubicon-usb-gadget-setup to 755

🤖 Generated with Claude Code

The file_modes lookup in download_reference_contents used item.path
(full GitHub API path with references/<name>/ prefix) but file_modes
keys are relative (prefix already stripped by fetch_file_modes). This
mismatch meant the lookup never matched, so executable scripts like
rubicon-usb-gadget-setup got 644 instead of 755, causing boot failures.

Fix: use relative_path (which has the prefix stripped) for the lookup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bbrock25 bbrock25 force-pushed the fix/init-ref-file-permissions branch from 03075e5 to 5aa85ce Compare February 25, 2026 02:52
@mobileoverlord mobileoverlord enabled auto-merge (rebase) February 25, 2026 03:14
@mobileoverlord mobileoverlord merged commit 4d9f83d into main Feb 25, 2026
5 checks passed
@mobileoverlord mobileoverlord deleted the fix/init-ref-file-permissions branch February 25, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants