:: limine / CONFIG.md 19.6 KB raw

1
# Limine configuration file
2
3
## Location of the config file
4
5
For EFI-booted Limine, `<EFI app path>/limine.conf` is taken into account
6
first. On BIOS, or on EFI if that file is not found, Limine scans for the
7
config file on *the boot drive*. Every partition of the boot drive is scanned
8
sequentially - first partition first (or, on EFI, the partition containing the
9
EFI executable of the booted Limine is scanned first), last partition last -
10
for the presence of either a `/boot/limine/limine.conf`, `/boot/limine.conf`,
11
`/limine/limine.conf`, or a `/limine.conf` file, in that order.
12
13
Once the file is located, Limine will use it as its config file. Other possible
14
candidates in subsequent partitions or directories are ignored.
15
16
It is thus imperative that the intended config file is placed in a location
17
that will not be shadowed by another candidate config file.
18
19
### Config via SMBIOS
20
21
Alternatively, if present, Limine considers first and foremost configurations
22
supplied to it as SMBIOS OEM String entries (Type 11). Such configurations are
23
accepted if the first string of such an entry starts with the prefix of
24
`limine:config:`. The rest of the string is taken as the config file. If such a
25
configuration is found, no further scanning for config files is done. As such,
26
in this SMBIOS-provided config file scenario, the `boot():` drive is undefined
27
on BIOS, and set to the boot device of Limine on UEFI.
28
29
## Structure of the config file
30
31
The Limine configuration file is comprised of *menu entries* and *options*.
32
Comments begin in '#' and can only be on their own lines.
33
34
### Menu entries and sub-entries
35
36
*Menu entries* describe *entries* which the user can select in the *boot menu*.
37
38
A *menu entry* is opened by a line starting with `/` followed by a
39
newline-terminated string, that being the title of the entry which the user
40
will see.
41
Any *local option* that comes after it, and before another *menu entry*, or
42
the end of the file, will be part of that *menu entry*.
43
44
A *menu entry* can be a directory, meaning it can hold sub-entries. In order
45
for an entry to become a directory, it needs to have a sub-entry following
46
right after it.
47
(A `comment` option may be present between the beginning of the directory entry
48
and the beginning of the sub-entry).
49
50
A *sub-entry* is a menu entry started with a number of `/` greater than 1
51
prepended to it.
52
Each `/` represents 1 level deeper down the tree hierarchy of directories and
53
entries.
54
55
Directories can be expanded (meaning they will not show up as collapsed in the
56
menu) by default if a `+` is put between the `/`s and the beginning of the
57
entry's title.
58
59
### Options
60
61
*Options* are simple `option_name: string...` style "assignments".
62
The string can have spaces and other special characters, without requiring
63
quotations. New lines are delimiters. Option names are not case sensitive.
64
65
Some *options* are part of an entry (*local*), some other options are *global*.
66
*Global options* can appear anywhere in the file and are not part of an entry,
67
although usually one would put them at the beginning of the config.
68
Some *local options* work the same between entries using any *protocol*, while
69
other *local options* are specific to a given *protocol*.
70
71
Some options take *paths* as strings; these are described in the next section.
72
73
*Global options* are:
74
75
Miscellaneous:
76
77
* `timeout` - Specifies the timeout in seconds before the first *entry* is
78
  automatically booted. Decimal values such as `0.25` are accepted. If set to
79
  `no`, disable automatic boot. If set to `0`, boots default entry instantly
80
  (see `default_entry` option).
81
* `quiet` - If set to `yes`, enable quiet mode, where all screen output except
82
  panics and important warnings is suppressed. If `timeout` is not 0, the
83
  `timeout` still occurs, and pressing any key during the timeout will reveal
84
  the menu and disable quiet mode.
85
* `serial` - If set to `yes`, enable serial I/O for the bootloader.
86
* `serial_baudrate` - If `serial` is set to `yes`, this specifies the baudrate
87
  to use for serial I/O. Defaults to `115200`. BIOS only, ignored with Limine
88
  UEFI.
89
* `global_dtb` - If set, use this DTB instead of the firmware-provided DTB for
90
  Limine itself, as well as for any booted entry whose protocol supports DTBs
91
  and the DTB is not locally overridden with `dtb_path`.
92
* `default_entry` - Entry which will be automatically selected at startup.
93
  Can be a 1-based entry index (e.g. `1`), or an entry path (e.g.
94
  `OSes/Arch Linux`). Entry paths use `/` as a directory separator; literal
95
  `/`, `\`, and `#` characters in entry names must be escaped as `\/`, `\\`,
96
  and `\#` respectively. If multiple sibling entries share the same name, append
97
  `#N` to select the Nth duplicate (e.g. `Arch Linux#1` for the second entry
98
  named `Arch Linux`). If unspecified, it is `1`.
99
* `remember_last_entry` - If set to `yes`, remember last booted entry.
100
  (UEFI only).
101
* `graphics` - If set to `no`, force text mode for the boot menu, else use
102
  a video mode.
103
* `wallpaper` - Path to a file to use as a wallpaper. BMP, PNG, JPEG, and QOI
104
  formats are supported. There can be multiple of this option, in which case
105
  the wallpaper will be randomly selected from the provided options.
106
* `wallpaper_style` - The style which will be used to display the wallpaper
107
  image: `tiled`, `centered`, or `stretched`. Default is `stretched`.
108
* `backdrop` - When the background style is `centered`, this specifies the
109
  colour of the backdrop for parts of the screen not covered by the background
110
  image, in RRGGBB format.
111
* `verbose` - If set to `yes`, print additional information during boot.
112
  Defaults to not verbose.
113
* `randomise_memory` - If set to `yes`, randomise the contents of RAM at bootup
114
  in order to find bugs related to non zeroed memory or for security reasons.
115
  This option will slow down boot time significantly. For the BIOS port of
116
  Limine, this will only randomise memory below 4GiB.
117
* `randomize_memory` - Alias of `randomise_memory`.
118
* `hash_mismatch_panic` - If set to `no`, do not panic if there is a hash
119
  mismatch for a file, but print a warning instead. Forced to `yes` when
120
  Secure Boot is active.
121
* `measured_boot` - If set to `yes`, opt in to measured boot. Forced to `yes`
122
  when Secure Boot is active, and forced back to `no` if the firmware does
123
  not expose a TPM 2.0/CC measurement interface. See
124
  [USAGE.md](USAGE.md#measured-boot).
125
126
Limine interface control options:
127
128
* `interface_resolution` - Specify screen resolution to be used by the Limine
129
  interface (menu, editor, console...) in the form `<width>x<height>`. This
130
  will *only* affect the Limine interface, not any booted OS. If not specified,
131
  Limine will pick a resolution automatically. If the resolution is not
132
  available, Limine will pick another one automatically. Ignored if using text
133
  mode.
134
* `interface_rotation` - Specifies the rotation of the Limine interface.
135
  It can be any of the following values: `0`, `90`, `180`, `270`. Default is `0`.
136
* `interface_branding` - A string that will be displayed on top of the Limine
137
  interface.
138
* `interface_branding_colour` - An `RRGGBB` hexadecimal value specifying the
139
  colour of the branding string. Default is `00aaaa`.
140
* `interface_branding_color` - Alias of `interface_branding_colour`.
141
* `interface_help_hidden` - Hides the help text located at the top of the
142
  screen showing the key bindings.
143
* `interface_help_colour` - An `RRGGBB` hexadecimal value specifying the
144
  colour of the help strings. Default is `00aa00`.
145
* `interface_help_color` - Alias of `interface_help_colour`.
146
* `interface_help_colour_bright` - An `RRGGBB` hexadecimal value specifying
147
  the brighter accent colour used for the auto-boot countdown digit. If
148
  unspecified, it is derived from `interface_help_colour` by adding `0x55`
149
  to each channel (saturating at `0xff`).
150
* `interface_help_color_bright` - Alias of `interface_help_colour_bright`.
151
152
Limine graphical terminal control options:
153
154
These are ignored if using text mode.
155
156
* `term_font` - Path to a font file to be used instead of the default one for
157
  the menu and terminal. The font file must be a code page 437 character set
158
  comprised of 256 consecutive glyph bitmaps. Each glyph's bitmap must be
159
  expressed left to right (1 byte per row), and top to bottom (16 bytes per
160
  whole glyph by default; see `term_font_size`). See e.g. the
161
  [VGA text mode font](https://github.com/viler-int10h/vga-text-mode-fonts)
162
  collection for fonts.
163
* `term_font_size` - The size of each glyph of the font in dots, which must
164
  correspond to the font file, or display will be garbled or loading issues
165
  will occur. Since it is assumed that all fonts are of width 8, the first
166
  value of the pair (AKA the `8` in `8x16`) is effectively ignored. To set
167
  horizontal spacing between glyphs on screen, see `term_font_spacing`.
168
  Defaults to `8x16`. Ignored if `term_font` not set or if the font fails to
169
  load.
170
* `term_font_scale` - Scaling for the font in the x and y directions. `2x2`
171
  would display the font in double size, which is useful on high-DPI displays
172
  at native resolution. `2x1` only makes the font twice as wide, similar to the
173
  VGA 40 column mode. `4x2` might be good for a narrow font on a high
174
  resolution display. Values over 8 are disallowed. Default is no scaling,
175
  i.e. `1x1`.
176
* `term_font_spacing` - Horizontal spacing, in pixels, between glyphs on
177
  screen. Also applies to the built-in Limine font. Defaults to 1. 0 is
178
  allowed.
179
* `term_palette` - Specifies the colour palette used by the terminal (RRGGBB).
180
  It is a `;` separated array of 8 colours: black, red, green, brown, blue,
181
  magenta, cyan, and gray. Ignored if not using a graphical terminal.
182
* `term_palette_bright` - Specifies the bright colour palette used by the
183
  terminal (RRGGBB). It is a `;` separated array of 8 bright colours:
184
  dark gray, bright red, bright green, yellow, bright blue, bright magenta,
185
  bright cyan, and white. Ignored if not using a graphical terminal.
186
* `term_background` - Terminal text background colour (TTRRGGBB). TT stands for
187
  transparency.
188
* `term_foreground` - Terminal text foreground colour (RRGGBB).
189
* `term_background_bright` - Terminal text background bright colour (RRGGBB).
190
* `term_foreground_bright` - Terminal text foreground bright colour (RRGGBB).
191
* `term_margin` - Set the amount of margin around the terminal.
192
* `term_margin_gradient` - Set the thickness in pixel for the gradient around
193
  the terminal.
194
195
Editor control options:
196
197
* `editor_enabled` - If set to `no`, the editor will not be accessible.
198
  Defaults to `yes` unless a config hash is enrolled. Unconditionally
199
  disabled when Secure Boot is active.
200
* `editor_highlighting` - If set to `no`, syntax highlighting in the editor
201
  will be disabled. Defaults to `yes`.
202
* `editor_validation` - If set to `no`, the editor will not alert you about
203
  invalid options or syntax errors. Defaults to `yes`.
204
205
*Locally assignable (non protocol specific) options* are:
206
207
* `comment` - An optional comment string that will be displayed by the
208
  bootloader on the menu when an entry is selected.
209
* `protocol` - The boot protocol that will be used to boot the
210
  kernel/executable. Valid protocols are: `linux`, `limine`, `multiboot`
211
  (or `multiboot1`), `multiboot2`, `efi`, `efi_boot_entry` and `bios`.
212
* `cmdline` - The command line string to be passed to the kernel/executable.
213
  Can be omitted.
214
* `kernel_cmdline` - Alias of `cmdline`.
215
* `if_fw_type` - Hide the entry if the firmware does not match. Valid values
216
  are: `BIOS`, `UEFI`
217
* `if_arch` - Hide the entry if the current CPU architecture is not in the
218
  space separated list of permitted architectures
219
    * see the `ARCH` macro in [Built-in macros](#built-in-macros) for a list of possible architectures
220
221
> **NOTE:** `uefi` and `efi_chainload` are aliases of the `efi` protocol
222
> option. `bios_chainload` is an alias of the `bios` protocol option.
223
224
> **NOTE:** BIOS chainloading entries will be hidden when booting using UEFI
225
> and vice-versa.
226
227
*Locally assignable (protocol specific) options* are:
228
229
* Linux protocol:
230
  * `path` - The path of the kernel.
231
  * `kernel_path` - Alias of `path`.
232
  * `module_path` - The path to a module (such as initramfs). This option can
233
    be specified multiple times to specify multiple modules.
234
  * `resolution` - The resolution to be used. This setting takes the form of
235
    `<width>x<height>x<bpp>`. If the resolution is not available, Limine will
236
    pick another one automatically. Omitting `<bpp>` will default to 32.
237
  * `textmode` - If set to `yes`, prefer text mode. (BIOS only)
238
  * `dtb_path` - A device tree blob to pass instead of the one provided by the
239
    firmware.
240
241
* Limine protocol:
242
  * `path` - The path of the executable.
243
  * `kernel_path` - Alias of `path`.
244
  * `module_path` - The path to a module. This option can be specified multiple
245
    times to specify multiple modules.
246
  * `module_string` - A string to be associated with a module. This option can
247
    also be specified multiple times. It applies to the module described by the
248
    last module option specified.
249
  * `module_cmdline` - Alias of `module_string`.
250
  * `resolution` - The resolution to be used. This setting takes the form of
251
    `<width>x<height>x<bpp>`. If the resolution is not available, Limine will
252
    pick another one automatically. Omitting `<bpp>` will default to 32.
253
  * `kaslr` - For relocatable executables, if set to `yes`, enable kernel
254
    address space layout randomisation. KASLR is disabled by default.
255
  * `randomise_hhdm_base` - If set to `yes`, randomise the base address of the
256
    higher half direct map. If set to `no`, do not. By default it is `yes` if
257
    KASLR is supported and enabled, else it is `no`.
258
  * `randomize_hhdm_base` - Alias of `randomise_hhdm_base`.
259
  * `max_paging_mode`, `min_paging_mode` - Limit the maximum and minimum paging
260
    modes to one of the following:
261
    - x86-64 and aarch64: `4level`, `5level`.
262
    - riscv64: `sv39`, `sv48`, `sv57`.
263
    - loongarch64: `4level`.
264
  * `paging_mode` - Equivalent to setting both `max_paging_mode` and
265
    `min_paging_mode` to the same value.
266
  * `dtb_path` - A device tree blob to pass instead of the one provided by the
267
    firmware.
268
269
* multiboot1 and multiboot2 protocols:
270
  * `path` - The path of the executable.
271
  * `kernel_path` - Alias of `path`.
272
  * `module_path` - The path to a module. This option can be specified multiple
273
    times to specify multiple modules.
274
  * `module_string` - A string to be passed to a module. This option can also
275
    be specified multiple times. It applies to the module described by the last
276
    module option specified.
277
  * `resolution` - The resolution to be used should the executable request a
278
    graphical framebuffer. This setting takes the form of
279
    `<width>x<height>x<bpp>` and *overrides* any resolution requested by the
280
    executable. If the resolution is not available, Limine will pick another
281
    one automatically. Omitting `<bpp>` will default to 32.
282
  * `textmode` - If set to `yes`, prefer text mode. (BIOS only)
283
284
* EFI Chainload protocol:
285
  * `path` - Path of the EFI application to chainload.
286
  * `image_path` - Alias of `path`.
287
  * `resolution` - The resolution to be used. This setting takes the form of
288
    `<width>x<height>x<bpp>`. If the resolution is not available, Limine will
289
    pick another one automatically. Omitting `<bpp>` will default to 32.
290
291
* EFI Boot Entry protocol:
292
  * `entry` - The name of the EFI boot entry to reboot into.
293
294
* BIOS Chainload protocol:
295
  * `drive` - The 1-based drive to chainload, if omitted, assume boot drive.
296
  * `partition` - The 1-based partition to chainload, if omitted, or set to 0,
297
    chainload drive (MBR).
298
  * `mbr_id` - Optional. If passed, use an MBR ID (32-bit hex value) to
299
    identify the drive containing the volume to chainload. Overrides `drive`,
300
    if present, but does *not* override `partition`.
301
  * `gpt_uuid` or `gpt_guid` - Optional. If passed, use the GPT GUID to
302
    identify the drive containing the volume to chainload. Overrides `drive`
303
    and `mbr_id`, if present, but does *not* override `partition`.
304
305
## Paths
306
307
A Limine path is used to locate files in the whole system. It is comprised of
308
a *resource*, a *resource argument*, and a *path*. It takes the form of:
309
```
310
resource(argument):/path
311
```
312
313
The format for `argument` changes depending on the resource used.
314
315
A resource can be one of the following:
316
* `boot` - If booted off PXE this is an alias of `tftp`. Else the `argument` is
317
  the 1-based decimal value representing the partition on the boot drive
318
  (values of 5+ for MBR logical partitions). If omitted, the partition
319
  containing the configuration file on the boot drive is used.
320
  For example: `boot(2):/...` will use partition 2 of the boot drive and
321
  `boot():/...` will use the partition containing the config file on the boot
322
  drive.
323
* `hdd` - Hard disk drives. The `argument` takes the form of `drive:partition`;
324
  for example: `hdd(3:1):/...` would use hard drive 3, partition 1. Partitions
325
  and drives are both 1-based (partition values of 5+ for MBR logical
326
  partitions). Omitting the partition is possible;
327
  for example: `hdd(2:):/...`. Omitting the partition will access the entire
328
  volume instead of a specific partition (useful for unpartitioned media).
329
* `odd` - Optical disk drives (CDs/DVDs/...). The `argument` takes the form of
330
  `drive:partition`; for example: `odd(3:1):/...` would use optical drive 3,
331
  partition 1. Partitions and drives are both 1-based (partition values of 5+
332
  for MBR logical partitions). Omitting the partition is possible;
333
  for example: `odd(2:):/...`. Omitting the partition will access the entire
334
  volume instead of a specific partition (useful for unpartitioned media, which
335
  is often the case for optical media).
336
* `guid` - The `argument` takes the form of a GUID/UUID, such as
337
  `guid(736b5698-5ae1-4dff-be2c-ef8f44a61c52):/...`. The GUID is that of either
338
  a filesystem, when available, or a GPT partition GUID, when using GPT, in a
339
  unified namespace.
340
* `uuid` - Alias of `guid`.
341
* `fslabel` - The `argument` is the name of the filesystem label of a
342
  partition.
343
* `tftp` - The `argument` is the IP address of the tftp server to load the file
344
  from. If the argument is left empty (`tftp():/...`) the file will be loaded
345
  from the server Limine booted from. This resource is only available when
346
  booting off PXE.
347
348
A path can optionally be suffixed with a blake2b hash for the referenced file,
349
by appending a pound character (`#`) followed by the blake2b hash.
350
E.g.: `boot():/somemodule.tar#ca6914d2...446b470a`.
351
When Secure Boot is active, all file paths **must** have a hash appended or
352
Limine will panic (except for wallpapers and fonts, which are silently skipped
353
instead, falling back to defaults).
354
355
A gzip-compressed resource is indicated by inserting a dollar character (`$`)
356
before the resource string. This allows for transparent decompression. For
357
such resources, the hash covers the consumed compressed gzip member bytes,
358
not the decompressed data and not trailing bytes outside the consumed member.
359
The hash thus authenticates the on-disk payload bytes Limine uses.
360
361
## Macros
362
363
Macros are strings that can be arbitrarily assigned to represent other strings.
364
For example:
365
```
366
${MY_MACRO}=Some text
367
```
368
369
Now, whenever `${MY_MACRO}` is used in the config file (except for an
370
assignment as above), it will be replaced by the text `Some text`. For example:
371
```
372
CMDLINE=something before ${MY_MACRO} something after
373
```
374
375
Macros must always be placed inside `${...}` where `...` is the arbitrary macro
376
name.
377
378
### Built-in macros
379
380
Limine automatically defines these macros:
381
382
* `ARCH` - This built-in macro expands to the architecture of the machine.
383
  Possible values are: `x86-64`, `ia-32`, `aarch64`, `riscv64`, `loongarch64`.
384
  In the case of IA-32, BIOS or UEFI, the macro will always expand to `x86-64`
385
  if the 64-bit extensions are available, else `ia-32`.
386
* `FW_TYPE` - This built-in macro expands to `UEFI` if booted using UEFI
387
  firmware, or `BIOS` if booted using legacy x86 BIOS.
388
tab: 248 wrap: offon