Files
Jacob Graves 86734a4827 Jenkins CI (#496)
* jenkins: initial commit

* dockerfile: add git and libbtbb installations to prerequisites

* jenkins: add usbhub installation to docker, reset port before flashing ubertooth firmware

* jenkins: move builds/tests to scripts in ci-scripts

* jenkins: fix typo

* jenkins: fix another typo

* jenkins: specify usbhub id for dual hub setup

* jenkins: update cleanup, test host after testing firmware

* jenkins: turn unused usb hub ports off for testing

* jenkins: restructure test to better detect faulty firmware

* break firmware for ci

* jenkins: use relative path when specifying DFU_TOOL

* jenkins: remove intentional infinite loop to fix build

* jenkins: remove unneeded options and environment sections from build

* update usbhub driver and enable the --disable-i2c option

* ci: disable privileged mode and enable device cgroup rule for usb in docker

* ci: remove redundancies from Dockerfile

* ci: update comments in Dockerfile
2022-06-08 13:20:49 -04:00

35 lines
974 B
Bash
Executable File

#!/bin/bash
usbhub --disable-i2c --hub D9D1 power state --port 4 --reset
sleep 1s
host/build/ubertooth-tools/src/ubertooth-dfu -d firmware/bluetooth_rxtx/bluetooth_rxtx.dfu -r
DFU_STATUS="$?"
if [ "$DFU_STATUS" == "0" ]
then
echo "DFU installation success! Checking device..."
sleep 1s
host/build/ubertooth-tools/src/ubertooth-util -b -p -s
DEVICE_STATUS="$?"
if [ "$DEVICE_STATUS" == "0" ]
then
echo "Device found! Exiting."
exit $DEVICE_STATUS
elif [ "$DEVICE_STATUS" == "1" ]
then
echo "Could not find device! Broken firmware? Exiting."
exit 99
else
echo "Unhandled device error!"
exit $DEVICE_STATUS
fi
elif [ "$DFU_STATUS" == "1" ]
then
echo "No Ubertooth found! Disconnected? Exiting."
exit $DFU_STATUS
elif [ "$DFU_STATUS" == "127" ]
then
echo "Host tool installation failed! Exiting."
exit $DFU_STATUS
else
echo "Unhandled DFU error!"
exit $DFU_STATUS
fi