]>
Commit | Line | Data |
---|---|---|
330345c2 | 1 | .TH NASH 8 "Mon Aug 02 2004" |
cd1a2927 MT |
2 | .SH NAME |
3 | nash \- script interpretor to interpret linuxrc images | |
4 | .SH SYNOPSIS | |
5 | \fBnash\fR [--quiet] [--force] \fIscript\fR | |
6 | ||
7 | .SH DESCRIPTION | |
8 | \fBnash\fR is a very simple script interpretor designed to be as small as | |
9 | possible. It is primarily designed to run simple linuxrc scripts on an initrd | |
10 | image. Arguments to commands may be enclosed in either single or double | |
11 | quotes to allow spaces to be included in the arguments. Spaces outside of | |
12 | quotations always delineate arguments, and so backslash escaping is supported. | |
13 | ||
14 | Additionally, if nash is invoked as \fBmodprobe\fR, it will immediately | |
15 | exit with a return code of zero. This is to allow initrd's to prevent some | |
16 | extraneous kernel error messages during startup. | |
17 | ||
18 | There are two types of commands, built in and external. External commands | |
19 | are run from the filesystem via execve(). If commands names are given without | |
20 | a path, nash will search it's builtin PATH, which is /usr/bin, /bin, | |
21 | /sbin, /usr/sbin. | |
22 | ||
23 | Currently, \fBnash\fR supports the following built in commands. | |
24 | ||
25 | .TP | |
26 | \fBaccess -[r][w][x][f] \fIpath\fR | |
27 | Tells whether the current user has sufficient permissions to read, write, or | |
28 | execture \fIpath\fR, or if the file exists (see \fBaccess(2)\fR for more | |
29 | information). | |
30 | ||
31 | .TP | |
32 | \fBecho [item]* [> \fIfilename\fR]\fR | |
33 | Echos the text strings given to a file, with a space in between each | |
34 | item. The output may be optionally redirected to a file. | |
35 | ||
36 | \fBexec\fR \fI<command>\fR | |
37 | The command given is execed, overlaying the nash process. | |
38 | ||
39 | .TP | |
40 | \fBfind \fIdir\fR -name \fIname\fR | |
41 | Display the path to files named \fIname\fR in or below directory \fIdir\FR. | |
42 | This is a \fBvery\fR limited implementation of find(1). | |
43 | ||
44 | .TP | |
45 | \fBfindlodev\fR | |
46 | Prints the full path to the first unused loopback block device on the | |
47 | system. If none is available, no output is displayed. | |
48 | ||
49 | .TP | |
50 | \fBlosetup \fI/dev/loopdev\fR \fIfile\fR | |
51 | Binds \fIfile\fR to the loopback device \fI/dev/loopdev\fR. See | |
52 | \fBlosetup(8)\fR for information on loopback devices. | |
53 | ||
54 | .TP | |
55 | \fBmkdevices\fR \fIpath\fR | |
56 | Creates device files for all of the block devices listed in | |
57 | \fB/proc/partitions\fR in the directory specfied by \fIpath\fR. | |
58 | ||
59 | .TP | |
60 | \fBmkdir\fR \fI[-p]\fR \fIpath\fR | |
61 | Creates the directory \fIpath\fR. If \fI-p\fR is specified, this command | |
62 | will not complain if the directory exists. Note this is a subset of the | |
63 | standard \fBmkdir\fR \fI-p\fR behavior. | |
64 | ||
65 | .TP | |
66 | \fBmknod\fR \fIpath\fR \fI[c|b]\fR \fImajor\fR \fIminor\fR | |
67 | Creates a device inode for \fIpath\fR. This is identical to \fBmkdev\fR(1) | |
68 | which the exceptions that it will not create named pipes and if the directories | |
69 | in \fIpath\fR do not exist they will be automatically created. | |
70 | ||
330345c2 MT |
71 | .TP |
72 | \fBmkdmnod\fR | |
73 | Creates a device inode for the device mapper control inode as | |
74 | \fI/dev/mapper/control\fR. If it already exists with the correct | |
75 | major/minor, it will not be recreated. | |
76 | ||
cd1a2927 MT |
77 | .TP |
78 | \fBmkrootdev \fIpath\fR | |
79 | Makes \fIpath\fR a block inode for the device which should be mounted | |
80 | as root. To determine this device nash uses | |
81 | the device suggested by the root= kernel command line argument (if | |
82 | root=LABEL is used devices are probed to find one with that label). If | |
83 | no root= argument is available, /proc/sys/kernel/real-root-dev provides | |
84 | the device number. | |
85 | ||
86 | .TP | |
87 | \fBmount \fI[--ro]\fR -o \fIopts\fR -t \fItype\fR \fIdevice\fR \fImntpoint\fR | |
88 | Mounts a filesystem. It does not support NFS, and it must be used in | |
89 | the form given above (arguments must go first). If \fIdevice\fR is of the form | |
90 | \fBLABEL=\fIfoo\fR the devices listed in /fB/proc/partitions\fR will | |
91 | be searched, and the first device with a volume label of \fIfoo\fR will | |
92 | be mounted. Normal \fBmount\fR(2) options are supported, and \fB--ro\fR will | |
93 | mount the filesystem read only for compatibility with older versions of nash. | |
94 | The \fBdefaults\fR mount option is silently ignored. | |
95 | ||
96 | .TP | |
97 | \fBpivot_root \fInewrootpath\fR \fIoldrootpath\fR | |
98 | Makes the filesystem mounted at \fInewrootpath\fR the new root filesystem, | |
99 | and mounts the current root filesystem as \fIoldrootpath\fR. | |
100 | ||
330345c2 MT |
101 | .TP |
102 | \fBreadlink \fIpath\fR | |
103 | Displays the value of the symbolic link \fIpath\fR. | |
104 | ||
cd1a2927 MT |
105 | .TP |
106 | \fBraidautorun \fImddevice\fR | |
107 | Runs raid autodetection on all raid-typed partitions. \fImddevice\fR must | |
108 | be a raid device (any will do). | |
109 | ||
330345c2 MT |
110 | .TP |
111 | \fBsetquiet\fR | |
112 | Cause any later echos in this script to not be displayed. | |
113 | ||
cd1a2927 MT |
114 | .TP |
115 | \fBshowlabels\fR | |
116 | Display a table of devices, their filesystem labels, and their uuids. | |
117 | ||
330345c2 MT |
118 | .TP |
119 | \fBsleep \fInum\fR | |
120 | Sleep for \fInum\fR seconds | |
121 | ||
122 | .TP | |
123 | \fBswitchroot \fInewrootpath\fR | |
124 | Makes the filesystem mounted at \fInewrootpath\fR the new root | |
125 | filesystem by moving the mountpoint. This will only work in 2.6 or | |
126 | later kernels. | |
127 | ||
cd1a2927 MT |
128 | .TP |
129 | \fBumount \fIpath\fR | |
130 | Unmounts the filesystem mounted at \fIpath\fR. | |
131 | ||
132 | .SH RETURN VALUE | |
133 | Returns 0 is the last command succeeded or 1 if it failed. | |
134 | ||
135 | .SH OPTIONS | |
136 | .TP | |
137 | \fB-\-force\fR | |
138 | Allows \fBforce\fR really execute the script, even though \fBnash\fR doesn't | |
139 | appear to be running from an initrd image. | |
140 | ||
141 | .SH BUGS | |
142 | Probably many. \fBnash\fR is \fbnot a shell\fR, and it shouldn't be thought of | |
143 | as one. It isn't entirely different from a shell, but that's mostly by | |
144 | accident. | |
145 | ||
146 | .SH AUTHOR | |
147 | .nf | |
148 | Erik Troan <ewt@redhat.com> | |
149 | .fi |