source: rtems-docs/c-user/config/filesystem.rst @ 7bad894

5
Last change on this file since 7bad894 was 7bad894, checked in by Sebastian Huber <sebastian.huber@…>, on 03/27/20 at 11:53:09

c-user: Use new template for integer config opts

Try to bring all descriptions up to date. Add cross-references to
several options. Clarify configuration value constraints.

Use this template also for initializer type options.

Close #3901.

  • Property mode set to 100644
File size: 14.5 KB
Line 
1.. SPDX-License-Identifier: CC-BY-SA-4.0
2
3.. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
4
5Filesystem Configuration
6========================
7
8This section describes configuration options related to filesytems.
9By default, the In-Memory Filesystem (IMFS) is used as the base filesystem (also
10known as root filesystem).  In order to save some memory for your application,
11you can disable the filesystem support with the
12:ref:`CONFIGURE_APPLICATION_DISABLE_FILESYSTEM` configuration option.
13Alternatively, you can strip down the features of the base filesystem with the
14:ref:`CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM` and
15:ref:`CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM` configuration options.  These
16three configuration options are mutually exclusive.  They are intended for an
17advanced application configuration.
18
19Features of the IMFS can be disabled and enabled with the following
20configuration options:
21
22* :ref:`CONFIGURE_IMFS_DISABLE_CHMOD`
23
24* :ref:`CONFIGURE_IMFS_DISABLE_CHOWN`
25
26* :ref:`CONFIGURE_IMFS_DISABLE_LINK`
27
28* :ref:`CONFIGURE_IMFS_DISABLE_MKNOD`
29
30* :ref:`CONFIGURE_IMFS_DISABLE_MKNOD_FILE`
31
32* :ref:`CONFIGURE_IMFS_DISABLE_MOUNT`
33
34* :ref:`CONFIGURE_IMFS_DISABLE_READDIR`
35
36* :ref:`CONFIGURE_IMFS_DISABLE_READLINK`
37
38* :ref:`CONFIGURE_IMFS_DISABLE_RENAME`
39
40* :ref:`CONFIGURE_IMFS_DISABLE_RMNOD`
41
42* :ref:`CONFIGURE_IMFS_DISABLE_SYMLINK`
43
44* :ref:`CONFIGURE_IMFS_DISABLE_UNMOUNT`
45
46* :ref:`CONFIGURE_IMFS_DISABLE_UTIME`
47
48* :ref:`CONFIGURE_IMFS_ENABLE_MKFIFO`
49
50.. index:: CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
51
52.. _CONFIGURE_APPLICATION_DISABLE_FILESYSTEM:
53
54CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
55----------------------------------------
56
57CONSTANT:
58    ``CONFIGURE_APPLICATION_DISABLE_FILESYSTEM``
59
60OPTION TYPE:
61    This configuration option is a boolean feature define.
62
63DEFAULT CONFIGURATION:
64    If this configuration option is undefined, then a base filesystem and the
65    configured filesystems are initialized during system initialization.
66
67DESCRIPTION:
68    In case this configuration option is defined, then **no** base filesystem is
69    initialized during system initialization and **no** filesystems are
70    configured.
71
72NOTES:
73    Filesystems shall be initialized to support file descriptor based device
74    drivers and basic input/output functions such as :c:func:`printf`.
75    Filesystems can be disabled to reduce the memory footprint of an application.
76
77.. index:: CONFIGURE_IMFS_DISABLE_CHMOD
78
79.. _CONFIGURE_IMFS_DISABLE_CHMOD:
80
81CONFIGURE_IMFS_DISABLE_CHMOD
82----------------------------
83
84CONSTANT:
85    ``CONFIGURE_IMFS_DISABLE_CHMOD``
86
87OPTION TYPE:
88    This configuration option is a boolean feature define.
89
90DEFAULT CONFIGURATION:
91    If this configuration option is undefined, then the root IMFS supports
92    changing the mode of files.
93
94DESCRIPTION:
95    In case this configuration option is defined, then the root IMFS does not
96    support changing the mode of files (no support for :c:func:`chmod`).
97
98NOTES:
99    None.
100
101.. index:: CONFIGURE_IMFS_DISABLE_CHOWN
102
103.. _CONFIGURE_IMFS_DISABLE_CHOWN:
104
105CONFIGURE_IMFS_DISABLE_CHOWN
106----------------------------
107
108CONSTANT:
109    ``CONFIGURE_IMFS_DISABLE_CHOWN``
110
111OPTION TYPE:
112    This configuration option is a boolean feature define.
113
114DEFAULT CONFIGURATION:
115    If this configuration option is undefined, then the root IMFS supports
116    changing the ownership of files.
117
118DESCRIPTION:
119    In case this configuration option is defined, then the root IMFS does not
120    support changing the ownership of files (no support for :c:func:`chown`).
121
122NOTES:
123    None.
124
125.. index:: CONFIGURE_IMFS_DISABLE_LINK
126
127.. _CONFIGURE_IMFS_DISABLE_LINK:
128
129CONFIGURE_IMFS_DISABLE_LINK
130---------------------------
131
132CONSTANT:
133    ``CONFIGURE_IMFS_DISABLE_LINK``
134
135OPTION TYPE:
136    This configuration option is a boolean feature define.
137
138DEFAULT CONFIGURATION:
139    If this configuration option is undefined, then the root IMFS supports hard
140    links.
141
142DESCRIPTION:
143    In case this configuration option is defined, then the root IMFS does not
144    support hard links (no support for :c:func:`link`).
145
146NOTES:
147    None.
148
149.. index:: CONFIGURE_IMFS_DISABLE_MKNOD
150
151.. _CONFIGURE_IMFS_DISABLE_MKNOD:
152
153CONFIGURE_IMFS_DISABLE_MKNOD
154----------------------------
155
156CONSTANT:
157    ``CONFIGURE_IMFS_DISABLE_MKNOD``
158
159OPTION TYPE:
160    This configuration option is a boolean feature define.
161
162DEFAULT CONFIGURATION:
163    If this configuration option is undefined, then the root IMFS supports making
164    files.
165
166DESCRIPTION:
167    In case this configuration option is defined, then the root IMFS does not
168    support making files (no support for :c:func:`mknod`).
169
170NOTES:
171    None.
172
173.. index:: CONFIGURE_IMFS_DISABLE_MKNOD_FILE
174
175.. _CONFIGURE_IMFS_DISABLE_MKNOD_FILE:
176
177CONFIGURE_IMFS_DISABLE_MKNOD_FILE
178---------------------------------
179
180CONSTANT:
181    ``CONFIGURE_IMFS_DISABLE_MKNOD_FILE``
182
183OPTION TYPE:
184    This configuration option is a boolean feature define.
185
186DEFAULT CONFIGURATION:
187    If this configuration option is undefined, then the root IMFS supports making
188    regular files.
189
190DESCRIPTION:
191    In case this configuration option is defined, then the root IMFS does not
192    support making regular files.
193
194NOTES:
195    None.
196
197.. index:: CONFIGURE_IMFS_DISABLE_MOUNT
198
199.. _CONFIGURE_IMFS_DISABLE_MOUNT:
200
201CONFIGURE_IMFS_DISABLE_MOUNT
202----------------------------
203
204CONSTANT:
205    ``CONFIGURE_IMFS_DISABLE_MOUNT``
206
207OPTION TYPE:
208    This configuration option is a boolean feature define.
209
210DEFAULT CONFIGURATION:
211    If this configuration option is undefined, then the root IMFS supports
212    mounting other filesystems.
213
214DESCRIPTION:
215    In case this configuration option is defined, then the root IMFS does not
216    support mounting other filesystems (no support for :c:func:`mount`).
217
218NOTES:
219    None.
220
221.. index:: CONFIGURE_IMFS_DISABLE_READDIR
222
223.. _CONFIGURE_IMFS_DISABLE_READDIR:
224
225CONFIGURE_IMFS_DISABLE_READDIR
226------------------------------
227
228CONSTANT:
229    ``CONFIGURE_IMFS_DISABLE_READDIR``
230
231OPTION TYPE:
232    This configuration option is a boolean feature define.
233
234DEFAULT CONFIGURATION:
235    If this configuration option is undefined, then the root IMFS supports
236    reading directories.
237
238DESCRIPTION:
239    In case this configuration option is defined, then the root IMFS does not
240    support reading directories (no support for :c:func:`readdir`).  It is still
241    possible to open files in a directory.
242
243NOTES:
244    None.
245
246.. index:: CONFIGURE_IMFS_DISABLE_READLINK
247
248.. _CONFIGURE_IMFS_DISABLE_READLINK:
249
250CONFIGURE_IMFS_DISABLE_READLINK
251-------------------------------
252
253CONSTANT:
254    ``CONFIGURE_IMFS_DISABLE_READLINK``
255
256OPTION TYPE:
257    This configuration option is a boolean feature define.
258
259DEFAULT CONFIGURATION:
260    If this configuration option is undefined, then the root IMFS supports
261    reading symbolic links.
262
263DESCRIPTION:
264    In case this configuration option is defined, then the root IMFS does not
265    support reading symbolic links (no support for :c:func:`readlink`).
266
267NOTES:
268    None.
269
270.. index:: CONFIGURE_IMFS_DISABLE_RENAME
271
272.. _CONFIGURE_IMFS_DISABLE_RENAME:
273
274CONFIGURE_IMFS_DISABLE_RENAME
275-----------------------------
276
277CONSTANT:
278    ``CONFIGURE_IMFS_DISABLE_RENAME``
279
280OPTION TYPE:
281    This configuration option is a boolean feature define.
282
283DEFAULT CONFIGURATION:
284    If this configuration option is undefined, then the root IMFS supports
285    renaming files.
286
287DESCRIPTION:
288    In case this configuration option is defined, then the root IMFS does not
289    support renaming files (no support for :c:func:`rename`).
290
291NOTES:
292    None.
293
294.. index:: CONFIGURE_IMFS_DISABLE_RMNOD
295
296.. _CONFIGURE_IMFS_DISABLE_RMNOD:
297
298CONFIGURE_IMFS_DISABLE_RMNOD
299----------------------------
300
301CONSTANT:
302    ``CONFIGURE_IMFS_DISABLE_RMNOD``
303
304OPTION TYPE:
305    This configuration option is a boolean feature define.
306
307DEFAULT CONFIGURATION:
308    If this configuration option is undefined, then the root IMFS supports
309    removing files.
310
311DESCRIPTION:
312    In case this configuration option is defined, then the root IMFS does not
313    support removing files (no support for :c:func:`rmnod`).
314
315NOTES:
316    None.
317
318.. index:: CONFIGURE_IMFS_DISABLE_SYMLINK
319
320.. _CONFIGURE_IMFS_DISABLE_SYMLINK:
321
322CONFIGURE_IMFS_DISABLE_SYMLINK
323------------------------------
324
325CONSTANT:
326    ``CONFIGURE_IMFS_DISABLE_SYMLINK``
327
328OPTION TYPE:
329    This configuration option is a boolean feature define.
330
331DEFAULT CONFIGURATION:
332    If this configuration option is undefined, then the root IMFS supports
333    creating symbolic links.
334
335DESCRIPTION:
336    In case this configuration option is defined, then the root IMFS does not
337    support creating symbolic links (no support for :c:func:`symlink`).
338
339NOTES:
340    None.
341
342.. index:: CONFIGURE_IMFS_DISABLE_UNMOUNT
343
344.. _CONFIGURE_IMFS_DISABLE_UNMOUNT:
345
346CONFIGURE_IMFS_DISABLE_UNMOUNT
347------------------------------
348
349CONSTANT:
350    ``CONFIGURE_IMFS_DISABLE_UNMOUNT``
351
352OPTION TYPE:
353    This configuration option is a boolean feature define.
354
355DEFAULT CONFIGURATION:
356    If this configuration option is undefined, then the root IMFS supports
357    unmounting other filesystems.
358
359DESCRIPTION:
360    In case this configuration option is defined, then the root IMFS does not
361    support unmounting other filesystems (no support for :c:func:`unmount`).
362
363NOTES:
364    None.
365
366.. index:: CONFIGURE_IMFS_DISABLE_UTIME
367
368.. _CONFIGURE_IMFS_DISABLE_UTIME:
369
370CONFIGURE_IMFS_DISABLE_UTIME
371----------------------------
372
373CONSTANT:
374    ``CONFIGURE_IMFS_DISABLE_UTIME``
375
376OPTION TYPE:
377    This configuration option is a boolean feature define.
378
379DEFAULT CONFIGURATION:
380    If this configuration option is undefined, then the root IMFS supports
381    changing file times.
382
383DESCRIPTION:
384    In case this configuration option is defined, then the root IMFS does not
385    support changing file times (no support for :c:func:`utime`).
386
387NOTES:
388    None.
389
390.. index:: CONFIGURE_IMFS_ENABLE_MKFIFO
391
392.. _CONFIGURE_IMFS_ENABLE_MKFIFO:
393
394CONFIGURE_IMFS_ENABLE_MKFIFO
395----------------------------
396
397CONSTANT:
398    ``CONFIGURE_IMFS_ENABLE_MKFIFO``
399
400OPTION TYPE:
401    This configuration option is a boolean feature define.
402
403DEFAULT CONFIGURATION:
404    If this configuration option is undefined, then the root IMFS does not
405    support making FIFOs (no support for :c:func:`mkfifo`).
406
407DESCRIPTION:
408    In case this configuration option is defined, then the root IMFS supports
409    making FIFOs.
410
411NOTES:
412    None.
413
414.. index:: CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
415
416.. _CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK:
417
418CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
419--------------------------------------
420
421CONSTANT:
422    ``CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK``
423
424OPTION TYPE:
425    This configuration option is an integer define.
426
427DEFAULT VALUE:
428    The default value is 128.
429
430VALUE CONSTRAINTS:
431    The value of this configuration option shall be
432    an element of {16, 32, 64, 128, 256, 512}.
433
434DESCRIPTION:
435    The value of this configuration option defines the block size for in-memory
436    files managed by the IMFS.
437
438NOTES:
439    The configured block size has two impacts. The first is the average amount of
440    unused memory in the last block of each file.  For example, when the block
441    size is 512, on average one-half of the last block of each file will remain
442    unused and the memory is wasted. In contrast, when the block size is 16, the
443    average unused memory per file is only 8 bytes. However, it requires more
444    allocations for the same size file and thus more overhead per block for the
445    dynamic memory management.
446
447    Second, the block size has an impact on the maximum size file that can be
448    stored in the IMFS. With smaller block size, the maximum file size is
449    correspondingly smaller. The following shows the maximum file size possible
450    based on the configured block size:
451
452    - when the block size is 16 bytes, the maximum file size is 1,328 bytes.
453
454    - when the block size is 32 bytes, the maximum file size is 18,656 bytes.
455
456    - when the block size is 64 bytes, the maximum file size is 279,488 bytes.
457
458    - when the block size is 128 bytes, the maximum file size is 4,329,344 bytes.
459
460    - when the block size is 256 bytes, the maximum file size is 68,173,568 bytes.
461
462    - when the block size is 512 bytes, the maximum file size is 1,082,195,456
463      bytes.
464
465.. index:: CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
466
467.. _CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM:
468
469CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
470--------------------------------------
471
472CONSTANT:
473    ``CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM``
474
475OPTION TYPE:
476    This configuration option is a boolean feature define.
477
478DEFAULT CONFIGURATION:
479    If this configuration option is undefined, then the described feature is not
480    enabled.
481
482DESCRIPTION:
483    In case this configuration option is defined, then an IMFS with a reduced
484    feature set will be the base filesystem (also known as root filesystem).
485
486NOTES:
487    In case this configuration option is defined, then the following
488    configuration options will be defined as well
489
490    - :ref:`CONFIGURE_IMFS_DISABLE_CHMOD`,
491
492    - :ref:`CONFIGURE_IMFS_DISABLE_CHOWN`,
493
494    - :ref:`CONFIGURE_IMFS_DISABLE_LINK`,
495
496    - :ref:`CONFIGURE_IMFS_DISABLE_MKNOD_FILE`,
497
498    - :ref:`CONFIGURE_IMFS_DISABLE_MOUNT`,
499
500    - :ref:`CONFIGURE_IMFS_DISABLE_READDIR`,
501
502    - :ref:`CONFIGURE_IMFS_DISABLE_READLINK`,
503
504    - :ref:`CONFIGURE_IMFS_DISABLE_RENAME`,
505
506    - :ref:`CONFIGURE_IMFS_DISABLE_RMNOD`,
507
508    - :ref:`CONFIGURE_IMFS_DISABLE_SYMLINK`,
509
510    - :ref:`CONFIGURE_IMFS_DISABLE_UTIME`, and
511
512    - :ref:`CONFIGURE_IMFS_DISABLE_UNMOUNT`.
513
514    In addition, a simplified path evaluation is enabled.  It allows only a look
515    up of absolute paths.
516
517    This configuration of the IMFS is basically a device-only filesystem.  It is
518    comparable in functionality to the pseudo-filesystem name space provided
519    before RTEMS release 4.5.0.
520
521.. index:: CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
522
523.. _CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM:
524
525CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
526-----------------------------------------
527
528CONSTANT:
529    ``CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM``
530
531OPTION TYPE:
532    This configuration option is a boolean feature define.
533
534DEFAULT CONFIGURATION:
535    If this configuration option is undefined, then the described feature is not
536    enabled.
537
538DESCRIPTION:
539    In case this configuration option is defined, then an IMFS with a reduced
540    feature set will be the base filesystem (also known as root filesystem).
541
542NOTES:
543    In case this configuration option is defined, then the following
544    configuration options will be defined as well
545
546    - :ref:`CONFIGURE_IMFS_DISABLE_CHMOD`,
547
548    - :ref:`CONFIGURE_IMFS_DISABLE_CHOWN`,
549
550    - :ref:`CONFIGURE_IMFS_DISABLE_LINK`,
551
552    - :ref:`CONFIGURE_IMFS_DISABLE_READLINK`,
553
554    - :ref:`CONFIGURE_IMFS_DISABLE_RENAME`,
555
556    - :ref:`CONFIGURE_IMFS_DISABLE_SYMLINK`,
557
558    - :ref:`CONFIGURE_IMFS_DISABLE_UTIME`, and
559
560    - :ref:`CONFIGURE_IMFS_DISABLE_UNMOUNT`.
Note: See TracBrowser for help on using the repository browser.