diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-09-11 21:54:23 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-09-11 21:54:23 +0000 |
commit | 97d11b18c99ba683fbe91fc3ad5d9b897de27c81 (patch) | |
tree | 221d07773f3a6dfb6f566eacf2c97e15e77e935f /nuttx/examples/nsh/nsh.h | |
parent | c89a814396a9e542f05bc8b204b0b6c00dc1bf83 (diff) | |
download | nuttx-97d11b18c99ba683fbe91fc3ad5d9b897de27c81.tar.gz nuttx-97d11b18c99ba683fbe91fc3ad5d9b897de27c81.tar.bz2 nuttx-97d11b18c99ba683fbe91fc3ad5d9b897de27c81.zip |
Add /etc via ROMFS and /tmp via FAT FS to NSH
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@910 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nsh/nsh.h')
-rw-r--r-- | nuttx/examples/nsh/nsh.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/nuttx/examples/nsh/nsh.h b/nuttx/examples/nsh/nsh.h index e35084ead..7626a4e3c 100644 --- a/nuttx/examples/nsh/nsh.h +++ b/nuttx/examples/nsh/nsh.h @@ -64,6 +64,49 @@ # error "No NSH front end defined" #endif +/* Verify support for ROMFS /etc directory support options */ + +#ifdef CONFIG_EXAMPLES_NSH_ROMFSETC +# ifdef CONFIG_DISABLE_MOUNTPOINT +# error "Mountpoint support is disabled" +# undef CONFIG_EXAMPLES_NSH_ROMFSETC +# endif +# if CONFIG_NFILE_DESCRIPTORS < 4 +# error "Not enough file descriptors" +# undef CONFIG_EXAMPLES_NSH_ROMFSETC +# endif +# ifndef CONFIG_FS_ROMFS +# error "ROMFS support not enabled" +# undef CONFIG_EXAMPLES_NSH_ROMFSETC +# endif +# ifndef CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT +# define CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT "/etc" +# endif +# ifdef CONFIG_EXAMPLES_NSH_INIT +# ifndef CONFIG_EXAMPLES_NSH_INITSCRIPT +# define CONFIG_EXAMPLES_NSH_INITSCRIPT "init.d/rcS" +# endif +# endif +# undef NSH_INITPATH +# define NSH_INITPATH CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT "/" CONFIG_EXAMPLES_NSH_INITSCRIPT +# ifndef CONFIG_EXAMPLES_NSH_ROMFSDEVNO +# define CONFIG_EXAMPLES_NSH_ROMFSDEVNO 0 +# endif +# ifndef CONFIG_EXAMPLES_NSH_ROMFSSECTSIZE +# define CONFIG_EXAMPLES_NSH_ROMFSSECTSIZE 64 +# endif +# define NSECTORS(b) (((b)+CONFIG_EXAMPLES_NSH_ROMFSSECTSIZE-1)/CONFIG_EXAMPLES_NSH_ROMFSSECTSIZE) +# define STR_RAMDEVNO(m) #m +# define MKMOUNT_DEVNAME(m) "/dev/ram" STR_RAMDEVNO(m) +# define MOUNT_DEVNAME MKMOUNT_DEVNAME(CONFIG_EXAMPLES_NSH_ROMFSDEVNO) +#else +# undef CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT +# undef CONFIG_EXAMPLES_NSH_INIT +# undef CONFIG_EXAMPLES_NSH_INITSCRIPT +# undef CONFIG_EXAMPLES_NSH_ROMFSDEVNO +# undef CONFIG_EXAMPLES_NSH_ROMFSSECTSIZE +#endif + /* This is the maximum number of arguments that will be accepted for a command */ #define NSH_MAX_ARGUMENTS 6 @@ -237,6 +280,15 @@ extern const char g_fmtinternalerror[]; * Public Function Prototypes ****************************************************************************/ +/* Initialization */ + +#ifdef CONFIG_EXAMPLES_NSH_ROMFSETC +extern int nsh_romfsetc(void); +#endif +#if CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0 && !defined(CONFIG_EXAMPLES_NSH_DISABLESCRIPT) +extern int nsh_script(FAR struct nsh_vtbl_s *vtbl, const char *cmd, const char *path); +#endif + /* Message handler */ extern int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline); |