diff --git a/machines/router/default.nix b/machines/router/default.nix index 129774b..61593c3 100644 --- a/machines/router/default.nix +++ b/machines/router/default.nix @@ -2,4 +2,14 @@ , nixpkgs ? (import ./npins).nixpkgs , liminix-config ? ./configuration.nix }: -(import liminix { inherit nixpkgs liminix-config; device = import (liminix + "/devices/belkin-rt3200"); }) +let + patchedLiminix = pkgs.applyPatches { + name = "liminix-patched"; + src = liminix; + patches = [ + ./liminix-dtbsize.patch + ]; + }; + pkgs = import nixpkgs {}; +in +(import patchedLiminix { inherit nixpkgs liminix-config; device = import (patchedLiminix + "/devices/belkin-rt3200"); }) diff --git a/machines/router/liminix-dtbsize.patch b/machines/router/liminix-dtbsize.patch new file mode 100644 index 0000000..62ac925 --- /dev/null +++ b/machines/router/liminix-dtbsize.patch @@ -0,0 +1,23 @@ +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" +