Skip to content

Prefer tmpfs for /tmp mount in SIM and update documentation#18781

Merged
acassis merged 2 commits into
apache:masterfrom
arjav1528:dev-issue-12791
Apr 23, 2026
Merged

Prefer tmpfs for /tmp mount in SIM and update documentation#18781
acassis merged 2 commits into
apache:masterfrom
arjav1528:dev-issue-12791

Conversation

@arjav1528
Copy link
Copy Markdown
Contributor

Note: Please adhere to Contributing Guidelines.

Fixes #12791

Why this change is needed

  • Current SIM rc.sysinit behavior always creates a FAT RAMDISK and mounts it on /tmp.
  • NuttX already supports TMPFS, and expected behavior is to use TMPFS for /tmp when available.

What this change does

  • Updates boards/sim/sim/sim/src/etc/init.d/rc.sysinit to:
    • Mount /tmp as tmpfs when CONFIG_FS_TMPFS=y.
    • Fall back to existing FAT RAMDISK flow when TMPFS is not enabled and CONFIG_FS_FAT=y.
  • Updates sched/Kconfig help text for ETC_ROMFS and FAT options so documentation matches implementation.
  • Updates documentation to reflect TMPFS-first /tmp behavior with FAT fallback:
    • Documentation/guides/etcromfs.rst
    • Documentation/applications/nsh/customizing.rst

Impact

  • Users: SIM configurations with TMPFS enabled now get /tmp backed by TMPFS by default.
  • Compatibility: FAT RAMDISK fallback is preserved for configurations without TMPFS.
  • Build process: No build system changes.
  • Hardware: Change is scoped to SIM startup script behavior.
  • Documentation: Kconfig help and guides now align with runtime behavior.
  • Security: No direct security impact identified.

What was tested

  1. File-level style checks on all touched files:
./tools/checkpatch.sh -f boards/sim/sim/sim/src/etc/init.d/rc.sysinit \
  sched/Kconfig \
  Documentation/guides/etcromfs.rst \
  Documentation/applications/nsh/customizing.rst

Prefer mounting /tmp with tmpfs in the SIM default rc.sysinit when
CONFIG_FS_TMPFS is enabled, and keep the FAT RAMDISK path as a
fallback for configurations that only enable CONFIG_FS_FAT.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
Update ETC_ROMFS help text and NSH/ROMFS guides to describe the
/tmp mount behavior as tmpfs-first with FAT RAMDISK fallback when
CONFIG_FS_TMPFS is not enabled.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
@github-actions github-actions Bot added Area: Documentation Improvements or additions to documentation Size: S The size of the change in this PR is small Board: simulator labels Apr 23, 2026
@acassis acassis merged commit f51052d into apache:master Apr 23, 2026
16 checks passed
@acassis
Copy link
Copy Markdown
Contributor

acassis commented Apr 23, 2026

Thank you @arjav1528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Board: simulator Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIM is mounting /tmp as vfat instead of using TMPFS

3 participants