This commit is contained in:
Buzz 2017-07-31 23:46:10 +10:00
parent 75c16b82c7
commit c17456216e

View File

@ -7,34 +7,19 @@ firmwaredir = "/firmware"
FILES_${PN} += "${firmwaredir}/" FILES_${PN} += "${firmwaredir}/"
REPO_NAME = "ardupilot-solo" REPO_NAME = "ardupilot-solo"
REPO_TAG = "solo-${PV}" #REPO_TAG = "solo-${PV}"
REPO_TAG = "solo-master"
FILE_EXT = "px4" FILE_EXT = "px4"
FILE_SRC = "ArduCopter-v2.${FILE_EXT}" FILE_SRC = "ArduCopter-v2.${FILE_EXT}"
FILE_DST = "ArduCopter-${PV}.${FILE_EXT}" FILE_DST = "ArduCopter-${PV}.${FILE_EXT}"
do_fetch () { do_fetch () {
#
# look up a release by tag name via the github api,
# extract the url for the build artifact that we're interested in (*.FILE_EXT),
# and download it.
# NB: this relies on the fact that tag names in the repo are of a specific form # TODO - smart fetch the correct version of the formware to match the repo-tag requested or something
# such that we can derive the tag name from the bitbake PV variable, which is itself # for now, get the LATEST MASTER PX4v2 ( ie pixhawk1 or 2.0(solo) firmware from ArduPilot build system:
# derived from the name of this file. curl http://firmware.ap.ardupilot.org/Copter/latest/PX4/ArduCopter-v2.px4 -o ${WORKDIR}/${FILE_SRC}
# or simply fake it with a zero-length file if the curl fails for some reason..:
SRC_URL="https://api.github.com/repos/OpenSolo/${REPO_NAME}/releases/tags/${REPO_TAG}" #touch ${WORKDIR}/${FILE_SRC}
echo $SRC_URL
BIN_URL=$(curl -s -H "Accept: application/json" ${SRC_URL} | jq -r '.assets[] | select(.name | endswith(".${FILE_EXT}")) | .url')
echo $BIN_URL
# NB: supply github access token as url param because if we supply it as a header,
# once github redirects us to s3, it gets included in that request as well
# and amazon complains that 2 forms of auth have been provided and quits.
echo 'curl -v -L -H "Accept: application/octet-stream" ${BIN_URL}?access_token=${TOKEN} -o ${WORKDIR}/${FILE_SRC}'
# fake it:
touch ${WORKDIR}/${FILE_SRC}
} }
do_install () { do_install () {