add installation script to repository

parent d0543eab
#!/bin/sh
SCRIPT_DIR=$(readlink -f $(dirname "${BASH_SOURCE[0]}"))
SERIAL_LINE=/dev/ttyUSB2
# override default serial line if need be
if [ x"$1" != x"" ] ; then
SERIAL_LINE="$1"
fi
# ensure existence of the serial line
if ! [ -c "$SERIAL_LINE" ] ; then
echo "serial device $SERIAL_LINE not present, exiting" >&2
exit 1
fi
# ensure permissions on the serial line
chmod -f 777 "$SERIAL_LINE" ||
[ -r $SERIAL_LINE -o -w $SERIAL_LINE ] ||
( echo "cannot r/w serial line $SERIAL_LINE, please run as root" 2>&1
exit )
# wrc.bin embedded firmware loading
BOOTLOADER=$SCRIPT_DIR/usb-bootloader.py
SPEED=921600
WRC_BIN=$SCRIPT_DIR/../lib/wrc.bin
PYTHON=$SCRIPT_DIR/../pyenv/bin/python3
# load wrc.bin firmware
$PYTHON $BOOTLOADER -b default -s $SPEED -p $SERIAL_LINE $WRC_BIN
sleep 7
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment