Add bitstream loading and run init scripts at boot time #52
Loading…
Reference in New Issue
No description provided.
Delete Branch "fsagbuya/nix-servo:fast-servo-init"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Note: This PR is rebased from #50. Need to merge that first before this.
Use
postBootCommand
here rather than runit because it does not support one-shot services like this. Also there will be issues on running our program in parallel with other services and the log in prompt. See sample implementation below:Note that it is imperative to use commands like
sv force-stop
andsv exit
here to emulate a one-shot type of service, otherwise runit will restart the service continously.Boot log: (Qemu)
The log-in prompt shows while the fpga manager is still on-going.
See full fast-servo boot log here: https://gist.github.com/fsagbuya/aa5bc932b653bc9f96f07dfbcde12f64#file-servo_bootlog-txt-L54-L170.
56c749eda4
toc06ad6ef1c
c06ad6ef1c
to07e0d6aa0d
07e0d6aa0d
toff8bf82988
ff8bf82988
tob7578e175a
@ -214,0 +225,4 @@
echo gateware.bin > /sys/class/fpga_manager/fpga0/firmware
# Run device init scripts
mkdir -p /opt/pyfastservo
Put those into a regular derivation instead of doing nix's job (poorly).
I can combine the
systemPackages
andpostBootCommands
to a single derivation and call itfast-servo-config
or something. Is that acceptable?Obviously not. Those init scripts are a regular package.
b7578e175a
toe149095e81
e149095e81
tocc0879fcb0
@ -214,0 +239,4 @@
# Program the FPGA
set +x
echo "Flashing bitstream..."
It's not flashing, just loading into SRAM. Please send another PR addressing this incorrect terminology.