Skip to content

Commit aed908f

Browse files
committed
platform: boot raspberry pi hosts with extlinux
1 parent e197713 commit aed908f

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

platform/nix/hosts/enschede-pi-1/default.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
{ ... }:
1+
{ lib, ... }:
22
{
33
imports = [
44
../../profiles/worker.nix
55
../../modules/k3s/node-labels.nix
66
./disko.nix
77
];
88

9+
# Raspberry Pi images boot through firmware + U-Boot/extlinux rather than EFI/systemd-boot.
10+
boot.loader = {
11+
grub.enable = lib.mkForce false;
12+
systemd-boot.enable = lib.mkForce false;
13+
efi.canTouchEfiVariables = lib.mkForce false;
14+
generic-extlinux-compatible.enable = true;
15+
};
16+
917
networking.hostName = "enschede-pi-1";
1018
personalStack.k3sNodeLabels = {
1119
"personal-stack/site" = "enschede";

platform/nix/hosts/enschede-pi-2/default.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
{ ... }:
1+
{ lib, ... }:
22
{
33
imports = [
44
../../profiles/worker.nix
55
../../modules/k3s/node-labels.nix
66
./disko.nix
77
];
88

9+
# Raspberry Pi images boot through firmware + U-Boot/extlinux rather than EFI/systemd-boot.
10+
boot.loader = {
11+
grub.enable = lib.mkForce false;
12+
systemd-boot.enable = lib.mkForce false;
13+
efi.canTouchEfiVariables = lib.mkForce false;
14+
generic-extlinux-compatible.enable = true;
15+
};
16+
917
networking.hostName = "enschede-pi-2";
1018
personalStack.k3sNodeLabels = {
1119
"personal-stack/site" = "enschede";

platform/nix/hosts/enschede-pi-3/default.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
{ ... }:
1+
{ lib, ... }:
22
{
33
imports = [
44
../../profiles/worker.nix
55
../../modules/k3s/node-labels.nix
66
./disko.nix
77
];
88

9+
# Raspberry Pi images boot through firmware + U-Boot/extlinux rather than EFI/systemd-boot.
10+
boot.loader = {
11+
grub.enable = lib.mkForce false;
12+
systemd-boot.enable = lib.mkForce false;
13+
efi.canTouchEfiVariables = lib.mkForce false;
14+
generic-extlinux-compatible.enable = true;
15+
};
16+
917
networking.hostName = "enschede-pi-3";
1018
personalStack.k3sNodeLabels = {
1119
"personal-stack/site" = "enschede";

platform/tooling/src/test/kotlin/com/jorisjonkers/personalstack/platform/PlatformHostDefinitionsTest.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ class PlatformHostDefinitionsTest {
4444
}
4545
}
4646

47+
@Test
48+
fun `raspberry pi hosts override efi boot with generic extlinux`() {
49+
listOf("enschede-pi-1", "enschede-pi-2", "enschede-pi-3").forEach { nodeName ->
50+
val hostDefinition = repositoryRoot.resolve("platform/nix/hosts/${nodeName}/default.nix").toFile().readText()
51+
52+
assertThat(hostDefinition)
53+
.contains("systemd-boot.enable = lib.mkForce false")
54+
.contains("efi.canTouchEfiVariables = lib.mkForce false")
55+
.contains("generic-extlinux-compatible.enable = true")
56+
}
57+
}
58+
4759
@Test
4860
fun `flake exports every inventory node with the correct architecture`() {
4961
val flake = repositoryRoot.resolve("platform/flake.nix").toFile().readText()

0 commit comments

Comments
 (0)