commit 185117843b8cd0ded55813f43a8541b8a0404314
parent 013168666151c82c930850dca5cc810d4d3f01bf
Author: Daniel Barlow <dan@telent.net>
Date: Sun, 12 Nov 2023 18:37:33 +0000
convert tftp.loadAddress from string to int
Diffstat:
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/devices/belkin-rt3200/default.nix b/devices/belkin-rt3200/default.nix
@@ -38,7 +38,7 @@
};
};
- module = {pkgs, config, lib, ... }:
+ module = {pkgs, config, lib, lim, ... }:
let firmware = pkgs.stdenv.mkDerivation {
name = "wlan-firmware";
phases = ["installPhase"];
@@ -143,7 +143,7 @@
};
boot = {
commandLine = [ "console=ttyS0,115200" ];
- tftp.loadAddress = "0x4007ff28";
+ tftp.loadAddress = lim.parseInt "0x4007ff28";
imageFormat = "fit";
};
filesystem =
diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix
@@ -144,7 +144,7 @@
};
};
boot.tftp = {
- loadAddress = "0x00A00000";
+ loadAddress = lim.parseInt "0x00A00000";
};
kernel = {
src = pkgs.pkgsBuildBuild.fetchurl {
diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix
@@ -43,7 +43,7 @@
'';
- module = { pkgs, config, lib, ...}:
+ module = { pkgs, config, lib, lim, ...}:
let
inherit (pkgs.liminix.networking) interface;
inherit (pkgs) openwrt;
@@ -120,7 +120,7 @@
};
};
boot.tftp = {
- loadAddress = "0x00A00000";
+ loadAddress = lim.parseInt "0x00A00000";
};
kernel = {
diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix
@@ -36,7 +36,7 @@
'';
- module = { pkgs, config, lib, ...}:
+ module = { pkgs, config, lib, lim, ...}:
let
inherit (pkgs.liminix.networking) interface;
inherit (pkgs.liminix.services) oneshot;
@@ -116,7 +116,7 @@
boot.tftp = {
# 20MB seems to give enough room to uncompress the kernel
# without anything getting trodden on. 10MB was too small
- loadAddress = "0x1400000";
+ loadAddress = lim.parseInt "0x1400000";
};
kernel = {
diff --git a/modules/base.nix b/modules/base.nix
@@ -58,7 +58,7 @@ in {
};
tftp = {
loadAddress = mkOption {
- type = types.str;
+ type = types.ints.unsigned;
description = ''
RAM address at which to load data when transferring via
TFTP. This is not the address of the flash storage,
diff --git a/modules/outputs/flashimage.nix b/modules/outputs/flashimage.nix
@@ -106,9 +106,9 @@ in {
cat > $out << EOF
setenv serverip ${tftp.serverip}
setenv ipaddr ${tftp.ipaddr}
- tftp 0x$(printf %x ${tftp.loadAddress}) result/firmware.bin
+ tftp 0x${toHexString tftp.loadAddress} result/firmware.bin
erase 0x$(printf %x ${flash.address}) +${flash.size}
- cp.b 0x$(printf %x ${tftp.loadAddress}) 0x$(printf %x ${flash.address}) \''${filesize}
+ cp.b 0x${toHexString tftp.loadAddress} 0x$(printf %x ${flash.address}) \''${filesize}
echo command line was ${builtins.toJSON (concatStringsSep " " config.boot.commandLine)}
EOF
'';