Skip to content

Commit 2f6d41e

Browse files
authored
Merge pull request #129 from keszybz/bls-tweaks
Some clarifications for the BLS
2 parents ae0976d + cfaeff1 commit 2f6d41e

1 file changed

Lines changed: 52 additions & 37 deletions

File tree

specs/boot_loader_specification.md

Lines changed: 52 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,27 @@ boot loader menu entries._
6666

6767
For systems where the firmware is able to read file systems directly, the ESP
6868
must — and the MBR boot and GPT XBOOTLDR partition should — be a file system
69-
readable by the firmware. For most systems this means VFAT (16 or 32
70-
bit). Applications accessing both partitions should hence not assume that
69+
readable by the firmware. For most systems this means VFAT (16 or 32 bit).
70+
Applications accessing both partitions should hence not assume that
7171
fancier file system features such as symlinks, hardlinks, access control or
7272
case sensitivity are supported.
7373

74+
Note that the partitions described here are not the exclusive territory of this specification.
75+
This specification only defines semantics of the `/loader/entries/` directory
76+
(along with the companion file `/loader/entries.srel`)
77+
and the `/EFI/Linux/` directory inside the file system,
78+
but it doesn't define other contents of the file system.
79+
Boot loaders, firmware, and other software implementing this specification
80+
may choose to place other files and directories in the same file system.
81+
For example,
82+
boot loaders might install their own boot code on the same partition;
83+
this is particularly common in the case of the ESP.
84+
Implementations of this specification must be able to operate correctly if
85+
files or directories other than `/loader/entries/` and `/EFI/Linux/` are found in the top level directory.
86+
Implementations that add their own files or directories to the file systems
87+
should use well-named directories,
88+
to make name collisions between multiple users of the file system unlikely.
89+
7490
### The `$BOOT` Partition Placeholder
7591

7692
In the text below, the placeholder `$BOOT` will be used to refer to the
@@ -130,12 +146,14 @@ integrity properties and should remain unmounted whenever possible.)
130146

131147
## Boot Loader Entries
132148

133-
This specification defines two types of boot loader entries. The first type is
134-
text based, very simple, and suitable for a variety of firmware, architecture
135-
and image types ("Type #1"). The second type is specific to EFI, but allows
136-
single-file images that embed all metadata in the kernel binary itself, which
137-
is useful to cryptographically sign them as one file for the purpose of
138-
SecureBoot ("Type #2").
149+
This specification defines two types of boot loader entries.
150+
The first type is text based, very simple,
151+
and suitable for a variety of firmware, architecture and image types ("Type #1").
152+
The second type is specific to EFI,
153+
but allows single-file images that combine the kernel binary
154+
with the configuration, initrd, and other components of the boot loader entry.
155+
This is also useful because the file can be cryptographically signed
156+
for the purposes of SecureBoot ("Type #2", Unified Kernel Images).
139157

140158
Not all boot loader entries will apply to all systems. For example, Type #1
141159
entries that use the `efi` key and all Type #2 entries only apply to EFI
@@ -146,21 +164,6 @@ from the user. Only entries matching the feature set of boot loader and system
146164
shall be considered and displayed. This allows image builders to put together
147165
images that transparently support multiple different architectures.
148166

149-
Note that the three partitions described above are not supposed to be the
150-
exclusive territory of this specification. This specification only defines
151-
semantics of the `/loader/entries/` directory (along with the companion file
152-
`/loader/entries.srel`) and the `/EFI/Linux/` directory inside the file system,
153-
but it doesn't intend to define contents of the rest of the file system. Boot
154-
loaders, firmware, and other software implementing this specification may
155-
choose to place other files and directories in the same file system. For
156-
example, boot loaders that implement this specification might install their own
157-
boot code on the same partition; this is particularly common in the case of the
158-
ESP. Implementations of this specification must be able to operate correctly if
159-
files or directories other than `/loader/entries/` and `/EFI/Linux/` are found
160-
in the top level directory. Implementations that add their own files or
161-
directories to the file systems should use well-named directories, to make name
162-
collisions between multiple users of the file system unlikely.
163-
164167
### Type #1 Boot Loader Specification Entries
165168

166169
`/loader/entries/` in `$BOOT` is the primary directory containing Type #1
@@ -200,12 +203,14 @@ set: ASCII upper and lower case characters, digits, "+", "-", "_" and ".".
200203
Also, the file names should have a length of at least one and at most 255
201204
characters (including the file name suffix).
202205

203-
These boot loader menu snippets shall be UNIX-style text files (i.e. lines
204-
separated by a single newline character), in the UTF-8 encoding. The
205-
boot loader menu snippets are loosely inspired by Grub1's configuration syntax.
206-
Lines beginning with "#" are used for comments and shall be ignored. The first
207-
word of a line is used as key and is separated by one or more spaces from the
208-
value.
206+
These boot loader menu snippets shall be UNIX-style text files
207+
(i.e. lines separated by a single newline character),
208+
in the UTF-8 encoding.
209+
The boot loader menu snippets are loosely inspired by Grub1's configuration syntax.
210+
Lines beginning with "#" are used for comments and shall be ignored.
211+
The first word of a line is used as key
212+
and is separated by one or more spaces from the value.
213+
The rest of the line contains the value, a literal string.
209214

210215
#### Type #1 Boot Loader Entry Keys
211216

@@ -247,19 +252,29 @@ The following keys are recognized:
247252

248253
Example: `sort-key fedora`
249254

250-
* `linux` is the Linux kernel image to execute and takes a path relative to the
251-
root of the file system containing the boot entry snippet itself. It is
252-
recommended that every distribution creates an entry-token/machine-id and
253-
version specific subdirectory and places its kernels and initrd images there
255+
* `linux` specifies the Linux kernel image to execute.
256+
The value is a path relative to the root of the file system
257+
containing the boot entry snippet itself.
258+
259+
It is recommended that every distribution creates
260+
a subdirectory specific to the entry-token or machine-id,
261+
and underneath that, subdirectories specific to the kernel version,
262+
and places places the kernel and initrd images there
254263
(see below).
255264

256265
Example: `linux /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/linux`
257266

258-
* `initrd` is the initrd `cpio` image to use when executing the kernel. This key
259-
may appear more than once in which case all specified images are used, in the
260-
order they are listed.
267+
* `initrd` specifies the initrd to use when executing the kernel (`cpio` image).
268+
The value is a path relative to the root of the file system
269+
containing the boot entry snippet itself.
270+
This key may appear more than once,
271+
in which case all specified images are used,
272+
in the order they are listed.
273+
274+
Example:
261275

262-
Example: `initrd 6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/initrd`
276+
initrd /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/initrd
277+
initrd /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/modules
263278

264279
* `efi` refers to an arbitrary EFI program. If this key is set, and the system
265280
is not an EFI system, this entry should be hidden.

0 commit comments

Comments
 (0)