summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-10 19:29:24 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-10 19:29:24 +0000
commitbae76fc0b070b5d47d35a44c6a91692957029cf8 (patch)
treeeb3c0fa04693ffd428c362bb714b1fcbe824e08c
parent9dcf38806dd69fade9cdeb1ad0a7b0fce7f72e77 (diff)
downloadpx4-nuttx-bae76fc0b070b5d47d35a44c6a91692957029cf8.tar.gz
px4-nuttx-bae76fc0b070b5d47d35a44c6a91692957029cf8.tar.bz2
px4-nuttx-bae76fc0b070b5d47d35a44c6a91692957029cf8.zip
ROMFS filesystem support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@903 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/ChangeLog1
-rw-r--r--nuttx/Documentation/NuttShell.html32
-rw-r--r--nuttx/Documentation/NuttX.html12
-rw-r--r--nuttx/Documentation/NuttxPortingGuide.html13
-rw-r--r--nuttx/arch/sim/src/up_blockdevice.c2
-rw-r--r--nuttx/configs/ntosd-dm320/nsh/defconfig2
-rw-r--r--nuttx/configs/sim/mount/defconfig2
-rw-r--r--nuttx/configs/sim/nettest/defconfig4
-rw-r--r--nuttx/configs/sim/ostest/defconfig4
-rw-r--r--nuttx/configs/sim/pashello/defconfig4
-rw-r--r--nuttx/drivers/ramdisk.c56
-rw-r--r--nuttx/examples/mount/mount.h3
-rw-r--r--nuttx/examples/mount/ramdisk.c2
-rw-r--r--nuttx/examples/nsh/README.txt28
-rw-r--r--nuttx/examples/nsh/nsh.h16
-rw-r--r--nuttx/examples/nsh/nsh_fscmds.c26
-rw-r--r--nuttx/examples/nsh/nsh_main.c18
-rw-r--r--nuttx/fs/Makefile7
-rw-r--r--nuttx/fs/fs_internal.h30
-rw-r--r--nuttx/fs/fs_mount.c8
-rw-r--r--nuttx/include/nuttx/ramdisk.h13
-rw-r--r--nuttx/tools/mkconfig.c34
22 files changed, 227 insertions, 90 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index ccb4e4e36..eb05614ae 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -463,3 +463,4 @@
random access to large files.
0.3.15 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Add support for ROMFS filesystem (initial checkin untested)
diff --git a/nuttx/Documentation/NuttShell.html b/nuttx/Documentation/NuttShell.html
index bedb624f8..d25d6d8c4 100644
--- a/nuttx/Documentation/NuttShell.html
+++ b/nuttx/Documentation/NuttShell.html
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
- <p>Last Updated: September 5, 2008</p>
+ <p>Last Updated: September 10, 2008</p>
</td>
</tr>
</table>
@@ -1485,7 +1485,7 @@ nsh>
</tr>
<tr>
<td><b><code>cd</code></b></td>
- <td>!<code>CONFIG_DISABLE_ENVIRON</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0</td>
+ <td>!<code>CONFIG_DISABLE_ENVIRON</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0</td>
</tr>
<tr>
<td><b><code>cp</code></b></td>
@@ -1530,11 +1530,11 @@ nsh>
</tr>
<tr>
<td><b><code>mkdir</code></b></td>
- <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0</td>
+ <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 &amp;&amp; <code>CONFIG_FS_WRITABLE</code><sup>4</sup></td>
</tr>
<tr>
<td><b><code>mkfatfs</code></b></td>
- <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 && <code>CONFIG_FS_FAT</code></td>
+ <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 &amp;&amp; <code>CONFIG_FS_FAT</code></td>
</tr>
<tr>
<td><b><code>mkfifo</code></b></td>
@@ -1542,11 +1542,11 @@ nsh>
</tr>
<tr>
<td><b><code>mkrd</code></b></td>
- <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 && <code>CONFIG_FS_FAT</code></td>
+ <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 &amp;&amp; <code>CONFIG_FS_WRITABLE</code><sup>4</sup></td>
</tr>
<tr>
<td><b><code>mount</code></b></td>
- <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> && <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 && <code>CONFIG_FS_FAT</code></td>
+ <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 &amp;&amp; <code>CONFIG_FS_READABLE</code><sup>3</sup></td>
</tr>
<tr>
<td><b><code>ping</code></b></td>
@@ -1569,11 +1569,11 @@ nsh>
</tr>
<tr>
<td><b><code>rm</code></b></td>
- <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0</td>
+ <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 &amp;&amp; <code>CONFIG_FS_WRITABLE</code><sup>4</sup></td>
</tr>
<tr>
<td><b><code>rmdir</code></b></td>
- <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0</td>
+ <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 &amp;&amp; <code>CONFIG_FS_WRITABLE</code><sup>4</sup></td>
</tr>
<tr>
<td><b><code>set</code></b></td>
@@ -1593,7 +1593,7 @@ nsh>
</tr>
<tr>
<td><b><code>umount</code></b></td>
- <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 &amp;&amp; <code>CONFIG_FS_FAT</code></td>
+ <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 &amp;&amp; <code>CONFIG_FS_READABLE</code><sup>3</sup></td>
</tr>
<tr>
<td><b><code>unset</code></b></td>
@@ -1606,10 +1606,18 @@ nsh>
</table></center>
<p><sup>1</sup><small>
- Because of hardware padding, the actual required packet size may be larger</small></p>
-<p><sup>2</sup><small>
+ Because of hardware padding, the actual required packet size may be larger</small><br>
+ <sup>2</sup><small>
Special TFTP server start-up optionss will probably be required to permit
- creation of files for the correct operation of the <code>put</code> command.</small></p>
+ creation of files for the correct operation of the <code>put</code> command.</small><br>
+ <sup>3</sup><small>
+ <code>CONFIG_FS_READABLE</code> is not a user configuration but is set automatically
+ if any readable filesystem is selected. At present, this is either <code>CONFIG_FS_FAT</code>
+ or <code>CONFIG_FS_ROMFS</code>.</small><br>
+ <sup>4</sup><small>
+ <code>CONFIG_FS_WRITABLE</code> is not a user configuration but is set automatically
+ if any writable filesystem is selected. At present, this is only <code>CONFIG_FS_FAT</code>.</small><br>
+</p>
<table width ="100%">
<tr bgcolor="#e4e4e4">
diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index 2e8aa1106..9dc58d909 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/Documentation/NuttX.html
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
- <p>Last Updated: September 8, 2008</p>
+ <p>Last Updated: September 10, 2008</p>
</td>
</tr>
</table>
@@ -379,11 +379,18 @@
<td><br></td>
<td>
<p>
- <li>VFAT filesystem support.</li>
+ <li>FAT12/16/32 filesystem support.</li>
</p>
</tr>
<tr>
+ <td><br></td>
+ <td>
+ <p>
+ <li>ROMFS filesystem support.</li>
+ </p>
+</tr>
+<tr>
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
<td bgcolor="#5eaee1">
<b>C Library</b>
@@ -1090,6 +1097,7 @@ buildroot-0.1.0 2007-03-09 &lt;spudmonkey@racsa.co.cr&gt
<pre><ul>
nuttx-0.3.15 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
+ * Add support for ROMFS filesystem (initial checkin untested)
pascal-0.1.3 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index 2f29e0b01..d9bb8a662 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -1515,6 +1515,19 @@ The system can be re-made subsequently by just typing <code>make</code>.
</li>
</ul>
+<h2>File Systems</h2>
+<ul>
+ <li>
+ <code>CONFIG_FS_FAT</code>: Enable FAT filesystem support.
+ </li>
+ <li>
+ <code>CONFIG_FAT_SECTORSIZE</code>: Max supported sector size.
+ </li>
+ <li>
+ <code>CONFIG_FS_ROMFS</code>: Enable ROMFS filesystem support
+ </li>
+</ul>
+
<h2>Network Support</h2>
<h3>TCP/IP and UDP support via uIP</h2>
<ul>
diff --git a/nuttx/arch/sim/src/up_blockdevice.c b/nuttx/arch/sim/src/up_blockdevice.c
index 1146e4182..d91d121ac 100644
--- a/nuttx/arch/sim/src/up_blockdevice.c
+++ b/nuttx/arch/sim/src/up_blockdevice.c
@@ -83,5 +83,5 @@
void up_registerblockdevice(void)
{
- rd_register(0, (ubyte*)up_deviceimage(), NSECTORS, LOGICAL_SECTOR_SIZE, TRUE);
+ ramdisk_register(0, (ubyte*)up_deviceimage(), NSECTORS, LOGICAL_SECTOR_SIZE, TRUE);
}
diff --git a/nuttx/configs/ntosd-dm320/nsh/defconfig b/nuttx/configs/ntosd-dm320/nsh/defconfig
index f8e1d831d..737135103 100644
--- a/nuttx/configs/ntosd-dm320/nsh/defconfig
+++ b/nuttx/configs/ntosd-dm320/nsh/defconfig
@@ -253,7 +253,9 @@ CONFIG_PREALLOC_TIMERS=8
# FAT filesystem configuration
# CONFIG_FS_FAT - Enable FAT filesystem support
# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
CONFIG_FS_FAT=n
+CONFIG_FS_ROMFS=n
#
# TCP/IP and UDP support via uIP
diff --git a/nuttx/configs/sim/mount/defconfig b/nuttx/configs/sim/mount/defconfig
index 979615652..16b7cd741 100644
--- a/nuttx/configs/sim/mount/defconfig
+++ b/nuttx/configs/sim/mount/defconfig
@@ -208,7 +208,9 @@ CONFIG_PREALLOC_TIMERS=8
# FAT filesystem configuration
# CONFIG_FS_FAT - Enable FAT filesystem support
# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
CONFIG_FS_FAT=y
+CONFIG_FS_ROMFS=n
#
# TCP/IP and UDP support via uIP
diff --git a/nuttx/configs/sim/nettest/defconfig b/nuttx/configs/sim/nettest/defconfig
index 73b2ae3f8..e774a6713 100644
--- a/nuttx/configs/sim/nettest/defconfig
+++ b/nuttx/configs/sim/nettest/defconfig
@@ -1,5 +1,5 @@
############################################################################
-# sim/nettest/defconfig
+# configs/sim/nettest/defconfig
#
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -208,7 +208,9 @@ CONFIG_PREALLOC_TIMERS=8
# FAT filesystem configuration
# CONFIG_FS_FAT - Enable FAT filesystem support
# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
CONFIG_FS_FAT=y
+CONFIG_FS_ROMFS=n
#
# TCP/IP and UDP support via uIP
diff --git a/nuttx/configs/sim/ostest/defconfig b/nuttx/configs/sim/ostest/defconfig
index 7acf0ef78..66def7eec 100644
--- a/nuttx/configs/sim/ostest/defconfig
+++ b/nuttx/configs/sim/ostest/defconfig
@@ -1,5 +1,5 @@
############################################################################
-# sim/defconfig
+# configs/sim/ostest/defconfig
#
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -209,7 +209,9 @@ CONFIG_PREALLOC_TIMERS=8
# FAT filesystem configuration
# CONFIG_FS_FAT - Enable FAT filesystem support
# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
CONFIG_FS_FAT=y
+CONFIG_FS_ROMFS=n
#
# TCP/IP and UDP support via uIP
diff --git a/nuttx/configs/sim/pashello/defconfig b/nuttx/configs/sim/pashello/defconfig
index 5c694d5b5..3f0ac8bd6 100644
--- a/nuttx/configs/sim/pashello/defconfig
+++ b/nuttx/configs/sim/pashello/defconfig
@@ -1,5 +1,5 @@
############################################################################
-# configs/sim/defconfig
+# configs/sim/pashello/defconfig
#
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -208,7 +208,9 @@ CONFIG_PREALLOC_TIMERS=8
# FAT filesystem configuration
# CONFIG_FS_FAT - Enable FAT filesystem support
# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
CONFIG_FS_FAT=y
+CONFIG_FS_ROMFS=n
#
# TCP/IP and UDP support via uIP
diff --git a/nuttx/drivers/ramdisk.c b/nuttx/drivers/ramdisk.c
index 48c969030..3f261943e 100644
--- a/nuttx/drivers/ramdisk.c
+++ b/nuttx/drivers/ramdisk.c
@@ -59,10 +59,14 @@
struct rd_struct_s
{
- uint32 rd_nsectors; /* Number of sectors on device */
- uint16 rd_sectsize; /* The size of one sector */
- boolean rd_writeenabled; /* TRUE: can write to ram disk */
- ubyte *rd_buffer; /* RAM disk backup memory */
+ uint32 rd_nsectors; /* Number of sectors on device */
+ uint16 rd_sectsize; /* The size of one sector */
+#ifdef CONFIG_FS_WRITABLE
+ boolean rd_writeenabled; /* TRUE: can write to ram disk */
+ ubyte *rd_buffer; /* RAM disk backup memory */
+#else
+ const ubyte *rd_buffer; /* ROM disk backup memory */
+#endif
};
/****************************************************************************
@@ -73,8 +77,10 @@ static int rd_open(FAR struct inode *inode);
static int rd_close(FAR struct inode *inode);
static ssize_t rd_read(FAR struct inode *inode, unsigned char *buffer,
size_t start_sector, unsigned int nsectors);
+#ifdef CONFIG_FS_WRITABLE
static ssize_t rd_write(FAR struct inode *inode, const unsigned char *buffer,
size_t start_sector, unsigned int nsectors);
+#endif
static int rd_geometry(FAR struct inode *inode, struct geometry *geometry);
/****************************************************************************
@@ -86,7 +92,11 @@ static const struct block_operations g_bops =
rd_open, /* open */
rd_close, /* close */
rd_read, /* read */
+#ifdef CONFIG_FS_WRITABLE
rd_write, /* write */
+#else
+ NULL, /* write */
+#endif
rd_geometry, /* geometry */
NULL /* ioctl */
};
@@ -153,6 +163,7 @@ static ssize_t rd_read(FAR struct inode *inode, unsigned char *buffer,
*
****************************************************************************/
+#ifdef CONFIG_FS_WRITABLE
static ssize_t rd_write(FAR struct inode *inode, const unsigned char *buffer,
size_t start_sector, unsigned int nsectors)
{
@@ -160,18 +171,25 @@ static ssize_t rd_write(FAR struct inode *inode, const unsigned char *buffer,
if (inode)
{
dev = (struct rd_struct_s *)inode->i_private;
- if (dev &&
- start_sector < dev->rd_nsectors &&
- start_sector + nsectors <= dev->rd_nsectors)
+ if (dev)
{
- memcpy(&dev->rd_buffer[start_sector * dev->rd_sectsize],
- buffer,
- nsectors * dev->rd_sectsize);
- return nsectors;
+ if (!dev->rd_writeenabled)
+ {
+ return -EACCES;
+ }
+ else if (start_sector < dev->rd_nsectors &&
+ start_sector + nsectors <= dev->rd_nsectors)
+ {
+ memcpy(&dev->rd_buffer[start_sector * dev->rd_sectsize],
+ buffer,
+ nsectors * dev->rd_sectsize);
+ return nsectors;
+ }
}
}
return -EINVAL;
}
+#endif
/****************************************************************************
* Name: rd_geometry
@@ -188,7 +206,11 @@ static int rd_geometry(FAR struct inode *inode, struct geometry *geometry)
dev = (struct rd_struct_s *)inode->i_private;
geometry->geo_available = TRUE;
geometry->geo_mediachanged = FALSE;
+#ifdef CONFIG_FS_WRITABLE
geometry->geo_writeenabled = dev->rd_writeenabled;
+#else
+ geometry->geo_writeenabled = FALSE;
+#endif
geometry->geo_nsectors = dev->rd_nsectors;
geometry->geo_sectorsize = dev->rd_sectsize;
return OK;
@@ -201,14 +223,18 @@ static int rd_geometry(FAR struct inode *inode, struct geometry *geometry)
****************************************************************************/
/****************************************************************************
- * Name: rd_register
+ * Name: ramdisk_register
*
* Description: Register the a ramdisk
****************************************************************************/
-int rd_register(int minor, ubyte *buffer, uint32 nsectors, uint16 sectsize,
- boolean writeenabled)
+#ifdef CONFIG_FS_WRITABLE
+int ramdisk_register(int minor, ubyte *buffer, uint32 nsectors, uint16 sectsize,
+ boolean writeenabled)
+#else
+int romdisk_register(int minor, ubyte *buffer, uint32 nsectors, uint16 sectsize)
+#endif
{
struct rd_struct_s *dev;
char devname[16];
@@ -232,7 +258,9 @@ int rd_register(int minor, ubyte *buffer, uint32 nsectors, uint16 sectsize,
dev->rd_nsectors = nsectors; /* Number of sectors on device */
dev->rd_sectsize = sectsize; /* The size of one sector */
+#ifdef CONFIG_FS_WRITABLE
dev->rd_writeenabled = writeenabled; /* TRUE: can write to ram disk */
+#endif
dev->rd_buffer = buffer; /* RAM disk backup memory */
/* Create a ramdisk device name */
diff --git a/nuttx/examples/mount/mount.h b/nuttx/examples/mount/mount.h
index 5a2ab61cd..68a03674d 100644
--- a/nuttx/examples/mount/mount.h
+++ b/nuttx/examples/mount/mount.h
@@ -49,6 +49,9 @@
/* 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
diff --git a/nuttx/examples/mount/ramdisk.c b/nuttx/examples/mount/ramdisk.c
index 905c56492..ca3846053 100644
--- a/nuttx/examples/mount/ramdisk.c
+++ b/nuttx/examples/mount/ramdisk.c
@@ -112,7 +112,7 @@ int create_ramdisk(void)
/* Register a RAMDISK device to manage this RAM image */
- ret = rd_register(CONFIG_EXAMPLES_MOUNT_RAMDEVNO,
+ ret = ramdisk_register(CONFIG_EXAMPLES_MOUNT_RAMDEVNO,
pbuffer,
CONFIG_EXAMPLES_MOUNT_NSECTORS,
CONFIG_EXAMPLES_MOUNT_SECTORSIZE,
diff --git a/nuttx/examples/nsh/README.txt b/nuttx/examples/nsh/README.txt
index 69187f1a3..31ec155cd 100644
--- a/nuttx/examples/nsh/README.txt
+++ b/nuttx/examples/nsh/README.txt
@@ -589,36 +589,42 @@ Command Dependencies on Configuration Settings
echo --
exec --
exit --
- get CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_BUFSIZE >= 558*
+ get CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_BUFSIZE >= 558 (see note 1)
help --
ifconfig CONFIG_NET
ls CONFIG_NFILE_DESCRIPTORS > 0
mb,mh,mw ---
mem ---
- mkdir !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0
+ mkdir !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_WRITABLE (see note 4)
mkfatfs !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_FAT
mkfifo CONFIG_NFILE_DESCRIPTORS > 0
- mkrd !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_FAT
- mount !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_FAT
+ mkrd !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_WRITABLE (see note 4)
+ mount !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_READABLE (see note 3)
ping CONFIG_NET && CONFIG_NET_ICMP && CONFIG_NET_ICMP_PING && !CONFIG_DISABLE_CLOCK && !CONFIG_DISABLE_SIGNALS
ps --
- put CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_BUFSIZE >= 558*
+ put CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_BUFSIZE >= 558 (see note 1,2)
pwd !CONFIG_DISABLE_ENVIRON && CONFIG_NFILE_DESCRIPTORS > 0
- rm !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0
- rmdir !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0
+ rm !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_WRITABLE (see note 4)
+ rmdir !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_WRITABLE (see note 4)
set !CONFIG_DISABLE_ENVIRON
sh CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0 && !CONFIG_EXAMPLES_NSH_DISABLESCRIPT
sleep !CONFIG_DISABLE_SIGNALS
test !CONFIG_EXAMPLES_NSH_DISABLESCRIPT
- umount !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_FAT
+ umount !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_FS_READABLE
unset !CONFIG_DISABLE_ENVIRON
usleep !CONFIG_DISABLE_SIGNALS
xd ---
* NOTES:
- - Because of hardware padding, the actual required size may be larger.
- - Special TFTP server start-up optionss will probably be required to permit
- creation of file for the correct operation of the put command.
+ 1. Because of hardware padding, the actual required for put and get
+ operations size may be larger.
+ 2. Special TFTP server start-up optionss 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 filesystem is selected. At present, this is either CONFIG_FS_FAT
+ and CONFIG_FS_ROMFS.
+ 4. CONFIG_FS_WRITABLE is not a user configuration but is set automatically
+ if any writable filesystem is selected. At present, this is only CONFIG_FS_FAT.
NSH-Specific Configuration Settings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/nuttx/examples/nsh/nsh.h b/nuttx/examples/nsh/nsh.h
index d8d18a72a..e35084ead 100644
--- a/nuttx/examples/nsh/nsh.h
+++ b/nuttx/examples/nsh/nsh.h
@@ -288,15 +288,19 @@ extern int cmd_lbracket(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
extern int cmd_sh(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif /* CONFIG_NFILE_STREAMS && !CONFIG_EXAMPLES_NSH_DISABLESCRIPT */
# ifndef CONFIG_DISABLE_MOUNTPOINT
- extern int cmd_mkdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
extern int cmd_mkfifo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
- extern int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
- extern int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
- extern int cmd_rmdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
-# ifdef CONFIG_FS_FAT
- extern int cmd_mkfatfs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
+# ifdef CONFIG_FS_READABLE
extern int cmd_mount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
extern int cmd_umount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
+# ifdef CONFIG_FS_WRITABLE
+ extern int cmd_mkdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
+ extern int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
+ extern int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
+ extern int cmd_rmdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
+# endif /* CONFIG_FS_WRITABLE */
+# endif /* CONFIG_FS_READABLE */
+# ifdef CONFIG_FS_FAT
+ extern int cmd_mkfatfs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif /* CONFIG_FS_FAT */
# endif /* !CONFIG_DISABLE_MOUNTPOINT */
# if !defined(CONFIG_DISABLE_ENVIRON)
diff --git a/nuttx/examples/nsh/nsh_fscmds.c b/nuttx/examples/nsh/nsh_fscmds.c
index 43ef483a6..d38d9b720 100644
--- a/nuttx/examples/nsh/nsh_fscmds.c
+++ b/nuttx/examples/nsh/nsh_fscmds.c
@@ -44,11 +44,13 @@
# include <sys/stat.h>
# include <fcntl.h>
# if !defined(CONFIG_DISABLE_MOUNTPOINT)
-# ifdef CONFIG_FS_FAT /* Need at least one filesytem in configuration */
+# ifdef CONFIG_FS_READABLE /* Need at least one filesytem in configuration */
# include <sys/mount.h>
+# include <nuttx/ramdisk.h>
+# endif
+# ifdef CONFIG_FS_FAT
# include <nuttx/mkfatfs.h>
# endif
-# include <nuttx/ramdisk.h>
#endif
#endif
@@ -711,7 +713,7 @@ int cmd_ls(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* Name: cmd_mkdir
****************************************************************************/
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE)
int cmd_mkdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
char *fullpath = nsh_getfullpath(vtbl, argv[1]);
@@ -781,7 +783,7 @@ int cmd_mkfifo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* Name: cmd_mkrd
****************************************************************************/
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE)
int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
const char *fmt;
@@ -860,10 +862,10 @@ int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Then register the ramdisk */
- ret = rd_register(minor, buffer, nsectors, sectsize, TRUE);
+ ret = ramdisk_register(minor, buffer, nsectors, sectsize, TRUE);
if (ret < 0)
{
- nsh_output(vtbl, g_fmtcmdfailed, argv[0], "rd_register", NSH_ERRNO_OF(-ret));
+ nsh_output(vtbl, g_fmtcmdfailed, argv[0], "ramdisk_register", NSH_ERRNO_OF(-ret));
free(buffer);
return ERROR;
}
@@ -879,8 +881,7 @@ errout_with_fmt:
* Name: cmd_mount
****************************************************************************/
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
-#ifdef CONFIG_FS_FAT /* Need at least one filesytem in configuration */
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_READABLE)
int cmd_mount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
char *source;
@@ -953,13 +954,12 @@ int cmd_mount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
return ret;
}
#endif
-#endif
/****************************************************************************
* Name: cmd_rm
****************************************************************************/
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE)
int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
char *fullpath = nsh_getfullpath(vtbl, argv[1]);
@@ -982,7 +982,7 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* Name: cmd_rmdir
****************************************************************************/
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE)
int cmd_rmdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
char *fullpath = nsh_getfullpath(vtbl, argv[1]);
@@ -1070,8 +1070,7 @@ int cmd_sh(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* Name: cmd_umount
****************************************************************************/
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
-#ifdef CONFIG_FS_FAT /* Need at least one filesytem in configuration */
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_READABLE)
int cmd_umount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
char *fullpath = nsh_getfullpath(vtbl, argv[1]);
@@ -1091,4 +1090,3 @@ int cmd_umount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
return ret;
}
#endif
-#endif
diff --git a/nuttx/examples/nsh/nsh_main.c b/nuttx/examples/nsh/nsh_main.c
index 68de85285..c893d2902 100644
--- a/nuttx/examples/nsh/nsh_main.c
+++ b/nuttx/examples/nsh/nsh_main.c
@@ -157,20 +157,22 @@ static const struct cmdmap_s g_cmdmap[] =
#endif
{ "mb", cmd_mb, 2, 3, "<hex-address>[=<hex-value>][ <hex-byte-count>]" },
{ "mem", cmd_mem, 1, 1, NULL },
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE)
{ "mkdir", cmd_mkdir, 2, 2, "<path>" },
-#ifdef CONFIG_FS_FAT
+#endif
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_FAT)
{ "mkfatfs", cmd_mkfatfs, 2, 2, "<path>" },
#endif
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
{ "mkfifo", cmd_mkfifo, 2, 2, "<path>" },
+#endif
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE)
{ "mkrd", cmd_mkrd, 2, 6, "[-m <minor>] [-s <sector-size>] <nsectors>" },
#endif
{ "mh", cmd_mh, 2, 3, "<hex-address>[=<hex-value>][ <hex-byte-count>]" },
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
-#ifdef CONFIG_FS_FAT /* Need at least one filesytem in configuration */
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_READABLE)
{ "mount", cmd_mount, 4, 5, "-t <fstype> <block-device> <dir-path>" },
#endif
-#endif
{ "mw", cmd_mw, 2, 3, "<hex-address>[=<hex-value>][ <hex-byte-count>]" },
{ "ps", cmd_ps, 1, 1, NULL },
#if defined(CONFIG_NET) && defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING) && \
@@ -183,7 +185,7 @@ static const struct cmdmap_s g_cmdmap[] =
#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON)
{ "pwd", cmd_pwd, 1, 1, NULL },
#endif
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE)
{ "rm", cmd_rm, 2, 2, "<file-path>" },
{ "rmdir", cmd_rmdir, 2, 2, "<dir-path>" },
#endif
@@ -199,10 +201,8 @@ static const struct cmdmap_s g_cmdmap[] =
#ifndef CONFIG_EXAMPLES_NSH_DISABLESCRIPT
{ "test", cmd_test, 3, NSH_MAX_ARGUMENTS, "<expression>" },
#endif
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
-# ifdef CONFIG_FS_FAT /* Need at least one filesytem in configuration */
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_READABLE)
{ "umount", cmd_umount, 2, 2, "<dir-path>" },
-# endif
#endif
#ifndef CONFIG_DISABLE_ENVIRON
{ "unset", cmd_unset, 2, 2, "<name>" },
diff --git a/nuttx/fs/Makefile b/nuttx/fs/Makefile
index 14a618803..0d08c84ab 100644
--- a/nuttx/fs/Makefile
+++ b/nuttx/fs/Makefile
@@ -57,6 +57,7 @@ CSRCS += fs_registerblockdriver.c fs_unregisterblockdriver.c \
fs_fsync.c fs_unlink.c fs_rename.c \
fs_mkdir.c fs_rmdir.c
include fat/Make.defs
+include romfs/Make.defs
endif
endif
@@ -67,8 +68,8 @@ OBJS = $(AOBJS) $(COBJS)
BIN = libfs$(LIBEXT)
-SUBDIRS = fat
-VPATH = fat
+SUBDIRS = fat romfs
+VPATH = fat:romfs
all: $(BIN)
@@ -84,7 +85,7 @@ $(BIN): $(OBJS)
done ; )
.depend: Makefile $(SRCS)
- @$(MKDEP) --dep-path . --dep-path fat $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
+ @$(MKDEP) --dep-path . --dep-path fat --dep-path romfs $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
depend: .depend
diff --git a/nuttx/fs/fs_internal.h b/nuttx/fs/fs_internal.h
index c09716943..3ebf3f210 100644
--- a/nuttx/fs/fs_internal.h
+++ b/nuttx/fs/fs_internal.h
@@ -94,19 +94,34 @@ struct fs_psuedodir_s
struct inode *fd_next; /* The inode for the next call to readdir() */
};
-#if defined(CONFIG_FS_FAT) && !defined(CONFIG_DISABLE_MOUNTPOINT)
-/* For fat, we need to retun the start cluster, current cluster, current
+#ifndef CONFIG_DISABLE_MOUNTPOINT
+#ifdef CONFIG_FS_FAT
+/* For fat, we need to return the start cluster, current cluster, current
* sector and current directory index.
*/
struct fs_fatdir_s
{
- uint32 fd_startcluster; /* Start cluster number of the directory*/
- uint32 fd_currcluster; /* Current cluster number being read*/
- size_t fd_currsector; /* Current sector being read*/
+ uint32 fd_startcluster; /* Start cluster number of the directory */
+ uint32 fd_currcluster; /* Current cluster number being read */
+ size_t fd_currsector; /* Current sector being read */
unsigned int fd_index; /* Current index of the directory entry to read */
};
-#endif
+#endif /* CONFIG_FS_FAT */
+
+#ifdef CONFIG_FS_ROMFS
+/* For ROMFS, we need to return the offset to the current and start positions
+ * of the directory entry being read
+ */
+
+struct fs_romfsdir_s
+{
+ uint32 fr_diroffset; /* Offset to the directory entry */
+ uint32 fr_firstoffset; /* Offset to the first entry */
+ uint32 fr_curroffset; /* Current offset into the directory contents */
+};
+#endif /* CONFIG_FS_ROMFS */
+#endif /* CONFIG_DISABLE_MOUNTPOINT */
struct internal_dir_s
{
@@ -148,6 +163,9 @@ struct internal_dir_s
#ifdef CONFIG_FS_FAT
struct fs_fatdir_s fat;
#endif
+#ifdef CONFIG_FS_ROMFS
+ struct fs_romfsdir_s romfs;
+#endif
#endif
} u;
diff --git a/nuttx/fs/fs_mount.c b/nuttx/fs/fs_mount.c
index 0de22ac5a..d0806ba7d 100644
--- a/nuttx/fs/fs_mount.c
+++ b/nuttx/fs/fs_mount.c
@@ -53,7 +53,7 @@
* every configured filesystem.
*/
-#ifdef CONFIG_FS_FAT
+#ifdef CONFIG_FS_READABLE
/****************************************************************************
* Definitions
@@ -76,12 +76,18 @@ struct fsmap_t
#ifdef CONFIG_FS_FAT
extern const struct mountpt_operations fat_operations;
#endif
+#ifdef CONFIG_FS_ROMFS
+extern const struct mountpt_operations romfs_operations;
+#endif
static const struct fsmap_t g_fsmap[] =
{
#ifdef CONFIG_FS_FAT
{ "vfat", &fat_operations },
#endif
+#ifdef CONFIG_FS_ROMFS
+ { "romfs", &romfs_operations },
+#endif
{ NULL, NULL },
};
diff --git a/nuttx/include/nuttx/ramdisk.h b/nuttx/include/nuttx/ramdisk.h
index 839855633..0e34db960 100644
--- a/nuttx/include/nuttx/ramdisk.h
+++ b/nuttx/include/nuttx/ramdisk.h
@@ -40,6 +40,7 @@
* Included Files
****************************************************************************/
+#include <nuttx/config.h>
#include <sys/types.h>
/****************************************************************************
@@ -62,7 +63,7 @@ extern "C" {
#define EXTERN extern
#endif
-/* Non-standard function to register a ramdisk
+/* Non-standard function to register a ramdisk or a romdisk
*
* minor: Selects suffix of device named /dev/ramN, N={1,2,3...}
* nsectors: Number of sectors on device
@@ -71,8 +72,14 @@ extern "C" {
* buffer: RAM disk backup memory
*/
-EXTERN int rd_register(int minor, ubyte *buffer, uint32 nsectors,
- uint16 sectize, boolean writeenabled);
+#ifdef CONFIG_FS_WRITABLE
+EXTERN int ramdisk_register(int minor, ubyte *buffer, uint32 nsectors,
+ uint16 sectize, boolean writeenabled);
+#define romdisk_register(m,b,n,s) ramdisk_register(m,b,n,s,0)
+#else
+EXTERN int romdisk_register(int minor, ubyte *buffer, uint32 nsectors,
+ uint16 sectize);
+#endif
#undef EXTERN
#ifdef __cplusplus
diff --git a/nuttx/tools/mkconfig.c b/nuttx/tools/mkconfig.c
index c1653f308..695b45298 100644
--- a/nuttx/tools/mkconfig.c
+++ b/nuttx/tools/mkconfig.c
@@ -1,7 +1,7 @@
-/************************************************************
+/****************************************************************************
* mkconfig.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 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.
*
@@ -31,7 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
@@ -41,9 +45,17 @@
#include <unistd.h>
#include <errno.h>
+/****************************************************************************
+ * Definitions
+ ****************************************************************************/
+
#define DEFCONFIG ".config"
#define LINESIZE ( PATH_MAX > 256 ? PATH_MAX : 256 )
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
static char line[LINESIZE+1];
static char *skip_space(char *ptr)
@@ -167,6 +179,10 @@ static void show_usage(const char *progname)
exit(1);
}
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
int main(int argc, char **argv, char **envp)
{
char *filepath;
@@ -245,6 +261,16 @@ int main(int argc, char **argv, char **envp)
printf("/* If mountpoint support in not included, then no filesystem can be supported */\n\n");
printf("#ifdef CONFIG_DISABLE_MOUNTPOINT\n");
printf("# undef CONFIG_FS_FAT\n");
+ printf("# undef CONFIG_FS_ROMFS\n");
+ printf("#endif\n\n");
+ printf("/* Check if any readable and writable filesystem is supported */\n\n");
+ printf("#undef CONFIG_FS_READABLE\n");
+ printf("#undef CONFIG_FS_WRITABLE\n");
+ printf("#if defined(CONFIG_FS_FAT) || defined(CONFIG_FS_ROMFS)\n");
+ printf("# define CONFIG_FS_READABLE 1\n");
+ printf("#endif\n\n");
+ printf("#if defined(CONFIG_FS_FAT)\n");
+ printf("# define CONFIG_FS_WRITABLE 1\n");
printf("#endif\n\n");
printf("/* There can be no network support with no socket descriptors */\n\n");
printf("#if CONFIG_NSOCKET_DESCRIPTORS <= 0\n");