nixos-riscv/fpga/run-node.sh
Rodrigo Arias Mallo ec70f54609 Prepare CI pipeline to boot NixOS
Increase the timeout to 30 minutes and load the rootfs
2024-08-30 18:37:15 +02:00

34 lines
689 B
Bash
Executable File

#!/usr/bin/bash
#set -x
set -e
echo "Hello from $(hostname)"
path="$1"
cd "$path"
# First kill any picocom instance
killall picocom || true
# Setup the environment
. env.sh
set -x
# Then perform the boot
./fpgactl -w bitstream.bit -b opensbi.bin -k kernel.bin -i initrd.bin -r rootfs.img
# Restart it again only loading the bootrom and OpenSBI (notice OpenSBI
# relocates itself so it will likely be gone by now)
sleep 1 && ./fpgactl -b opensbi.bin &
timeout=$((30 * 60)) # Always stop after 30 min
timeout_silent=$((10 * 60)) # Stop if 10 min without output
# Set dead switch
sleep $timeout && killall picocom &
picocom -q -x $(($timeout_silent*1000)) -b 115200 $FPGACTL_UART