Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Plan: Add Configuration Directory Mounting with dmffs

Understanding:

  • Need to add ability to pass a config directory path to cmake
  • This directory should be converted to a dmffs filesystem image and embedded in ROM
  • At runtime, mount this dmffs image as /configs/

Implementation Steps:

  • Understand the repository structure and existing embedding mechanisms
  • Complete the scripts/romfs.cmake script to:
    • Accept DMBOOT_CONFIG_DIR cmake variable
    • Use make_dmffs tool to create filesystem image from the config directory
    • Embed the resulting image as a binary object file
  • Update main CMakeLists.txt to:
    • Add DMBOOT_CONFIG_DIR as a cmake cache variable
    • Include the romfs.cmake script when config dir is provided
    • Add embedded config filesystem object to the firmware
  • Update linker script to add section for config filesystem
  • Update src/main.c to:
    • Add external symbols for the embedded config filesystem
    • Mount the embedded config filesystem as /configs/ in mount_embedded_filesystems()
  • Update README.md with documentation
  • Address code review feedback:
    • Replace snprintf with Dmod_SnPrintf (DMOD SAL function)
    • Remove stdio.h include
  • Complete implementation

Summary

Successfully implemented configuration directory mounting using dmffs with DMOD SAL functions.

Original prompt

This section details on the original issue you should resolve

<issue_title>Dodać montowanie katalogu konfiguracyjnego</issue_title>
<issue_description>W tym tasku potrzeba wykorzystać dmffs, aby zamontować wybrany katalog jako katalog konfiguracyjny. Czyli chcemy, aby można było do cmake podać ścieżkę do katalogu konfiguracyjnego, który następnie zostanie zamontowany w systemie z wykorzystaniem dmffs jako /configs/. </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot AI changed the title [WIP] Add mounting of configuration directory using dmffs Add dmffs config directory mounting at /configs/ Dec 29, 2025
Copilot AI requested a review from JohnAmadis December 29, 2025 12:48
@JohnAmadis JohnAmadis marked this pull request as ready for review December 29, 2025 14:12
Copy link
Contributor

@JohnAmadis JohnAmadis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot zapisz to sobie gdzies w instrukcjach na przyszłość - nie używamy snprintf tylko funkcji z DMOD SAL

src/main.c Outdated
@@ -1,5 +1,6 @@
#define DMOD_ENABLE_REGISTRATION
#include <string.h>
#include <stdio.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

żadnego stdio!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9716f7d - removed stdio.h include

src/main.c Outdated

// Mount the dmffs filesystem at /configs/
char mount_opts[128];
snprintf(mount_opts, sizeof(mount_opts), "addr=0x%X,size=%u",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dmod_SnPrintf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9716f7d - replaced snprintf with Dmod_SnPrintf

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 29, 2025

@copilot zapisz to sobie gdzies w instrukcjach na przyszłość - nie używamy snprintf tylko funkcji z DMOD SAL

Understood - will use DMOD SAL functions (like Dmod_SnPrintf) instead of standard C library functions going forward

Copilot AI requested a review from JohnAmadis December 29, 2025 14:18
@JohnAmadis JohnAmadis merged commit 79657cc into master Dec 29, 2025
5 checks passed
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.

Dodać montowanie katalogu konfiguracyjnego

2 participants