diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-01-12 16:58:08 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-01-12 16:58:08 +0000 |
commit | c8a77dfe4d3d307c1d5dd2650b7297447d8b609d (patch) | |
tree | 9ea78393bc3ecd6ab4de449383d4e97e5f3648ae /net-wireless/hackrf-tools | |
parent | 2891d29af8907ce881662f4a02844926d7a293c7 (diff) |
gentoo resync : 12.01.2019
Diffstat (limited to 'net-wireless/hackrf-tools')
-rw-r--r-- | net-wireless/hackrf-tools/Manifest | 3 | ||||
-rwxr-xr-x | net-wireless/hackrf-tools/files/hackrf_easy_flash | 162 | ||||
-rw-r--r-- | net-wireless/hackrf-tools/hackrf-tools-2018.01.1-r1.ebuild (renamed from net-wireless/hackrf-tools/hackrf-tools-2018.01.1.ebuild) | 4 |
3 files changed, 167 insertions, 2 deletions
diff --git a/net-wireless/hackrf-tools/Manifest b/net-wireless/hackrf-tools/Manifest index 9ca6eee3a6f6..98825612a619 100644 --- a/net-wireless/hackrf-tools/Manifest +++ b/net-wireless/hackrf-tools/Manifest @@ -1,6 +1,7 @@ +AUX hackrf_easy_flash 4028 BLAKE2B bfa259dfa26ecd44894406fe0af417ec69451777e73399e84772690a9b26de74f6a6c249146179917ceeeb53465a35c197e2253706f3161c6662b65871769e3f SHA512 c8432b8e29621c00e81b235990a2c6e5ffdd26085e83965ac408f2f6e94dbd5a4bdc3dfa6c1080c156c6d21a4b4e2e09a02e861f1d651bbd5b01986629a18b69 DIST hackrf-2017.02.1.tar.xz 15409352 BLAKE2B 930c6d30cbcadd366f889add7cd8f9756edf7a6b82a478353ea94662e9d2e0b612ca5ec0473eb0083dcbec761f2d5385eea31608f50f81543449ffa4bc31d277 SHA512 7cd6ad9aa8fef8afed41c48a3358bff18c6b2a9a112b13daabda87726e0e3ca4cf1e0c0c6ff9689bdd49f854e2e5887a84ccd7975abef43a43b75ecf8a5236ce DIST hackrf-2018.01.1.tar.xz 15464500 BLAKE2B 3a56305ce17b46660621b8f3e996e35909d7a8e7ab88ef643ed8f4c8d68f346e11dfe5fd2cb37aa23af62f202f28d9a8dc1da0cd8768fdbd6f293c65562f25a4 SHA512 89848fb58a8a29f7fe85bd817d5716117a2c7a5f2c4bb8582ad1ba8186831ca3054ea1314de943d1e923641eb18b6008cd8af79585e58fa50d55d5a7fd1b04e4 EBUILD hackrf-tools-2017.02.1.ebuild 1789 BLAKE2B 20161a6b7e8671113734a07739e3b06877a0cccbedca9a7c2e5c46b565bef9895ce53892154287af729bf4ce9976dcc4bab10a9c6dfa534545d51d80adb80f3d SHA512 30db812a7478defce70a780c43bab24faeb84487b6b4a0dea633637e9c5169a98b6655a8378dee88a518bce4bcb8759eecc198095f857da18c1a40098bc13150 -EBUILD hackrf-tools-2018.01.1.ebuild 1789 BLAKE2B ceb59c1a24d3a825bed85a04d53d72b0814fe98dd2602a5a329d72c791923075bd5764747308aeebba212d42cfe1bcd2f188a85a9a4159c75e5d61d7e8896fb0 SHA512 a98f7a085966d5679f7a2eccac5689afe1d13169ccdb0e5155d7f19a901a3ee517e59036427ec65ad31bf4e79ddff53229b4574aa021d8b573f814fb0ee10270 +EBUILD hackrf-tools-2018.01.1-r1.ebuild 1915 BLAKE2B d96634f38cf22fd3e4f01c23ecd1f0125f0fdf8b6553daddf5175a3b3b94040a6ed9aaf00a1272aa952a50941250cad888bf8cfcd7ffd28ed9d0dda49c2195d5 SHA512 aa1881d149f17320b83e7795fafbe66ca2c0667c54a44ede32bcd4c79557301878295de622b0939ace599bf302e86c27b4f9336cd81f0285435215075865665e EBUILD hackrf-tools-9999.ebuild 1789 BLAKE2B 20161a6b7e8671113734a07739e3b06877a0cccbedca9a7c2e5c46b565bef9895ce53892154287af729bf4ce9976dcc4bab10a9c6dfa534545d51d80adb80f3d SHA512 30db812a7478defce70a780c43bab24faeb84487b6b4a0dea633637e9c5169a98b6655a8378dee88a518bce4bcb8759eecc198095f857da18c1a40098bc13150 MISC metadata.xml 477 BLAKE2B b801f5f0a79afbd3227a4ee2688b9332824f61b8bda623565d2f36408dc792aacc273495d7ada5a37a69092bedc61b7ca28952738a5969bfe3132253423d437d SHA512 ba679c6d4942d6a0f8efb480f820434676e37148bc60b481e9b7b0fe13b6037ee8c450632a85de25ed08e96b6e3308ee7b54b8a5f5130cd43827ad811d59a825 diff --git a/net-wireless/hackrf-tools/files/hackrf_easy_flash b/net-wireless/hackrf-tools/files/hackrf_easy_flash new file mode 100755 index 000000000000..78d0c69b0cd5 --- /dev/null +++ b/net-wireless/hackrf-tools/files/hackrf_easy_flash @@ -0,0 +1,162 @@ +#!/bin/sh + +DFU_MODE=0 +CPLD=0 + +get_dfu() { + if [ -r "/usr/share/hackrf/hackrf_one_usb.dfu" ]; then + ram_firmware="/usr/share/hackrf/hackrf_one_usb.dfu" + else + printf "Unable to find hackrf_one_usb.dfu in the search path\n" + exit 1 + fi + export ram_firmware +} + +get_cpld() { + if [ -r "/usr/share/hackrf/hackrf_cpld_default.xsvf" ]; then + cpld="/usr/share/hackrf/hackrf_cpld_default.xsvf" + else + printf "Unable to find default.xsvf in the search path\n" + exit 1 + fi + export cpld +} + +usage() { + printf "hackrf_easy_flash list\n" + printf "hackrf_easy_flash upgrade\n" +} + +if [ -z "${1}" ]; then + usage + exit 0 +fi + +list_firmware() { + if [ ${DFU_MODE} = 1 ]; then + if [ -z "${ram_firmware}" ]; then + get_dfu + fi + printf "Best DFU found: ${ram_firmware}\n" + fi + printf "Available firmware options:\n" + if [ -r "/usr/share/hackrf/hackrf_one_usb.bin" ]; then + printf "hackrf (default)\n" + fi + if [ -r "/usr/share/hackrf/portapack-h1-firmware.bin" ]; then + printf "portapack (--portapack)\n" + fi + if [ -r "/usr/share/hackrf/portapack-h1-havoc.bin" ]; then + printf "portapack-havoc (--havoc)\n" + fi +} + +#parse args +while [ -n "${1}" ]; do + case $1 in + -h|--help) + usage + exit 0 + ;; + list|--list) + list_firmware + exit 0 + ;; + update|--update|upgrade|--upgrade|hackrf|--hackrf) + firmware="/usr/share/hackrf/hackrf_one_usb.bin" + TARGET=hackrf + shift + ;; + portapack|--portapack) + firmware="/usr/share/hackrf/portapack-h1-firmware.bin" + TARGET=portapack + shift + ;; + havoc|--havoc) + firmware="/usr/share/hackrf/portapack-h1-havoc.bin" + TARGET=havoc + shift + ;; + cpld|--cpld) + CPLD=1 + get_cpld + shift + ;; + dfu|--dfu) + DFU_MODE=1 + get_dfu + shift + ;; + --) + shift + break + ;; + *) + break + ;; + esac +done + +if [ -z "${firmware}" ]; then + firmware="/usr/share/hackrf/hackrf_one_usb.bin" + TARGET="hackrf" +fi + +if [ ! -r "${firmware}" ]; then + printf "Unable to find or read ${firmware}\n" + printf "Please ensure the requested firmware is installed and readable\n" + exit 1 +fi + +if [ "${CPLD}" = 1 ] && [ "${TARGET}" != "hackrf" ]; then + printf "To update the CPLD you must use the stock hackrf firmware or do this update manually\n" + printf "Try \"$(basename $0) --cpld && $(basename $0) ${TARGET}\"\n" + exit 1 +fi + +printf "This tool is provided by Gentoo, please report bugs on https://bugs.gentoo.org/\n\n" +if [ ${DFU_MODE} = 1 ]; then + printf "Preparing to reset hackrf with DFU ${ram_firmware}\n" + printf "Then flashing with ${firmware}\n\n" + printf "Hold down the HackRF's DFU button (the button closest to the antenna jack)\n" + printf "then plug the HackRF into a USB port on your computer.\n" + printf "After the HackRF is plugged in, you may release the DFU button.\n" + printf "Press any key to continue or ^c to abort\n" + read + if ! dfu-util --device 1fc9:000c --download "${ram_firmware}" --reset; then + printf "dfu-util reported failure, quitting\n" + exit 1 + fi + sleep 2s +else + if hackrf_info | grep -q 'No HackRF boards found.'; then + printf "No hackrf found, please ensure you are in hackrf mode or try --dfu\n" + exit 1 + fi +fi +if hackrf_spiflash -w "${firmware}"; then + sleep 3s + hackrf_spiflash -R + sleep 3s +else + printf "hackrf_spiflash reported failure, quitting\n" + exit 1 +fi +if [ "${CPLD}" = 1 ]; then + #printf "To update the cpld, please reset your hackrf into it's new firmware before updating the cpld\n" + #printf "Please reset your hackrf by pressing the button furthest from the antenna or power cycling it.\n" + #printf "Press any key to continue or ^c to abort\n" + #read + if hackrf_cpldjtag -x "${cpld}"; then + sleep 3s + hackrf_spiflash -R + else + printf "hackrf_cpldjtag reported failure\n" + exit 1 + fi +fi +if [ "${TARGET}" = "hackrf" ]; then + hackrf_info +fi +printf "If you saw no errors, you are up to date with the requested firmware\n" diff --git a/net-wireless/hackrf-tools/hackrf-tools-2018.01.1.ebuild b/net-wireless/hackrf-tools/hackrf-tools-2018.01.1-r1.ebuild index 8e2e2ed538cf..077393444eb7 100644 --- a/net-wireless/hackrf-tools/hackrf-tools-2018.01.1.ebuild +++ b/net-wireless/hackrf-tools/hackrf-tools-2018.01.1-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=6 @@ -30,6 +30,7 @@ RDEPEND="${DEPEND}" src_install() { cmake-utils_src_install + dosbin "${FILESDIR}/hackrf_easy_flash" if [[ ${PV} != "9999" ]] ; then insinto /usr/share/hackrf newins "${WORKDIR}/hackrf-${PV}/firmware-bin/hackrf_jawbreaker_usb.bin" hackrf_jawbreaker_usb-${PV}.bin @@ -41,6 +42,7 @@ src_install() { ln -s hackrf_one_usb-${PV}.bin "${ED}/usr/share/hackrf/hackrf_one_usb.bin" ln -s hackrf_one_usb-${PV}.dfu "${ED}/usr/share/hackrf/hackrf_one_usb_ram.dfu" ln -s hackrf_one_usb-${PV}.dfu "${ED}/usr/share/hackrf/hackrf_one_usb.dfu" + ln -s hackrf_cpld_default-${PV}.xsvf "${ED}/usr/share/hackrf/hackrf_cpld_default.xsvf" else ewarn "The compiled firmware files are only available in the versioned releases, you are on your own for this." fi |