From 77d07071ff073399b8c4f07b801899ea1e7842d1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 30 Sep 2014 06:43:49 -0600 Subject: Add support for a custom NSH ROMFS startup image header file location. From Martin Lederhilger --- apps/nshlib/Kconfig | 41 ++++++++++++++++++++++++++++++++++++----- apps/nshlib/nsh_romfsetc.c | 4 +++- 2 files changed, 39 insertions(+), 6 deletions(-) (limited to 'apps/nshlib') diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig index 0add860d6..ba9c718b4 100644 --- a/apps/nshlib/Kconfig +++ b/apps/nshlib/Kconfig @@ -529,14 +529,45 @@ config NSH_ROMFSSECTSIZE increased if the ROMFS volume were to be become large. Any value selected must be a power of 2. +choice + prompt "ROMFS header location" + default NSH_DEFAULTROMFS + +config NSH_DEFAULTROMFS + bool "Default ROMFS header path" + ---help--- + Selects the default header located in the source directory of the + NSH library. + config NSH_ARCHROMFS - bool "Architecture-specific ROMFS header" - default n + bool "Architecture-specific ROMFS path" ---help--- Enable this option to provide an architecture-specific ROMFS - header at . Note that this header - will be copied from nuttx/configs//include and should - be stored at this location. + header at arch//nsh_romfsimg.h. Note that this header + will be linked (or copied) from nuttx/configs//include + and should be stored at that location in the nuttx configs/ + sub-directory. + +config NSH_CUSTOMROMFS + bool "Custom ROMFS header path" + ---help--- + Enable this option to provide a custom ROMFS header. The path to + the header file can be specified in the option "Custom ROMFS header + file". + +endchoice + +if NSH_CUSTOMROMFS + +config NSH_CUSTOMROMFS_HEADER + string "Custom ROMFS header file path" + default "" + ---help--- + Specifies the path to the custom ROMFS header file. This must be + either a full path or a path relative to one of the include file + search paths provided in your CFLAGS. + +endif #NSH_CUSTOMROMFS config NSH_FATDEVNO int "FAT block device minor number" diff --git a/apps/nshlib/nsh_romfsetc.c b/apps/nshlib/nsh_romfsetc.c index 6f538b4c5..eba60af92 100644 --- a/apps/nshlib/nsh_romfsetc.c +++ b/apps/nshlib/nsh_romfsetc.c @@ -55,7 +55,9 @@ #ifdef CONFIG_NSH_ARCHROMFS # include -#else +#elif defined(CONFIG_NSH_CUSTOMROMFS) +# include CONFIG_NSH_CUSTOMROMFS_HEADER +#else /* if defined(CONFIG_NSH_DEFAULTROMFS) */ # include "nsh_romfsimg.h" #endif -- cgit v1.2.3