commit ab147abd9be1d7b5d9e8e6102f8bdaa40e78500b
parent bca0c9b26b509633439c0566722e2ff0819858b7
Author: Daniel Barlow <dan@telent.net>
Date: Mon, 25 Sep 2023 23:20:28 +0100
less padding in firmware.bin
we only need to align to erase block size, which may be
less than the 128k previously hard-coded
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/flashimage.nix b/modules/flashimage.nix
@@ -47,10 +47,12 @@ in {
system.outputs = {
firmware =
- let o = config.system.outputs; in
- pkgs.runCommand "firmware" {} ''
- dd if=${o.uimage} of=$out bs=128k conv=sync
- dd if=${o.rootfs} of=$out bs=128k conv=sync,nocreat,notrunc oflag=append
+ let
+ o = config.system.outputs;
+ bs = config.hardware.flash.eraseBlockSize;
+ in pkgs.runCommand "firmware" {} ''
+ dd if=${o.uimage} of=$out bs=${bs} conv=sync
+ dd if=${o.rootfs} of=$out bs=${bs} conv=sync,nocreat,notrunc oflag=append
'';
flashimage =
let o = config.system.outputs; in