mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 17:23:34 +08:00
apps/builtin/binfs.c moved to nuttx/fs/binfs/fs_binfs.c
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5523 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -473,3 +473,5 @@
|
|||||||
very lightweight). Now supports open, close, and a new ioctl to recover
|
very lightweight). Now supports open, close, and a new ioctl to recover
|
||||||
the builtin filename. The latter will be needed to support a binfs
|
the builtin filename. The latter will be needed to support a binfs
|
||||||
binfmt.
|
binfmt.
|
||||||
|
* builtin/binfs.c: Move apps/builtin/binfs.c to fs/binfs/fs_binfs.c
|
||||||
|
CONFIG_APPS_BINDIR rename CONFIG_FS_BINFS
|
||||||
|
|||||||
@@ -13,20 +13,6 @@ config BUILTIN
|
|||||||
|
|
||||||
if BUILTIN
|
if BUILTIN
|
||||||
|
|
||||||
config APPS_BINDIR
|
|
||||||
bool "BINFS File System"
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
The BINFS file system is current just a toy. The BINFS may, for example,
|
|
||||||
be mount at /bin. Then all of the built-in applications will appear as
|
|
||||||
executable file in /bin if you list them from NSH like:
|
|
||||||
|
|
||||||
nsh> ls -l /bin
|
|
||||||
|
|
||||||
At present, the BINFS supports nothing more than that. It is planned,
|
|
||||||
however, to support execution of the builtin applications from BINFS as
|
|
||||||
well (via a binfmt/ loader). However, that is down the road.
|
|
||||||
|
|
||||||
config BUILTIN_PROXY_STACKSIZE
|
config BUILTIN_PROXY_STACKSIZE
|
||||||
int "Builtin Proxy Stack Size"
|
int "Builtin Proxy Stack Size"
|
||||||
default 1024
|
default 1024
|
||||||
|
|||||||
@@ -41,10 +41,6 @@ include $(APPDIR)/Make.defs
|
|||||||
ASRCS =
|
ASRCS =
|
||||||
CSRCS = builtin.c exec_builtin.c
|
CSRCS = builtin.c exec_builtin.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_APPS_BINDIR),y)
|
|
||||||
CSRCS += binfs.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <nuttx/binfmt/builtin.h>
|
||||||
#include <apps/apps.h>
|
#include <apps/apps.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -53,10 +53,9 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <nuttx/binfmt/builtin.h>
|
||||||
#include <apps/apps.h>
|
#include <apps/apps.h>
|
||||||
|
|
||||||
#include "builtin.h"
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|||||||
@@ -62,14 +62,6 @@
|
|||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
struct builtin_s
|
|
||||||
{
|
|
||||||
const char *name; /* Invocation name and as seen under /sbin/ */
|
|
||||||
int priority; /* Use: SCHED_PRIORITY_DEFAULT */
|
|
||||||
int stacksize; /* Desired stack size */
|
|
||||||
main_t main; /* Entry point: main(int argc, char *argv[]) */
|
|
||||||
};
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -82,15 +74,6 @@ extern "C" {
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The "bindir" is file system that supports access to the builtin applications.
|
|
||||||
* It is typically mounted under /bin.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef CONFIG_APPS_BINDIR
|
|
||||||
EXTERN mountpt_operations;
|
|
||||||
EXTERN const struct mountpt_operations binfs_operations;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ static int mount_handler(FAR const char *mountpoint,
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_APPS_BINDIR
|
#ifdef CONFIG_FS_BINFS
|
||||||
case BINFS_MAGIC:
|
case BINFS_MAGIC:
|
||||||
fstype = "bindir";
|
fstype = "bindir";
|
||||||
break;
|
break;
|
||||||
|
|||||||
+2
-1
@@ -3955,4 +3955,5 @@
|
|||||||
* arch/mips/src/mips32/up_vfork.c, up_vfork.h, and vfork.S:
|
* arch/mips/src/mips32/up_vfork.c, up_vfork.h, and vfork.S:
|
||||||
Implement vfork() for MIPS32 (no floating point support)
|
Implement vfork() for MIPS32 (no floating point support)
|
||||||
* configs/ubw32/ostest: Enable the vfork() test.
|
* configs/ubw32/ostest: Enable the vfork() test.
|
||||||
|
* fs/binfs: Move apps/builtin/binfs.c to fs/binfs/fs_binfs.c
|
||||||
|
CONFIG_APPS_BINDIR rename CONFIG_FS_BINFS
|
||||||
|
|||||||
@@ -270,8 +270,9 @@ nsh
|
|||||||
|
|
||||||
Description
|
Description
|
||||||
-----------
|
-----------
|
||||||
Configures to use the NuttShell at apps/examples/nsh. This configuration
|
Configures to use the NuttShell at apps/examples/nsh. This version has
|
||||||
may be selected as follows:
|
one builtin function: This configuration: apps/examples/hello. This
|
||||||
|
configuration may be selected as follows:
|
||||||
|
|
||||||
cd <nuttx-directory>/tools
|
cd <nuttx-directory>/tools
|
||||||
./configure.sh sim/nsh
|
./configure.sh sim/nsh
|
||||||
@@ -281,7 +282,7 @@ nsh2
|
|||||||
Description
|
Description
|
||||||
-----------
|
-----------
|
||||||
This is another example that configures to use the NuttShell at apps/examples/nsh.
|
This is another example that configures to use the NuttShell at apps/examples/nsh.
|
||||||
Unlike nsh, this version uses NSH built-in functions. The nx, nxhello, and
|
Like nsh, this version uses NSH built-in functions: The nx, nxhello, and
|
||||||
nxlines examples are included as built-in functions.
|
nxlines examples are included as built-in functions.
|
||||||
|
|
||||||
X11 Configuration
|
X11 Configuration
|
||||||
|
|||||||
@@ -42,3 +42,6 @@ CONFIGURED_APPS += examples/nsh
|
|||||||
CONFIGURED_APPS += system/readline
|
CONFIGURED_APPS += system/readline
|
||||||
CONFIGURED_APPS += nshlib
|
CONFIGURED_APPS += nshlib
|
||||||
|
|
||||||
|
# Example built-in application
|
||||||
|
|
||||||
|
CONFIGURED_APPS += examples/hello
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# sim/nsh/defconfig
|
# sim/nsh/defconfig
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008-2012 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2008-2013 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -46,7 +46,7 @@ CONFIG_ARCH_BOARD_SIM=y
|
|||||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||||
CONFIG_DEBUG=n
|
CONFIG_DEBUG=n
|
||||||
CONFIG_DEBUG_VERBOSE=n
|
CONFIG_DEBUG_VERBOSE=n
|
||||||
CONFIG_DEBUG_SYMBOLS=n
|
CONFIG_DEBUG_SYMBOLS=y
|
||||||
|
|
||||||
CONFIG_HAVE_CXX=n
|
CONFIG_HAVE_CXX=n
|
||||||
CONFIG_HAVE_CXXINITIALIZE=n
|
CONFIG_HAVE_CXXINITIALIZE=n
|
||||||
@@ -170,6 +170,7 @@ CONFIG_FAT_LFN=n
|
|||||||
CONFIG_FAT_MAXFNAME=32
|
CONFIG_FAT_MAXFNAME=32
|
||||||
CONFIG_FS_NXFFS=n
|
CONFIG_FS_NXFFS=n
|
||||||
CONFIG_FS_ROMFS=y
|
CONFIG_FS_ROMFS=y
|
||||||
|
CONFIG_FS_BINFS=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# TCP/IP and UDP support via uIP
|
# TCP/IP and UDP support via uIP
|
||||||
@@ -193,6 +194,11 @@ CONFIG_NET_STATISTICS=y
|
|||||||
#CONFIG_NET_ARPTAB_SIZE=8
|
#CONFIG_NET_ARPTAB_SIZE=8
|
||||||
CONFIG_NET_BROADCAST=n
|
CONFIG_NET_BROADCAST=n
|
||||||
|
|
||||||
|
#
|
||||||
|
# Settings for examples/hello
|
||||||
|
#
|
||||||
|
CONFIG_EXAMPLES_HELLO_BUILTIN=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# UIP Network Utilities
|
# UIP Network Utilities
|
||||||
#
|
#
|
||||||
@@ -224,7 +230,7 @@ CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
|
|||||||
#
|
#
|
||||||
# Settings for apps/nshlib
|
# Settings for apps/nshlib
|
||||||
#
|
#
|
||||||
CONFIG_NSH_BUILTIN_APPS=n
|
CONFIG_NSH_BUILTIN_APPS=y
|
||||||
CONFIG_NSH_FILEIOSIZE=1024
|
CONFIG_NSH_FILEIOSIZE=1024
|
||||||
CONFIG_NSH_STRERROR=n
|
CONFIG_NSH_STRERROR=n
|
||||||
CONFIG_NSH_LINELEN=80
|
CONFIG_NSH_LINELEN=80
|
||||||
|
|||||||
@@ -526,4 +526,4 @@ CONFIG_HEAP_SIZE=
|
|||||||
CONFIG_APPS_DIR="../apps"
|
CONFIG_APPS_DIR="../apps"
|
||||||
|
|
||||||
# Provide /dev/ramX and then: mount -t binfs /dev/ram0 /bin
|
# Provide /dev/ramX and then: mount -t binfs /dev/ram0 /bin
|
||||||
CONFIG_APPS_BINDIR=y
|
CONFIG_FS_BINFS=y
|
||||||
|
|||||||
+2
-1
@@ -5,11 +5,12 @@
|
|||||||
|
|
||||||
comment "File system configuration"
|
comment "File system configuration"
|
||||||
|
|
||||||
source fs/fat/Kconfig
|
|
||||||
source fs/mmap/Kconfig
|
source fs/mmap/Kconfig
|
||||||
|
source fs/fat/Kconfig
|
||||||
source fs/nfs/Kconfig
|
source fs/nfs/Kconfig
|
||||||
source fs/nxffs/Kconfig
|
source fs/nxffs/Kconfig
|
||||||
source fs/romfs/Kconfig
|
source fs/romfs/Kconfig
|
||||||
|
source fs/binfs/Kconfig
|
||||||
|
|
||||||
comment "System Logging"
|
comment "System Logging"
|
||||||
|
|
||||||
|
|||||||
+10
-5
@@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# fs/Makefile
|
# fs/Makefile
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007, 2008, 2011-2012 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2007, 2008, 2011-2013 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -72,6 +72,9 @@ CSRCS += fs_registerdriver.c fs_unregisterdriver.c
|
|||||||
CSRCS += fs_registerblockdriver.c fs_unregisterblockdriver.c \
|
CSRCS += fs_registerblockdriver.c fs_unregisterblockdriver.c \
|
||||||
fs_findblockdriver.c fs_openblockdriver.c fs_closeblockdriver.c
|
fs_findblockdriver.c fs_openblockdriver.c fs_closeblockdriver.c
|
||||||
|
|
||||||
|
DEPPATH =
|
||||||
|
VPATH = .
|
||||||
|
|
||||||
include mmap/Make.defs
|
include mmap/Make.defs
|
||||||
|
|
||||||
# Stream support
|
# Stream support
|
||||||
@@ -91,13 +94,17 @@ endif
|
|||||||
# Additional files required is mount-able file systems are supported
|
# Additional files required is mount-able file systems are supported
|
||||||
|
|
||||||
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
|
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
|
||||||
|
|
||||||
CSRCS += fs_fsync.c fs_mkdir.c fs_mount.c fs_rename.c fs_rmdir.c \
|
CSRCS += fs_fsync.c fs_mkdir.c fs_mount.c fs_rename.c fs_rmdir.c \
|
||||||
fs_umount.c fs_unlink.c
|
fs_umount.c fs_unlink.c
|
||||||
CSRCS += fs_foreachmountpoint.c
|
CSRCS += fs_foreachmountpoint.c
|
||||||
|
|
||||||
include fat/Make.defs
|
include fat/Make.defs
|
||||||
include romfs/Make.defs
|
include romfs/Make.defs
|
||||||
include nxffs/Make.defs
|
include nxffs/Make.defs
|
||||||
include nfs/Make.defs
|
include nfs/Make.defs
|
||||||
|
include binfs/Make.defs
|
||||||
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -108,8 +115,7 @@ OBJS = $(AOBJS) $(COBJS)
|
|||||||
|
|
||||||
BIN = libfs$(LIBEXT)
|
BIN = libfs$(LIBEXT)
|
||||||
|
|
||||||
SUBDIRS = mmap fat romfs nxffs:nfs
|
SUBDIRS = mmap fat romfs nxffs nfs binfs
|
||||||
VPATH = mmap:fat:romfs:nxffs:nfs
|
|
||||||
|
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
|
|
||||||
@@ -123,8 +129,7 @@ $(BIN): $(OBJS)
|
|||||||
$(call ARCHIVE, $@, $(OBJS))
|
$(call ARCHIVE, $@, $(OBJS))
|
||||||
|
|
||||||
.depend: Makefile $(SRCS)
|
.depend: Makefile $(SRCS)
|
||||||
$(Q) $(MKDEP) --dep-path . $(MMAPDEPPATH) $(FATDEPPATH) $(ROMFSDEPPATH) $(NXFFSDEPPATH) $(NFSDEPPATH) \
|
$(Q) $(MKDEP) --dep-path . $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||||
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
|
|
||||||
$(Q) touch $@
|
$(Q) touch $@
|
||||||
|
|
||||||
depend: .depend
|
depend: .depend
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#
|
||||||
|
# For a description of the syntax of this configuration file,
|
||||||
|
# see misc/tools/kconfig-language.txt.
|
||||||
|
#
|
||||||
|
|
||||||
|
config FS_BINFS
|
||||||
|
bool "BINFS File System"
|
||||||
|
default n
|
||||||
|
depends on BUILTIN
|
||||||
|
---help---
|
||||||
|
The BINFS file system is provides access to builtin applications through
|
||||||
|
the NuttX file system. The BINFS may, for example, be mount at /bin.
|
||||||
|
Then all of the built-in applications will appear as executable files in
|
||||||
|
/bin. Then, for example, you list them from NSH like:
|
||||||
|
|
||||||
|
nsh> ls -l /bin
|
||||||
|
|
||||||
|
If the BINFS BINFMT loader is also enabled, then the builtin applications
|
||||||
|
can be executed through the normal mechanisms (posix_spawn(), exev(), etc.)
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
############################################################################
|
||||||
|
# fs/binfs/Make.defs
|
||||||
|
#
|
||||||
|
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||||
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in
|
||||||
|
# the documentation and/or other materials provided with the
|
||||||
|
# distribution.
|
||||||
|
# 3. Neither the name Nuttx nor the names of its contributors may be
|
||||||
|
# used to endorse or promote products derived from this software
|
||||||
|
# without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_FS_BINFS),y)
|
||||||
|
# Files required for BINFS file system support
|
||||||
|
|
||||||
|
ASRCS +=
|
||||||
|
CSRCS += fs_binfs.c
|
||||||
|
|
||||||
|
# Include BINFS build support
|
||||||
|
|
||||||
|
DEPPATH += --dep-path binfs
|
||||||
|
VPATH += :binfs
|
||||||
|
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)binfs}
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/builtin/binfs.c
|
* fs/binfs/fs_binfs.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -54,12 +54,11 @@
|
|||||||
#include <nuttx/fs/fs.h>
|
#include <nuttx/fs/fs.h>
|
||||||
#include <nuttx/fs/binfs.h>
|
#include <nuttx/fs/binfs.h>
|
||||||
#include <nuttx/fs/dirent.h>
|
#include <nuttx/fs/dirent.h>
|
||||||
|
#include <nuttx/binfmt/builtin.h>
|
||||||
|
|
||||||
#include <apps/apps.h>
|
#include <apps/apps.h>
|
||||||
|
|
||||||
#include "builtin.h"
|
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_BINFS)
|
||||||
|
|
||||||
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_APPS_BINDIR)
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
@@ -444,5 +443,5 @@ static int binfs_stat(struct inode *mountpt, const char *relpath, struct stat *b
|
|||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_APPS_BINDIR */
|
#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_BINFS */
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# Make.defs
|
# Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2008, 2011, 2013 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -44,7 +44,10 @@ CSRCS += fs_fat32.c fs_fat32dirent.c fs_fat32attrib.c fs_fat32util.c
|
|||||||
ASRCS +=
|
ASRCS +=
|
||||||
CSRCS += fs_mkfatfs.c fs_configfat.c fs_writefat.c
|
CSRCS += fs_mkfatfs.c fs_configfat.c fs_writefat.c
|
||||||
|
|
||||||
# Argument for dependency checking
|
# Include FAT build support
|
||||||
|
|
||||||
|
DEPPATH += --dep-path fat
|
||||||
|
VPATH += :fat
|
||||||
|
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)fat}
|
||||||
|
|
||||||
FATDEPPATH = --dep-path fat
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
+6
-7
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/fs_mount.c
|
* fs/fs_mount.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -47,10 +47,6 @@
|
|||||||
|
|
||||||
#include <nuttx/fs/fs.h>
|
#include <nuttx/fs/fs.h>
|
||||||
|
|
||||||
#ifdef CONFIG_APPS_BINDIR
|
|
||||||
# include <apps/apps.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "fs_internal.h"
|
#include "fs_internal.h"
|
||||||
|
|
||||||
/* At least one filesystem must be defined, or this file will not compile.
|
/* At least one filesystem must be defined, or this file will not compile.
|
||||||
@@ -78,7 +74,7 @@
|
|||||||
|
|
||||||
/* These file systems do not require block drivers */
|
/* These file systems do not require block drivers */
|
||||||
|
|
||||||
#if defined(CONFIG_FS_NXFFS) || defined(CONFIG_APPS_BINDIR) || defined(CONFIG_NFS)
|
#if defined(CONFIG_FS_NXFFS) || defined(CONFIG_FS_BINFS) || defined(CONFIG_NFS)
|
||||||
# define NONBDFS_SUPPORT
|
# define NONBDFS_SUPPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -123,6 +119,9 @@ extern const struct mountpt_operations nxffs_operations;
|
|||||||
#ifdef CONFIG_NFS
|
#ifdef CONFIG_NFS
|
||||||
extern const struct mountpt_operations nfs_operations;
|
extern const struct mountpt_operations nfs_operations;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_FS_BINFS
|
||||||
|
extern const struct mountpt_operations binfs_operations;
|
||||||
|
#endif
|
||||||
|
|
||||||
static const struct fsmap_t g_nonbdfsmap[] =
|
static const struct fsmap_t g_nonbdfsmap[] =
|
||||||
{
|
{
|
||||||
@@ -132,7 +131,7 @@ static const struct fsmap_t g_nonbdfsmap[] =
|
|||||||
#ifdef CONFIG_NFS
|
#ifdef CONFIG_NFS
|
||||||
{ "nfs", &nfs_operations },
|
{ "nfs", &nfs_operations },
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_APPS_BINDIR
|
#ifdef CONFIG_FS_BINFS
|
||||||
{ "binfs", &binfs_operations },
|
{ "binfs", &binfs_operations },
|
||||||
#endif
|
#endif
|
||||||
{ NULL, NULL },
|
{ NULL, NULL },
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# fs/mmap/Make.defs
|
# fs/mmap/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -40,4 +40,9 @@ ifeq ($(CONFIG_FS_RAMMAP),y)
|
|||||||
CSRCS += fs_munmap.c fs_rammap.c
|
CSRCS += fs_munmap.c fs_rammap.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
MMAPDEPPATH = --dep-path mmap
|
# Include MMAP build support
|
||||||
|
|
||||||
|
DEPPATH += --dep-path mmap
|
||||||
|
VPATH += :mmap
|
||||||
|
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)mmap}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# Make.defs
|
# Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -44,7 +44,10 @@ CSRCS +=
|
|||||||
ASRCS +=
|
ASRCS +=
|
||||||
CSRCS += rpc_clnt.c nfs_util.c nfs_vfsops.c
|
CSRCS += rpc_clnt.c nfs_util.c nfs_vfsops.c
|
||||||
|
|
||||||
# Argument for dependency checking
|
# Include NFS build support
|
||||||
|
|
||||||
|
DEPPATH += --dep-path nfs
|
||||||
|
VPATH += :nfs
|
||||||
|
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)nfs}
|
||||||
|
|
||||||
NFSDEPPATH = --dep-path nfs
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# fs/nxffs/Make.defs
|
# fs/nxffs/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -40,7 +40,10 @@ CSRCS += nxffs_block.c nxffs_blockstats.c nxffs_cache.c nxffs_dirent.c \
|
|||||||
nxffs_open.c nxffs_pack.c nxffs_read.c nxffs_reformat.c \
|
nxffs_open.c nxffs_pack.c nxffs_read.c nxffs_reformat.c \
|
||||||
nxffs_stat.c nxffs_unlink.c nxffs_util.c nxffs_write.c
|
nxffs_stat.c nxffs_unlink.c nxffs_util.c nxffs_write.c
|
||||||
|
|
||||||
# Argument for dependency checking
|
# Include NXFFS build support
|
||||||
|
|
||||||
|
DEPPATH += --dep-path nxffs
|
||||||
|
VPATH += :nxffs
|
||||||
|
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)nxffs}
|
||||||
|
|
||||||
NXFFSDEPPATH = --dep-path nxffs
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# fs/romfs/Make.defs
|
# fs/romfs/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2008, 2011, 2013 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -39,7 +39,10 @@ ifeq ($(CONFIG_FS_ROMFS),y)
|
|||||||
ASRCS +=
|
ASRCS +=
|
||||||
CSRCS += fs_romfs.c fs_romfsutil.c
|
CSRCS += fs_romfs.c fs_romfsutil.c
|
||||||
|
|
||||||
# Argument for dependency checking
|
# Include ROMFS build support
|
||||||
|
|
||||||
|
DEPPATH += --dep-path romfs
|
||||||
|
VPATH += :romfs
|
||||||
|
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)romfs}
|
||||||
|
|
||||||
ROMFSDEPPATH = --dep-path romfs
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/builtin/builtin.h
|
* include/nuttx/binfmt/builtin.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Uros Platise. All rights reserved.
|
* Copyright (C) 2011 Uros Platise. All rights reserved.
|
||||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_BUILTIN_BUILTIN_H
|
#ifndef __INCLUDE_NUTTX_BINFMT_BUILTIN_H
|
||||||
#define __APPS_BUILTIN_BUILTIN_H
|
#define __INCLUDE_NUTTX_BINFMT_BUILTIN_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@@ -49,6 +49,14 @@
|
|||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
struct builtin_s
|
||||||
|
{
|
||||||
|
const char *name; /* Invocation name and as seen under /sbin/ */
|
||||||
|
int priority; /* Use: SCHED_PRIORITY_DEFAULT */
|
||||||
|
int stacksize; /* Desired stack size */
|
||||||
|
main_t main; /* Entry point: main(int argc, char *argv[]) */
|
||||||
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -73,5 +81,5 @@ EXTERN int number_builtins(void);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __APPS_BUILTIN_BUILTIN_H */
|
#endif /* __INCLUDE_NUTTX_BINFMT_BUILTIN_H */
|
||||||
|
|
||||||
@@ -44,6 +44,8 @@
|
|||||||
|
|
||||||
#include <nuttx/fs/ioctl.h>
|
#include <nuttx/fs/ioctl.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_FS_BINFS
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -62,7 +64,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -72,9 +74,21 @@ extern "C" {
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* The "bindir" is file system that supports access to the builtin applications.
|
||||||
|
* It is typically mounted under /bin.
|
||||||
|
*/
|
||||||
|
|
||||||
|
EXTERN mountpt_operations;
|
||||||
|
EXTERN const struct mountpt_operations binfs_operations;
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Function Prototypes
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* CONFIG_FS_BINFS */
|
||||||
#endif /* __INCLUDE_NUTTX_FS_BINFS_H */
|
#endif /* __INCLUDE_NUTTX_FS_BINFS_H */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* include/nuttx/fs/dirent.h
|
* include/nuttx/fs/dirent.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2009, 2011-2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -102,7 +102,7 @@ struct fs_romfsdir_s
|
|||||||
};
|
};
|
||||||
#endif /* CONFIG_FS_ROMFS */
|
#endif /* CONFIG_FS_ROMFS */
|
||||||
|
|
||||||
#ifdef CONFIG_APPS_BINDIR
|
#ifdef CONFIG_FS_BINFS
|
||||||
/* The apps/ pseudo bin/ directory. The state value is simply an index */
|
/* The apps/ pseudo bin/ directory. The state value is simply an index */
|
||||||
|
|
||||||
struct fs_binfsdir_s
|
struct fs_binfsdir_s
|
||||||
@@ -179,7 +179,7 @@ struct fs_dirent_s
|
|||||||
#ifdef CONFIG_FS_ROMFS
|
#ifdef CONFIG_FS_ROMFS
|
||||||
struct fs_romfsdir_s romfs;
|
struct fs_romfsdir_s romfs;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_APPS_BINDIR
|
#ifdef CONFIG_FS_BINFS
|
||||||
struct fs_binfsdir_s binfs;
|
struct fs_binfsdir_s binfs;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_FS_NXFFS
|
#ifdef CONFIG_FS_NXFFS
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* tools/mkconfig.c
|
* tools/mkconfig.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -213,14 +213,14 @@ int main(int argc, char **argv, char **envp)
|
|||||||
printf("# undef CONFIG_FS_FAT\n");
|
printf("# undef CONFIG_FS_FAT\n");
|
||||||
printf("# undef CONFIG_FS_ROMFS\n");
|
printf("# undef CONFIG_FS_ROMFS\n");
|
||||||
printf("# undef CONFIG_FS_NXFFS\n");
|
printf("# undef CONFIG_FS_NXFFS\n");
|
||||||
printf("# undef CONFIG_APPS_BINDIR\n");
|
printf("# undef CONFIG_FS_BINFS\n");
|
||||||
printf("# undef CONFIG_NFS\n");
|
printf("# undef CONFIG_NFS\n");
|
||||||
printf("#endif\n\n");
|
printf("#endif\n\n");
|
||||||
printf("/* Check if any readable and writable filesystem (OR USB storage) is supported */\n\n");
|
printf("/* Check if any readable and writable filesystem (OR USB storage) is supported */\n\n");
|
||||||
printf("#undef CONFIG_FS_READABLE\n");
|
printf("#undef CONFIG_FS_READABLE\n");
|
||||||
printf("#undef CONFIG_FS_WRITABLE\n");
|
printf("#undef CONFIG_FS_WRITABLE\n");
|
||||||
printf("#if defined(CONFIG_FS_FAT) || defined(CONFIG_FS_ROMFS) || defined(CONFIG_USBMSC) || \\\n");
|
printf("#if defined(CONFIG_FS_FAT) || defined(CONFIG_FS_ROMFS) || defined(CONFIG_USBMSC) || \\\n");
|
||||||
printf(" defined(CONFIG_FS_NXFFS) || defined(CONFIG_APPS_BINDIR) || defined(CONFIG_NFS)\n");
|
printf(" defined(CONFIG_FS_NXFFS) || defined(CONFIG_FS_BINFS) || defined(CONFIG_NFS)\n");
|
||||||
printf("# define CONFIG_FS_READABLE 1\n");
|
printf("# define CONFIG_FS_READABLE 1\n");
|
||||||
printf("#endif\n\n");
|
printf("#endif\n\n");
|
||||||
printf("#if defined(CONFIG_FS_FAT) || defined(CONFIG_USBMSC) || defined(CONFIG_FS_NXFFS) || \\\n");
|
printf("#if defined(CONFIG_FS_FAT) || defined(CONFIG_USBMSC) || defined(CONFIG_FS_NXFFS) || \\\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user