forked from DGNum/liminix
feat(zyxel): cleanup A/B schema
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
parent
afb14d844b
commit
59d6640343
8 changed files with 29 additions and 180 deletions
|
@ -67,10 +67,6 @@ in {
|
|||
default = "bootargs";
|
||||
description = "Kernel command line's devicetree node";
|
||||
};
|
||||
imageType = mkOption {
|
||||
type = types.enum [ "primary" "secondary" ];
|
||||
default = "primary";
|
||||
};
|
||||
imageFormat = mkOption {
|
||||
type = types.enum ["fit" "uimage"];
|
||||
default = "uimage";
|
||||
|
@ -113,7 +109,10 @@ in {
|
|||
"root=${config.hardware.rootDevice}"
|
||||
"rootfstype=${config.rootfsType}"
|
||||
"fw_devlink=off"
|
||||
] ++ lib.optional (config.rootOptions != null) "rootflags=${config.rootOptions}";
|
||||
]
|
||||
++ (map (mtd: "ubi.mtd=${mtd}") config.hardware.ubi.mtds)
|
||||
++ lib.optional (config.rootOptions != null) "rootflags=${config.rootOptions}"
|
||||
++ lib.optional (config.hardware.alternativeRootDevice != null) "altroot=${config.hardware.alternativeRootDevice}";
|
||||
|
||||
system.callService = path : parameters :
|
||||
let
|
||||
|
|
|
@ -82,6 +82,18 @@ in {
|
|||
type = types.str;
|
||||
example = "/dev/mtdblock3";
|
||||
};
|
||||
alternativeRootDevice = mkOption {
|
||||
description = "Full path to alternative preferred root device (the B partition of your rootfs)";
|
||||
type = types.nullOr types.str;
|
||||
example = "ubi_b:rootfs";
|
||||
default = null;
|
||||
};
|
||||
ubi.mtds = mkOption {
|
||||
description = "List of MTD device to attach";
|
||||
type = types.listOf types.str;
|
||||
example = [ "ubi_a" "ubi_b" "data" ];
|
||||
default = null;
|
||||
};
|
||||
networkInterfaces = mkOption {
|
||||
type = types.attrsOf types.anything;
|
||||
};
|
||||
|
|
|
@ -62,7 +62,7 @@ on a system with pre-existing firmware and OS.
|
|||
};
|
||||
'';
|
||||
in
|
||||
pkgs.runCommand "zyxel-nwa-fit-${config.boot.imageType}" {
|
||||
pkgs.runCommand "zyxel-nwa-fit" {
|
||||
nativeBuildInputs = [ pkgs.pkgsBuildBuild.ubootTools pkgs.pkgsBuildBuild.dtc ];
|
||||
} ''
|
||||
mkimage -f ${dts} $out
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue