First, we need script wich will perform the actions:
- Code: Select all
nano /usr/bin/startup.sh
The content could be the following:
- Code: Select all
#!/bin/sh
# LEDs firts.
for i in 97 108 #This is for Odroid C1+. Put desired GPIO pins here
do
echo $i > /sys/class/gpio/export
echo out > /sys/class/gpio$i/direction
echo 1 > /sys/class/gpio$i/value
done
#play a sound
mpg123 -a hw:1,0 /srv/http/startup.mp3
exit 0
Put your startup sound file to /srv/http folder. Make the command
- Code: Select all
chmod +x /usr/bin/startup.sh
Now, we should modify the Rune to launch this script after initial loading.
- Code: Select all
nano /srv/http/command/rune_SY_wrk
Find the line
- Code: Select all
runelog('--- NORMAL STARTUP');
Insert above that line the following:
- Code: Select all
// Startup sound
sysCmd('/usr/bin/startup.sh > /dev/null 2>&1 &');
That's all. Then the system will be ready, it will swith LEDs ON and play the sound.