From 848214d1047532acb902df7c1a534a1cba26f62b Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 23 Dec 2024 22:36:14 +0000 Subject: [PATCH] add ubivolume output --- modules/outputs/ubivolume.nix | 5 ++++- modules/outputs/zyxel-nwa-fit.nix | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/outputs/ubivolume.nix b/modules/outputs/ubivolume.nix index 1d82292..d5097cd 100644 --- a/modules/outputs/ubivolume.nix +++ b/modules/outputs/ubivolume.nix @@ -18,6 +18,9 @@ in eraseBlockSize = mkOption { type = types.str; }; # LEB maxLEBcount = mkOption { type = types.str; }; # LEB }; + options.system.outputs.ubivolume = mkOption { + type = types.package; + }; config = mkIf (config.rootfsType == "ubifs") { kernel.config = { @@ -28,7 +31,7 @@ in }; boot.initramfs.enable = true; - system.outputs.rootfs = + system.outputs.ubivolume = let inherit (pkgs.pkgsBuildBuild) runCommand; ubiVolume = ({ name, volumeId, image, flags ? [] }: diff --git a/modules/outputs/zyxel-nwa-fit.nix b/modules/outputs/zyxel-nwa-fit.nix index a6e14b6..13e8f9d 100644 --- a/modules/outputs/zyxel-nwa-fit.nix +++ b/modules/outputs/zyxel-nwa-fit.nix @@ -31,7 +31,7 @@ on a system with pre-existing firmware and OS. config = mkIf (config.rootfsType == "ubifs") { system.outputs.zyxel-nwa-fit = - let + let o = config.system.outputs; # 8129kb padding. paddedKernel = pkgs.runCommand "padded-kernel" {} '' @@ -39,7 +39,7 @@ on a system with pre-existing firmware and OS. dd if=/dev/zero of=$out bs=1 count=1 seek=8388607 ''; firmwareImage = pkgs.runCommand "firmware-image" {} '' - cat ${paddedKernel} ${o.rootfs} > $out + cat ${paddedKernel} ${o.ubivolume} > $out ''; dts = pkgs.writeText "image.its" '' /dts-v1/;