@@ -55,6 +55,22 @@ in
5555 '';
5656 };
5757
58+ firmwarePartitionOffset = mkOption {
59+ type = types.int;
60+ default = 8;
61+ description = ''
62+ Gap in front of the /boot/firmware partition, in mebibytes (1024×1024
63+ bytes).
64+ Can be increased to make more space for boards requiring to dd u-boot
65+ SPL before actual partitions.
66+
67+ Unless you are building your own images pre-configured with an
68+ installed U-Boot, you can instead opt to delete the existing `FIRMWARE`
69+ partition, which is used **only** for the Raspberry Pi family of
70+ hardware.
71+ '';
72+ };
73+
5874 firmwarePartitionID = mkOption {
5975 type = types.str;
6076 default = "0x2178694e";
@@ -177,7 +193,7 @@ in
177193 zstd -d --no-progress "${rootfsImage}" -o ./root-fs.img
178194
179195 # Gap in front of the first partition, in MiB
180− gap=8
196+ gap=${toString config.sdImage.firmwarePartitionOffset}
181197
182198 # Create the image file sized to fit /boot/firmware and /, plus slack for the gap.
183199 rootSizeBlocks=$(du -B 512 --apparent-size ./root-fs.img | awk '{ print $1 }')