From b76c5b4abef377d8cffeca8165843c4f8abf86fc Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 4 Dec 2023 14:11:53 +0100 Subject: [PATCH] modules/ubifs: revamp to offer directly access to the UBIfs partition Adds the LEB and PEB option and let the user remove the boot image in case where U-Boot does not support UBI boot. --- modules/outputs/ubifs.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/outputs/ubifs.nix b/modules/outputs/ubifs.nix index cfa27b9..11c879c 100644 --- a/modules/outputs/ubifs.nix +++ b/modules/outputs/ubifs.nix @@ -12,9 +12,16 @@ in imports = [ ./initramfs.nix ]; + + options.system.outputs.rootubifs = mkOption { + type = types.package; + internal = true; + }; + options.hardware.ubi = { minIOSize = mkOption { type = types.str; }; - eraseBlockSize = mkOption { type = types.str; }; # LEB + logicalEraseBlockSize = mkOption { type = types.str; }; # LEB + physicalEraseBlockSize = mkOption { type = types.str; }; # PEB maxLEBcount = mkOption { type = types.str; }; # LEB }; @@ -35,7 +42,7 @@ in } '' mkdir tmp tree=${o.bootablerootdir} - mkfs.ubifs -x favor_lzo -c ${cfg.maxLEBcount} -m ${cfg.minIOSize} -e ${cfg.eraseBlockSize} -y -r $tree --output $out --squash-uids -o $out + mkfs.ubifs -x favor_lzo -c ${cfg.maxLEBcount} -m ${cfg.minIOSize} -e ${cfg.logicalEraseBlockSize} -y -r $tree --output $out --squash-uids -o $out ''; }; };