summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-07 10:46:06 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-07 10:46:06 -0600
commitc5711dd525c2eae779fb8ec384f3aa9c4253edaf (patch)
tree659f8c454485b5a24c28dfe1948b486a9fdf155c
parent080e53a9082e9d5bc75c3e84f84ffdc6cf1985d6 (diff)
downloadnuttx-c5711dd525c2eae779fb8ec384f3aa9c4253edaf.tar.gz
nuttx-c5711dd525c2eae779fb8ec384f3aa9c4253edaf.tar.bz2
nuttx-c5711dd525c2eae779fb8ec384f3aa9c4253edaf.zip
Several commands must be disabled in the kernel build because they depend on interfaces that are not available outside of the kernel: dd, df, losetup, mkfatfs, mkdr, and ps.
-rw-r--r--apps/nshlib/nsh.h28
-rw-r--r--apps/nshlib/nsh_ddcmd.c2
2 files changed, 27 insertions, 3 deletions
diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h
index a17b0a901..dc13e3753 100644
--- a/apps/nshlib/nsh.h
+++ b/apps/nshlib/nsh.h
@@ -547,12 +547,36 @@
#endif
/* Certain commands are not available in a kernel builds because they depend
- * on interfaces that are not exported by the kernel.
+ * 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
+ * sched_foreach and foreach_mountpoint) and should never be made
+ * available to user applications as OS interfaces. For these, the long
+ * range solution to restoring the functionality will be to support procfs
+ * entries the provide the necessary 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 losetup, loteardown, and 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. Such
+ * interfaces include mkfatfs.
*/
#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL)
-# undef CONFIG_NSH_DISABLE_DF
+# undef CONFIG_NSH_DISABLE_PS /* 'ps' depends on sched_foreach */
+# define CONFIG_NSH_DISABLE_PS 1
+# undef CONFIG_NSH_DISABLE_DF /* 'df' depends on foreach_mountpoint */
# define CONFIG_NSH_DISABLE_DF 1
+# undef CONFIG_NSH_DISABLE_DD /* 'dd' depends on bchlib_* interfaces */
+# define CONFIG_NSH_DISABLE_DD 1
+# undef CONFIG_NSH_DISABLE_LOSETUP /* 'losetup' depends on losetup/loteardown */
+# define CONFIG_NSH_DISABLE_LOSETUP 1
+# undef CONFIG_NSH_DISABLE_MKFATFS /* 'mkfatfs' depends on mkfatfs interface */
+# define CONFIG_NSH_DISABLE_MKFATFS 1
+# undef CONFIG_NSH_DISABLE_MKRD /* 'mkrd' depends on ramdisk_register */
+# define CONFIG_NSH_DISABLE_MKRD 1
#endif
/****************************************************************************
diff --git a/apps/nshlib/nsh_ddcmd.c b/apps/nshlib/nsh_ddcmd.c
index 4ab80bef1..58298ea7a 100644
--- a/apps/nshlib/nsh_ddcmd.c
+++ b/apps/nshlib/nsh_ddcmd.c
@@ -59,7 +59,7 @@
#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_NSH_DISABLE_DD)
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
/* If no sector size is specified wity BS=, then the following default value