hackrf/ci-scripts/test-firmware-program.sh
Jacob Graves fa0662e54c Jenkins CI (#1102)
* jenkins: initial commit

* jenkins: add missing usb hub check script

* jenkins: squish docker apt package install commands into a single command

* jenkins: fix type in Dockerfile

* jenkins: override interactive installations in Dockerfile (build-essentials fails due to tzdata)

* jenkins: set executable flag on ci scripts

* jenkins: remove sudo prefix from install scripts

* jenkins: add python3 venv to Dockerfile and build scripts

* jenkins: add missing python venv command to host install script

* jenkins: remove python install and venv redundancies

* jenkins: remove make install step, run hackrf tools directly from their build directory

* jenkins: re-add python3 and pip installations to docker because usbhub depends on them

* jenkins: add missing git install to docker

* jenkins: add python-is-python3 to docker's installed dependencies

* jenkins: use path string to specify the correct device for dfu-util

* jenkins: specify usbhub id for dual hub setup

* jenkins: turn unused usb hub ports off for testing

* jenkins: remove custom job throttle property

* use --disable-i2c usbhub option, install usbhub from latest, replace --privileged with cgroups option, remove redundancies from Dockerfile

* update device usb path for dfu-util

* remove apt/lists/* and fix typos

* ci: remove redundant environment setup in Jenkins
2022-06-08 13:26:28 -04:00

21 lines
569 B
Bash
Executable File

#!/bin/bash
usbhub --disable-i2c --hub D9D1 power state --port 2 --reset
sleep 1s
dfu-util --path 1-2.2 --alt 0 --download firmware/hackrf_usb/build/hackrf_usb.dfu
EXIT_CODE="$?"
if [ "$EXIT_CODE" == "0" ]
then
echo "DFU installation success! Exiting.."
exit $EXIT_CODE
elif [ "$EXIT_CODE" == "74" ]
then
echo "No DFU capable USB device available! Disconnected? Exiting.."
exit 1
elif [ "$EXIT_CODE" == "127" ]
then
echo "dfu-util installation failed! Exiting.."
exit $EXIT_CODE
else
echo "god have mercy on your soul"
exit $EXIT_CODE
fi