Specifications

2.3 The ``rdev'' utility
There are a few of the kernel boot parameters that have their default values stored in various bytes in the
kernel image itself. There is a utility called rdev that is installed on most systems that knows where these
values are, and how to change them. It can also change things that have no kernel boot argument equivalent,
such as the default video mode used.
The rdev utility is usually also aliased to swapdev, ramsize, vidmode and rootflags. These are the five things
that rdev can change, those being the root device, the swap device, the RAM disk parameters, the default
video mode, and the readonly/readwrite setting of root device.
More information on rdev can be found by typing rdev −h or by reading the supplied man page (man
rdev).
2.4 How the Kernel Sorts the Arguments
Most of the boot args take the form of:
name[=value_1][,value_2]...[,value_11]
where `name' is a unique keyword that is used to identify what part of the kernel the associated values (if any)
are to be given to. Multiple boot args are just a space separated list of the above format. Note the limit of 11 is
real, as the present code only handles 11 comma separated parameters per keyword. (However, you can
re−use the same keyword with up to an additional 11 parameters in unusually complicated situations,
assuming the setup function supports it.) Also note that the kernel splits the list into a maximum of ten integer
arguments, and a following string, so you can't really supply 11 integers unless you convert the 11th arg from
a string to an int in the driver itself.
Most of the sorting goes on in linux/init/main.c. First, the kernel checks to see if the argument is any
of the special arguments `root=', `ro', `rw', or `debug'. The meaning of these special arguments is described
further on in the document.
Then it walks a list of setup functions (contained in the bootsetups array) to see if the specified argument
string (such as `foo') has been associated with a setup function (foo_setup()) for a particular device or
part of the kernel. If you passed the kernel the line foo=3,4,5,6,bar then the kernel would search the
bootsetups array to see if `foo' was registered. If it was, then it would call the setup function associated
with `foo' (foo_setup()) and hand it the integer arguments 3, 4, 5 and 6 as given on the kernel command
line, and also hand it the string argument bar.
2.5 Setting Environment Variables.
Anything of the form `foo=bar' that is not accepted as a setup function as described above is then interpreted
as an environment variable to be set. An example would be to use TERM=vt100 or
BOOT_IMAGE=vmlinuz.bak as a boot argument. These environment variables are typically tested for in
the initialization scripts to enable or disable a wide range of things.
The Linux BootPrompt−HowTo
2.3 The ``rdev'' utility 6