Remove support for CONFIG_FS_WRITABLE and CONFIG_FS_READABLE

This commit is contained in:
Gregory Nutt 2020-03-21 11:25:56 -06:00 committed by Xiang Xiao
parent 54b375dc43
commit 1a9444a68b
16 changed files with 157 additions and 320 deletions

View File

@ -1,35 +1,20 @@
/****************************************************************************
* examples/mount/mount.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -49,9 +34,6 @@
/* Configure the test */
#if defined(CONFIG_EXAMPLES_MOUNT_DEVNAME)
# if !defined(CONFIG_FS_WRITABLE)
# error "Writable filesystem required in this configuration"
# endif
# undef CONFIG_EXAMPLES_MOUNT_NSECTORS
# undef CONFIG_EXAMPLES_MOUNT_SECTORSIZE
# undef CONFIG_EXAMPLES_MOUNT_RAMDEVNO

View File

@ -6,7 +6,6 @@
config FSUTILS_PASSWD
bool "Password file support"
default n
depends on FS_READABLE
---help---
Enables support for /etc/passwd file access routines
@ -19,7 +18,6 @@ config FSUTILS_PASSWD_PATH
config FSUTILS_PASSWD_READONLY
bool "Read-only /etc/passwd file?"
default n
depends on FS_WRITABLE
config FSUTILS_PASSWD_IOBUFFER_SIZE
int "Allocated I/O buffer size"

View File

@ -1,35 +1,20 @@
############################################################################
# apps/fsutils/passwd/Makefile
#
# Copyright (C) 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
@ -38,15 +23,11 @@
# Password file access library
ifeq ($(CONFIG_FSUTILS_PASSWD),y)
ifeq ($(CONFIG_FS_READABLE),y)
CSRCS += passwd_verify.c passwd_find.c passwd_encrypt.c
ifeq ($(CONFIG_FS_WRITABLE),y)
ifneq ($(CONFIG_FSUTILS_PASSWD_READONLY),y)
CSRCS += passwd_adduser.c passwd_deluser.c passwd_update.c passwd_append.c
CSRCS += passwd_delete.c passwd_lock.c
endif
endif
endif
endif
include $(APPDIR)/Application.mk

View File

@ -1,35 +1,20 @@
/****************************************************************************
* apps/fsutils/passwd/passwd.h
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -93,7 +78,7 @@ struct passwd_s
*
****************************************************************************/
#if defined(CONFIG_FS_WRITABLE) && !defined(CONFIG_FSUTILS_PASSWD_READONLY)
#if !defined(CONFIG_FSUTILS_PASSWD_READONLY)
# define PASSWD_SEM_DECL(s) FAR sem_t *s
int passwd_lock(FAR sem_t **semp);
void passwd_unlock(FAR sem_t *sem);

View File

@ -811,7 +811,7 @@ menu "NxWM Media Player Display Settings"
config NXWM_MEDIAPLAYER
bool "NxWM Media Player"
default n
depends on FS_READABLE && SYSTEM_NXPLAYER
depends on SYSTEM_NXPLAYER
---help---
Enable support for the MP3 Media Player. This features requires
a board that includes an MP3 Codec chip, such as the Mikromedia

View File

@ -1,35 +1,20 @@
/****************************************************************************
* apps/include/fsutils/passwd.h
*
* Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -74,7 +59,7 @@
*
****************************************************************************/
#if defined(CONFIG_FS_WRITABLE) && defined(CONFIG_FSUTILS_PASSWD_READONLY)
#if defined(CONFIG_FSUTILS_PASSWD_READONLY)
int passwd_adduser(FAR const char *username, FAR const char *password);
/****************************************************************************
@ -114,7 +99,7 @@ int passwd_deluser(FAR const char *username);
int passwd_update(FAR const char *username, FAR const char *password);
#endif /* CONFIG_FS_WRITABLE && CONFIG_FSUTILS_PASSWD_READONLY */
#endif /* CONFIG_FSUTILS_PASSWD_READONLY */
/****************************************************************************
* Name: passwd_verify

View File

@ -7,7 +7,6 @@ config INTERPRETERS_BAS
tristate "Basic Interpreter support"
default n
select LIBC_FLOATINGPOINT
depends on FS_READABLE
---help---
This is a Basic interpreter written by Michael Haardt

View File

@ -434,7 +434,7 @@ config NSH_DISABLE_NSLOOKUP
config NSH_DISABLE_PASSWD
bool "Disable passwd"
default y
depends on NSH_LOGIN_PASSWD && FS_WRITABLE && !FSUTILS_PASSWD_READONLY
depends on NSH_LOGIN_PASSWD && !FSUTILS_PASSWD_READONLY
config NSH_DISABLE_PMCONFIG
bool "Disable pmconfig"
@ -567,12 +567,12 @@ config NSH_DISABLE_URLENCODE
config NSH_DISABLE_USERADD
bool "Disable useradd"
default y
depends on NSH_LOGIN_PASSWD && FS_WRITABLE && !FSUTILS_PASSWD_READONLY
depends on NSH_LOGIN_PASSWD && !FSUTILS_PASSWD_READONLY
config NSH_DISABLE_USERDEL
bool "Disable userdel"
default y
depends on NSH_LOGIN_PASSWD && FS_WRITABLE && !FSUTILS_PASSWD_READONLY
depends on NSH_LOGIN_PASSWD && !FSUTILS_PASSWD_READONLY
config NSH_DISABLE_USLEEP
bool "Disable usleep"

View File

@ -1448,7 +1448,7 @@ Command Dependencies on Configuration Settings
cp --
dd --
delroute CONFIG_NET && CONFIG_NET_ROUTE
df !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_READABLE (see note 3)
df !CONFIG_DISABLE_MOUNTPOINT
dirname --
dmesg CONFIG_RAMLOG_SYSLOG
echo --
@ -1472,15 +1472,15 @@ Command Dependencies on Configuration Settings
lsmod CONFIG_MODULE && CONFIG_FS_PROCFS && !CONFIG_FS_PROCFS_EXCLUDE_MODULE
md5 CONFIG_NETUTILS_CODECS && CONFIG_CODECS_HASH_MD5
mb,mh,mw ---
mkdir (!CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE) || !CONFIG_DISABLE_PSEUDOFS_OPERATIONS
mkdir !CONFIG_DISABLE_MOUNTPOINT || !CONFIG_DISABLE_PSEUDOFS_OPERATIONS
mkfatfs !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FSUTILS_MKFATFS
mkfifo CONFIG_PIPES && CONFIG_DEV_FIFO_SIZE > 0
mkrd !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE (see note 4)
mount !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_READABLE (see note 3)
mv (!CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE) || !CONFIG_DISABLE_PSEUDOFS_OPERATIONS (see note 4)
mkrd !CONFIG_DISABLE_MOUNTPOINT
mount !CONFIG_DISABLE_MOUNTPOINT
mv !CONFIG_DISABLE_MOUNTPOINT || !CONFIG_DISABLE_PSEUDOFS_OPERATIONS
nfsmount !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NET && CONFIG_NFS
nslookup CONFIG_LIBC_NETDB && CONFIG_NETDB_DNSCLIENT
password !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE && CONFIG_NSH_LOGIN_PASSWD
password !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NSH_LOGIN_PASSWD
pmconfig CONFIG_PM && !CONFIG_NSH_DISABLE_PMCONFIG
poweroff CONFIG_BOARDCTL_POWEROFF
ps CONFIG_FS_PROCFS && !CONFIG_FS_PROCFS_EXCLUDE_PROC
@ -1488,8 +1488,8 @@ Command Dependencies on Configuration Settings
pwd !CONFIG_DISABLE_ENVIRON
readlink CONFIG_PSEUDOFS_SOFTLINK
reboot CONFIG_BOARDCTL_RESET
rm (!CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE) || !CONFIG_DISABLE_PSEUDOFS_OPERATIONS
rmdir (!CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE) || !CONFIG_DISABLE_PSEUDOFS_OPERATIONS
rm !CONFIG_DISABLE_MOUNTPOINT || !CONFIG_DISABLE_PSEUDOFS_OPERATIONS
rmdir !CONFIG_DISABLE_MOUNTPOINT || !CONFIG_DISABLE_PSEUDOFS_OPERATIONS
rmmod CONFIG_MODULE
route CONFIG_FS_PROCFS && CONFIG_FS_PROCFS_EXCLUDE_NET &&
!CONFIG_FS_PROCFS_EXCLUDE_ROUTE && CONFIG_NET_ROUTE &&
@ -1503,13 +1503,13 @@ Command Dependencies on Configuration Settings
telnetd CONFIG_NSH_TELNET && !CONFIG_NSH_DISABLE_TELNETD
time ---
truncate !CONFIG_DISABLE_MOUNTPOINT
umount !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_READABLE
umount !CONFIG_DISABLE_MOUNTPOINT
uname !CONFIG_NSH_DISABLE_UNAME
unset CONFIG_NSH_VARS || !CONFIG_DISABLE_ENVIRON
urldecode CONFIG_NETUTILS_CODECS && CONFIG_CODECS_URLCODE
urlencode CONFIG_NETUTILS_CODECS && CONFIG_CODECS_URLCODE
useradd !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE && CONFIG_NSH_LOGIN_PASSWD
userdel !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE && CONFIG_NSH_LOGIN_PASSWD
useradd !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NSH_LOGIN_PASSWD
userdel !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NSH_LOGIN_PASSWD
usleep --
get CONFIG_NET && CONFIG_NET_TCP
xd ---
@ -1519,10 +1519,6 @@ Command Dependencies on Configuration Settings
operations size may be larger.
2. Special TFTP server start-up options will probably be required to permit
creation of file for the correct operation of the put command.
3. CONFIG_FS_READABLE is not a user configuration but is set automatically
if any readable file system is selected.
4. CONFIG_FS_WRITABLE is not a user configuration but is set automatically
if any writable file system is selected.
In addition, each NSH command can be individually disabled via one of the following
settings. All of these settings make the configuration of NSH potentially complex but

View File

@ -1,35 +1,20 @@
/****************************************************************************
* apps/nshlib/nsh.h
*
* Copyright (C) 2007-2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -81,8 +66,7 @@
*/
#undef NSH_HAVE_WRITABLE_MOUNTPOINT
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \
CONFIG_NFILE_STREAMS > 0
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_STREAMS > 0
# define NSH_HAVE_WRITABLE_MOUNTPOINT 1
#endif
@ -1048,24 +1032,20 @@ int cmd_irqinfo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
!defined(CONFIG_NSH_DISABLE_MKFIFO)
int cmd_mkfifo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
# ifdef CONFIG_FS_READABLE
# ifdef NSH_HAVE_CATFILE
# ifndef CONFIG_NSH_DISABLE_DF
# ifdef NSH_HAVE_CATFILE
# ifndef CONFIG_NSH_DISABLE_DF
int cmd_df(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
# ifndef CONFIG_NSH_DISABLE_MOUNT
# endif
# ifndef CONFIG_NSH_DISABLE_MOUNT
int cmd_mount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
# endif
# ifndef CONFIG_NSH_DISABLE_UMOUNT
# endif
# ifndef CONFIG_NSH_DISABLE_UMOUNT
int cmd_umount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
# ifdef CONFIG_FS_WRITABLE
# ifndef CONFIG_NSH_DISABLE_MKRD
# endif
# ifndef CONFIG_NSH_DISABLE_MKRD
int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
# endif /* CONFIG_FS_WRITABLE */
# endif /* CONFIG_FS_READABLE */
# endif
# ifdef CONFIG_FSUTILS_MKFATFS
# ifndef CONFIG_NSH_DISABLE_MKFATFS
int cmd_mkfatfs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
@ -1079,8 +1059,8 @@ int cmd_irqinfo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# ifndef CONFIG_NSH_DISABLE_TRUNCATE
int cmd_truncate(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
# if defined(CONFIG_NSH_LOGIN_PASSWD) && defined(CONFIG_FS_WRITABLE) && \
!defined(CONFIG_FSUTILS_PASSWD_READONLY)
# if defined(CONFIG_NSH_LOGIN_PASSWD) && \
!defined(CONFIG_FSUTILS_PASSWD_READONLY)
# ifndef CONFIG_NSH_DISABLE_USERADD
int cmd_useradd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
@ -1128,8 +1108,7 @@ int cmd_irqinfo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
int cmd_ifup(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
int cmd_ifdown(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
# if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE) && \
defined(CONFIG_NFS)
# if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_NFS)
# ifndef CONFIG_NSH_DISABLE_NFSMOUNT
int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif

View File

@ -1,35 +1,20 @@
/****************************************************************************
* apps/nshlib/nsh_command.c
*
* Copyright (C) 2007-2019, 2020 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -176,8 +161,7 @@ static const struct cmdmap_s g_cmdmap[] =
{ "delroute", cmd_delroute, 2, 3, "<target> [<netmask>]" },
#endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE) && \
!defined(CONFIG_NSH_DISABLE_DF)
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && !defined(CONFIG_NSH_DISABLE_DF)
#ifdef NSH_HAVE_CATFILE
#if defined(HAVE_DF_HUMANREADBLE) && defined(HAVE_DF_BLOCKOUTPUT)
{ "df", cmd_df, 1, 2, "[-h]" },
@ -357,7 +341,7 @@ static const struct cmdmap_s g_cmdmap[] =
"<hex-address>[=<hex-value>] [<hex-byte-count>]" },
#endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE)
#if !defined(CONFIG_DISABLE_MOUNTPOINT)
#ifndef CONFIG_NSH_DISABLE_MOUNT
#if defined(NSH_HAVE_CATFILE) && defined(HAVE_MOUNT_LIST)
{ "mount", cmd_mount, 1, 7,
@ -393,8 +377,8 @@ static const struct cmdmap_s g_cmdmap[] =
{ "nslookup", cmd_nslookup, 2, 2, "<host-name>" },
#endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \
defined(CONFIG_NSH_LOGIN_PASSWD) && \
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && \
defined(CONFIG_NSH_LOGIN_PASSWD) && \
!defined(CONFIG_FSUTILS_PASSWD_READONLY)
# ifndef CONFIG_NSH_DISABLE_PASSWD
{ "passwd", cmd_passwd, 3, 3, "<username> <password>" },
@ -549,7 +533,7 @@ static const struct cmdmap_s g_cmdmap[] =
#endif
#endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE)
#if !defined(CONFIG_DISABLE_MOUNTPOINT)
# ifndef CONFIG_NSH_DISABLE_UMOUNT
{ "umount", cmd_umount, 2, 2, "<dir-path>" },
# endif
@ -568,8 +552,8 @@ static const struct cmdmap_s g_cmdmap[] =
# endif
#endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \
defined(CONFIG_NSH_LOGIN_PASSWD) && \
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && \
defined(CONFIG_NSH_LOGIN_PASSWD) && \
!defined(CONFIG_FSUTILS_PASSWD_READONLY)
# ifndef CONFIG_NSH_DISABLE_USERADD
{ "useradd", cmd_useradd, 3, 3, "<username> <password>" },

View File

@ -1,36 +1,20 @@
/****************************************************************************
* apps/nshlib/nsh_fscmds.c
*
* Copyright (C) 2007-2009, 2011-2014, 2017-2019 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -57,11 +41,9 @@
#include <debug.h>
#if !defined(CONFIG_DISABLE_MOUNTPOINT)
# ifdef CONFIG_FS_READABLE /* Need at least one filesystem in configuration */
# include <sys/mount.h>
# include <sys/boardctl.h>
# include <nuttx/drivers/ramdisk.h>
# endif
# include <sys/mount.h>
# include <sys/boardctl.h>
# include <nuttx/drivers/ramdisk.h>
# ifdef CONFIG_DEV_LOOP
# include <sys/ioctl.h>
# include <nuttx/fs/loop.h>

View File

@ -1,35 +1,20 @@
/****************************************************************************
* apps/nshlib/nsh_mntcmds.c
*
* Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -68,8 +53,7 @@
* Name: cmd_df
****************************************************************************/
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE) && \
!defined(CONFIG_NSH_DISABLE_DF)
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && !defined(CONFIG_NSH_DISABLE_DF)
#ifdef NSH_HAVE_CATFILE
int cmd_df(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
@ -99,8 +83,7 @@ int cmd_df(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* Name: cmd_mount
****************************************************************************/
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE) && \
!defined(CONFIG_NSH_DISABLE_MOUNT)
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && !defined(CONFIG_NSH_DISABLE_MOUNT)
int cmd_mount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
FAR const char *source;
@ -376,8 +359,7 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* Name: cmd_umount
****************************************************************************/
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE) && \
!defined(CONFIG_NSH_DISABLE_UMOUNT)
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && !defined(CONFIG_NSH_DISABLE_UMOUNT)
int cmd_umount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
char *fullpath = nsh_getfullpath(vtbl, argv[1]);

View File

@ -1,35 +1,20 @@
/****************************************************************************
* apps/nshlib/nsh_passwdcmds.c
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -44,8 +29,8 @@
#include "nsh.h"
#include "nsh_console.h"
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \
defined(CONFIG_NSH_LOGIN_PASSWD) && \
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && \
defined(CONFIG_NSH_LOGIN_PASSWD) && \
!defined(CONFIG_FSUTILS_PASSWD_READONLY)
/****************************************************************************
@ -115,5 +100,5 @@ int cmd_passwd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
}
#endif /* !CONFIG_NSH_DISABLE_USERADD */
#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_WRITABLE &&
* CONFIG_NSH_LOGIN_PASSWD && !CONFIG_FSUTILS_PASSWD_READONLY */
#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NSH_LOGIN_PASSWD &&
* !CONFIG_FSUTILS_PASSWD_READONLY */

View File

@ -6,7 +6,6 @@
config TESTING_FSTEST
tristate "Generic file system test"
default n
depends on FS_READABLE && FS_WRITABLE
---help---
Enable the generic file system test

View File

@ -35,7 +35,7 @@ config TESTING_OSTEST_NBARRIER_THREADS
config TESTING_OSTEST_AIO
bool "Asynchronous I/O Tests"
default n
depends on FS_AIO && FS_WRITABLE
depends on FS_AIO
---help---
Enables test of asynchronous I/O. You must have a mounted, writable
directory in place to use this test.