Skip to content

softeners: implement dfx-mgr softener#159

Draft
artiepoole wants to merge 20 commits intoartie/cargo_publishfrom
artie/dfx-mgr2
Draft

softeners: implement dfx-mgr softener#159
artiepoole wants to merge 20 commits intoartie/cargo_publishfrom
artie/dfx-mgr2

Conversation

@artiepoole
Copy link
Copy Markdown
Collaborator

@artiepoole artiepoole commented Mar 10, 2026

In order to implement the dfx-mgr softener, a few key details have/had to be ironed out:

  • how to add softeners as components/how else to do it from the snap side of things
    • we are going to enable all features, and add dfx-mgr binaries in the component with a wrapper script
  • what sort of wrapper script to run softener daemons "if present" (I want snapctl list components)
    • I still want to look into this
    • I wrote a python wrapper which is extensible (hopefully) to handle loading whatever daemons we have present.
    • Zygmunt strongly suggested we put this logic inside fpgad (or an fpgad wrapper script) so that the snap interfaces are not duplicated.
  • how to handle fpgad status when components exist
    • I added a get_status_message() dbus method and a platform.status_message() method
    • get_overlays still ambiguous because it returns the handle from the fs, not useful for dfx-mgr (needs slot)
  • remove platform specific logic from the control/status interface methods
    • where applicable, I have done so. There are open questions about a few methods
    • write_bitstream_direct, apply_overlay, remove_overlay and remove_bitstream (new) return message is platform specific now
    • shared functionality kept in dbus.rs, but universal-only helpers moved to universal_helpers.rs
  • add cli and dbus interface logic to enable dfx-mgr-client -remove [slot] equivalent functionality
    • Done
  • tests for the new functionality
    • WIP (next PR?)
  • how to minimise duplicated code/handle the fact that dfx-mgr doesn't support a separate "set_flags" or "get_flags"
    • to be discussed
  • how to enable dfx-mgr -load <package> functionality
    • also WIP - needs kernel support

CLI is updated a bit (get_status_message added, remove bitstream exists, status command changed) - still might have major changes soon.

dfx-mgr's "load_overlay" is currently using -b ... -o .... and it has to resolve the fliename for -b from the file specified by -o and therefore a dtb parser was added to the dependencies.

still TODO:

  • testing
  • decide on wrapper script for daemons only or within fpgad
  • -load support for dfx-mgr

@artiepoole artiepoole force-pushed the artie/cargo_publish branch from fbeeb2e to e5a03cc Compare March 10, 2026 16:28
@artiepoole artiepoole force-pushed the artie/cargo_publish branch from e5a03cc to d37c8c2 Compare March 10, 2026 16:31
@artiepoole artiepoole force-pushed the artie/dfx-mgr2 branch 6 times, most recently from 29903b4 to 5acd412 Compare March 16, 2026 17:39
@artiepoole artiepoole changed the title Artie/dfx mgr2 Implement dfx-mgr softener Mar 17, 2026
@artiepoole artiepoole force-pushed the artie/cargo_publish branch from d37c8c2 to 7eee048 Compare March 20, 2026 13:15
@artiepoole artiepoole force-pushed the artie/dfx-mgr2 branch 4 times, most recently from 811d6ad to fb79888 Compare March 23, 2026 14:58
@artiepoole artiepoole force-pushed the artie/cargo_publish branch from 7eee048 to c9db3af Compare March 24, 2026 09:57
@artiepoole artiepoole force-pushed the artie/dfx-mgr2 branch 2 times, most recently from c1914f3 to 73f1ff6 Compare March 24, 2026 10:08
@artiepoole artiepoole force-pushed the artie/cargo_publish branch from c9db3af to 57b7208 Compare March 24, 2026 10:08
@artiepoole artiepoole force-pushed the artie/dfx-mgr2 branch 2 times, most recently from 8a05612 to b1c8692 Compare March 24, 2026 11:34
@artiepoole artiepoole force-pushed the artie/cargo_publish branch 2 times, most recently from b2b64a8 to ffce870 Compare March 24, 2026 16:19
@artiepoole artiepoole force-pushed the artie/cargo_publish branch from ffce870 to b8c948e Compare March 26, 2026 14:20
@artiepoole artiepoole force-pushed the artie/cargo_publish branch from b8c948e to b3d3a4a Compare March 26, 2026 14:41
@artiepoole artiepoole force-pushed the artie/cargo_publish branch from b3d3a4a to 84a195e Compare March 26, 2026 14:53
@artiepoole artiepoole force-pushed the artie/dfx-mgr2 branch 2 times, most recently from 00943c1 to 07146bc Compare April 1, 2026 08:43
@artiepoole artiepoole force-pushed the artie/cargo_publish branch 2 times, most recently from fbb2a31 to ed89cdc Compare April 1, 2026 08:47
@artiepoole artiepoole force-pushed the artie/dfx-mgr2 branch 2 times, most recently from 15a686d to cdc614a Compare April 1, 2026 08:50
@artiepoole artiepoole force-pushed the artie/cargo_publish branch from ed89cdc to 70df418 Compare April 1, 2026 08:50
@artiepoole artiepoole force-pushed the artie/cargo_publish branch from 70df418 to ca57127 Compare April 10, 2026 10:14
Signed-off-by: Artie Poole <stuart.poole@canonical.com>
Signed-off-by: Artie Poole <stuart.poole@canonical.com>
Signed-off-by: Artie Poole <stuart.poole@canonical.com>
Signed-off-by: Artie Poole <stuart.poole@canonical.com>
Signed-off-by: Artie Poole <stuart.poole@canonical.com>
- Add snapcraft configuration for dfx-mgr integration
- Add content interface with explicit identifier
- Create install and post-refresh hooks for daemon.conf
- Add softener_wrapper script for persistent dfx-mgrd monitoring
- Temporarily add ubuntu-xilinx PPA (to be removed before merge)
This commit sets up the snapcraft infrastructure needed to run
dfx-mgr as a backend for FPGA management on supported platforms.

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
- Bump version from 0.1.0 to 0.2.0
- Add initial dfx_mgr dbus method with command string splitting
- Add map_error_io_to_fdo helper for Command error handling
This version introduces dfx-mgr support as a new softener backend.

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
Makes FpgadError non-exhaustive to force default match arms,
improving forward compatibility for error handling.

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
- Add remove_bitstream method to Platform trait
- Make remove_overlay accept Option<slot> for dfx-mgr compatibility
- Move firmware path splitting/joining from dbus to platform implementations
- Move path utilities to system_io for reuse across platforms
- Create XilinxDfxMgrFPGA and XilinxDfxMgrOverlayHandler stubs

Major refactoring to push platform-specific logic out of dbus layer
and into the platform implementations where it belongs.

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
- Implement basic XilinxDfxMgrFPGA and XilinxDfxMgrOverlayHandler
- Add dfx-mgr-client wrapper functions (load, remove, list, etc.)
- Add FDT parsing helpers to extract bitstream path from DTBO
- Add fdt dependency for device tree parsing
- if $SNAP is not defined that's okay just use the non-snap path for
   dfx-mgr-client

This commit provides the core dfx-mgr integration, allowing fpgad
to use dfx-mgr as a backend for bitstream loading on supported
Xilinx platforms.

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
- Add remove_bitstream subcommand to CLI
- Improve display formatting with pretty-print macros
- Add corresponding dbus method

Enables testing of dfx-mgr bitstream removal functionality.

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
- Add status_message method to Platform trait
- Implement platform-specific status formatting
- Add TODO comments for overlay status improvements
- add binary tests

Allows platforms to provide custom status messages.

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
Add comprehensive documentation for dfx-mgr platform components:

- XilinxDfxMgrPlatform, XilinxDfxMgrFPGA, XilinxDfxMgrOverlayHandler
- Helper functions and FDT parsing utilities

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
- Remove unused dfx-mgr wrapper functions (list_uio, list_irbuf, etc.)
- Remove required_flags method from OverlayHandler trait
- Remove completed TODO comments

Cleanup of code that was added during exploration but is not needed.

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
- Add FpgadError::Feature variant for missing feature errors
- Use cfg macro to provide helpful error when dfx-mgr feature missing
- Add check for dfx-mgr-client binary with installation instructions

Improves user experience when dfx-mgr features are not available.

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
Remove unused documentation file that is no longer relevant.

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
…er feature gating

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
…logic into platform specific code

Signed-off-by: Artie Poole <stuart.poole@canonical.com>
Signed-off-by: Artie Poole <stuart.poole@canonical.com>
Signed-off-by: Artie Poole <stuart.poole@canonical.com>
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