Skip to content

qlrd/krux-installer

 
 

Repository files navigation

Krux Installer

Build main branch codecov created at downloads downloads (latest release) commits (since latest release)

Krux Installer is a GUI based tool to flash Krux without typing any command in terminal for flash the firmware onto the device.

Installing

There are pre-built releases for:

  • Linux:
    • Debian-like
    • Fedora-like
  • Windows
  • MacOS:
    • intel processors
    • arm64 processors (M1/M2/M3)

To build it from the source, please follow the steps below:

System setup

Make sure you have python:

python --version

Linux

Generally, all Linux come with python.

Windows

Follow the instructions at python.org

MacOS

Before installing krux-installer source code, you will need prepare the system:

Install brew package manager

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install latest python

brew install python

and add this line to your ~/.zshrc:

alias python=python3

Ensure openssl have a correct link

Python's ssl module relies on OpenSSL for cryptographic operations. Ensure that OpenSSL is installed on your system and is compatible with the Python version you're using.

Since we expect that you're using the Python installed with Homebrew, it's recommended to install OpenSSL through Homebrew if it's not already installed:

brew install openssl

After installing OpenSSL, make sure it's linked correctly:

brew link --force openssl

This ensures that the OpenSSL libraries are available in the expected locations that Python can find and use.

Patch your zshrc

Library paths on MacOS involves verifying that the environment variables and system configurationsare correctyly set to find the necessary libraries, such as OpenSSL, which is crucial for the ssl module in Python.

On MacOS, the dynamic linker tool dyld uses environment variabes to locate shared libraries. The primary environment variable for specifying library paths is DYLD_LIBRARY_PATH.

Adding the lines below to your ~/.zshrc (or similar) the DYLD_LIBRARY_PATH will be set each time you open a new terminal session (and therefore the OpenSSL libraries libcrypto.dylib and libssl.dylib will can be found):

OPENSSL_MAJOR_VERSION=`openssl --version | awk '{ print $2}' | cut -d . -f1`
OPENSSL_FULL_VERSION=`openssl --version | awk ' { print $2}'`
export DYLD_LIBRARY_PATH="/opt/homebrew/Cellar/openssl@$OPENSSL_MAJOR_VERSION/$OPENSSL_FULL_VERSION/lib:$DYLD_LIBRARY_PATH"

Install poetry

Make sure you have poetry installed:

python -m pipx install poetry

If you have problems with installation, make sure to properly configure its options.

Download sources

Clone the repository:

git clone --recurse-submodules https://github.com/krux-installer.git

Install python dependencies:

poetry install

Update code

If already cloned the repo without using --recurse-submodules, use the command below to clone the needed submodules:

git submodule update --init

Developing

Krux-Installer uses poe task manager for formatting, linting, tests and coverage. To see all available tasks, run:

poetry run poe

Format code

poetry run poe format

Lint

poetry run poe lint

Test

poetry run poe test

For systems without a window manager:

poetry run poe test --no-xvfb

Build

At the moment, you'll need to patch some code on kivy to build the Graphical User Interface:

Build for Debian, Fedora, MacOS

Make sure you have the wget tool to download a specific commit.

If you not have:

  • Debian: sudo apt-get install wget;
  • Fedora: sudo dnf install wget;
  • MacOS: brew install wget.

Then you can patch PyInstaller hook for kivy and build an executable:

poetry run poe patch-nix
poetry run poe build-nix

Build for Windows

poetry run poe patch-win
poetry run poe build-win

It will export all project in a one-file binary:

  • linux: ./dist/krux-installer
  • macOS: ./dist/krux-installer.app/Contents/MacOS/krux-installer
  • windows: ./dist/krux-installer.exe

To more options see .ci/create-spec.py against the PyInstaller options.

Packages

No packages published

Languages

  • Python 97.3%
  • Shell 2.3%
  • PowerShell 0.4%