Compare commits

...

3 Commits

Author SHA1 Message Date
8af7bdc386 reduce tmpfs overlay size to 256M 2025-04-22 14:20:44 +08:00
be6f2b36fd Merge pull request 'move FPGA programming before overlay mount' (#72) from fsagbuya/nix-servo:fix_fpga_ro_write into master
Reviewed-on: M-Labs/nix-servo#72
2025-04-14 16:54:16 +08:00
336fb07c44 move FPGA programming before overlay mount
Move FPGA programming from postBootCommands to preMount to ensure bitstream
is loaded before the filesystem becomes read-only. This fixes PL initialization
issues that occurred when the system booted in read-only mode.
2025-04-14 16:43:50 +08:00
2 changed files with 3 additions and 3 deletions

View File

@ -442,7 +442,7 @@
(pkgs.python3.withPackages(ps: with ps; [ pyfastservo linien-server]))
fs-mode
];
boot.postBootCommands = lib.mkAfter ''
not-os.preMount = lib.mkAfter ''
# Program the FPGA
set +x

View File

@ -59,7 +59,7 @@ index d7b0bf3..70353a1 100644
'';
}
diff --git a/stage-1.nix b/stage-1.nix
index 331fecd..67203ff 100644
index 331fecd..4ef51fb 100644
--- a/stage-1.nix
+++ b/stage-1.nix
@@ -117,11 +117,6 @@ let
@ -103,7 +103,7 @@ index 331fecd..67203ff 100644
+ if [ "$USE_READONLY" = "1" ]; then
+ mkdir -p /mnt.ro /mnt.overlay
+ mount -o ro $root /mnt.ro
+ mount -t tmpfs -o size=1G tmpfs /mnt.overlay
+ mount -t tmpfs -o size=256M tmpfs /mnt.overlay
+ mkdir -p /mnt.overlay/upper /mnt.overlay/work
+ mount -t overlay overlay -o lowerdir=/mnt.ro,upperdir=/mnt.overlay/upper,workdir=/mnt.overlay/work /mnt
+ mkdir -p /mnt/boot