Skip to content

Commit ce3413b

Browse files
committed
BLS: say that initrd may be split at whitespace for compat
A path is not allowed to contain whitespace (only ASCII upper and lower case characters, digits, "+", "-", "_" and "." per the first section), so we know that a space cannot occur in the value. But unfortunately, this is an easy mistake to make. We made the situation worse by allowing other keys to contain whitespace-separated paths, e.g. 'devicetree-overlay' is defined as "multiple overlays are separated by spaces and applied in the same order as they are listed." So it's easy to try to apply the same pattern in other places. Also, the implementation that was done for grub2 allowed multiple paths to be specified. It is certainly confusing if we say that initrd /some/path/initrd /some/path/extra is not a valid. If instead we were to correctly understand that the user meant two different initrds and emit a warning, our behaviour would be more robust and user-friendly. C.f. systemd/systemd#38834 https://bugzilla.redhat.com/show_bug.cgi?id=2323348 https://lists.fedoraproject.org/archives/list/[email protected]/message/AYB4VHQ5K6CEV4NYCK2QTZB2OEAIJMP7/
1 parent 801eefd commit ce3413b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

specs/boot_loader_specification.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,18 @@ The following keys are recognized:
264264

265265
Example: `linux /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/linux`
266266

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.
267+
* `initrd` specifies an initrd to use when executing the kernel (`cpio` image).
268+
The value is a path
269+
relative to the root of the file system containing the boot entry snippet itself.
270270
This key may appear more than once,
271271
in which case all specified images are used,
272272
in the order they are listed.
273273

274+
To increase robustness,
275+
an implementation *should* split the path at whitespace
276+
and treat each part as a separate path.
277+
A warning *should* be emitted in that case.
278+
274279
Example:
275280

276281
initrd /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/initrd

0 commit comments

Comments
 (0)