There are many other questions about running a script on startup, but I am specifically interested in getting a short Python script to run as soon as possible when the Pi boots.
All it requires is SPI to write to a TFT display (ILI9341). The screen is initially white, so I'd like to display something as soon as possible to appease the user. I'm running Raspbian Stretch on a RasPi 3 and it takes 16 seconds from when I connect power to when the script runs.
The script is in /etc/init.d/MSDriver.sh, which runs a show-logo.py. Currently the following is used to make it run on startup:
sudo update-rc.d MSDriver.sh defaults 95 05
I've tried lowering
01, as from what I understand a lower number means a higher start priority. Even still, it takes 16 seconds from power-on to when the script runs.
Here's my LSB header: (I've prepended slashes only to stop raspi.SE from rendering them as headers)
\### BEGIN INIT INFO
\# Provides: MSDriver
\# Required-Start: hostname $local_fs
\# Default-Start: 2 3 4 5
\# Default-Stop: 0 1 6
\# Short-Description: Start/stop MSDriver
\# Description: This script starts/stops MSDriver.
\### END INIT INFO
How can I get this script to run sooner?
(kindly let me know if there's anything I can do to improve my question, thanks! :)