From ce3413bab7068763791594e82782639884357aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 9 Sep 2025 12:09:24 +0200 Subject: [PATCH] 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. https://github.com/systemd/systemd/issues/38834 https://bugzilla.redhat.com/show_bug.cgi?id=2323348 https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/AYB4VHQ5K6CEV4NYCK2QTZB2OEAIJMP7/ --- specs/boot_loader_specification.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/specs/boot_loader_specification.md b/specs/boot_loader_specification.md index 2c95370..35ddc07 100644 --- a/specs/boot_loader_specification.md +++ b/specs/boot_loader_specification.md @@ -264,13 +264,18 @@ The following keys are recognized: Example: `linux /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/linux` -* `initrd` specifies the initrd to use when executing the kernel (`cpio` image). - The value is a path relative to the root of the file system - containing the boot entry snippet itself. +* `initrd` specifies an initrd to use when executing the kernel (`cpio` image). + The value is a path + relative to the root of the file system containing the boot entry snippet itself. This key may appear more than once, in which case all specified images are used, in the order they are listed. + To increase robustness, + an implementation *should* split the path at whitespace + and treat each part as a separate path. + A warning *should* be emitted in that case. + Example: initrd /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/initrd