diff --git a/modules/hardware.nix b/modules/hardware.nix index 598038d..44afc3a 100644 --- a/modules/hardware.nix +++ b/modules/hardware.nix @@ -67,6 +67,7 @@ in { }; loadAddress = mkOption { type = types.ints.unsigned; default = null; }; entryPoint = mkOption { type = types.ints.unsigned; }; + alignment = mkOption { type = types.ints.unsigned; default = null; description = "Alignment passed to `mkimage` for FIT"; }; radios = mkOption { description = '' Kernel modules (from mac80211 package) required for the diff --git a/modules/outputs.nix b/modules/outputs.nix index f60e146..d7861d9 100644 --- a/modules/outputs.nix +++ b/modules/outputs.nix @@ -111,7 +111,7 @@ in }; uimage = liminix.builders.uimage { commandLine = concatStringsSep " " config.boot.commandLine; - inherit (config.hardware) loadAddress entryPoint; + inherit (config.hardware) loadAddress entryPoint alignment; inherit (config.boot) imageFormat; inherit (o) kernel dtb; }; diff --git a/pkgs/kernel/uimage.nix b/pkgs/kernel/uimage.nix index 83d9031..96123a4 100644 --- a/pkgs/kernel/uimage.nix +++ b/pkgs/kernel/uimage.nix @@ -20,6 +20,7 @@ in { , extraName ? "" # e.g. socFamily , loadAddress , imageFormat +, alignment ? null , dtb ? null } : stdenv.mkDerivation { name = "kernel.image"; @@ -70,7 +71,7 @@ in { }; }; _VARS - mkimage -f mkimage.its kernel.uimage + mkimage -f mkimage.its ${lib.optionalString (alignment != null) "-B 0x${lib.toHexString alignment}"} kernel.uimage mkimage -l kernel.uimage '';