forked from Ideetron/Larank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·36 lines (28 loc) · 1.11 KB
/
install
File metadata and controls
executable file
·36 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# start me like: install lorank8v1 1.0.1
# from the directory you cloned the repro Lorank in.
# Control of urs leds
function led_on { pushd /sys/class/leds/beaglebone\:green\:usr$1; echo none > trigger; echo 1 > brightness; popd; }
function led_off { pushd /sys/class/leds/beaglebone\:green\:usr$1; echo none > trigger; echo 0 > brightness; popd; }
function led_flash { pushd /sys/class/leds/beaglebone\:green\:usr$1; echo timer > trigger; echo 50 > delay_on; echo 100 > delay_off; popd; }
function led_blank { led_off 0; led_off 1; led_off 2; led_off 3; }
function led_error { led_flash 0; led_flash 1; led_flash 2; led_flash 3; }
HWTARGET=$1
SWVERSION=$2
# report progress
led_blank
led_flash 0
sleep 1
# Set the Lorank installation software to the correct release.
pushd Lorank
if [[ $SWVERSION != "" ]]; then git checkout -q Lorank_v$SWVERSION; fi
popd
# Start the platform dependent installation for this release.
./Lorank/$HWTARGET/install $SWVERSION
# We are done, check if we must report an error, if not terminate.
if [ $? -ne 0 ];
then
led_error
else
systemctl --no-block poweroff
fi