forked from mirrors/nixpkgs
Merge pull request #128082 from flokli/sdcard-firmware-partition-offset
nixos/sdcard: make firmware partition offset configurable
This commit is contained in:
commit
6845a74d4c
|
@ -55,6 +55,22 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
firmwarePartitionOffset = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 8;
|
||||||
|
description = ''
|
||||||
|
Gap in front of the /boot/firmware partition, in mebibytes (1024×1024
|
||||||
|
bytes).
|
||||||
|
Can be increased to make more space for boards requiring to dd u-boot
|
||||||
|
SPL before actual partitions.
|
||||||
|
|
||||||
|
Unless you are building your own images pre-configured with an
|
||||||
|
installed U-Boot, you can instead opt to delete the existing `FIRMWARE`
|
||||||
|
partition, which is used **only** for the Raspberry Pi family of
|
||||||
|
hardware.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
firmwarePartitionID = mkOption {
|
firmwarePartitionID = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "0x2178694e";
|
default = "0x2178694e";
|
||||||
|
@ -177,7 +193,7 @@ in
|
||||||
zstd -d --no-progress "${rootfsImage}" -o ./root-fs.img
|
zstd -d --no-progress "${rootfsImage}" -o ./root-fs.img
|
||||||
|
|
||||||
# Gap in front of the first partition, in MiB
|
# Gap in front of the first partition, in MiB
|
||||||
gap=8
|
gap=${toString config.sdImage.firmwarePartitionOffset}
|
||||||
|
|
||||||
# Create the image file sized to fit /boot/firmware and /, plus slack for the gap.
|
# Create the image file sized to fit /boot/firmware and /, plus slack for the gap.
|
||||||
rootSizeBlocks=$(du -B 512 --apparent-size ./root-fs.img | awk '{ print $1 }')
|
rootSizeBlocks=$(du -B 512 --apparent-size ./root-fs.img | awk '{ print $1 }')
|
||||||
|
|
Loading…
Reference in a new issue