Skip to content

Add device subdirectory support for APPS layout in firmware - #3126

Draft
jLynx wants to merge 1 commit into
portapack-mayhem:nextfrom
jLynx:mono_sd_card_files
Draft

Add device subdirectory support for APPS layout in firmware#3126
jLynx wants to merge 1 commit into
portapack-mayhem:nextfrom
jLynx:mono_sd_card_files

Conversation

@jLynx

@jLynx jLynx commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR optimizes the release workflow by consolidating device-specific SD card assets into a single "universal" ZIP file. It also introduces a structured directory layout for external applications (.ppma/.ppmp), ensuring that different hardware targets (HackRF, PortaRF, HackRF Pro) load the correct binaries from dedicated subdirectories on the SD card.


Key Changes

1. Workflow & Release Optimization

  • Asset Consolidation: Replaced the generation of 6 individual SD card ZIPs (3 devices × 2 map variants) with 2 consolidated ZIPs (Standard and No-World-Map).
  • Multi-Device Bundle: The CI now unzips and merges the artifacts for HackRF, PortaRF, and HackRF Pro into a single distribution, reducing clutter in the GitHub Releases page.
  • Matrix Enhancements: Added device_subdir to the build matrix to facilitate organized file placement during the build process.

2. Firmware & App Directory Logic

  • Namespaced Apps: External applications are now stored in APPS/<device_subdir>/ (e.g., APPS/hackrf, APPS/portarf, or APPS/hpro) instead of a flat APPS/ root.
  • Dynamic Path Resolution:
    • Added init_apps_dir() in file_path.cpp to detect the hardware at runtime and point the apps_dir path to the correct subdirectory.
    • Modified main.cpp to initialize these paths immediately after successful hardware initialization.
  • Build System Updates: CMakeLists.txt and internal helper scripts (copy_external_apps.sh, fast_flash_pp_and_copy_apps.py) now respect the DEVICE_SUBDIR environment variable.

3. Build System Improvements

  • Unified OCI/PPFW: Firmware naming now includes the artifact_suffix consistently across nightly and stable workflows to prevent binary collisions when creating combined archives.

Technical Details

Feature Old Behavior New Behavior
SD Card Layout /APPS/*.ppma /APPS/<device>/*.ppma
Release Assets 6 separate ZIP files for SD cards 2 "All-in-one" ZIP files
App Loading Hardcoded to /APPS Runtime detection based on portapack::device_type
CI Complexity Uploaded multiple redundant artifacts Merges device artifacts into a single combined release

Impact

  • Users: Can now use a single "Copy to SD Card" ZIP that works across all supported Mayhem hardware variants.
  • Developers: Cleaner release page and more robust handling of device-specific binary requirements.

Important

Ensure that existing users are informed to move their custom apps to the new subdirectories or perform a clean install from the new consolidated SD card ZIP to ensure apps remain visible in the UI.

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