#!/bin/sh # # Load puzzlefw kernel driver. # start() { # Check that the FPGA is running. # If the PuzzleFW firmware is not running on the FPGA, # attempting to load the driver will crash the system. read fpga_state &2 exit 1 fi # Load module. echo "Loading puzzlefw driver ..." insmod /opt/puzzlefw/driver/puzzlefw.ko } stop() { echo -n "Unloading puzzlefw driver ..." rmmod puzzlefw } case "$1" in start) start ;; stop) stop ;; restart|reload) stop start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac