image: make the gpt headerHole configurable
This commit is contained in:
parent
2e7795a938
commit
17d2029ba2
|
@ -1,5 +1,8 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
# we need space in the GPT header to place tow-boot.
|
||||||
|
# only actually need 1 MB, but better to over-allocate than under-allocate
|
||||||
|
colinsane.image.extraGPTPadding = 16 * 1024 * 1024;
|
||||||
system.build.img = pkgs.runCommandNoCC "nixos_full-disk-image.img" {} ''
|
system.build.img = pkgs.runCommandNoCC "nixos_full-disk-image.img" {} ''
|
||||||
cp -v ${config.system.build.img-without-firmware}/nixos.img $out
|
cp -v ${config.system.build.img-without-firmware}/nixos.img $out
|
||||||
chmod +w $out
|
chmod +w $out
|
||||||
|
|
|
@ -10,6 +10,10 @@ in
|
||||||
default = [];
|
default = [];
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.package;
|
||||||
};
|
};
|
||||||
|
colinsane.image.extraGPTPadding = mkOption {
|
||||||
|
default = 0;
|
||||||
|
type = types.int;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
config = let
|
config = let
|
||||||
# return true if super starts with sub
|
# return true if super starts with sub
|
||||||
|
@ -52,8 +56,7 @@ in
|
||||||
# leave some space for firmware
|
# leave some space for firmware
|
||||||
# TODO: we'd prefer to turn this into a protected firmware partition, rather than reserving space in the GPT header itself
|
# TODO: we'd prefer to turn this into a protected firmware partition, rather than reserving space in the GPT header itself
|
||||||
# Tow-Boot manages to do that; not sure how.
|
# Tow-Boot manages to do that; not sure how.
|
||||||
# TODO: does this method work on all systems (test on lappy)
|
headerHole = cfg.extraGPTPadding;
|
||||||
headerHole = imageBuilder.size.MiB 16;
|
|
||||||
partitions = [
|
partitions = [
|
||||||
(fsBuilderMapBoot."${bootFs.fsType}" {
|
(fsBuilderMapBoot."${bootFs.fsType}" {
|
||||||
# fs properties
|
# fs properties
|
||||||
|
|
Loading…
Reference in New Issue
Block a user