diff options
author | Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> | 2017-12-07 02:00:21 +0200 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> | 2018-01-22 11:18:23 +0200 |
commit | 962e79ef32c95435eca1c84856fdc9941ce06720 (patch) | |
tree | 4efe7988be7c5a67cf210072000f686885033dee /nixos/maintainers/scripts | |
parent | 73695300bc0ad15d01e5ac52329b9668b1a33704 (diff) |
nixos/make-disk-image.nix: Support EFI images
- Add a new parameter `imageType` that can specify either "efi" or
"legacy" (the default which should see no change in behaviour by
this patch).
- EFI images get a GPT partition table (instead of msdos) with a
mandatory ESP partition (so we add an assert that `partitioned`
is true).
- Use the partx tool from util-linux to determine exact start + size
of the root partition. This is required because GPT stores a secondary
partition table at the end of the disk, so we can't just have
mkfs.ext4 create the filesystem until the end of the disk.
- (Unrelated to any EFI changes) Since we're depending on the
`-E offset=X` option to mkfs which is only supported by e2fsprogs,
disallow any attempts of creating partitioned disk images where
the root filesystem is not ext4.
Diffstat (limited to 'nixos/maintainers/scripts')
-rw-r--r-- | nixos/maintainers/scripts/ec2/amazon-image.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/maintainers/scripts/ec2/amazon-image.nix b/nixos/maintainers/scripts/ec2/amazon-image.nix index 2e67edf8ee3..972c04453ae 100644 --- a/nixos/maintainers/scripts/ec2/amazon-image.nix +++ b/nixos/maintainers/scripts/ec2/amazon-image.nix @@ -46,7 +46,7 @@ in { inherit lib config; inherit (cfg) contents format name; pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package - partitioned = config.ec2.hvm; + partitionTableType = if config.ec2.hvm then "legacy" else "none"; diskSize = cfg.sizeMB; configFile = pkgs.writeText "configuration.nix" '' |