diff --git a/THOUGHTS.txt b/THOUGHTS.txt index 8a0d6ff..8111aba 100644 --- 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 index 025b1d0..a606104 100644 --- 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 index 2af5dbe..a7982f8 100644 --- 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 index 5e49ef7..6172cef 100644 --- 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 index fb97e30..ef19e1c 100644 --- 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 index 9aa6d23..9c16df6 100644 --- 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;