xiaoxiang781216 edited a comment on issue #793: boards/Board.mk: use genromfs 
to make romfs image
URL: https://github.com/apache/incubator-nuttx/pull/793#issuecomment-613898005
 
 
   > is this an alternative to NSH_CUSTOMROMFS?
   > 
   
   RCSRCS/RCRAWS isn't an alternative which is designed to work with 
NSH_ROMFSETC/NSH_ARCHROMFS/NSH_CUSTOMROMFS. In the old workflow, if user enable 
NSH_ROMFSETC, he/she need prepare nsh_romfsimg.h by self or utilize 
mkromfs.sh(but this approach is only suitable for demo purpose). In the new 
workflow, user just need:
   1.Enable NSH_ROMFSETC
   2.Append script files into RCSRCS
   2.Append binary files to RCRAWS
   Then the build system will automatically generate romfs.img and convert to 
header file for you.
   
   > how is a user supposed to specify RCSRCS and RCRAWS?
   
   Here is a demo boards/arm/chip/board/src/Makefile
   ```
   RCSRCS := rcS
   
   VPATH += :etc/init.d
   DEPPATH += --dep-path etc/init.d
   
   include $(TOPDIR)/boards/Board.mk
   ```
   
   And boards/arm/chip/board/src/etc/init.d/rcS
   ```
   #include <nuttx/config.h>
   
   #ifdef CONFIG_NSH_PROC_MOUNTPOINT
   mount -t procfs CONFIG_NSH_PROC_MOUNTPOINT
   #endif
   
   #ifdef CONFIG_FS_TMPFS
   mount -t tmpfs CONFIG_LIBC_TMPDIR
   #endif
   
   #ifndef CONFIG_NSH_DISABLE_UNAME
   uname -a > /dev/syslog
   #endif
   ```
   
   Of course, user could add more script or config files to RCSRCS/RCRAWS, the 
only between RCSRCS and RCRAWS is that RCSRCS will go through C preprocessor 
but RCRAWS not.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to