From 06acc559a152adcd967960dccd2f7ade4617e1cb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 26 Oct 2019 12:26:16 -0600 Subject: [PATCH] apps/nshlib: Tighten up some of the conditional logic for mkrd. --- nshlib/Kconfig | 2 +- nshlib/nsh.h | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/nshlib/Kconfig b/nshlib/Kconfig index 687d4837d..21b09919c 100644 --- a/nshlib/Kconfig +++ b/nshlib/Kconfig @@ -12,7 +12,7 @@ config NSH_LIBRARY select NETUTILS_NETLIB if NET select LIBC_NETDB if NET select READLINE_HAVE_EXTMATCH - select DRVR_MKRD if !NSH_DISABLE_MKRD + select DRVR_MKRD if !NSH_DISABLE_MKRD && !DISABLE_MOUNTPOINT ---help--- Build the NSH support library. This is used, for example, by system/nsh in order to implement the full NuttShell (NSH). diff --git a/nshlib/nsh.h b/nshlib/nsh.h index 5540dbf3b..a2580f002 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -861,13 +861,24 @@ int nsh_loginscript(FAR struct nsh_vtbl_s *vtbl); #endif #endif -/* Architecture-specific initialization */ +/* Certain commands are only available if the boardctl() interface is + * available: + */ + +/* Architecture-specific initialization depends on boardctl(BOARDIOC_INIT) */ #if defined(CONFIG_NSH_ARCHINIT) && !defined(CONFIG_LIB_BOARDCTL) # warning CONFIG_NSH_ARCHINIT is set, but CONFIG_LIB_BOARDCTL is not # undef CONFIG_NSH_ARCHINIT #endif +/* The mkrd command depends on boardctl(BOARDIOC_MKRD) */ + +#if !defined(CONFIG_LIB_BOARDCTL) || !defined(CONFIG_DRVR_MKRD) +# undef CONFIG_NSH_DISABLE_MKRD +# define CONFIG_NSH_DISABLE_MKRD 1 +#endif + /* Basic session and message handling */ struct console_stdio_s;