mirror of
https://github.com/nix-community/disko.git
synced 2024-09-17 09:37:17 +03:00
fix gpt-bios-compat example and test it.
This commit is contained in:
parent
e0de34c07d
commit
fd2de4ddd4
@ -1,33 +0,0 @@
|
||||
# Example to create a bios compatible gpt partition
|
||||
{
|
||||
type = "devices";
|
||||
content = {
|
||||
sda = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
type = "partition";
|
||||
start = "0";
|
||||
end = "1M";
|
||||
part-type = "primary";
|
||||
flags = ["bios_grub"];
|
||||
content.type = "noop";
|
||||
}
|
||||
{
|
||||
type = "partition";
|
||||
# leave space for the grub aka BIOS boot
|
||||
start = "1M";
|
||||
end = "100%";
|
||||
part-type = "primary";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
37
example/gpt-bios-compat.nix
Normal file
37
example/gpt-bios-compat.nix
Normal file
@ -0,0 +1,37 @@
|
||||
# Example to create a bios compatible gpt partition
|
||||
{
|
||||
disk = {
|
||||
vdb = {
|
||||
device = "/dev/vdb";
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
name = "boot";
|
||||
type = "partition";
|
||||
start = "0";
|
||||
end = "1M";
|
||||
part-type = "primary";
|
||||
flags = ["bios_grub"];
|
||||
}
|
||||
{
|
||||
name = "root";
|
||||
type = "partition";
|
||||
# leave space for the grub aka BIOS boot
|
||||
start = "1M";
|
||||
end = "100%";
|
||||
part-type = "primary";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
10
tests/gpt-bios-compat.nix
Normal file
10
tests/gpt-bios-compat.nix
Normal file
@ -0,0 +1,10 @@
|
||||
{ pkgs ? (import <nixpkgs> { })
|
||||
, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest
|
||||
}:
|
||||
makeDiskoTest {
|
||||
disko-config = import ../example/gpt-bios-compat.nix;
|
||||
extraTestScript = ''
|
||||
machine.succeed("mountpoint /mnt");
|
||||
machine.succeed("grub-install --target=i386-pc /dev/vdb");
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user