liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 0a06319d0cb165f0d2a05e227fc01b17f98f2dff
parent 8cead61740af1f9f102afd39f1dd838d1eed4c5b
Author: Daniel Barlow <dan@telent.net>
Date:   Fri, 10 Feb 2023 18:20:01 +0000

make loadAddress and entryPoint device configuration

... already having second thoughts about loadAddress

Diffstat:
MTHOUGHTS.txt | 8++++++++
Mdefault.nix | 7++++---
Mdevices/gl-ar750/default.nix | 4++--
Mdevices/gl-mt300a/default.nix | 6++----
Mdevices/gl-mt300n-v2/default.nix | 6++----
Mmodules/base.nix | 18+++++++++---------
6 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/THOUGHTS.txt b/THOUGHTS.txt @@ -501,3 +501,11 @@ For better developer experience, I am thinking that either (1) swap tasks 2 and 3 (writable filesystem before module system) or (2) add NBD support so I can iterate on a real device without full rebuilds every time + + +Fri Feb 10 06:18:25 PM GMT 2023 + +did the overlay->module thing + +Need to fix all the configuration around PHRAM, I can't see how it +would ever ork diff --git a/default.nix b/default.nix @@ -45,7 +45,7 @@ let }; uimage = (callPackage ./kernel/uimage.nix {}) { commandLine = concatStringsSep " " config.boot.commandLine; - inherit (device.boot) loadAddress entryPoint; + inherit (config.device) loadAddress entryPoint; inherit kernel; inherit dtb; }; @@ -80,8 +80,9 @@ let ln -s ${manifest} manifest ln -s ${kernel.headers} build '' + - (if device ? boot then '' - ln -s ${uimage} uimage + (if config.device.loadAddress != null then + '' + ln -s {uimage} uimage ${if phram then "ln -s ${boot-scr} boot.scr" else ""} ln -s ${boot-scr} flash.scr '' else "")); diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix @@ -34,8 +34,8 @@ hash = "sha256-YYi4gkpLjbOK7bM2MGQjAyEBuXJ9JNXoz/JEmYf8xE8="; }; in { - device.defaultOutput = "directory"; - device.boot = { + device = { + defaultOutput = "directory"; loadAddress = "0x80060000"; entryPoint = "0x80060000"; }; diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix @@ -23,10 +23,8 @@ in { device = { defaultOutput = "directory"; - boot = { - loadAddress = "0x80000000"; - entryPoint = "0x80000000"; - }; + loadAddress = "0x80000000"; + entryPoint = "0x80000000"; }; kernel = { diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix @@ -23,10 +23,8 @@ in { device = { defaultOutput = "directory"; - boot = { - loadAddress = "0x80000000"; - entryPoint = "0x80000000"; - }; + loadAddress = "0x80000000"; + entryPoint = "0x80000000"; }; kernel = { diff --git a/modules/base.nix b/modules/base.nix @@ -29,28 +29,28 @@ in { default = "true"; type = types.lines; } ; - dts = mkOption { type = types.string; }; + dts = mkOption { type = types.path; }; config = mkOption { # mostly the values are y n or m, but sometimes # other strings are also used type = types.attrsOf types.nonEmptyStr; }; }; - boot.commandLine = mkOption { - type = types.listOf types.nonEmptyStr; - }; groups = mkOption { type = types.attrsOf types.anything; }; users = mkOption { type = types.attrsOf types.anything; }; - device = { - defaultOutput = mkOption { - type = types.nonEmptyStr; - }; - boot = mkOption { type = types.any; }; + boot.commandLine = mkOption { + type = types.listOf types.nonEmptyStr; + default = []; + }; + device.defaultOutput = mkOption { + type = types.nonEmptyStr; }; + device.loadAddress = mkOption { default = null; }; + device.entryPoint = mkOption { }; }; config = { defaultProfile.packages = with pkgs;