builders/uimage: support aligning the FIT

This is necessary when writing to a MTD partition with a certain erasesize.
This commit is contained in:
Raito Bezarius 2023-12-04 14:07:30 +01:00
parent c59364d623
commit dde8386f75
3 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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;
};

View file

@ -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
'';