mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-11 09:04:01 +03:00
image-builder: tests: de-hardcodes partition IDs
This commit is contained in:
parent
ba36d675f7
commit
746df92fb6
@ -6,19 +6,22 @@ let
|
||||
imageBuilder = pkgs.callPackage <image-builder> {};
|
||||
inherit (pkgs.lib.attrsets) mapAttrsToList;
|
||||
inherit (pkgs.lib.strings) concatStringsSep removePrefix;
|
||||
IDs = {
|
||||
FAT32 = "0123456789ABCDEF";
|
||||
ESP = "0123456789ABCDEF";
|
||||
};
|
||||
in
|
||||
|
||||
with imageBuilder;
|
||||
|
||||
let
|
||||
cmds =
|
||||
mapAttrsToList (name: fn:
|
||||
mapAttrsToList (fn_name: fn:
|
||||
let
|
||||
fs = fn {
|
||||
name = removePrefix "make" name;
|
||||
size = size.MiB 10;
|
||||
# FIXME : this is wrong. Not all partition IDs have the same format.
|
||||
partitionID = "0123456789ABCDEF";
|
||||
fs = fn rec {
|
||||
name = removePrefix "make" fn_name;
|
||||
size = imageBuilder.size.MiB 10;
|
||||
partitionID = IDs."${name}";
|
||||
};
|
||||
in
|
||||
''
|
||||
|
@ -6,18 +6,21 @@ let
|
||||
imageBuilder = pkgs.callPackage <image-builder> {};
|
||||
inherit (pkgs.lib.attrsets) mapAttrsToList;
|
||||
inherit (pkgs.lib.strings) concatStringsSep removePrefix;
|
||||
IDs = {
|
||||
FAT32 = "0123456789ABCDEF";
|
||||
ESP = "0123456789ABCDEF";
|
||||
};
|
||||
in
|
||||
|
||||
with imageBuilder;
|
||||
|
||||
let
|
||||
cmds =
|
||||
mapAttrsToList (name: fn:
|
||||
mapAttrsToList (fn_name: fn:
|
||||
let
|
||||
fs = fn {
|
||||
name = removePrefix "make" name;
|
||||
# FIXME : this is wrong. Not all partition IDs have the same format.
|
||||
partitionID = "0123456789ABCDEF";
|
||||
fs = fn rec {
|
||||
name = removePrefix "make" fn_name;
|
||||
partitionID = IDs."${name}";
|
||||
populateCommands = ''
|
||||
echo "I am ${name}." > file
|
||||
ls -lA
|
||||
|
Loading…
Reference in New Issue
Block a user