systemd / systemd/systemd

Socket-activated FunctionFS binary descriptors

Open
#12,766 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pid1 RFE 🎁
Dominant language
C
Stars
16.7k
Forks
4.7k
Avg merge
1d 6h
Merged PRs (30d)
140

Description

USB gadgets can be implemented as userspace daemons running on top of FunctionFS. Systemd has socket-activation of such daemons built in. The very first thing that must be done by systemd is writing USB descriptors and strings to the ep0 file. The said descriptors and strings are referenced by USBFunctionDescriptors and USBFunctionStrings of the service unit associated with the socket unit in question. Both the descriptors and strings must be in binary form.

It is difficult to create the needed binary blobs on the one hand, and to inspect what is inside such blobs on the other. The latter can only be done manually with a hex viewer and USB standard.

There is a gt tool: https://github.com/kopasiak/gt and an outstanding pull request: https://github.com/kopasiak/gt/pull/8. The PR adds support to gt for creating the binary blobs with command line invocations of gt or based on a declarative config file.

The question to systemd maintainers is whether you would like similar functionality in systemd itself, so that systemd can build those binary blobs on its own based on a textual description? The standalone gt tool mentioned above seems a better place for such functionality, because it could also do the reverse: given a blob produce a textual description - the latter does not seem the right fit for systemd and seems better handled by a standalone tool. But anyway, what is your opinion?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the issue proposal and the referenced gt project and pull request #8. Determine whether descriptor construction belongs in systemd or remains external; completion would require a maintainer decision and defined implementation scope, since no systemd file, entry point, or test is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.