Commit 6b99e6e6 authored by Randy Dunlap's avatar Randy Dunlap Committed by Jonathan Corbet

Documentation/admin-guide: blockdev/ramdisk: remove use of "rdev"

Remove use of "rdev" from blockdev/ramdisk.rst and update
admin-guide/kernel-parameters.txt.

"rdev" is considered antiquated, ancient, archaic, obsolete, deprecated
{choose any or all}.

"rdev" was removed from util-linux in 2010:
  https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=a3e40c14651fccf18e7954f081e601389baefe3fSigned-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Cc: Karel Zak <kzak@redhat.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Martin Mares <mj@ucw.cz>
Cc: linux-video@atrey.karlin.mff.cuni.cz
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
Link: https://lore.kernel.org/r/20200918015640.8439-3-rdunlap@infradead.orgSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent fc67d5bc
...@@ -6,7 +6,7 @@ Using the RAM disk block device with Linux ...@@ -6,7 +6,7 @@ Using the RAM disk block device with Linux
1) Overview 1) Overview
2) Kernel Command Line Parameters 2) Kernel Command Line Parameters
3) Using "rdev -r" 3) Using "rdev"
4) An Example of Creating a Compressed RAM Disk 4) An Example of Creating a Compressed RAM Disk
...@@ -59,51 +59,27 @@ default is 4096 (4 MB). ...@@ -59,51 +59,27 @@ default is 4096 (4 MB).
rd_size rd_size
See ramdisk_size. See ramdisk_size.
3) Using "rdev -r" 3) Using "rdev"
------------------ ---------------
The usage of the word (two bytes) that "rdev -r" sets in the kernel image is "rdev" is an obsolete, deprecated, antiquated utility that could be used
as follows. The low 11 bits (0 -> 10) specify an offset (in 1 k blocks) of up to set the boot device in a Linux kernel image.
to 2 MB (2^11) of where to find the RAM disk (this used to be the size). Bit
14 indicates that a RAM disk is to be loaded, and bit 15 indicates whether a
prompt/wait sequence is to be given before trying to read the RAM disk. Since
the RAM disk dynamically grows as data is being written into it, a size field
is not required. Bits 11 to 13 are not currently used and may as well be zero.
These numbers are no magical secrets, as seen below::
./arch/x86/kernel/setup.c:#define RAMDISK_IMAGE_START_MASK 0x07FF Instead of using rdev, just place the boot device information on the
./arch/x86/kernel/setup.c:#define RAMDISK_PROMPT_FLAG 0x8000 kernel command line and pass it to the kernel from the bootloader.
./arch/x86/kernel/setup.c:#define RAMDISK_LOAD_FLAG 0x4000
Consider a typical two floppy disk setup, where you will have the You can also pass arguments to the kernel by setting FDARGS in
kernel on disk one, and have already put a RAM disk image onto disk #2. arch/x86/boot/Makefile and specify in initrd image by setting FDINITRD in
arch/x86/boot/Makefile.
Hence you want to set bits 0 to 13 as 0, meaning that your RAM disk Some of the kernel command line boot options that may apply here are::
starts at an offset of 0 kB from the beginning of the floppy.
The command line equivalent is: "ramdisk_start=0"
You want bit 14 as one, indicating that a RAM disk is to be loaded. ramdisk_start=N
The command line equivalent is: "load_ramdisk=1" ramdisk_size=M
You want bit 15 as one, indicating that you want a prompt/keypress
sequence so that you have a chance to switch floppy disks.
The command line equivalent is: "prompt_ramdisk=1"
Putting that together gives 2^15 + 2^14 + 0 = 49152 for an rdev word.
So to create disk one of the set, you would do::
/usr/src/linux# cat arch/x86/boot/zImage > /dev/fd0
/usr/src/linux# rdev /dev/fd0 /dev/fd0
/usr/src/linux# rdev -r /dev/fd0 49152
If you make a boot disk that has LILO, then for the above, you would use:: If you make a boot disk that has LILO, then for the above, you would use::
append = "ramdisk_start=0 load_ramdisk=1 prompt_ramdisk=1" append = "ramdisk_start=N ramdisk_size=M"
Since the default start = 0 and the default prompt = 1, you could use::
append = "load_ramdisk=1"
4) An Example of Creating a Compressed RAM Disk 4) An Example of Creating a Compressed RAM Disk
----------------------------------------------- -----------------------------------------------
...@@ -151,12 +127,9 @@ f) Put the RAM disk image onto the floppy, after the kernel. Use an offset ...@@ -151,12 +127,9 @@ f) Put the RAM disk image onto the floppy, after the kernel. Use an offset
dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400 dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400
g) Use "rdev" to set the boot device, RAM disk offset, prompt flag, etc. g) Make sure that you have already specified the boot information in
For prompt_ramdisk=1, load_ramdisk=1, ramdisk_start=400, one would FDARGS and FDINITRD or that you use a bootloader to pass kernel
have 2^15 + 2^14 + 400 = 49552:: command line boot options to the kernel.
rdev /dev/fd0 /dev/fd0
rdev -r /dev/fd0 49552
That is it. You now have your boot/root compressed RAM disk floppy. Some That is it. You now have your boot/root compressed RAM disk floppy. Some
users may wish to combine steps (d) and (f) by using a pipe. users may wish to combine steps (d) and (f) by using a pipe.
...@@ -167,11 +140,14 @@ users may wish to combine steps (d) and (f) by using a pipe. ...@@ -167,11 +140,14 @@ users may wish to combine steps (d) and (f) by using a pipe.
Changelog: Changelog:
---------- ----------
SEPT-2020 :
Removed usage of "rdev"
10-22-04 : 10-22-04 :
Updated to reflect changes in command line options, remove Updated to reflect changes in command line options, remove
obsolete references, general cleanup. obsolete references, general cleanup.
James Nelson (james4765@gmail.com) James Nelson (james4765@gmail.com)
12-95 : 12-95 :
Original Document Original Document
...@@ -2453,8 +2453,7 @@ ...@@ -2453,8 +2453,7 @@
memblock=debug [KNL] Enable memblock debug messages. memblock=debug [KNL] Enable memblock debug messages.
load_ramdisk= [RAM] List of ramdisks to load from floppy load_ramdisk= [RAM] [Deprecated]
See Documentation/admin-guide/blockdev/ramdisk.rst.
lockd.nlm_grace_period=P [NFS] Assign grace period. lockd.nlm_grace_period=P [NFS] Assign grace period.
Format: <integer> Format: <integer>
...@@ -3933,9 +3932,7 @@ ...@@ -3933,9 +3932,7 @@
Param: <number> - step/bucket size as a power of 2 for Param: <number> - step/bucket size as a power of 2 for
statistical time based profiling. statistical time based profiling.
prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk prompt_ramdisk= [RAM] [Deprecated]
before loading.
See Documentation/admin-guide/blockdev/ramdisk.rst.
prot_virt= [S390] enable hosting protected virtual machines prot_virt= [S390] enable hosting protected virtual machines
isolated from the hypervisor (if hardware supports isolated from the hypervisor (if hardware supports
...@@ -3993,6 +3990,8 @@ ...@@ -3993,6 +3990,8 @@
ramdisk_size= [RAM] Sizes of RAM disks in kilobytes ramdisk_size= [RAM] Sizes of RAM disks in kilobytes
See Documentation/admin-guide/blockdev/ramdisk.rst. See Documentation/admin-guide/blockdev/ramdisk.rst.
ramdisk_start= [RAM] RAM disk image start address
random.trust_cpu={on,off} random.trust_cpu={on,off}
[KNL] Enable or disable trusting the use of the [KNL] Enable or disable trusting the use of the
CPU's random number generator (if available) to CPU's random number generator (if available) to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment