hackens-org-configurations/machines/router/liminix-dtbsize.patch
2024-01-19 19:46:05 +01:00

23 lines
1.1 KiB
Diff

diff --git a/modules/outputs/tftpboot.nix b/modules/outputs/tftpboot.nix
index ad6ed63..9773042 100644
--- a/modules/outputs/tftpboot.nix
+++ b/modules/outputs/tftpboot.nix
@@ -73,8 +73,6 @@ in {
rootfsStart=${toString cfg.loadAddress}
rootfsSize=$(binsize64k ${o.rootfs} )
dtbStart=$(($rootfsStart + $rootfsSize))
- dtbSize=$(binsize ${o.dtb} )
- imageStart=$(($dtbStart + $dtbSize))
imageSize=$(binsize ${image})
ln -s ${o.manifest} manifest
@@ -102,6 +100,9 @@ in {
fdtput -p -t s dtb /reserved-memory/$node compatible phram
fdtput -p -t lx dtb /reserved-memory/$node reg $ac_prefix $(hex $rootfsStart) $sz_prefix $(hex $rootfsSize)
+ dtbSize=$(binsize ./dtb )
+ imageStart=$(($dtbStart + $dtbSize))
+
cmd="liminix ${cmdline} mtdparts=phram0:''${rootfsSize}(rootfs) phram.phram=phram0,''${rootfsStart},''${rootfsSize},${toString config.hardware.flash.eraseBlockSize} root=/dev/mtdblock0";
fdtput -t s dtb /chosen bootargs "$cmd"