[rtems commit] IMFS: Add fine grained configuration

Joel Sherrill joel.sherrill at oarcorp.com
Thu Feb 12 20:55:39 UTC 2015


Is there any guidance for the (unexpected) user using the
miniIMFS? The configuration parameter just went away.

Can it be an error in confdefs.h?

On 2/12/2015 2:48 PM, Sebastian Huber wrote:
> Module:    rtems
> Branch:    master
> Commit:    a9df9169882c564af6714bbf121c278092d3c51c
> Changeset: http://git.rtems.org/rtems/commit/?id=a9df9169882c564af6714bbf121c278092d3c51c
>
> Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
> Date:      Sun Feb  8 19:43:09 2015 +0100
>
> IMFS: Add fine grained configuration
>
> Remove miniIMFS.  Statically initialize the root IMFS.
>
> Add configuration options to disable individual
> features of the root IMFS, e.g.
>   o CONFIGURE_IMFS_DISABLE_CHOWN,
>   o CONFIGURE_IMFS_DISABLE_FCHMOD,
>   o CONFIGURE_IMFS_DISABLE_LINK,
>   o CONFIGURE_IMFS_DISABLE_MKNOD,
>   o CONFIGURE_IMFS_DISABLE_MOUNT,
>   o CONFIGURE_IMFS_DISABLE_READLINK,
>   o CONFIGURE_IMFS_DISABLE_RENAME,
>   o CONFIGURE_IMFS_DISABLE_RMNOD,
>   o CONFIGURE_IMFS_DISABLE_SYMLINK,
>   o CONFIGURE_IMFS_DISABLE_UNMOUNT, and
>   o CONFIGURE_IMFS_DISABLE_UTIME.
>
> ---
>
>  .../lib/libbsp/powerpc/beatnik/irq/irq_test_app.c  |   1 -
>  cpukit/libfs/Makefile.am                           |   4 +-
>  cpukit/libfs/src/imfs/fifoimfs_init.c              |  78 -----
>  cpukit/libfs/src/imfs/imfs.h                       |  21 +-
>  cpukit/libfs/src/imfs/imfs_init.c                  |   2 +-
>  cpukit/libfs/src/imfs/imfs_load_tar.c              |   5 +-
>  cpukit/libfs/src/imfs/imfs_make_generic_node.c     |  10 -
>  cpukit/libfs/src/imfs/miniimfs_init.c              |  74 -----
>  cpukit/sapi/include/confdefs.h                     | 184 +++++++-----
>  doc/user/conf.t                                    | 320 ++++++++++++++++++---
>  testsuites/fstests/Makefile.am                     |   2 +
>  testsuites/fstests/configure.ac                    |   2 +
>  testsuites/fstests/fsimfsconfig01/Makefile.am      |  19 ++
>  .../fstests/fsimfsconfig01/fsimfsconfig01.doc      |  11 +
>  .../fstests/fsimfsconfig01/fsimfsconfig01.scn      |   2 +
>  testsuites/fstests/fsimfsconfig01/init.c           | 139 +++++++++
>  testsuites/fstests/fsimfsconfig02/Makefile.am      |  19 ++
>  .../fstests/fsimfsconfig02/fsimfsconfig02.doc      |  11 +
>  .../fstests/fsimfsconfig02/fsimfsconfig02.scn      |   2 +
>  testsuites/fstests/fsimfsconfig02/init.c           |  84 ++++++
>  testsuites/fstests/fsimfsgeneric01/init.c          |  16 +-
>  testsuites/fstests/mimfs_support/fs_support.c      |   2 +
>  testsuites/libtests/tar03/init.c                   |   9 -
>  testsuites/psxtests/psxfile01/main.c               |   2 +
>  testsuites/psxtests/psximfs02/init.c               |   2 +
>  testsuites/psxtests/psxmount/main.c                |   2 +
>  testsuites/psxtests/psxreaddir/main.c              |   2 +
>  testsuites/psxtests/psxstat/main.c                 |   2 +
>  testsuites/samples/iostream/system.h               |   3 -
>  testsuites/sptests/sp47/init.c                     |   2 -
>  testsuites/sptests/sp48/init.c                     |   2 -
>  31 files changed, 728 insertions(+), 306 deletions(-)
>
> diff --git a/c/src/lib/libbsp/powerpc/beatnik/irq/irq_test_app.c b/c/src/lib/libbsp/powerpc/beatnik/irq/irq_test_app.c
> index 72a43fa..cb9ff14 100644
> --- a/c/src/lib/libbsp/powerpc/beatnik/irq/irq_test_app.c
> +++ b/c/src/lib/libbsp/powerpc/beatnik/irq/irq_test_app.c
> @@ -36,7 +36,6 @@ rtems_task Init(
>  #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
>  #define CONFIGURE_MAXIMUM_TASKS            1
>  #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
> -#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
>  #include <confdefs.h>
>
>  #include <stdio.h>
> diff --git a/cpukit/libfs/Makefile.am b/cpukit/libfs/Makefile.am
> index 3c454e7..802dfdb 100644
> --- a/cpukit/libfs/Makefile.am
> +++ b/cpukit/libfs/Makefile.am
> @@ -41,7 +41,7 @@ noinst_LIBRARIES += libimfs.a
>  libimfs_a_SOURCES =
>
>  libimfs_a_SOURCES += src/imfs/deviceio.c \
> -    src/imfs/fifoimfs_init.c src/imfs/imfs_chown.c src/imfs/imfs_config.c \
> +    src/imfs/imfs_chown.c src/imfs/imfs_config.c \
>      src/imfs/imfs_creat.c src/imfs/imfs_directory.c \
>      src/imfs/imfs_eval.c src/imfs/imfs_fchmod.c \
>      src/imfs/imfs_fifo.c \
> @@ -56,7 +56,7 @@ libimfs_a_SOURCES += src/imfs/deviceio.c \
>      src/imfs/imfs_rename.c src/imfs/imfs_rmnod.c \
>      src/imfs/imfs_stat.c src/imfs/imfs_stat_file.c src/imfs/imfs_symlink.c \
>      src/imfs/imfs_unmount.c src/imfs/imfs_utime.c src/imfs/ioman.c \
> -    src/imfs/imfs_memfile.c src/imfs/miniimfs_init.c src/imfs/imfs.h
> +    src/imfs/imfs_memfile.c src/imfs/imfs.h
>
>  # POSIX FIFO/pipe
>  libimfs_a_SOURCES += src/pipe/fifo.c src/pipe/pipe.c src/pipe/pipe.h
> diff --git a/cpukit/libfs/src/imfs/fifoimfs_init.c b/cpukit/libfs/src/imfs/fifoimfs_init.c
> deleted file mode 100644
> index 4063557..0000000
> --- a/cpukit/libfs/src/imfs/fifoimfs_init.c
> +++ /dev/null
> @@ -1,78 +0,0 @@
> -/**
> - * @file
> - *
> - * @ingroup LibFSIMFS
> - *
> - * @brief IMFS without fifo support initialization.
> - */
> -
> -/*
> - * Copyright (c) 2010
> - * embedded brains GmbH
> - * Obere Lagerstr. 30
> - * D-82178 Puchheim
> - * Germany
> - * <rtems at embedded-brains.de>
> - *
> - * The license and distribution terms for this file may be
> - * found in the file LICENSE in this distribution or at
> - * http://www.rtems.org/license/LICENSE.
> - */
> -
> -#if HAVE_CONFIG_H
> -  #include "config.h"
> -#endif
> -
> -#include "imfs.h"
> -
> -#include <stdlib.h>
> -
> -#include <rtems/seterr.h>
> -
> -const rtems_filesystem_operations_table fifoIMFS_ops = {
> -  .lock_h = rtems_filesystem_default_lock,
> -  .unlock_h = rtems_filesystem_default_unlock,
> -  .eval_path_h = IMFS_eval_path,
> -  .link_h = IMFS_link,
> -  .are_nodes_equal_h = rtems_filesystem_default_are_nodes_equal,
> -  .mknod_h = IMFS_mknod,
> -  .rmnod_h = IMFS_rmnod,
> -  .fchmod_h = IMFS_fchmod,
> -  .chown_h = IMFS_chown,
> -  .clonenod_h = IMFS_node_clone,
> -  .freenod_h = IMFS_node_free,
> -  .mount_h = IMFS_mount,
> -  .unmount_h = IMFS_unmount,
> -  .fsunmount_me_h = IMFS_fsunmount,
> -  .utime_h = IMFS_utime,
> -  .symlink_h = IMFS_symlink,
> -  .readlink_h = IMFS_readlink,
> -  .rename_h = IMFS_rename,
> -  .statvfs_h = rtems_filesystem_default_statvfs
> -};
> -
> -static const IMFS_mknod_controls IMFS_fifo_mknod_controls = {
> -  .directory = &IMFS_mknod_control_directory,
> -  .device = &IMFS_mknod_control_device,
> -  .file = &IMFS_mknod_control_memfile,
> -  .fifo = &IMFS_mknod_control_fifo
> -};
> -
> -int fifoIMFS_initialize(
> -  rtems_filesystem_mount_table_entry_t *mt_entry,
> -  const void *data
> -)
> -{
> -  IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) );
> -  IMFS_mount_data mount_data = {
> -    .fs_info = fs_info,
> -    .ops = &fifoIMFS_ops,
> -    .mknod_controls = &IMFS_fifo_mknod_controls
> -  };
> -
> -  if ( fs_info == NULL ) {
> -    rtems_set_errno_and_return_minus_one( ENOMEM );
> -  }
> -
> -  return IMFS_initialize_support( mt_entry, &mount_data );
> -}
> diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h
> index 00fc179..c03257a 100644
> --- a/cpukit/libfs/src/imfs/imfs.h
> +++ b/cpukit/libfs/src/imfs/imfs.h
> @@ -391,10 +391,6 @@ extern const IMFS_node_control IMFS_node_control_linfile;
>  extern const IMFS_mknod_control IMFS_mknod_control_fifo;
>  extern const IMFS_mknod_control IMFS_mknod_control_enosys;
>
> -extern const rtems_filesystem_operations_table miniIMFS_ops;
> -extern const rtems_filesystem_operations_table IMFS_ops;
> -extern const rtems_filesystem_operations_table fifoIMFS_ops;
> -
>  extern const rtems_filesystem_limits_and_options_t  IMFS_LIMITS_AND_OPTIONS;
>
>  /*
> @@ -406,16 +402,6 @@ extern int IMFS_initialize(
>     const void                           *data
>  );
>
> -extern int fifoIMFS_initialize(
> -  rtems_filesystem_mount_table_entry_t  *mt_entry,
> -  const void                            *data
> -);
> -
> -extern int miniIMFS_initialize(
> -   rtems_filesystem_mount_table_entry_t *mt_entry,
> -   const void                           *data
> -);
> -
>  extern int IMFS_initialize_support(
>    rtems_filesystem_mount_table_entry_t *mt_entry,
>    const void                           *data
> @@ -586,9 +572,12 @@ extern IMFS_jnode_t *IMFS_create_node(
>    void *arg
>  );
>
> -extern bool IMFS_is_imfs_instance(
> +static inline bool IMFS_is_imfs_instance(
>    const rtems_filesystem_location_info_t *loc
> -);
> +)
> +{
> +  return loc->mt_entry->ops->clonenod_h == IMFS_node_clone;
> +}
>
>  /** @} */
>
> diff --git a/cpukit/libfs/src/imfs/imfs_init.c b/cpukit/libfs/src/imfs/imfs_init.c
> index e82490f..bbab2cb 100644
> --- a/cpukit/libfs/src/imfs/imfs_init.c
> +++ b/cpukit/libfs/src/imfs/imfs_init.c
> @@ -25,7 +25,7 @@
>
>  #include <rtems/seterr.h>
>
> -const rtems_filesystem_operations_table IMFS_ops = {
> +static const rtems_filesystem_operations_table IMFS_ops = {
>    .lock_h = rtems_filesystem_default_lock,
>    .unlock_h = rtems_filesystem_default_unlock,
>    .eval_path_h = IMFS_eval_path,
> diff --git a/cpukit/libfs/src/imfs/imfs_load_tar.c b/cpukit/libfs/src/imfs/imfs_load_tar.c
> index d303cd2..7228978 100644
> --- a/cpukit/libfs/src/imfs/imfs_load_tar.c
> +++ b/cpukit/libfs/src/imfs/imfs_load_tar.c
> @@ -58,10 +58,7 @@ int rtems_tarfs_load(
>       RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
>     );
>
> -   if (
> -     rootloc.mt_entry->ops != &IMFS_ops
> -       && rootloc.mt_entry->ops != &fifoIMFS_ops
> -   ) {
> +   if ( !IMFS_is_imfs_instance( &rootloc ) ) {
>       rv = -1;
>     }
>
> diff --git a/cpukit/libfs/src/imfs/imfs_make_generic_node.c b/cpukit/libfs/src/imfs/imfs_make_generic_node.c
> index f302dda..aef21c9 100644
> --- a/cpukit/libfs/src/imfs/imfs_make_generic_node.c
> +++ b/cpukit/libfs/src/imfs/imfs_make_generic_node.c
> @@ -39,16 +39,6 @@ IMFS_jnode_t *IMFS_node_initialize_generic(
>    return node;
>  }
>
> -bool IMFS_is_imfs_instance(
> -  const rtems_filesystem_location_info_t *loc
> -)
> -{
> -  const char *type = loc->mt_entry->type;
> -
> -  return strcmp(type, RTEMS_FILESYSTEM_TYPE_IMFS) == 0
> -    || strcmp(type, RTEMS_FILESYSTEM_TYPE_MINIIMFS) == 0;
> -}
> -
>  int IMFS_make_generic_node(
>    const char *path,
>    mode_t mode,
> diff --git a/cpukit/libfs/src/imfs/miniimfs_init.c b/cpukit/libfs/src/imfs/miniimfs_init.c
> deleted file mode 100644
> index 7451c5e..0000000
> --- a/cpukit/libfs/src/imfs/miniimfs_init.c
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -/**
> - * @file
> - *
> - * @ingroup LibFSIMFS
> - *
> - * @brief Mini-IMFS initialization.
> - */
> -
> -/*
> - *  COPYRIGHT (c) 1989-1999.
> - *  On-Line Applications Research Corporation (OAR).
> - *
> - *  The license and distribution terms for this file may be
> - *  found in the file LICENSE in this distribution or at
> - *  http://www.rtems.org/license/LICENSE.
> - */
> -
> -#if HAVE_CONFIG_H
> -  #include "config.h"
> -#endif
> -
> -#include "imfs.h"
> -
> -#include <stdlib.h>
> -
> -#include <rtems/seterr.h>
> -
> -const rtems_filesystem_operations_table miniIMFS_ops = {
> -  .lock_h = rtems_filesystem_default_lock,
> -  .unlock_h = rtems_filesystem_default_unlock,
> -  .eval_path_h = IMFS_eval_path,
> -  .link_h = rtems_filesystem_default_link,
> -  .are_nodes_equal_h = rtems_filesystem_default_are_nodes_equal,
> -  .mknod_h = IMFS_mknod,
> -  .rmnod_h = IMFS_rmnod,
> -  .fchmod_h = rtems_filesystem_default_fchmod,
> -  .chown_h = rtems_filesystem_default_chown,
> -  .clonenod_h = IMFS_node_clone,
> -  .freenod_h = IMFS_node_free,
> -  .mount_h = IMFS_mount,
> -  .unmount_h = rtems_filesystem_default_unmount,
> -  .fsunmount_me_h = rtems_filesystem_default_fsunmount,
> -  .utime_h = rtems_filesystem_default_utime,
> -  .symlink_h = rtems_filesystem_default_symlink,
> -  .readlink_h = rtems_filesystem_default_readlink,
> -  .rename_h = rtems_filesystem_default_rename,
> -  .statvfs_h = rtems_filesystem_default_statvfs
> -};
> -
> -static const IMFS_mknod_controls IMFS_mini_mknod_controls = {
> -  .directory = &IMFS_mknod_control_directory,
> -  .device = &IMFS_mknod_control_device,
> -  .file = &IMFS_mknod_control_memfile,
> -  .fifo = &IMFS_mknod_control_enosys
> -};
> -
> -int miniIMFS_initialize(
> -  rtems_filesystem_mount_table_entry_t *mt_entry,
> -  const void                           *data
> -)
> -{
> -  IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) );
> -  IMFS_mount_data mount_data = {
> -    .fs_info = fs_info,
> -    .ops = &miniIMFS_ops,
> -    .mknod_controls = &IMFS_mini_mknod_controls
> -  };
> -
> -  if ( fs_info == NULL ) {
> -    rtems_set_errno_and_return_minus_one( ENOMEM );
> -  }
> -
> -  return IMFS_initialize_support( mt_entry, &mount_data );
> -}
> diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
> index 211c6bc..6fb0951 100644
> --- a/cpukit/sapi/include/confdefs.h
> +++ b/cpukit/sapi/include/confdefs.h
> @@ -125,14 +125,6 @@ const rtems_libio_helper rtems_fs_init_helper =
>  #endif
>  #endif
>
> -/*
> - *  If the application disables the filesystem, they will not need
> - *  a mount table, so do not produce one.
> - */
> -#ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
> -  #define CONFIGURE_HAS_OWN_MOUNT_TABLE
> -#endif
> -
>  /**
>   * This macro defines the number of POSIX file descriptors allocated
>   * and managed by libio.  These are the "integer" file descriptors that
> @@ -257,7 +249,6 @@ const rtems_libio_helper rtems_fs_init_helper =
>   *     Add file filesystems to the default filesystem table.
>   *
>   *   List of available file systems. You can define as many as you like:
> - *     CONFIGURE_FILESYSTEM_MINIIMFS - MiniIMFS, use DEVFS now
>   *     CONFIGURE_FILESYSTEM_IMFS     - In Memory File System (IMFS)
>   *     CONFIGURE_FILESYSTEM_DEVFS    - Device File System (DSVFS)
>   *     CONFIGURE_FILESYSTEM_TFTPFS   - TFTP File System, networking enabled
> @@ -271,10 +262,10 @@ const rtems_libio_helper rtems_fs_init_helper =
>   *
>   *    - If nothing is defined the base file system is the IMFS.
>   *
> - *    - If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystem
> - *      are disabled by force and an empty DEVFS is created.
> + *    - If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystems
> + *      are disabled by force.
>   *
> - *    - If CONFIGURE_USE_DEV_AS_BASE_FILESYSTEM is defined all filesystem
> + *    - If CONFIGURE_USE_DEV_AS_BASE_FILESYSTEM is defined all filesystems
>   *      are disabled by force and DEVFS is defined.
>   */
>
> @@ -285,7 +276,6 @@ const rtems_libio_helper rtems_fs_init_helper =
>     * been disabled.
>     */
>    #ifdef CONFIGURE_FILESYSTEM_ALL
> -    #define CONFIGURE_FILESYSTEM_MINIIMFS
>      #define CONFIGURE_FILESYSTEM_IMFS
>      #define CONFIGURE_FILESYSTEM_DEVFS
>      #define CONFIGURE_FILESYSTEM_TFTPFS
> @@ -301,23 +291,19 @@ const rtems_libio_helper rtems_fs_init_helper =
>     * configured other filesystem parameters.
>     */
>    #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
> -     #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) || \
> -        defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
> -       #error "Filesystem disabled but a base filesystem configured."
> +     #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
> +       #error "Filesystem disabled and a base filesystem configured."
>       #endif
>
> -    #if defined(CONFIGURE_FILESYSTEM_MINIIMFS) || \
> -        defined(CONFIGURE_FILESYSTEM_IMFS) || \
> -        defined(CONFIGURE_FILESYSTEM_DEVFS) || \
> -        defined(CONFIGURE_FILESYSTEM_TFTPFS) || \
> -        defined(CONFIGURE_FILESYSTEM_FTPFS) || \
> -        defined(CONFIGURE_FILESYSTEM_NFS) || \
> -        defined(CONFIGURE_FILESYSTEM_DOSFS) || \
> -        defined(CONFIGURE_FILESYSTEM_RFS) || \
> -        defined(CONFIGURE_FILESYSTEM_JFFS2)
> -        #error "Configured filesystems but root filesystem was not IMFS!"
> -        #error "Filesystems could be disabled, DEVFS is root, or"
> -        #error "  miniIMFS is root!"
> +     #if defined(CONFIGURE_FILESYSTEM_IMFS) || \
> +       defined(CONFIGURE_FILESYSTEM_DEVFS) || \
> +       defined(CONFIGURE_FILESYSTEM_TFTPFS) || \
> +       defined(CONFIGURE_FILESYSTEM_FTPFS) || \
> +       defined(CONFIGURE_FILESYSTEM_NFS) || \
> +       defined(CONFIGURE_FILESYSTEM_DOSFS) || \
> +       defined(CONFIGURE_FILESYSTEM_RFS) || \
> +       defined(CONFIGURE_FILESYSTEM_JFFS2)
> +       #error "Filesystem disabled and a filesystem configured."
>       #endif
>    #endif
>
> @@ -328,10 +314,6 @@ const rtems_libio_helper rtems_fs_init_helper =
>    #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
>      #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
>        #define CONFIGURE_FILESYSTEM_DEVFS
> -    #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
> -      #define CONFIGURE_FILESYSTEM_MINIIMFS
> -    #elif !defined(CONFIGURE_FILESYSTEM_IMFS)
> -      #define CONFIGURE_FILESYSTEM_IMFS
>      #endif
>    #endif
>
> @@ -355,28 +337,12 @@ const rtems_libio_helper rtems_fs_init_helper =
>  #endif
>
>  /**
> - * This defines the miniIMFS file system table entry.
> - */
> -#if !defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) && \
> -    defined(CONFIGURE_FILESYSTEM_MINIIMFS)
> -  #define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS \
> -    { RTEMS_FILESYSTEM_TYPE_MINIIMFS, miniIMFS_initialize }
> -#endif
> -#endif
> -
> -#ifndef RTEMS_SCHEDSIM
> -/**
>   * This defines the IMFS file system table entry.
>   */
>  #if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \
> -    defined(CONFIGURE_FILESYSTEM_IMFS)
> -  #if CONFIGURE_MAXIMUM_FIFOS > 0 || CONFIGURE_MAXIMUM_PIPES > 0
> -    #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \
> -      { RTEMS_FILESYSTEM_TYPE_IMFS, fifoIMFS_initialize }
> -  #else
> -    #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \
> -      { RTEMS_FILESYSTEM_TYPE_IMFS, IMFS_initialize }
> -  #endif
> +  defined(CONFIGURE_FILESYSTEM_IMFS)
> +  #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \
> +    { RTEMS_FILESYSTEM_TYPE_IMFS, IMFS_initialize }
>  #endif
>  #endif
>
> @@ -506,28 +472,27 @@ const rtems_libio_helper rtems_fs_init_helper =
>      #include <rtems/devfs.h>
>    #endif
>
> -#ifndef RTEMS_SCHEDSIM
> -  #if defined(CONFIGURE_FILESYSTEM_IMFS) || \
> -      defined(CONFIGURE_FILESYSTEM_MINIIMFS)
> -    int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
> -  #endif
> -#endif
> -
>    /**
>     * Table termination record.
>     */
>    #define CONFIGURE_FILESYSTEM_NULL { NULL, NULL }
>
>  #ifndef RTEMS_SCHEDSIM
> +  #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) && \
> +    !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
> +    int imfs_rq_memfile_bytes_per_block =
> +      CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
> +  #endif
> +
>    /**
>     * The default file system table. Must be terminated with the NULL entry if
>     * you provide your own.
>     */
> -  #ifndef CONFIGURE_HAS_OWN_FILESYSTEM_TABLE
> +  #if !defined(CONFIGURE_HAS_OWN_FILESYSTEM_TABLE) && \
> +    !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
>      const rtems_filesystem_table_t rtems_filesystem_table[] = {
> -      #if defined(CONFIGURE_FILESYSTEM_MINIIMFS) && \
> -          defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS)
> -        CONFIGURE_FILESYSTEM_ENTRY_miniIMFS,
> +      #if !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
> +        { "/", IMFS_initialize_support },
>        #endif
>        #if defined(CONFIGURE_FILESYSTEM_IMFS) && \
>            defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS)
> @@ -565,30 +530,115 @@ const rtems_libio_helper rtems_fs_init_helper =
>      };
>    #endif
>
> -  #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE
> +  #if !defined(CONFIGURE_HAS_OWN_MOUNT_TABLE) && \
> +    !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
>      #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
>        static devFS_node devFS_root_filesystem_nodes [CONFIGURE_MAXIMUM_DEVICES];
>        static const devFS_data devFS_root_filesystem_data = {
>          devFS_root_filesystem_nodes,
>          CONFIGURE_MAXIMUM_DEVICES
>        };
> +    #else
> +      static IMFS_fs_info_t _Configure_IMFS_fs_info;
> +
> +      static const rtems_filesystem_operations_table _Configure_IMFS_ops = {
> +        rtems_filesystem_default_lock,
> +        rtems_filesystem_default_unlock,
> +        IMFS_eval_path,
> +        #ifdef CONFIGURE_IMFS_DISABLE_LINK
> +          rtems_filesystem_default_link,
> +        #else
> +          IMFS_link,
> +        #endif
> +        rtems_filesystem_default_are_nodes_equal,
> +        #ifdef CONFIGURE_IMFS_DISABLE_MKNOD
> +          rtems_filesystem_default_mknod,
> +        #else
> +          IMFS_mknod,
> +        #endif
> +        #ifdef CONFIGURE_IMFS_DISABLE_RMNOD
> +          rtems_filesystem_default_rmnod,
> +        #else
> +          IMFS_rmnod,
> +        #endif
> +        #ifdef CONFIGURE_IMFS_DISABLE_FCHMOD
> +          rtems_filesystem_default_fchmod,
> +        #else
> +          IMFS_fchmod,
> +        #endif
> +        #ifdef CONFIGURE_IMFS_DISABLE_CHOWN
> +          rtems_filesystem_default_chown,
> +        #else
> +          IMFS_chown,
> +        #endif
> +        IMFS_node_clone,
> +        IMFS_node_free,
> +        #ifdef CONFIGURE_IMFS_DISABLE_MOUNT
> +          rtems_filesystem_default_mount,
> +        #else
> +          IMFS_mount,
> +        #endif
> +        #ifdef CONFIGURE_IMFS_DISABLE_UNMOUNT
> +          rtems_filesystem_default_unmount,
> +        #else
> +          IMFS_unmount,
> +        #endif
> +        rtems_filesystem_default_fsunmount,
> +        #ifdef CONFIGURE_IMFS_DISABLE_UTIME
> +          rtems_filesystem_default_utime,
> +        #else
> +          IMFS_utime,
> +        #endif
> +        #ifdef CONFIGURE_IMFS_DISABLE_SYMLINK
> +          rtems_filesystem_default_symlink,
> +        #else
> +          IMFS_symlink,
> +        #endif
> +        #ifdef CONFIGURE_IMFS_DISABLE_READLINK
> +          rtems_filesystem_default_readlink,
> +        #else
> +          IMFS_readlink,
> +        #endif
> +        #ifdef CONFIGURE_IMFS_DISABLE_RENAME
> +          rtems_filesystem_default_rename,
> +        #else
> +          IMFS_rename,
> +        #endif
> +        rtems_filesystem_default_statvfs
> +      };
> +
> +      static const IMFS_mknod_controls _Configure_IMFS_mknod_controls = {
> +        &IMFS_mknod_control_directory,
> +        &IMFS_mknod_control_device,
> +        &IMFS_mknod_control_memfile,
> +        #if CONFIGURE_MAXIMUM_FIFOS > 0 || CONFIGURE_MAXIMUM_PIPES > 0
> +          &IMFS_mknod_control_fifo
> +        #else
> +          &IMFS_mknod_control_enosys
> +        #endif
> +      };
> +
> +      static const IMFS_mount_data _Configure_IMFS_mount_data = {
> +        &_Configure_IMFS_fs_info,
> +        &_Configure_IMFS_ops,
> +        &_Configure_IMFS_mknod_controls
> +      };
>      #endif
> +
>      const rtems_filesystem_mount_configuration
>        rtems_filesystem_root_configuration = {
>        NULL,
>        NULL,
>        #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
>          RTEMS_FILESYSTEM_TYPE_DEVFS,
> -      #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
> -        RTEMS_FILESYSTEM_TYPE_MINIIMFS,
>        #else
> -        RTEMS_FILESYSTEM_TYPE_IMFS,
> +        "/",
>        #endif
>        RTEMS_FILESYSTEM_READ_WRITE,
>        #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
>          &devFS_root_filesystem_data
>        #else
> -        NULL
> +        &_Configure_IMFS_mount_data
>        #endif
>      };
>    #endif
> diff --git a/doc/user/conf.t b/doc/user/conf.t
> index 7afe09c..fd986e2 100644
> --- a/doc/user/conf.t
> +++ b/doc/user/conf.t
> @@ -2577,40 +2577,6 @@ None.
>  @c XXX - Please provide an example
>
>  @c
> - at c === CONFIGURE_USE_MINIIMFS_AS_BASE_SYSTEM ===
> - at c
> - at subsection Configure miniIMFS as Root File System
> -
> - at findex CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
> -
> - at table @b
> - at item CONSTANT:
> - at code{CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM}
> -
> - at item DATA TYPE:
> -Boolean feature macro.
> -
> - at item RANGE:
> -Defined or undefined.
> -
> - at item DEFAULT VALUE:
> -This is not defined by default. If no other root file system
> -configuration parameters are specified, the IMFS will be used as the
> -root file system.
> -
> - at end table
> -
> - at subheading DESCRIPTION:
> -This configuration parameter is defined if the application wishes to use
> -the reduced functionality miniIMFS as the root filesystem. This reduced
> -version of the full IMFS does not include the capability to mount other
> -file system types, but it does support directories, device nodes, and
> -symbolic links.
> -
> - at subheading NOTES:
> -The miniIMFS nodes and is smaller in executable code size than the full IMFS.
> -
> - at c
>  @c === CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM ===
>  @c
>  @subsection Configure devFS as Root File System
> @@ -2711,6 +2677,292 @@ infrastructure necessary to support @code{printf()}.
>  None.
>
>  @c
> + at c === CONFIGURE_IMFS_DISABLE_CHOWN ===
> + at c
> + at subsection Disable change owner support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_CHOWN
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_CHOWN}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to change the
> +owner is disabled in the root IMFS.
> +
> + at c
> + at c === CONFIGURE_IMFS_DISABLE_FCHMOD ===
> + at c
> + at subsection Disable change mode support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_FCHMOD
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_FCHMOD}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to change the
> +mode is disabled in the root IMFS.
> +
> + at c
> + at c === CONFIGURE_IMFS_DISABLE_UTIME ===
> + at c
> + at subsection Disable change times support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_UTIME
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_UTIME}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to change times
> +is disabled in the root IMFS.
> +
> + at c
> + at c === CONFIGURE_IMFS_DISABLE_LINK ===
> + at c
> + at subsection Disable create hard link support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_LINK
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_LINK}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to create hard
> +links is disabled in the root IMFS.
> +
> + at c
> + at c === CONFIGURE_IMFS_DISABLE_SYMLINK ===
> + at c
> + at subsection Disable create symbolic link support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_SYMLINK
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_SYMLINK}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to create
> +symbolic links is disabled in the root IMFS.
> +
> + at c
> + at c === CONFIGURE_IMFS_DISABLE_READLINK ===
> + at c
> + at subsection Disable read symbolic link support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_READLINK
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_READLINK}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to read symbolic
> +links is disabled in the root IMFS.
> +
> + at c
> + at c === CONFIGURE_IMFS_DISABLE_RENAME ===
> + at c
> + at subsection Disable rename support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_RENAME
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_RENAME}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to rename nodes
> +is disabled in the root IMFS.
> +
> + at c
> + at c === CONFIGURE_IMFS_DISABLE_MOUNT ===
> + at c
> + at subsection Disable mount support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_MOUNT
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_MOUNT}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to mount other
> +file systems is disabled in the root IMFS.
> +
> + at c
> + at c === CONFIGURE_IMFS_DISABLE_UNMOUNT ===
> + at c
> + at subsection Disable unmount support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_UNMOUNT
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_UNMOUNT}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to unmount file
> +systems is disabled in the root IMFS.
> +
> + at c
> + at c === CONFIGURE_IMFS_DISABLE_MKNOD ===
> + at c
> + at subsection Disable make nodes support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_MKNOD
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_MKNOD}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to make
> +directories, devices, regular files and FIFOs is disabled in the root IMFS.
> +
> + at c
> + at c === CONFIGURE_IMFS_DISABLE_RMNOD ===
> + at c
> + at subsection Disable remove nodes support of root IMFS
> +
> + at findex CONFIGURE_IMFS_DISABLE_RMNOD
> +
> + at table @b
> + at item CONSTANT:
> + at code{CONFIGURE_IMFS_DISABLE_RMNOD}
> +
> + at item DATA TYPE:
> +Boolean feature macro.
> +
> + at item RANGE:
> +Defined or undefined.
> +
> + at item DEFAULT VALUE:
> +This is not defined by default.
> +
> + at end table
> +
> + at subheading DESCRIPTION:
> +In case this configuration option is defined, then the support to remove nodes
> +is disabled in the root IMFS.
> +
> + at c
>  @c === Block Device Cache Configuration ===
>  @c
>  @section Block Device Cache Configuration
> diff --git a/testsuites/fstests/Makefile.am b/testsuites/fstests/Makefile.am
> index 404966c..6b01b20 100644
> --- a/testsuites/fstests/Makefile.am
> +++ b/testsuites/fstests/Makefile.am
> @@ -1,6 +1,8 @@
>  ACLOCAL_AMFLAGS = -I ../aclocal
>
>  _SUBDIRS =
> +_SUBDIRS += fsimfsconfig02
> +_SUBDIRS += fsimfsconfig01
>  _SUBDIRS += fsdosfsname01
>  _SUBDIRS += fsdosfswrite01
>  _SUBDIRS += fsdosfsformat01
> diff --git a/testsuites/fstests/configure.ac b/testsuites/fstests/configure.ac
> index fca2fdf..87b8961 100644
> --- a/testsuites/fstests/configure.ac
> +++ b/testsuites/fstests/configure.ac
> @@ -77,6 +77,8 @@ AC_CHECK_SIZEOF([blkcnt_t])
>
>  # Explicitly list all Makefiles here
>  AC_CONFIG_FILES([Makefile
> +fsimfsconfig02/Makefile
> +fsimfsconfig01/Makefile
>  fsdosfsname01/Makefile
>  fsdosfswrite01/Makefile
>  fsdosfsformat01/Makefile
> diff --git a/testsuites/fstests/fsimfsconfig01/Makefile.am b/testsuites/fstests/fsimfsconfig01/Makefile.am
> new file mode 100644
> index 0000000..0787dbe
> --- /dev/null
> +++ b/testsuites/fstests/fsimfsconfig01/Makefile.am
> @@ -0,0 +1,19 @@
> +rtems_tests_PROGRAMS = fsimfsconfig01
> +fsimfsconfig01_SOURCES = init.c
> +
> +dist_rtems_tests_DATA = fsimfsconfig01.scn fsimfsconfig01.doc
> +
> +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
> +include $(top_srcdir)/../automake/compile.am
> +include $(top_srcdir)/../automake/leaf.am
> +
> +AM_CPPFLAGS += -I$(top_srcdir)/../support/include
> +
> +LINK_OBJS = $(fsimfsconfig01_OBJECTS)
> +LINK_LIBS = $(fsimfsconfig01_LDLIBS)
> +
> +fsimfsconfig01$(EXEEXT): $(fsimfsconfig01_OBJECTS) $(fsimfsconfig01_DEPENDENCIES)
> +       @rm -f fsimfsconfig01$(EXEEXT)
> +       $(make-exe)
> +
> +include $(top_srcdir)/../automake/local.am
> diff --git a/testsuites/fstests/fsimfsconfig01/fsimfsconfig01.doc b/testsuites/fstests/fsimfsconfig01/fsimfsconfig01.doc
> new file mode 100644
> index 0000000..d243512
> --- /dev/null
> +++ b/testsuites/fstests/fsimfsconfig01/fsimfsconfig01.doc
> @@ -0,0 +1,11 @@
> +This file describes the directives and concepts tested by this test set.
> +
> +test set name: fsimfsconfig01
> +
> +directives:
> +
> +  TBD
> +
> +concepts:
> +
> +  - Ensure that the IMFS configuration defines work.
> diff --git a/testsuites/fstests/fsimfsconfig01/fsimfsconfig01.scn b/testsuites/fstests/fsimfsconfig01/fsimfsconfig01.scn
> new file mode 100644
> index 0000000..145048b
> --- /dev/null
> +++ b/testsuites/fstests/fsimfsconfig01/fsimfsconfig01.scn
> @@ -0,0 +1,2 @@
> +*** BEGIN OF TEST FSIMFSCONFIG 1 ***
> +*** END OF TEST FSIMFSCONFIG 1 ***
> diff --git a/testsuites/fstests/fsimfsconfig01/init.c b/testsuites/fstests/fsimfsconfig01/init.c
> new file mode 100644
> index 0000000..3f842c0
> --- /dev/null
> +++ b/testsuites/fstests/fsimfsconfig01/init.c
> @@ -0,0 +1,139 @@
> +/*
> + * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
> + *
> + *  embedded brains GmbH
> + *  Dornierstr. 4
> + *  82178 Puchheim
> + *  Germany
> + *  <rtems at embedded-brains.de>
> + *
> + * The license and distribution terms for this file may be
> + * found in the file LICENSE in this distribution or at
> + * http://www.rtems.org/license/LICENSE.
> + */
> +
> +#ifdef HAVE_CONFIG_H
> +  #include "config.h"
> +#endif
> +
> +#include "tmacros.h"
> +
> +#include <sys/stat.h>
> +#include <errno.h>
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <utime.h>
> +
> +#include <rtems/imfs.h>
> +#include <rtems/libio.h>
> +
> +const char rtems_test_name[] = "FSIMFSCONFIG 1";
> +
> +static const IMFS_node_control node_control = IMFS_GENERIC_INITIALIZER(
> +  &rtems_filesystem_handlers_default,
> +  IMFS_node_initialize_generic,
> +  IMFS_node_destroy_default
> +);
> +
> +static void Init(rtems_task_argument arg)
> +{
> +  struct utimbuf times;
> +  const char *generic = "generic";
> +  const char *mnt = "mnt";
> +  int rv;
> +
> +  TEST_BEGIN();
> +
> +  rv = IMFS_make_generic_node(
> +    generic,
> +    S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO,
> +    &node_control,
> +    NULL
> +  );
> +  rtems_test_assert(rv == 0);
> +
> +  errno = 0;
> +  rv = chown(generic, 0, 0);
> +  rtems_test_assert(rv == -1);
> +  rtems_test_assert(errno == ENOTSUP);
> +
> +  errno = 0;
> +  rv = chmod(generic, 0);
> +  rtems_test_assert(rv == -1);
> +  rtems_test_assert(errno == ENOTSUP);
> +
> +  errno = 0;
> +  rv = link(generic, "link");
> +  rtems_test_assert(rv == -1);
> +  rtems_test_assert(errno == ENOTSUP);
> +
> +  rv = mkdir(mnt, S_IRWXU);
> +  rtems_test_assert(rv == 0);
> +
> +  errno = 0;
> +  rv = mount(
> +    "",
> +    mnt,
> +    RTEMS_FILESYSTEM_TYPE_IMFS,
> +    RTEMS_FILESYSTEM_READ_ONLY,
> +    NULL
> +  );
> +  rtems_test_assert(rv == -1);
> +  rtems_test_assert(errno == ENOTSUP);
> +
> +  errno = 0;
> +  rv = rename(generic, "new");
> +  rtems_test_assert(rv == -1);
> +  rtems_test_assert(errno == ENOTSUP);
> +
> +  errno = 0;
> +  rv = unlink(generic);
> +  rtems_test_assert(rv == -1);
> +  rtems_test_assert(errno == ENOTSUP);
> +
> +  errno = 0;
> +  rv = symlink(generic, "link");
> +  rtems_test_assert(rv == -1);
> +  rtems_test_assert(errno == ENOTSUP);
> +
> +  errno = 0;
> +  rv = utime(generic, &times);
> +  rtems_test_assert(rv == -1);
> +  rtems_test_assert(errno == ENOTSUP);
> +
> +  TEST_END();
> +  rtems_test_exit(0);
> +}
> +
> +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
> +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
> +
> +#define CONFIGURE_FILESYSTEM_IMFS
> +
> +#define CONFIGURE_IMFS_DISABLE_CHOWN
> +#define CONFIGURE_IMFS_DISABLE_FCHMOD
> +#define CONFIGURE_IMFS_DISABLE_LINK
> +
> +#if 0
> +/*
> + * This would lead to a fatal error since rtems_filesystem_initialize() creates
> + * a "/dev" directory.
> + */
> +#define CONFIGURE_IMFS_DISABLE_MKNOD
> +#endif
> +
> +#define CONFIGURE_IMFS_DISABLE_MOUNT
> +#define CONFIGURE_IMFS_DISABLE_RENAME
> +#define CONFIGURE_IMFS_DISABLE_RMNOD
> +#define CONFIGURE_IMFS_DISABLE_SYMLINK
> +#define CONFIGURE_IMFS_DISABLE_UTIME
> +
> +#define CONFIGURE_MAXIMUM_TASKS 1
> +
> +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
> +
> +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
> +
> +#define CONFIGURE_INIT
> +
> +#include <rtems/confdefs.h>
> diff --git a/testsuites/fstests/fsimfsconfig02/Makefile.am b/testsuites/fstests/fsimfsconfig02/Makefile.am
> new file mode 100644
> index 0000000..9567eea
> --- /dev/null
> +++ b/testsuites/fstests/fsimfsconfig02/Makefile.am
> @@ -0,0 +1,19 @@
> +rtems_tests_PROGRAMS = fsimfsconfig02
> +fsimfsconfig02_SOURCES = init.c
> +
> +dist_rtems_tests_DATA = fsimfsconfig02.scn fsimfsconfig02.doc
> +
> +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
> +include $(top_srcdir)/../automake/compile.am
> +include $(top_srcdir)/../automake/leaf.am
> +
> +AM_CPPFLAGS += -I$(top_srcdir)/../support/include
> +
> +LINK_OBJS = $(fsimfsconfig02_OBJECTS)
> +LINK_LIBS = $(fsimfsconfig02_LDLIBS)
> +
> +fsimfsconfig02$(EXEEXT): $(fsimfsconfig02_OBJECTS) $(fsimfsconfig02_DEPENDENCIES)
> +       @rm -f fsimfsconfig02$(EXEEXT)
> +       $(make-exe)
> +
> +include $(top_srcdir)/../automake/local.am
> diff --git a/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.doc b/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.doc
> new file mode 100644
> index 0000000..3693513
> --- /dev/null
> +++ b/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.doc
> @@ -0,0 +1,11 @@
> +This file describes the directives and concepts tested by this test set.
> +
> +test set name: fsimfsconfig02
> +
> +directives:
> +
> +  TBD
> +
> +concepts:
> +
> +  - Ensure that the IMFS configuration defines work.
> diff --git a/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.scn b/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.scn
> new file mode 100644
> index 0000000..c89a4a2
> --- /dev/null
> +++ b/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.scn
> @@ -0,0 +1,2 @@
> +*** BEGIN OF TEST FSIMFSCONFIG 2 ***
> +*** END OF TEST FSIMFSCONFIG 2 ***
> diff --git a/testsuites/fstests/fsimfsconfig02/init.c b/testsuites/fstests/fsimfsconfig02/init.c
> new file mode 100644
> index 0000000..35f9c83
> --- /dev/null
> +++ b/testsuites/fstests/fsimfsconfig02/init.c
> @@ -0,0 +1,84 @@
> +/*
> + * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
> + *
> + *  embedded brains GmbH
> + *  Dornierstr. 4
> + *  82178 Puchheim
> + *  Germany
> + *  <rtems at embedded-brains.de>
> + *
> + * The license and distribution terms for this file may be
> + * found in the file LICENSE in this distribution or at
> + * http://www.rtems.org/license/LICENSE.
> + */
> +
> +#ifdef HAVE_CONFIG_H
> +  #include "config.h"
> +#endif
> +
> +#include "tmacros.h"
> +
> +#include <sys/stat.h>
> +#include <errno.h>
> +#include <unistd.h>
> +
> +#include <rtems/imfs.h>
> +#include <rtems/libio.h>
> +
> +const char rtems_test_name[] = "FSIMFSCONFIG 2";
> +
> +static void Init(rtems_task_argument arg)
> +{
> +  const char *mnt = "mnt";
> +  const char *link = "link";
> +  char buf[1];
> +  int rv;
> +
> +  TEST_BEGIN();
> +
> +  rv = mkdir(mnt, S_IRWXU);
> +  rtems_test_assert(rv == 0);
> +
> +  rv = mount(
> +    "",
> +    mnt,
> +    RTEMS_FILESYSTEM_TYPE_IMFS,
> +    RTEMS_FILESYSTEM_READ_ONLY,
> +    NULL
> +  );
> +  rtems_test_assert(rv == 0);
> +
> +  errno = 0;
> +  rv = unmount(mnt);
> +  rtems_test_assert(rv == -1);
> +  rtems_test_assert(errno == ENOTSUP);
> +
> +  rv = symlink(mnt, link);
> +  rtems_test_assert(rv == 0);
> +
> +  errno = 0;
> +  rv = readlink(link, &buf[0], sizeof(buf));
> +  rtems_test_assert(rv == -1);
> +  rtems_test_assert(errno == ENOTSUP);
> +
> +  TEST_END();
> +  rtems_test_exit(0);
> +}
> +
> +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
> +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
> +
> +#define CONFIGURE_FILESYSTEM_IMFS
> +
> +#define CONFIGURE_IMFS_DISABLE_READLINK
> +#define CONFIGURE_IMFS_DISABLE_UNMOUNT
> +
> +#define CONFIGURE_MAXIMUM_TASKS 1
> +
> +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
> +
> +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
> +
> +#define CONFIGURE_INIT
> +
> +#include <rtems/confdefs.h>
> diff --git a/testsuites/fstests/fsimfsgeneric01/init.c b/testsuites/fstests/fsimfsgeneric01/init.c
> index 44d75c5..6cc6c15 100644
> --- a/testsuites/fstests/fsimfsgeneric01/init.c
> +++ b/testsuites/fstests/fsimfsgeneric01/init.c
> @@ -396,6 +396,13 @@ static const IMFS_node_control node_initialization_error_control = {
>    .node_destroy = node_destroy_inhibited
>  };
>
> +static const rtems_filesystem_operations_table *imfs_ops;
> +
> +static int other_clone(rtems_filesystem_location_info_t *loc)
> +{
> +  return (*imfs_ops->clonenod_h)(loc);
> +}
> +
>  static void test_imfs_make_generic_node_errors(void)
>  {
>    int rv = 0;
> @@ -403,7 +410,7 @@ static void test_imfs_make_generic_node_errors(void)
>    rtems_chain_control *chain = &rtems_filesystem_mount_table;
>    rtems_filesystem_mount_table_entry_t *mt_entry =
>      (rtems_filesystem_mount_table_entry_t *) rtems_chain_first(chain);
> -  const char *type = mt_entry->type;
> +  rtems_filesystem_operations_table other_ops;
>    void *opaque = NULL;
>    rtems_resource_snapshot before;
>
> @@ -421,14 +428,17 @@ static void test_imfs_make_generic_node_errors(void)
>    rtems_test_assert(rtems_resource_snapshot_check(&before));
>
>    errno = 0;
> -  mt_entry->type = "XXX";
> +  imfs_ops = mt_entry->ops;
> +  other_ops = *imfs_ops;
> +  other_ops.clonenod_h = other_clone;
> +  mt_entry->ops = &other_ops;
>    rv = IMFS_make_generic_node(
>      path,
>      S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO,
>      &node_control,
>      NULL
>    );
> -  mt_entry->type = type;
> +  mt_entry->ops = imfs_ops;
>    rtems_test_assert(rv == -1);
>    rtems_test_assert(errno == ENOTSUP);
>    rtems_test_assert(rtems_resource_snapshot_check(&before));
> diff --git a/testsuites/fstests/mimfs_support/fs_support.c b/testsuites/fstests/mimfs_support/fs_support.c
> index 849d856..29ccfd3 100644
> --- a/testsuites/fstests/mimfs_support/fs_support.c
> +++ b/testsuites/fstests/mimfs_support/fs_support.c
> @@ -64,5 +64,7 @@ test_shutdown_filesystem (void)
>  #define CONFIGURE_INIT_TASK_STACK_SIZE (16 * 1024)
>  #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS  1
>
> +#define CONFIGURE_FILESYSTEM_IMFS
> +
>  #define CONFIGURE_INIT
>  #include <rtems/confdefs.h>
> diff --git a/testsuites/libtests/tar03/init.c b/testsuites/libtests/tar03/init.c
> index 3e2b5d3..72e95ec 100644
> --- a/testsuites/libtests/tar03/init.c
> +++ b/testsuites/libtests/tar03/init.c
> @@ -34,13 +34,6 @@ void test_tarfs_error(void)
>      printf ("error: untar failed returned %d\n", sc);
>      rtems_test_exit(1);
>    }
> -
> -  puts("Loading tarfs image with miniIMFS as root filesystem - ERROR");
> -  sc = rtems_tarfs_load("/",(void *)rtems_task_create, 72);
> -  if (sc != -1) {
> -    printf ("error: untar failed returned %d\n", sc);
> -    rtems_test_exit(1);
> -  }
>  }
>
>  rtems_task Init(
> @@ -65,8 +58,6 @@ rtems_task Init(
>
>  #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
>
> -#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
> -
>  #define CONFIGURE_INIT
>  #include <rtems/confdefs.h>
>  /* end of file */
> diff --git a/testsuites/psxtests/psxfile01/main.c b/testsuites/psxtests/psxfile01/main.c
> index a6ad029..554f8e9 100644
> --- a/testsuites/psxtests/psxfile01/main.c
> +++ b/testsuites/psxtests/psxfile01/main.c
> @@ -35,6 +35,8 @@ rtems_task Init(
>
>  #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 6
>
> +#define CONFIGURE_FILESYSTEM_IMFS
> +
>  #define CONFIGURE_MAXIMUM_TASKS 1
>  #define CONFIGURE_INIT_TASK_STACK_SIZE (2 * RTEMS_MINIMUM_STACK_SIZE)
>
> diff --git a/testsuites/psxtests/psximfs02/init.c b/testsuites/psxtests/psximfs02/init.c
> index 00a171f..d372a6f 100644
> --- a/testsuites/psxtests/psximfs02/init.c
> +++ b/testsuites/psxtests/psximfs02/init.c
> @@ -208,6 +208,8 @@ rtems_task Init(
>  #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
>  #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
>
> +#define CONFIGURE_FILESYSTEM_IMFS
> +
>  #define CONFIGURE_MAXIMUM_TASKS                  1
>  #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK   15
>  #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
> diff --git a/testsuites/psxtests/psxmount/main.c b/testsuites/psxtests/psxmount/main.c
> index 2e32a29..a723b87 100644
> --- a/testsuites/psxtests/psxmount/main.c
> +++ b/testsuites/psxtests/psxmount/main.c
> @@ -33,6 +33,8 @@ rtems_task Init(
>
>  #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10
>
> +#define CONFIGURE_FILESYSTEM_IMFS
> +
>  #define CONFIGURE_MAXIMUM_TASKS 1
>
>  #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 1
> diff --git a/testsuites/psxtests/psxreaddir/main.c b/testsuites/psxtests/psxreaddir/main.c
> index 90880b0..176d264 100644
> --- a/testsuites/psxtests/psxreaddir/main.c
> +++ b/testsuites/psxtests/psxreaddir/main.c
> @@ -31,6 +31,8 @@ rtems_task Init(
>
>  #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10
>
> +#define CONFIGURE_FILESYSTEM_IMFS
> +
>  #define CONFIGURE_MAXIMUM_TASKS 1
>
>  #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
> diff --git a/testsuites/psxtests/psxstat/main.c b/testsuites/psxtests/psxstat/main.c
> index 19ed8d4..07fde7f 100644
> --- a/testsuites/psxtests/psxstat/main.c
> +++ b/testsuites/psxtests/psxstat/main.c
> @@ -35,6 +35,8 @@ rtems_task Init(
>
>  #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10
>
> +#define CONFIGURE_FILESYSTEM_IMFS
> +
>  #define CONFIGURE_MAXIMUM_TASKS 1
>
>  #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
> diff --git a/testsuites/samples/iostream/system.h b/testsuites/samples/iostream/system.h
> index 7256f8f..62f7d53 100644
> --- a/testsuites/samples/iostream/system.h
> +++ b/testsuites/samples/iostream/system.h
> @@ -31,9 +31,6 @@
>  #define CONFIGURE_INIT_TASK_STACK_SIZE    (RTEMS_MINIMUM_STACK_SIZE * 2)
>  #define CONFIGURE_EXTRA_TASK_STACKS       RTEMS_MINIMUM_STACK_SIZE
>
> -/* Only remove when this macro is removed from confdefs.h. It tests it. */
> -#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
> -
>  #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
>
>  #include <rtems/confdefs.h>
> diff --git a/testsuites/sptests/sp47/init.c b/testsuites/sptests/sp47/init.c
> index 1a0d569..5d28303 100644
> --- a/testsuites/sptests/sp47/init.c
> +++ b/testsuites/sptests/sp47/init.c
> @@ -74,7 +74,5 @@ rtems_task Init(rtems_task_argument ignored)
>
>  #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
>
> -#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
> -
>  #define CONFIGURE_INIT
>  #include <rtems/confdefs.h>
> diff --git a/testsuites/sptests/sp48/init.c b/testsuites/sptests/sp48/init.c
> index 701aa17..53d8245 100644
> --- a/testsuites/sptests/sp48/init.c
> +++ b/testsuites/sptests/sp48/init.c
> @@ -102,7 +102,5 @@ rtems_task Init(rtems_task_argument ignored)
>
>  #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
>
> -#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
> -
>  #define CONFIGURE_INIT
>  #include <rtems/confdefs.h>
>
> _______________________________________________
> vc mailing list
> vc at rtems.org
> http://lists.rtems.org/mailman/listinfo/vc

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the devel mailing list