Repository navigation
Smaller firmware: no comments in /cfg, ls and dmramfs on /ext, an empty dmffs as the root - #150
Merged
Merged
Conversation
…ty dmffs as the root Strip the comments: the .ini and .rules files of the /cfg image lose their comment and empty lines (scripts/strip_comments.cmake, STRIP of dmboot_embed_dmffs, option DMBOOT_STRIP_CONFIG_COMMENTS, ON): config_fs 15.7 kB -> 4.9 kB. The files in DMBOOT_CONFIG_DIR are not touched, only the copy the image is made from. Move ls and dmramfs to tools.dmd (/ext/bin with DMBOOT_EXT_TOOLS, the firmware without it): -9.8 kB of modules.dmp. The root file system was a dmramfs, so it is now a read-only dmffs of its own embedded in the image (.embedded.root_fs, 38 bytes, with /mnt - automount cannot make that one itself), and /tmp is a dmramfs mounted by a unit (configs/common/services/tmp.ini; in /ext/cfg/services when the tools are on /ext, so it starts once /ext is mounted). The internal flash image is about 382 kB (402 kB before), MinSizeRel on the STM32F746G-DISCO. Tested on the board: / lists mnt cfg eviews dev ext tmp, /tmp can be written to, mkdir /foo is refused, the SD card is mounted at /mnt. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The line was broken when the option of the comment stripping was added in front of it: set(DMBOOT_EVIEWS_DIR"...") leaves DMBOOT_EVIEWS_DIR empty in a fresh build directory, so dmf-get got "--views-dir --package-dir ..." and failed with "Cannot specify both module name and dependencies file". It went unnoticed in a build directory that had the value in its cache already. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
echo > /test.txt cannot work any more: / is a read-only dmffs. The test waits for /tmp (the tmp unit mounts it once /ext is mounted, which is after the shell is up) and writes there. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
modules/CMakeLists.txt takes configs/common/services/tmp.ini from the sources of the firmware; the fixture of the test is a minimal source tree and has to have it too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JohnAmadis
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three steps that take the internal flash image of the
stm32f746g-discofrom ~402 kB to ~382 kB (MinSizeRel), on top of the slim firmware (#149):/cfgimage. The.iniand.rulesfiles lose their comment lines and empty lines before the image is made (scripts/strip_comments.cmake,STRIPofdmboot_embed_dmffs, optionDMBOOT_STRIP_CONFIG_COMMENTS, ON).config_fs15.7 kB → 4.9 kB. The files inDMBOOT_CONFIG_DIRare not touched, the image is made from a copy; comments after a value stay.lsanddmramfstotools.dmd, i.e. to/ext/binwithDMBOOT_EXT_TOOLS(in the firmware without it): −9.8 kB ofmodules.dmp..embedded.root_fs, 38 bytes, with/mnt– automount cannot make that one itself) instead of a dmramfs, and/tmpis a dmramfs mounted by a unit (configs/common/services/tmp.ini). With the tools on/extthe unit lands in/ext/cfg/services, so/tmpappears once/extis mounted.Behaviour change
/is read-only, and nothing can be written before/extis up (then/tmpis). Something that writes to/tmpearly needs to wait for thetmpunit (after=tmp).Tested
STM32F746G-DISCO, firmware flashed and
upload-ext:ls /→mnt cfg eviews dev ext tmp;mkdir /tmp/xworks,mkdir /foois refused; the SD card is mounted at/mnt/DMODOSby automount; carhmi, networkd, dmview and dmaudio run. Afterflash.dmdchanges a stalebuild/dmfkeeps the old modules: removedmf/<module>.*andmodules/flash.download_complete(not new, but easy to hit here).Not run: Renode, other boards (
lsanddmramfsstay in the firmware where there is noDMBOOT_EXT_TOOLS).🤖 Generated with Claude Code