xref: /aosp_15_r20/external/coreboot/payloads/external/LinuxBoot/Kconfig (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1## SPDX-License-Identifier: GPL-2.0-only
2
3if PAYLOAD_LINUXBOOT
4
5choice
6	prompt "Architecture"
7	depends on LINUXBOOT_COMPILE_KERNEL || LINUXBOOT_BUILD_INITRAMFS
8	default LINUXBOOT_X86_64
9
10config LINUXBOOT_X86_64
11	bool "x86_64"
12	depends on ARCH_X86
13	help
14	  AMD64 kernel and initramfs
15
16config LINUXBOOT_X86
17	bool "x86"
18	depends on ARCH_X86
19	help
20	  X86 kernel and initramfs
21
22config LINUXBOOT_ARM
23	bool "arm64"
24	depends on ARCH_ARM
25	select PAYLOAD_FIT_SUPPORT
26	help
27	  arm kernel and initramfs
28
29config LINUXBOOT_ARM64
30	bool "arm64"
31	depends on ARCH_ARM64
32	select PAYLOAD_FIT_SUPPORT
33	help
34	  AARCH64 kernel and initramfs
35
36config LINUXBOOT_RISCV_RV32
37	bool "RISC-V"
38	depends on ARCH_RISCV_RV32
39	select PAYLOAD_FIT_SUPPORT
40	help
41	  RISC-V kernel and initramfs
42
43config LINUXBOOT_RISCV_RV64
44	bool "RISC-V"
45	depends on ARCH_RISCV_RV64
46	select PAYLOAD_FIT_SUPPORT
47	help
48	  RISC-V kernel and initramfs
49
50endchoice
51
52comment "Linux kernel"
53
54config LINUXBOOT_COMPILE_KERNEL
55	bool "Compile kernel"
56	default n
57
58config LINUXBOOT_KERNEL_PATH
59	string "Path to kernel"
60	default "build/uImage" if LINUXBOOT_KERNEL_UIMAGE
61	default "build/bzImage" if LINUXBOOT_KERNEL_BZIMAGE
62	help
63	  The kernel path is either and absolute path or relative to the
64	  LinuxBoot directory
65
66if LINUXBOOT_COMPILE_KERNEL
67
68config LINUXBOOT_CROSS_COMPILE
69	string "cross compiler"
70	default "" # e.g. "aarch64-linux-gnu-"
71	help
72	  Choose a custom cross compiler toolchain to use.
73	  It can be useful if you don't want to use the coreboot toolchain
74	  or experience problems using it.
75
76config LINUXBOOT_KERNEL_VERSION
77	string "kernel version"
78	default "6.3"
79	help
80	  Choose the Linux kernel version number. (x.x.x)
81	  Release candidate kernels (rc) are currently are not supported.
82
83config LINUXBOOT_KERNEL_CONFIGFILE
84	string "Config file path"
85	default "i386/defconfig"     if LINUXBOOT_X86
86	default "x86_64/defconfig"   if LINUXBOOT_X86_64
87	default "arm64/defconfig"    if LINUXBOOT_ARM64
88	default "riscv/defconfig-32" if LINUXBOOT_RISCV_RV32
89	default "riscv/defconfig-64" if LINUXBOOT_RISCV_RV64
90	help
91	  Path to the kernel configuration file.
92
93	  Note: this can be a defconfig file or a complete .config file.
94
95choice
96	prompt "Kernel binary format"
97	default LINUXBOOT_KERNEL_BZIMAGE if LINUXBOOT_X86 || LINUXBOOT_X86_64
98	default LINUXBOOT_KERNEL_UIMAGE if LINUXBOOT_ARM64 || LINUXBOOT_RISCV_RV32 || LINUXBOOT_RISCV_RV64
99
100config LINUXBOOT_KERNEL_BZIMAGE
101	bool "bzImage"
102	depends on LINUXBOOT_X86 || LINUXBOOT_X86_64
103
104config LINUXBOOT_KERNEL_UIMAGE
105	bool "uImage"
106	depends on LINUXBOOT_ARM64 || LINUXBOOT_RISCV_RV32 || LINUXBOOT_RISCV_RV64
107
108endchoice
109
110config LINUXBOOT_DTS_FILE
111	string "Compiled devicetree file"
112	depends on LINUXBOOT_ARM64 || LINUXBOOT_RISCV_RV32 || LINUXBOOT_RISCV_RV64
113	default "empty.dts"
114
115endif #LINUXBOOT_COMPILE_KERNEL
116
117config LINUX_COMMAND_LINE
118	string "Kernel command-line"
119	default ""
120	help
121	  Add your own kernel command-line arguments.
122
123config PAYLOAD_FILE
124	default "payloads/external/LinuxBoot/build/Image"
125
126comment "Linux initramfs"
127
128config LINUXBOOT_BUILD_INITRAMFS
129	bool "Build initramfs"
130	default n
131
132config LINUXBOOT_INITRAMFS_PATH
133	string "Path to initramfs"
134	default "build/initramfs_u-root.cpio" if LINUXBOOT_UROOT
135
136if LINUXBOOT_BUILD_INITRAMFS
137
138choice
139	prompt "Initramfs"
140	default LINUXBOOT_UROOT
141
142config LINUXBOOT_UROOT
143	bool "u-root"
144	depends on !LINUXBOOT_RISCV_RV32 # not supported by u-root
145	help
146	  Enable u-root linuxboot mode.
147	  See http://u-root.tk/ for more information.
148
149endchoice
150
151if LINUXBOOT_UROOT
152
153choice
154	prompt "U-root version"
155	default LINUXBOOT_UROOT_MAIN
156
157config LINUXBOOT_UROOT_CUSTOM
158	bool "custom"
159	help
160	  choose a custom u-root branch
161
162config LINUXBOOT_UROOT_MAIN
163	bool "main"
164	help
165	  Latest u-root version
166
167config LINUXBOOT_UROOT_V7_0_0
168	bool "v7.0.0"
169
170config LINUXBOOT_UROOT_V6_0_0
171	bool "v6.0.0"
172
173config LINUXBOOT_UROOT_V5_0_0
174	bool "v5.0.0"
175
176config LINUXBOOT_UROOT_V4_0_0
177	bool "v4.0.0"
178
179config LINUXBOOT_UROOT_V3_0_0
180	bool "v3.0.0"
181
182config LINUXBOOT_UROOT_V2_0_0
183	bool "v2.0.0"
184
185config LINUXBOOT_UROOT_V1_0_0
186	bool "v1.0.0"
187
188endchoice
189
190config LINUXBOOT_UROOT_CHECKOUT
191	string "U-root custom branch"
192	depends on LINUXBOOT_UROOT_CUSTOM
193
194config LINUXBOOT_UROOT_VERSION
195	string
196	default LINUXBOOT_UROOT_CHECKOUT if LINUXBOOT_UROOT_CUSTOM
197	default "main" if LINUXBOOT_UROOT_MAIN
198	default "v7.0.0" if LINUXBOOT_UROOT_V7_0_0
199	default "v6.0.0" if LINUXBOOT_UROOT_V6_0_0
200	default "v5.0.0" if LINUXBOOT_UROOT_V5_0_0
201	default "v4.0.0" if LINUXBOOT_UROOT_V4_0_0
202	default "v3.0.0" if LINUXBOOT_UROOT_V3_0_0
203	default "v2.0.0" if LINUXBOOT_UROOT_V2_0_0
204	default "v1.0.0" if LINUXBOOT_UROOT_V1_0_0
205
206choice
207	prompt "Build format"
208	default LINUXBOOT_UROOT_BB
209	help
210	  u-root build format (e.g. bb or source). (default "bb")
211
212config LINUXBOOT_UROOT_BB
213	bool "bb"
214
215config LINUXBOOT_UROOT_SOURCE
216	bool "source (experimental)"
217
218endchoice
219
220config LINUXBOOT_UROOT_FORMAT
221	string
222	default "bb" if LINUXBOOT_UROOT_BB
223	default "source" if LINUXBOOT_UROOT_SOURCE
224
225config LINUXBOOT_UROOT_FILES
226	string "Add files to u-root base"
227	help
228	  Additional files, directories, and binaries (with their ldd dependencies) to add to archive.
229	  Can be speficified multiple times.
230
231config LINUXBOOT_UROOT_INITCMD
232	string "Init target"
233	default "init"
234	help
235	  Symlink target for /init.
236	  Can be an absolute path or a u-root command name. (default "init")
237
238config LINUXBOOT_UROOT_SHELL
239	string "default shell"
240	default "elvish"
241	help
242	  Default shell.
243	  Can be an absolute path or a u-root command name. (default "elvish")
244
245config LINUXBOOT_UROOT_COMMANDS
246	string "U-root commands"
247	default "boot coreboot-app"
248	help
249	  List of additional modules to include,
250	  separated by space. (default "boot coreboot-app")
251
252if LINUXBOOT_UROOT_MAIN
253
254choice
255	prompt "Choose a specific bootloader"
256	default SPECIFIC_BOOTLOADER_SYSTEMBOOT
257	help
258	  Specify a bootloader which starts after u-root init. It will be a symlink
259	  to /bin/uinit. Default: systemboot
260
261config SPECIFIC_BOOTLOADER_NONE
262	bool "none"
263	help
264	  Leave u-root to decide which bootloaders to load first after init, if
265	  any at all. Most likely u-root will start into the defined u-root shell.
266
267config SPECIFIC_BOOTLOADER_SYSTEMBOOT
268	bool "systemboot"
269	help
270	  If systemboot has been used as a bootloader wrapper in the past,
271	  enable this option. It will invoke -uinitcmd=systemboot and result in
272	  a BIOS/UEFI BDS boot behavior.
273
274config SPECIFIC_BOOTLOADER_BOOT2
275	bool "boot2"
276
277config SPECIFIC_BOOTLOADER_PXEBOOT
278	bool "pxeboot"
279
280config SPECIFIC_BOOTLOADER_STBOOT
281	bool "stboot"
282
283config SPECIFIC_BOOTLOADER_CUSTOM
284	bool "custom"
285
286endchoice
287
288config SPECIFIC_BOOTLOADER_CUSTOM_CMD
289	string "Specify a custom program to start"
290	depends on SPECIFIC_BOOTLOADER_CUSTOM
291	help
292	  This option will symlink the input to /bin/unit which will set it as the
293	  first boot program after the u-root init. Program flags are not
294	  symlinkable.
295
296config LINUXBOOT_UROOT_UINITCMD
297	string
298	default "" if SPECIFIC_BOOTLOADER_NONE
299	default "systemboot" if SPECIFIC_BOOTLOADER_SYSTEMBOOT
300	default "boot2" if SPECIFIC_BOOTLOADER_BOOT2
301	default "pxeboot" if SPECIFIC_BOOTLOADER_PXEBOOT
302	default "stboot" if SPECIFIC_BOOTLOADER_STBOOT
303	default SPECIFIC_BOOTLOADER_CUSTOM_CMD if SPECIFIC_BOOTLOADER_CUSTOM
304
305endif #LINUXBOOT_UROOT_MAIN
306
307endif #LINUXBOOT_UROOT
308
309endif #LINUXBOOT_BUILD_INITRAMFS
310
311choice
312	prompt "Initramfs compression format"
313	default LINUXBOOT_INITRAMFS_COMPRESSION_XZ
314
315config LINUXBOOT_INITRAMFS_COMPRESSION_NONE
316	bool "none"
317
318config LINUXBOOT_INITRAMFS_COMPRESSION_XZ
319	bool "xz compression"
320
321endchoice
322
323config LINUXBOOT_INITRAMFS_SUFFIX
324	string
325	default "" if LINUXBOOT_INITRAMFS_COMPRESSION_NONE
326	default ".xz" if LINUXBOOT_INITRAMFS_COMPRESSION_XZ
327
328endif #PAYLOAD_LINUXBOOT
329