You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2026/04/23 13:26:29 UTC

(nuttx) branch master updated (94e5fb9d3ec -> f51052d7803)

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


    from 94e5fb9d3ec boards/stm32l4: migrate to new pinmap
     new bf0848dbd61 boards/sim: Prefer tmpfs for /tmp in rc.sysinit.
     new f51052d7803 sched/docs: Align ETC ROMFS text with tmpfs-first /tmp mount.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Documentation/applications/nsh/customizing.rst | 18 ++++++++++----
 Documentation/guides/etcromfs.rst              | 11 ++++++---
 boards/sim/sim/sim/src/etc/init.d/rc.sysinit   | 12 ++++++---
 sched/Kconfig                                  | 34 ++++++++++++++------------
 4 files changed, 48 insertions(+), 27 deletions(-)


(nuttx) 02/02: sched/docs: Align ETC ROMFS text with tmpfs-first /tmp mount.

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit f51052d78030d00001f71c780efcae9a588bf63b
Author: Arjav Patel <ar...@gmail.com>
AuthorDate: Thu Apr 23 07:33:38 2026 +0530

    sched/docs: Align ETC ROMFS text with tmpfs-first /tmp mount.
    
    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 <ar...@gmail.com>
---
 Documentation/applications/nsh/customizing.rst | 18 ++++++++++----
 Documentation/guides/etcromfs.rst              | 11 ++++++---
 sched/Kconfig                                  | 34 ++++++++++++++------------
 3 files changed, 39 insertions(+), 24 deletions(-)

diff --git a/Documentation/applications/nsh/customizing.rst b/Documentation/applications/nsh/customizing.rst
index 2d120373a9a..ca2d305ff8c 100644
--- a/Documentation/applications/nsh/customizing.rst
+++ b/Documentation/applications/nsh/customizing.rst
@@ -57,10 +57,13 @@ The NSH initialization function, ``nsh_initialize()``, be found in
      read-only, ROMFS file system is mounted by ``nsh_romfsetc()``.
 
      The ROMFS image is, itself, just built into the firmware. By default,
-     this ``rc.sysinit`` system init script contains the following logic::
+     this ``rc.sysinit`` system init script contains logic to prefer
+     TMPFS for ``/tmp`` and to fall back to FAT RAMDISK::
 
-        # Create a RAMDISK and mount it at XXXRDMOUNTPOINTXXX
+        # Mount /tmp on TMPFS
+        mount -t tmpfs XXXRDMOUNTPOINTXXX
 
+        # Otherwise create a RAMDISK and mount it at XXXRDMOUNTPOINTXXX
         mkrd -m XXXMKRDMINORXXX -s XXMKRDSECTORSIZEXXX XXMKRDBLOCKSXXX
         mkfatfs /dev/ramXXXMKRDMINORXXX
         mount -t vfat /dev/ramXXXMKRDMINORXXX XXXRDMOUNTPOINTXXX
@@ -79,15 +82,20 @@ The NSH initialization function, ``nsh_initialize()``, be found in
      -  ``XXXRDMOUNTPOINTXXX`` will become the configured mount point.
         Default: ``/etc``
 
-     By default, the substituted values would yield an ``rc.sysinit`` file like::
+     By default, with FAT fallback values substituted, ``rc.sysinit``
+     can look like::
 
-        # Create a RAMDISK and mount it at /tmp
+        # Mount /tmp on TMPFS
+        mount -t tmpfs /tmp
 
+        # Otherwise create a RAMDISK and mount it at /tmp
         mkrd -m 1 -s 512 1024
         mkfatfs /dev/ram1
         mount -t vfat /dev/ram1 /tmp
 
-     This script will, then:
+     This script will:
+
+     -  Mount ``/tmp`` as TMPFS when available, or else:
 
      -  Create a RAMDISK of size 512*1024 bytes at ``/dev/ram1``,
 
diff --git a/Documentation/guides/etcromfs.rst b/Documentation/guides/etcromfs.rst
index aee60257a39..9a579fc2d11 100644
--- a/Documentation/guides/etcromfs.rst
+++ b/Documentation/guides/etcromfs.rst
@@ -58,10 +58,13 @@ behave as follows at Nuttx start-up time:
               `-- rcS
               `-- rc.sysinit
 
-  -  By default, the contents of ``rc.sysinit`` script are::
+  -  By default, the contents of ``rc.sysinit`` script prefer TMPFS for
+     ``/tmp`` and fall back to FAT RAMDISK when TMPFS is not enabled::
 
-      # Create a RAMDISK and mount it at /tmp
+      # Mount /tmp on TMPFS
+      mount -t tmpfs /tmp
 
+      # Otherwise create a RAMDISK and mount it at /tmp
       mkrd -m 1 -s 512 1024
       mkfatfs /dev/ram1
       mount -t vfat /dev/ram1 /tmp
@@ -96,8 +99,8 @@ In most of these cases, the configuration sets up the *default*
 script is here: ``apps/nshlib/rc.sysinit.template`` and
 ``apps/nshlib/rcS.template``. (The funny values in the rc.sysinit.template
 like ``XXXMKRDMINORXXX`` get replaced via ``sed`` at build time). This
-default configuration creates a ramdisk and mounts it at ``/tmp`` as
-discussed above.
+default configuration mounts ``/tmp`` as TMPFS when enabled, otherwise
+it creates a RAMDISK and mounts FAT at ``/tmp`` as discussed above.
 
 Customizing Start up Scripts
 ============================
diff --git a/sched/Kconfig b/sched/Kconfig
index 167cd17eb95..a3860afc1b0 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -552,8 +552,9 @@ menuconfig ETC_ROMFS
 	---help---
 		Mount a ROMFS filesystem at /etc and provide a system init
 		script at /etc/init.d/rc.sysinit and a startup script
-		at /etc/init.d/rcS.  The default system init script will mount
-		a FAT FS RAMDISK at /tmp but the logic is easily extensible.
+		at /etc/init.d/rcS.  The default system init script mounts
+		/tmp as TMPFS when FS_TMPFS is enabled, otherwise it can
+		fall back to mounting a FAT FS RAMDISK at /tmp.
 
 if ETC_ROMFS
 
@@ -591,37 +592,40 @@ config ETC_FATDEVNO
 	default 1
 	depends on FS_FAT
 	---help---
-		When the default rcS file used when ETC_ROMFS is selected, it
-		will mount a FAT FS under /tmp. This is the minor number of the FAT
-		FS block device.  The default is '1' corresponding to /dev/ram1.
+		When ETC_ROMFS is selected and FS_TMPFS is disabled, the
+		default rc.sysinit script mounts a FAT FS under /tmp. This
+		is the minor number of the FAT FS block device.  The default
+		is '1' corresponding to /dev/ram1.
 
 config ETC_FATSECTSIZE
 	int "FAT sector size"
 	default 512
 	depends on FS_FAT
 	---help---
-		When the default rcS file used when ETC_ROMFS is selected, it
-		will mount a FAT FS under /tmp. This is the sector size use with the
-		FAT FS. Default is 512.
+		When ETC_ROMFS is selected and FS_TMPFS is disabled, the
+		default rc.sysinit script mounts a FAT FS under /tmp. This
+		is the sector size used with the FAT FS. Default is 512.
 
 config ETC_FATNSECTORS
 	int "FAT number of sectors"
 	default 1024
 	depends on FS_FAT
 	---help---
-		When the default rcS file used when ETC_ROMFS is selected, it
-		will mount a FAT FS under /tmp. This is the number of sectors to use
-		with the FAT FS.  Default is 1024.  The amount of memory used by the
-		FAT FS will be ETC_FATSECTSIZE * ETC_FATNSECTORS bytes.
+		When ETC_ROMFS is selected and FS_TMPFS is disabled, the
+		default rc.sysinit script mounts a FAT FS under /tmp. This
+		is the number of sectors to use with the FAT FS.  Default is
+		1024.  The amount of memory used by the FAT FS will be
+		ETC_FATSECTSIZE * ETC_FATNSECTORS bytes.
 
 config ETC_FATMOUNTPT
 	string "FAT mount point"
 	default "/tmp"
 	depends on FS_FAT
 	---help---
-		When the default rcS file used when ETC_ROMFS is selected, it
-		will mount a FAT FS under /tmp. This is the location where the FAT
-		FS will be mounted.  Default is "/tmp".
+		When ETC_ROMFS is selected and FS_TMPFS is disabled, the
+		default rc.sysinit script mounts a FAT FS under /tmp. This
+		is the location where the FAT FS will be mounted.  Default is
+		"/tmp".
 
 endif # ETC_ROMFS
 


(nuttx) 01/02: boards/sim: Prefer tmpfs for /tmp in rc.sysinit.

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit bf0848dbd61ccf5837beca76bf0df99a7d6b23c3
Author: Arjav Patel <ar...@gmail.com>
AuthorDate: Thu Apr 23 07:33:37 2026 +0530

    boards/sim: Prefer tmpfs for /tmp in rc.sysinit.
    
    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 <ar...@gmail.com>
---
 boards/sim/sim/sim/src/etc/init.d/rc.sysinit | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/boards/sim/sim/sim/src/etc/init.d/rc.sysinit b/boards/sim/sim/sim/src/etc/init.d/rc.sysinit
index d1b409a7a62..659eb12f307 100644
--- a/boards/sim/sim/sim/src/etc/init.d/rc.sysinit
+++ b/boards/sim/sim/sim/src/etc/init.d/rc.sysinit
@@ -26,13 +26,19 @@
 #define CONCAT(x, y)  CONCAT_(x, y)
 
 #ifdef CONFIG_ETC_ROMFS
-#ifdef CONFIG_FS_FAT
+#ifdef CONFIG_FS_TMPFS
 
-/* Create a RAMDISK and mount it at /tmp */
+/* Mount /tmp on TMPFS */
+
+mount -t tmpfs /tmp
+
+#elif defined(CONFIG_FS_FAT)
+
+/* Create a FAT RAMDISK and mount it at /tmp */
 
 mkrd -m CONFIG_ETC_FATDEVNO -s CONFIG_ETC_FATSECTSIZE CONFIG_ETC_FATNSECTORS
 mkfatfs CONCAT(/dev/ram, CONFIG_ETC_FATDEVNO)
 mount -t vfat CONCAT(/dev/ram, CONFIG_ETC_FATDEVNO) CONFIG_ETC_FATMOUNTPT
 
-#endif /* CONFIG_FS_FAT */
+#endif /* CONFIG_FS_TMPFS || CONFIG_FS_FAT */
 #endif /* CONFIG_ETC_ROMFS */