apps/nshlib/nsh_fscmds.c: The NSH mkrd command was in violation of the NuttX portable POSIX interface. it was calling the internal OS function ramdisk_register() directly. No only is this a violation of the interface specification, but also prevents use of mkrd in PROTECTED or KERNEL buils.

With this commit, the NSH mkrd command now used the BOARDIOC_MKRD boardctl() command.  This command is availabe in all build modes.  The effect of this change is to move the hear of the NSH mkrd command into to OS and provide user-space access via boardctl().
This commit is contained in:
Gregory Nutt
2019-10-26 09:42:51 -06:00
parent 3e4db5cb40
commit c8a066f699
3 changed files with 23 additions and 53 deletions

View File

@@ -546,26 +546,6 @@
# define IOBUFFERSIZE (PATH_MAX + 1)
#endif
/* Certain commands are not available in a kernel builds because they depend
* on interfaces that are not exported by the kernel. These are actually
* bugs that need to be fixed but for now the commands are simply disabled.
* There are three classes of fixes required:
*
* - Some of these interfaces are inherently internal to the OS (such as
* register_ramdisk()) and should never be made available to user
* applications as OS interfaces.
* - Other interfaces are more standard and for these there probably should
* be new system calls to support the OS interface. Such interfaces
* include things like mkrd.
* - Other interfaces simply need to be moved out of the OS and into the C
* library where they will become accessible to application code.
*/
#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL)
# undef CONFIG_NSH_DISABLE_MKRD /* 'mkrd' depends on ramdisk_register */
# define CONFIG_NSH_DISABLE_MKRD 1
#endif
/* Certain commands/features are only available if the procfs file system is
* enabled.
*/