Commit 1810732e94576ae0d04e953ecaba8c7151c9a287

Authored by Randy Dunlap
Committed by Linus Torvalds
1 parent 0e1ccb9619

docs: ramdisk/initrd/initramfs corrections

initrd/initramfs/ramdisk docs:
- fix typos/spellos/grammar
- clarify RAM disk config location
- correct cpio option

Acked-by: Bryan O'Sullivan <bos@serpentine.com>
Acked-by: Rob Landley <rob@landley.net>
Cc: Werner Almesberger <werner@almesberger.net>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 4 changed files with 27 additions and 22 deletions Side-by-side Diff

Documentation/early-userspace/README
... ... @@ -19,7 +19,7 @@
19 19 - klibc, a userspace C library, currently packaged separately, that is
20 20 optimized for correctness and small size.
21 21  
22   -The cpio file format used by initramfs is the "newc" (aka "cpio -c")
  22 +The cpio file format used by initramfs is the "newc" (aka "cpio -H newc")
23 23 format, and is documented in the file "buffer-format.txt". There are
24 24 two ways to add an early userspace image: specify an existing cpio
25 25 archive to be used as the image or have the kernel build process build
... ... @@ -44,7 +44,7 @@
44 44 CONFIG_INITRAMFS_SOURCE. Sources can be either directories or files -
45 45 cpio archives are *not* allowed when building from sources.
46 46  
47   -A source directory will have it and all of it's contents packaged. The
  47 +A source directory will have it and all of its contents packaged. The
48 48 specified directory name will be mapped to '/'. When packaging a
49 49 directory, limited user and group ID translation can be performed.
50 50 INITRAMFS_ROOT_UID can be set to a user ID that needs to be mapped to
... ... @@ -144,7 +144,7 @@
144 144 initrd format, an cpio archive. It must be called "/init". This binary
145 145 is responsible to do all the things prepare_namespace() would do.
146 146  
147   - To remain backwards compatibility, the /init binary will only run if it
  147 + To maintain backwards compatibility, the /init binary will only run if it
148 148 comes via an initramfs cpio archive. If this is not the case,
149 149 init/main.c:init() will run prepare_namespace() to mount the final root
150 150 and exec one of the predefined init binaries.
Documentation/filesystems/ramfs-rootfs-initramfs.txt
... ... @@ -8,7 +8,7 @@
8 8  
9 9 Ramfs is a very simple filesystem that exports Linux's disk caching
10 10 mechanisms (the page cache and dentry cache) as a dynamically resizable
11   -ram-based filesystem.
  11 +RAM-based filesystem.
12 12  
13 13 Normally all files are cached in memory by Linux. Pages of data read from
14 14 backing store (usually the block device the filesystem is mounted on) are kept
... ... @@ -34,7 +34,7 @@
34 34 ------------------
35 35  
36 36 The older "ram disk" mechanism created a synthetic block device out of
37   -an area of ram and used it as backing store for a filesystem. This block
  37 +an area of RAM and used it as backing store for a filesystem. This block
38 38 device was of fixed size, so the filesystem mounted on it was of fixed
39 39 size. Using a ram disk also required unnecessarily copying memory from the
40 40 fake block device into the page cache (and copying changes back out), as well
... ... @@ -46,8 +46,8 @@
46 46 to avoid this copying by playing with the page tables, but they're unpleasantly
47 47 complicated and turn out to be about as expensive as the copying anyway.)
48 48 More to the point, all the work ramfs is doing has to happen _anyway_,
49   -since all file access goes through the page and dentry caches. The ram
50   -disk is simply unnecessary, ramfs is internally much simpler.
  49 +since all file access goes through the page and dentry caches. The RAM
  50 +disk is simply unnecessary; ramfs is internally much simpler.
51 51  
52 52 Another reason ramdisks are semi-obsolete is that the introduction of
53 53 loopback devices offered a more flexible and convenient way to create
... ... @@ -103,7 +103,7 @@
103 103 initramfs archive is a gzipped cpio archive (like tar only simpler,
104 104 see cpio(1) and Documentation/early-userspace/buffer-format.txt). The
105 105 kernel's cpio extraction code is not only extremely small, it's also
106   - __init data that can be discarded during the boot process.
  106 + __init text and data that can be discarded during the boot process.
107 107  
108 108 - The program run by the old initrd (which was called /initrd, not /init) did
109 109 some setup and then returned to the kernel, while the init program from
... ... @@ -220,7 +220,7 @@
220 220 non-GPL code you'd like to run from initramfs, without conflating it with
221 221 the GPL licensed Linux kernel binary).
222 222  
223   -It can also be used to supplement the kernel's built-in initamfs image. The
  223 +It can also be used to supplement the kernel's built-in initramfs image. The
224 224 files in the external archive will overwrite any conflicting files in
225 225 the built-in initramfs archive. Some distributors also prefer to customize
226 226 a single kernel image with task-specific initramfs images, without recompiling.
... ... @@ -339,7 +339,7 @@
339 339 The move to early userspace is necessary because finding and mounting the real
340 340 root device is complex. Root partitions can span multiple devices (raid or
341 341 separate journal). They can be out on the network (requiring dhcp, setting a
342   -specific mac address, logging into a server, etc). They can live on removable
  342 +specific MAC address, logging into a server, etc). They can live on removable
343 343 media, with dynamically allocated major/minor numbers and persistent naming
344 344 issues requiring a full udev implementation to sort out. They can be
345 345 compressed, encrypted, copy-on-write, loopback mounted, strangely partitioned,
Documentation/initrd.txt
... ... @@ -80,8 +80,8 @@
80 80 ----------------------
81 81  
82 82 Recent kernels have support for populating a ramdisk from a compressed cpio
83   -archive, on such systems, the creation of a ramdisk image doesn't need to
84   -involve special block devices or loopbacks, you merely create a directory on
  83 +archive. On such systems, the creation of a ramdisk image doesn't need to
  84 +involve special block devices or loopbacks; you merely create a directory on
85 85 disk with the desired initrd content, cd to that directory, and run (as an
86 86 example):
87 87  
... ... @@ -293,7 +293,7 @@
293 293 generated with all the necessary modules. Then, only /sbin/init or a file
294 294 read by it would have to be different.
295 295  
296   -A third scenario are more convenient recovery disks, because information
  296 +A third scenario is more convenient recovery disks, because information
297 297 like the location of the root FS partition doesn't have to be provided at
298 298 boot time, but the system loaded from initrd can invoke a user-friendly
299 299 dialog and it can also perform some sanity checks (or even some form of
... ... @@ -339,8 +339,8 @@
339 339 Mixed change_root and pivot_root mechanism
340 340 ------------------------------------------
341 341  
342   -In case you did not want to use root=/dev/ram0 to trig the pivot_root mechanism,
343   -you may create both /linuxrc and /sbin/init in your initrd image.
  342 +In case you did not want to use root=/dev/ram0 to trigger the pivot_root
  343 +mechanism, you may create both /linuxrc and /sbin/init in your initrd image.
344 344  
345 345 /linuxrc would contain only the following:
346 346  
... ... @@ -350,7 +350,7 @@
350 350 umount -n /proc
351 351  
352 352 Once linuxrc exited, the kernel would mount again your initrd as root,
353   -this time executing /sbin/init. Again, it would be duty of this init
  353 +this time executing /sbin/init. Again, it would be the duty of this init
354 354 to build the right environment (maybe using the root= device passed on
355 355 the cmdline) before the final execution of the real /sbin/init.
356 356  
Documentation/ramdisk.txt
... ... @@ -22,16 +22,21 @@
22 22 RAM from the buffer cache. The driver marks the buffers it is using as dirty
23 23 so that the VM subsystem does not try to reclaim them later.
24 24  
25   -Also, the RAM disk supports up to 16 RAM disks out of the box, and can
26   -be reconfigured to support up to 255 RAM disks - change "#define NUM_RAMDISKS"
27   -in drivers/block/rd.c. To use RAM disk support with your system, run
28   -'./MAKEDEV ram' from the /dev directory. RAM disks are all major number 1, and
29   -start with minor number 0 for /dev/ram0, etc. If used, modern kernels use
30   -/dev/ram0 for an initrd.
  25 +The RAM disk supports up to 16 RAM disks by default, and can be reconfigured
  26 +to support an unlimited number of RAM disks (at your own risk). Just change
  27 +the configuration symbol BLK_DEV_RAM_COUNT in the Block drivers config menu
  28 +and (re)build the kernel.
31 29  
  30 +To use RAM disk support with your system, run './MAKEDEV ram' from the /dev
  31 +directory. RAM disks are all major number 1, and start with minor number 0
  32 +for /dev/ram0, etc. If used, modern kernels use /dev/ram0 for an initrd.
  33 +
32 34 The old "ramdisk=<ram_size>" has been changed to "ramdisk_size=<ram_size>" to
33 35 make it clearer. The original "ramdisk=<ram_size>" has been kept around for
34 36 compatibility reasons, but it may be removed in the future.
  37 +There are also config symbols (in the Block drivers config menu) for these
  38 +variables: BLK_DEV_RAM_SIZE defaults to 4096 and BLK_DEV_RAM_BLOCKSIZE
  39 +defaults to 1024.
35 40  
36 41 The new RAM disk also has the ability to load compressed RAM disk images,
37 42 allowing one to squeeze more programs onto an average installation or