stage-0: defaults according to platform and kernel version
AArch64 Linux (arm64) didnd't support kexec up until 4.8
-{ config, lib, modules, baseModules, ... }:
+{ config, lib, pkgs, modules, baseModules, ... }:
# This module provides the `stage-0` build output.
# It is the same configuration, with minor customizations.
let
inherit (lib) mkOption types;
inherit (config.mobile.quirks) supportsStage-0;
+ kernelVersionSupportsKexec =
+ if pkgs.targetPlatform.system == "aarch64-linux"
+ then (lib.versionAtLeast (config.mobile.boot.stage-1.kernel.package.version) "4.8")
+ else true
+ ;
in
{
options = {
mobile.quirks.supportsStage-0 = mkOption {
type = types.bool;
- default = true;
+ default = kernelVersionSupportsKexec;
+ defaultText = "(Varies per platform; aarch64 depends on kernel version.)";
description = ''
Set to false when a device cannot use `kexec` to kexec into a system.
+
+ A default value will be selected according to the platform and
+ `mobile.boot` kernel selected.
'';
};
};
