Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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=a3e40c14651fccf18e7954f081e601389baefe3f

Signed-off-by: Randy 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.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Randy Dunlap and committed by
Jonathan Corbet
6b99e6e6 fc67d5bc

+25 -50
+21 -45
Documentation/admin-guide/blockdev/ramdisk.rst
··· 6 6 7 7 1) Overview 8 8 2) Kernel Command Line Parameters 9 - 3) Using "rdev -r" 9 + 3) Using "rdev" 10 10 4) An Example of Creating a Compressed RAM Disk 11 11 12 12 ··· 59 59 rd_size 60 60 See ramdisk_size. 61 61 62 - 3) Using "rdev -r" 63 - ------------------ 62 + 3) Using "rdev" 63 + --------------- 64 64 65 - The usage of the word (two bytes) that "rdev -r" sets in the kernel image is 66 - as follows. The low 11 bits (0 -> 10) specify an offset (in 1 k blocks) of up 67 - to 2 MB (2^11) of where to find the RAM disk (this used to be the size). Bit 68 - 14 indicates that a RAM disk is to be loaded, and bit 15 indicates whether a 69 - prompt/wait sequence is to be given before trying to read the RAM disk. Since 70 - the RAM disk dynamically grows as data is being written into it, a size field 71 - is not required. Bits 11 to 13 are not currently used and may as well be zero. 72 - These numbers are no magical secrets, as seen below:: 65 + "rdev" is an obsolete, deprecated, antiquated utility that could be used 66 + to set the boot device in a Linux kernel image. 73 67 74 - ./arch/x86/kernel/setup.c:#define RAMDISK_IMAGE_START_MASK 0x07FF 75 - ./arch/x86/kernel/setup.c:#define RAMDISK_PROMPT_FLAG 0x8000 76 - ./arch/x86/kernel/setup.c:#define RAMDISK_LOAD_FLAG 0x4000 68 + Instead of using rdev, just place the boot device information on the 69 + kernel command line and pass it to the kernel from the bootloader. 77 70 78 - Consider a typical two floppy disk setup, where you will have the 79 - kernel on disk one, and have already put a RAM disk image onto disk #2. 71 + You can also pass arguments to the kernel by setting FDARGS in 72 + arch/x86/boot/Makefile and specify in initrd image by setting FDINITRD in 73 + arch/x86/boot/Makefile. 80 74 81 - Hence you want to set bits 0 to 13 as 0, meaning that your RAM disk 82 - starts at an offset of 0 kB from the beginning of the floppy. 83 - The command line equivalent is: "ramdisk_start=0" 75 + Some of the kernel command line boot options that may apply here are:: 84 76 85 - You want bit 14 as one, indicating that a RAM disk is to be loaded. 86 - The command line equivalent is: "load_ramdisk=1" 87 - 88 - You want bit 15 as one, indicating that you want a prompt/keypress 89 - sequence so that you have a chance to switch floppy disks. 90 - The command line equivalent is: "prompt_ramdisk=1" 91 - 92 - Putting that together gives 2^15 + 2^14 + 0 = 49152 for an rdev word. 93 - So to create disk one of the set, you would do:: 94 - 95 - /usr/src/linux# cat arch/x86/boot/zImage > /dev/fd0 96 - /usr/src/linux# rdev /dev/fd0 /dev/fd0 97 - /usr/src/linux# rdev -r /dev/fd0 49152 77 + ramdisk_start=N 78 + ramdisk_size=M 98 79 99 80 If you make a boot disk that has LILO, then for the above, you would use:: 100 81 101 - append = "ramdisk_start=0 load_ramdisk=1 prompt_ramdisk=1" 102 - 103 - Since the default start = 0 and the default prompt = 1, you could use:: 104 - 105 - append = "load_ramdisk=1" 106 - 82 + append = "ramdisk_start=N ramdisk_size=M" 107 83 108 84 4) An Example of Creating a Compressed RAM Disk 109 85 ----------------------------------------------- ··· 127 151 128 152 dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400 129 153 130 - g) Use "rdev" to set the boot device, RAM disk offset, prompt flag, etc. 131 - For prompt_ramdisk=1, load_ramdisk=1, ramdisk_start=400, one would 132 - have 2^15 + 2^14 + 400 = 49552:: 133 - 134 - rdev /dev/fd0 /dev/fd0 135 - rdev -r /dev/fd0 49552 154 + g) Make sure that you have already specified the boot information in 155 + FDARGS and FDINITRD or that you use a bootloader to pass kernel 156 + command line boot options to the kernel. 136 157 137 158 That is it. You now have your boot/root compressed RAM disk floppy. Some 138 159 users may wish to combine steps (d) and (f) by using a pipe. ··· 140 167 Changelog: 141 168 ---------- 142 169 170 + SEPT-2020 : 171 + 172 + Removed usage of "rdev" 173 + 143 174 10-22-04 : 144 175 Updated to reflect changes in command line options, remove 145 176 obsolete references, general cleanup. 146 177 James Nelson (james4765@gmail.com) 147 - 148 178 149 179 12-95 : 150 180 Original Document
+4 -5
Documentation/admin-guide/kernel-parameters.txt
··· 2453 2453 2454 2454 memblock=debug [KNL] Enable memblock debug messages. 2455 2455 2456 - load_ramdisk= [RAM] List of ramdisks to load from floppy 2457 - See Documentation/admin-guide/blockdev/ramdisk.rst. 2456 + load_ramdisk= [RAM] [Deprecated] 2458 2457 2459 2458 lockd.nlm_grace_period=P [NFS] Assign grace period. 2460 2459 Format: <integer> ··· 3932 3933 Param: <number> - step/bucket size as a power of 2 for 3933 3934 statistical time based profiling. 3934 3935 3935 - prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk 3936 - before loading. 3937 - See Documentation/admin-guide/blockdev/ramdisk.rst. 3936 + prompt_ramdisk= [RAM] [Deprecated] 3938 3937 3939 3938 prot_virt= [S390] enable hosting protected virtual machines 3940 3939 isolated from the hypervisor (if hardware supports ··· 3989 3992 3990 3993 ramdisk_size= [RAM] Sizes of RAM disks in kilobytes 3991 3994 See Documentation/admin-guide/blockdev/ramdisk.rst. 3995 + 3996 + ramdisk_start= [RAM] RAM disk image start address 3992 3997 3993 3998 random.trust_cpu={on,off} 3994 3999 [KNL] Enable or disable trusting the use of the