diff --git a/Documentation/NuttShell.html b/Documentation/NuttShell.html index d25d6d8c437..c017d6eca83 100644 --- a/Documentation/NuttShell.html +++ b/Documentation/NuttShell.html @@ -67,6 +67,12 @@ 1.6 Environment Variables +
+ 1.7 NSH Start-Up Scrip+ |
+
+ NSH Start-Up Script.
+ NSH supports options to provide a start up script for NSH. In general
+ this capability is enabled with CONFIG_EXAMPLES_NSH_ROMFSETC, but has
+ several other related configuration options as described with the
+ NSH-specific configuration settings.
+ This capability also depends on:
+
CONFIG_DISABLE_MOUNTPOINT not set
+ CONFIG_NFILE_DESCRIPTORS < 4
+ CONFIG_FS_ROMFS enabled
+ + Default Start-Up Behavior. + The implementation that is provided is intended to provide great flexibility + for the use of Start-Up files. This paragraph will discuss the general + behavior when all of the configuration options are set to the default + values. +
+
+ In this default case, enabling CONFIG_EXAMPLES_NSH_ROMFSETC will cause
+ NSH to behave as follows at NSH startup time:
+
+`--init.d/ + `-- rcS +
/etc, resulting in:
++|--dev/ +| `-- ram0 +`--etc/ + `--init.d/ + `-- rcS ++
+# Create a RAMDISK and mount it at XXXRDMOUNTPOUNTXXX + +mkrd -m 1 -s 512 1024 +mkfatfs /dev/ram1 +mount -t vfat /dev/ram1 /tmp ++
/etc/init.d/rcS at start-up (before the
+ first NSH prompt. After execution of the script, the root FS will look
+ like:
++|--dev/ +| |-- ram0 +| `-- ram1 +|--etc/ +| `--init.d/ +| `-- rcS +`--tmp/ ++
+ Modifying the ROMFS Image.
+ The contents of the /etc directory are retained in the file
+ examples/nsh/nsh_romfsimg.h. In order to modify the start-up
+ behavior, there are three things to study:
+
CONFIG_EXAMPLES_NSH_ROMFSETC configuration options
+ discussed with the other NSH-specific configuration settings.
+
+ mkromfsimg.sh Script.
+ The script examples/nsh/mkromfsimg.sh creates nsh_romfsimg.h.
+ It is not automatically executed. If you want to change the
+ configuration settings associated with creating and mounting
+ the /tmp directory, then it will be necessary to re-generate
+ this header file using the mkromfsimg.sh script.
+
+ The behavior of this script depends upon three things: +
genromfs tool (available from http://romfs.sourceforge.net).
+ - The file
examples/nsh/rcS.template.
+ rcS.template.
+ The file examples/nsh/rcS.template contains the general form
+ of the rcS file; configurated values are plugged into this
+ template file to produce the final rcS file.
+
+ All of the startup-behavior is contained in rcS.template. The
+ role of mkromfsimg.sh is to (1) apply the specific configuration
+ settings to rcS.template to create the final rcS, and (2) to
+ generate the header file nsh_romfsimg.h containg the ROMFS
+ file system image.
+
| @@ -1641,7 +1770,7 @@ nsh> | CONFIG_EXAMPLES_NSH_FILEIOSIZE |
Size of a static I/O buffer used for file access (ignored if - there is no filesystem). + there is no filesystem). Default is 1024. | |
CONFIG_EXAMPLES_NSH_ROMFSETC |
+
+ Mount a ROMFS filesystem at /etc and provide a startup script
+ at /etc/init.d/rcS. The default startup script will mount
+ a FAT FS RAMDISK at /tmp but the logic is
+ easily extensible.
+ |
+ ||
CONFIG_EXAMPLES_NSH_CONSOLE |
@@ -1720,6 +1858,7 @@ nsh> | Configuration | Description |
|---|---|---|---|
CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE |
Determines the size of the I/O buffer to use for sending/ @@ -1760,6 +1899,76 @@ nsh> |
+ If CONFIG_EXAMPLES_NSH_ROMFSETC is selected, then the following additional
+ configuration setting apply:
+
| Configuration | +Description | +
|---|---|
CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT |
+
+ The default mountpoint for the ROMFS volume is "/etc", but that
+ can be changed with this setting. This must be a absolute path
+ beginning with '/' and enclosed in quotes.
+ |
+
CONFIG_EXAMPLES_NSH_INITSCRIPT |
+
+ This is the relative path to the startup script within the mountpoint.
+ The default is "init.d/rcS". This is a relative path and must not
+ start with '/' but must be enclosed in quotes.
+ |
+
CONFIG_EXAMPLES_NSH_ROMFSDEVNO |
+
+ This is the minor number of the ROMFS block device. The default is
+ '0' corresponding to /dev/ram0.
+ |
+
CONFIG_EXAMPLES_NSH_ROMFSSECTSIZE |
+ + This is the sector size to use with the ROMFS volume. Since the + default volume is very small, this defaults to 64 but should be + increased if the ROMFS volume were to be become large. Any value + selected must be a power of 2. + | +
+ When the default rcS file used when CONFIG_EXAMPLES_NSH_ROMFSETC is
+ selected, it will mount a FAT FS under /tmp. The following selections
+ describe that FAT FS.
+
| Configuration | +Description | +
|---|---|
CONFIG_EXAMPLES_NSH_FATDEVNO |
+
+ This is the minor number of the FAT FS block device. The default is
+ '1' corresponding to /dev/ram1.
+ |
+
CONFIG_EXAMPLES_NSH_FATSECTSIZE |
+ + This is the sector size use with the FAT FS. Default is 512. + | +