From dd8ec18881789c09dd971979570786bfcc34f988 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 26 Jan 2024 22:45:59 +0000 Subject: [PATCH] restore boot.tftp.freeSpaceBytes --- examples/recovery.nix | 1 + modules/outputs/tftpboot.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/recovery.nix b/examples/recovery.nix index 535306e..55b6efe 100644 --- a/examples/recovery.nix +++ b/examples/recovery.nix @@ -31,6 +31,7 @@ in rec { boot.tftp = { ipaddr = "10.0.0.8"; # my address serverip = "10.0.0.1"; # build machine or other tftp server + freeSpaceBytes = 1024 * 1024 * 4; }; hostname = "recovery"; diff --git a/modules/outputs/tftpboot.nix b/modules/outputs/tftpboot.nix index ad6ed63..274ebad 100644 --- a/modules/outputs/tftpboot.nix +++ b/modules/outputs/tftpboot.nix @@ -72,6 +72,7 @@ in { hex() { printf "0x%x" $1; } rootfsStart=${toString cfg.loadAddress} rootfsSize=$(binsize64k ${o.rootfs} ) + rootfsSize=$(($rootfsSize + ${toString cfg.freeSpaceBytes} )) dtbStart=$(($rootfsStart + $rootfsSize)) dtbSize=$(binsize ${o.dtb} ) imageStart=$(($dtbStart + $dtbSize))