Skip to content

Commit

Permalink
pluto index.html: add more build info into the index.html file
Browse files Browse the repository at this point in the history
Make the index.html page a little more dynamic, by adding
username/password, and the tupples for toolchains

Signed-off-by: Robin Getz <[email protected]>
  • Loading branch information
rgetz committed May 22, 2019
1 parent 147c012 commit 00bbbc0
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 22 deletions.
39 changes: 39 additions & 0 deletions board/pluto/msd/index.html → board/pluto/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<div class="dropdown-content">
<p><a class="button" href="#firmware">Upgrade Firmware</a></p>
<p><a class="button" href="#version">Version Info</a></p>
<p><a class="button" href="#target">Custom Apps</a></p>
<p><a class="button" href="#config">Config Settings</a></p>
<p><a class="button" href="#wifi">Wi-Fi Settings</a></p>
<p><a class="button" href="#wired">Wired Settings</a></p>
Expand Down Expand Up @@ -211,6 +212,44 @@ <h3>Firmware</h3>
</tbody>
</table>
<a class="anchor" href="#top">Back to top</a>
<p id="target"><strong>Standalone Applications:</strong></p>
<p><a href="https://wiki.analog.com/university/tools/pluto/devs/embedded_code">Custom C/C++ applications</a> can be created/compiled on a host with a <a href="https://releases.linaro.org/components/toolchain/binaries/">Linaro GNU Compiler Collection (GCC)</a> toolchain (with the appropriate flags), transferred over and run directly on the PlutoSDR.</p>
<table>
<tbody>
<tr>
<td>GCC Compiler <a href="https://collaborate.linaro.org/display/TCWGPUB/ARM+and+AArch64+Target+Triples">Target Triple</a></td>
<td>#GCC_TRIPLE#</td>
</tr>
<tr>
<td>GCC version</td>
<td>#GCC_VERSION#</td>
</tr>
<tr>
<td>Binutils version</td>
<td>#BIN_VERSION#</td>
</tr>
<tr>
<td>SysRoot</td>
<td><a id="sysroot" href="https://github.com/analogdevicesinc/plutosdr-fw/releases/latest">Latest SYSROOT</a></td>
</tr>
</tbody>
</table>
<a class="anchor" href="#top">Back to top</a>
<p id="userpass"><strong>Build Settings:</strong></p>
<p>There are many settings which are set as part of the build configuration, and can not be changed without rebuilding the firmware.</p>
<table>
<tbody>
<tr>
<td>Username:</td>
<td>root</td>
</tr>
<tr>
<td>Password:</td>
<td>#ROOTPASSWORD#</td>
</tr>
</tbody>
</table>
<a class="anchor" href="#top">Back to top</a>
<p id="config"><strong>Configuration Settings:</strong></p>
<p>On the root file system, there are <a href="./config.txt">configuration settings</a> that can modify the default configuration, they currently are:</p>
<table>
Expand Down
86 changes: 64 additions & 22 deletions board/pluto/msd/img/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function GetDriverurl() {
latest_libiio = response;
var select = document.getElementById("os-select");
var suffix = "";
var os;
for (i = 0; i < latest_libiio.assets.length; i++) {
os = latest_libiio.assets[i].name.split('-')[2];
suffix = os.slice(-4);
Expand Down Expand Up @@ -127,6 +128,7 @@ function libiio_type() {
var os = document.getElementById("os-select").value;
select.onchange = null;
var i;
var j;
for (i = select.options.length - 1 ; i >= 0 ; i--) {
select.remove(i);
}
Expand Down Expand Up @@ -214,34 +216,74 @@ function libiio_url() {

function CheckFrmVersion() {
GetDriverurl();
var req = jQuery.getJSON("https://api.github.com/repos/analogdevicesinc/plutosdr-fw/releases/latest");
var req = jQuery.getJSON("https://api.github.com/repos/analogdevicesinc/plutosdr-fw/releases");
req.fail(function() {
document.getElementById('versiontest').innerHTML = "Can't check right now, try manually";
document.getElementById('sysroot').innerHTML = "Latest SysRoot";
});
req.done(function(response) {
var VerOnGithub = response.name;
var res = versionCompare("#BUILD#", VerOnGithub);
var message;
if (res < 0) {
message = "Newer version available online (Version " + VerOnGithub + " )";
document.getElementById('versionsection').className = "download";
} else if (res > 0) {
message = "Wow! Your Pluto Firmware Version #BUILD# is newer than (" + VerOnGithub + ") on Github.";
document.getElementById('versionsection').className = "";
document.getElementById('plutsdr-fw-download').style.visibility = "hidden";
document.getElementById('hideupgrade').style.display = "none";
} else if (res == 0) {
message = "Pluto is using the same version as latest release!";
document.getElementById('versionsection').className = "";
document.getElementById('plutsdr-fw-download').style.visibility = "hidden";
document.getElementById('hideupgrade').style.display = "none";
var VerOnGithub = response[0].name;
var VerLocal = "#BUILD#";
if (VerLocal.match(/BUILD/)) {
document.getElementById('versiontest').innerHTML = "Seems not to be deployed";
document.getElementById('sysroot').innerHTML = "Unknown SysRoot";
jQuery('#sysroot').removeAttr('href');
} else {
message = "Failure in comparing version, latest upstream is " + VerOnGithub;
document.getElementById('versionsection').className = "";
var res = versionCompare(VerLocal, VerOnGithub);
var message;
var sysroot_message;
var j;
var k;
var sysroot_url = null;
for (j = 0; j < response.length; j++) {
if (response[j].name.match(VerLocal+"$")) {
for (k = 0; k < response[j].assets.length; k++) {
if (response[j].assets[k].name.match(/sysroot/i)) {
sysroot_url = response[j].assets[k].browser_download_url;
break;
}
}
break;
}
}
if (res < 0) {
message = "Newer version available online (Version " + VerOnGithub + " )";
if (sysroot_url)
sysroot_message = "Old Sysroot for firmware " + VerLocal +
" (please upgrade firmware to " + VerOnGithub + ")";
else
sysroot_message = "No Sysroot for firmware " + VerLocal +
" (please upgrade firmware to " + VerOnGithub + ")";
document.getElementById('versionsection').className = "download";
} else if (res > 0) {
message = "Wow! Your Pluto Firmware Version " + VerLocal +
" is newer than (" + VerOnGithub + ") on Github.";
sysroot_message = "Firmware " + VerLocal + " doesn't have pre-built SYSROOT";
jQuery('#sysroot').removeAttr('href');
document.getElementById('versionsection').className = "";
document.getElementById('plutsdr-fw-download').style.visibility = "hidden";
document.getElementById('hideupgrade').style.display = "none";
} else if (res == 0) {
message = "Pluto is using the same version as latest release!";
sysroot_message = "SYSROOT for firmware version " + VerOnGithub;
document.getElementById('versionsection').className = "";
document.getElementById('plutsdr-fw-download').style.visibility = "hidden";
document.getElementById('hideupgrade').style.display = "none";
} else {
message = "Failure in comparing version, latest upstream is " + VerOnGithub;
sysroot_message = "SYSROOT for firmware version " + VerOnGithub;
document.getElementById('versionsection').className = "";
}
document.getElementById('versiontest').innerHTML = message;
document.getElementById('plutsdr-fw-download').innerHTML = "Download version " + VerOnGithub;
jQuery('#plutsdr-fw-download').attr ('href', response[0].assets[0].browser_download_url);

document.getElementById('sysroot').innerHTML = sysroot_message;
if(sysroot_url)
jQuery('#sysroot').attr ('href', sysroot_url);
else
jQuery('#sysroot').removeAttr('href');
}
document.getElementById('versiontest').innerHTML = message;
document.getElementById('plutsdr-fw-download').innerHTML = "Download version " + VerOnGithub;
jQuery('#plutsdr-fw-download').attr ('href', response.assets[0].browser_download_url);
});
}

Expand Down
11 changes: 11 additions & 0 deletions board/pluto/post-build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
# args from BR2_ROOTFS_POST_SCRIPT_ARGS
# $2 board name
. ${BR2_CONFIG}
set -e

INSTALL=install
Expand All @@ -20,6 +21,16 @@ BOARD_DIR="$(dirname $0)"
BOARD_NAME="$(basename ${BOARD_DIR})"
GENIMAGE_CFG="${BOARD_DIR}/genimage-msd.cfg"
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
GCC_VERSION=$(${BR2_TOOLCHAIN_EXTERNAL_PREFIX}-gcc --version | head -1 | sed 's/.*(\(.*\))/\1/')
BIN_VERSION=$(${BR2_TOOLCHAIN_EXTERNAL_PREFIX}-as --version | head -1 | sed 's/.*(\(.*\))/\1/')
GCC_TRIPLE=$(${BR2_TOOLCHAIN_EXTERNAL_PREFIX}-gcc -v -c 2>&1 | sed 's/ /\n/g' | grep -e "--target" | awk -F= '{print $2}')
if [ "$BR2_TARGET_GENERIC_ROOT_PASSWD" = "analog" ] ; then
ROOTPASSWD=$BR2_TARGET_GENERIC_ROOT_PASSWD;
else
ROOTPASSWD="********"
fi

sed -e "s/#GCC_TRIPLE#/$GCC_TRIPLE/g" -e "s/#GCC_VERSION#/$GCC_VERSION/g" -e "s/#BIN_VERSION#/$BIN_VERSION/g" ${BOARD_DIR}/index.html -e "s/#ROOTPASSWORD#/$ROOTPASSWD/g" > ${BOARD_DIR}/msd/index.html

rm -rf "${GENIMAGE_TMP}"

Expand Down

0 comments on commit 00bbbc0

Please sign in to comment.