1
1
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:
Samuel Dionne-Riel 2019-08-29 18:12:51 -04:00
parent ba36d675f7
commit 746df92fb6
2 changed files with 17 additions and 11 deletions

View File

@ -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
''

View File

@ -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