Compare commits

...

2 Commits

Author SHA1 Message Date
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
c2cc5c0d6a fix fs_mode_rw filename mismatch 2025-04-14 12:58:20 +08:00
2 changed files with 4 additions and 4 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..f1f73cb 100644
index 331fecd..67203ff 100644
--- a/stage-1.nix
+++ b/stage-1.nix
@@ -117,11 +117,6 @@ let
@ -96,8 +96,8 @@ index 331fecd..f1f73cb 100644
+ mkdir -p /boot
+ mount -t vfat -o ro /dev/mmcblk0p1 /boot
+ USE_READONLY=1
+ if [ -e /boot/rw_mode ]; then
+ echo "Found rw_mode flag, enabling read-write mode"
+ if [ -e /boot/fs_mode_rw ]; then
+ echo "Found fs_mode_rw file, enabling read-write mode"
+ USE_READONLY=0
+ fi
+ if [ "$USE_READONLY" = "1" ]; then