lxbe_tool.providers package

class lxbe_tool.providers.Provider[source]

Bases: abc.ABC

Base class for all providers.

find_tool(tool_name, tool_version)[source]

Find a tool inside the provider environment.

Raises:
Returns:

install_module(module_name, module_path=None, module_version=None)[source]

Install a Python module into the Python environment.

module_path or module_version should be provided.

install_tool(tool_name, tool_version)[source]

Installs a tool inside the provider environment.

Raises:SystemError – The provider is unable to install the tool.
exception lxbe_tool.providers.ToolNotFoundError[source]

Bases: OSError

Tool is not found in environment.

exception lxbe_tool.providers.ToolWrongVersionError[source]

Bases: OSError

Tool is found but provides wrong version.

Submodules

lxbe_tool.providers.conda module

Conda based provider.

https://conda.io/docs/

Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. Conda quickly installs, runs and updates packages and their dependencies. Conda easily creates, saves, loads and switches between environments on your local computer. It was created for Python programs, but it can package and distribute software for any language.

class lxbe_tool.providers.conda.Conda(download_dir)[source]

Bases: lxbe_tool.providers.Provider

The Conda provider can provide;
  • Python environment which modules can be installed into.
  • Tools (such as gcc / openocd)
install_module(module)[source]

# lite for LITE in $LITE_REPOS; do

LITE_DIR=$THIRD_DIR/$LITE (

echo cd $LITE_DIR echo “Installing $LITE from $LITE_DIR (local python module)” python setup.py develop

) check_import $LITE

done

install_tool(toolname)[source]

# binutils for the target echo echo “Installing binutils for ${CPU} (assembler, linker, and other tools)” conda install -y $CONDA_FLAGS binutils-${CPU}-elf=$BINUTILS_VERSION check_version ${CPU}-elf-ld $BINUTILS_VERSION

# gcc for the target echo echo “Installing gcc for ${CPU} (‘bare metal’ C cross compiler)” conda install -y $CONDA_FLAGS gcc-${CPU}-elf-nostdc=$GCC_VERSION check_version ${CPU}-elf-gcc $GCC_VERSION

# gdb for the target #echo #echo “Installing gdb for ${CPU} (debugger)” #conda install -y $CONDA_FLAGS gdb-${CPU}-elf=$GDB_VERSION #check_version ${CPU}-elf-gdb $GDB_VERSION

# openocd for programming via Cypress FX2 echo echo “Installing openocd (jtag tool for programming and debug)” conda install -y $CONDA_FLAGS openocd=$OPENOCD_VERSION check_version openocd $OPENOCD_VERSION

setup()[source]

# Hot patch conda so to not use the systems environments. function fix_conda {

for py in $(find $CONDA_DIR -name envs_manager.py); do

START_SUM=$(sha256sum $py | sed -e’s/ .*//’) sed -i -e”s^expand(join(‘~’, ‘.conda’, ‘environments.txt’))^join(‘$CONDA_DIR’, ‘environments.txt’)^” $py END_SUM=$(sha256sum $py | sed -e’s/ .*//’) if [ $START_SUM != $END_SUM ]; then

sed -i -e”s/$START_SUM/$END_SUM/” $(find $CONDA_DIR -name paths.json)

fi

done

}

if [[ ! -e $CONDA_DIR/bin/conda ]]; then
wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh chmod a+x Miniconda3-latest-Linux-x86_64.sh # -p to specify the install location # -b to enable batch mode (no prompts) # -f to not return an error if the location specified by -p already exists ./Miniconda3-latest-Linux-x86_64.sh -p $CONDA_DIR -b -f fix_conda conda config –system –set always_yes yes conda config –system –set changeps1 no conda config –system –add envs_dirs $CONDA_DIR/envs conda config –system –add pkgs_dirs $CONDA_DIR/pkgs conda update -q conda

fi fix_conda conda config –system –add channels timvideos conda info

class lxbe_tool.providers.conda.CondaVersionTuple(version, system, machine, file)

Bases: tuple

file

Alias for field number 3

machine

Alias for field number 2

system

Alias for field number 1

version

Alias for field number 0

lxbe_tool.providers.conda.installed_version()[source]

~/conda/bin/conda –version conda 4.5.9

lxbe_tool.providers.conda.live_versions()[source]

Get the versions currently live on conda website.

lxbe_tool.providers.docker module

Based on this example -> https://github.com/open-power/pdbg/blob/master/.build.sh

TEMPDIR=`mktemp -d ${HOME}/pdbgobjXXXXXX` RUN_TMP=”docker run –rm=true –user=${USER} -w ${TEMPDIR} -v ${HOME}:${HOME} -t ${CONTAINER}” ${RUN_TMP} ${SRCDIR}/configure –host=arm-linux-gnueabi ${RUN_TMP} make rm -rf ${TEMPDIR}

lxbe_tool.providers.system module