Skip to content

Commit 26c9c72

Browse files
mhiramatrostedt
authored andcommitted
docs: bootconfig: Add how to use bootconfig for kernel parameters
Add a section to describe how to use the bootconfig for specifying kernel and init parameters. This is an important section because it is the reason why this document is under the admin-guide. Link: https://lkml.kernel.org/r/163077086399.222577.5881779375643977991.stgit@devnote2 Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: [email protected] Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent b66fbbe commit 26c9c72

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

Documentation/admin-guide/bootconfig.rst

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ update the boot loader and the kernel image itself as long as the boot
178178
loader passes the correct initrd file size. If by any chance, the boot
179179
loader passes a longer size, the kernel fails to find the bootconfig data.
180180

181-
To do this operation, Linux kernel provides "bootconfig" command under
181+
To do this operation, Linux kernel provides ``bootconfig`` command under
182182
tools/bootconfig, which allows admin to apply or delete the config file
183183
to/from initrd image. You can build it by the following command::
184184

@@ -196,6 +196,43 @@ To remove the config from the image, you can use -d option as below::
196196
Then add "bootconfig" on the normal kernel command line to tell the
197197
kernel to look for the bootconfig at the end of the initrd file.
198198

199+
200+
Kernel parameters via Boot Config
201+
=================================
202+
203+
In addition to the kernel command line, the boot config can be used for
204+
passing the kernel parameters. All the key-value pairs under ``kernel``
205+
key will be passed to kernel cmdline directly. Moreover, the key-value
206+
pairs under ``init`` will be passed to init process via the cmdline.
207+
The parameters are concatinated with user-given kernel cmdline string
208+
as the following order, so that the command line parameter can override
209+
bootconfig parameters (this depends on how the subsystem handles parameters
210+
but in general, earlier parameter will be overwritten by later one.)::
211+
212+
[bootconfig params][cmdline params] -- [bootconfig init params][cmdline init params]
213+
214+
Here is an example of the bootconfig file for kernel/init parameters.::
215+
216+
kernel {
217+
root = 01234567-89ab-cdef-0123-456789abcd
218+
}
219+
init {
220+
splash
221+
}
222+
223+
This will be copied into the kernel cmdline string as the following::
224+
225+
root="01234567-89ab-cdef-0123-456789abcd" -- splash
226+
227+
If user gives some other command line like,::
228+
229+
ro bootconfig -- quiet
230+
231+
The final kernel cmdline will be the following::
232+
233+
root="01234567-89ab-cdef-0123-456789abcd" ro bootconfig -- splash quiet
234+
235+
199236
Config File Limitation
200237
======================
201238

0 commit comments

Comments
 (0)