8000 fix(gadget): write absolute configfs symlink targets by adeelahmad · Pull Request #30 · adeelahmad/gadgetcast · GitHub
[go: up one dir, main page]

Skip to content

fix(gadget): write absolute configfs symlink targets - #30

Merged
adeelahmad merged 1 commit into
masterfrom
fix/configfs-symlink
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
masterfrom
fix/configfs-symlink

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Summary

  • gadgetcast gadget up failed on real hardware: symlink ../../header/h .../control/class/fs/h: no such file or directory.
  • Cause: configfs resolves symlink targets against the process working directory, not the link's directory, so the plan's relative targets never resolve. The fake configfs and tempdir tests resolve them normally, which hid it.
  • Fix: OS.Symlink joins relative targets onto the link's directory. Plan is unchanged.

Test plan

  • New TestOSSymlinkWritesAbsoluteTarget (red before, green after)
  • gofmt / go vet / go build / go test ./...
  • Pi Zero 2 W, Debian trixie, kernel 6.18.50: gadget service active, UDC configured, macOS lists the GadgetCast UVC camera and UAC2 input/output

🤖 Generated with Claude Code

https://claude.ai/code/session_01C7ienWVsaHE85pDmB62jxz

configfs resolves a symlink's target against the caller's working
directory, not the link's directory, so the relative "../../header/h"
links failed on a real kernel with ENOENT and `gadgetcast gadget up`
exited before binding the UDC. OS.Symlink now joins relative targets
onto the link's directory. Verified on a Pi Zero 2 W (kernel 6.18):
UDC state "configured", macOS enumerates the UVC camera and UAC2 audio.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7ienWVsaHE85pDmB62jxz
@adeelahmad
adeelahmad merged commit 4e3feeb into master Oct 18, 2026
3 checks passed
@adeelahmad
adeelahmad deleted the fix/configfs-symlink branch October 18, 2026 01:22
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.

1 participant

0