Code Monkey home page Code Monkey logo

ledobe's Introduction

LeDoBE

Ledger Live Dockerized Build Environment

Build Ledger Live components in an isolated Docker environment with persistence between sessions.

A GNU Make Makefile with a number of targets is included to simplify building some of the Ledger components, but be aware that the supported component range is very limited at the moment. Truth to be told, this entire project began with the goal of building just the Ledger Live desktop application for a Raspberry Pi 4, which is an ARM64 device that did not get any official support from @LedgerHQ at the time.

Supported platforms

At this point only ARM64 Linux is supported out of the box.

With some tinkering you should be able to make it work for other platforms. Consider submitting a pull request, if you manage to also come up with a good workflow for multiple platforms.

Scope

The scope of this project is limited to providing a stable and isolated build environment. You are welcome to contribute reports and/or solutions for any issues that you encounter during builds.

Any issue that you encounter during the runtime of the build artifacts (see Troubleshooting) falls outside the scope of this project, unless you are able to trace it back to a specific problem with this build environment. In which case, as stated previously, your contribution of issue reports/resolutions is very welcome.

Installation

Requirements

  • Docker (tested with v18.09.1+)

Recommended

  • A POSIX compliant shell

Process

Once you have the LeDoBE source code (that is available at https://github.com/antichris/ledobe), either

  • run

     bin/build
  • or build an image from the included docker directory:

     docker build -t ledobe docker

    You can replace ledobe with a tag of your choosing, just be consistent in all invocations from here on.

Operation

TL;DR

bin/run make

If you find that your builds are taking a flippin' forever, have a look-see at the section on jobs.

Details

Starting Containers

The bin/run creates directories to persist your build data and spins up and attaches to a container. You can also do this manually:

mkdir home build
docker run -it --rm \
	-v"$(readlink -f home):/mnt/ledobe" \
	-v"$(readlink -f build):/build" \
	ledobe

Building stuff

Containers run bash shell by default, which is where you would execute

make

to start building Ledger Live components. A bunch of make targets have recipes to make it way easier to build them, see the relevant section below.

Switching versions

The included Makefile has component versions listed as variables near the top. If you change any of those variables to a different commit-ish (tag, branch, exact commit, etc.) in the Git history of the corresponding component, make will automatically check out the relevant commit and rebuild the component at that version the next time you run it.

Jobs

Concurrent execution can speed up things tremendously. If you have sufficient memory (both physical and swap), you should increase make jobs up to the max threads that your device can handle. On a Raspberry Pi 4B that would be 4:

make -j4

If you don't have enough memory, but you decide to run with increased jobs anyway, expect crashes as the kernel OOM killer kicks in.

Here is an article on increasing the swap size on a Raspberry Pi.

make Targets

By default make is going to build the Ledger Live desktop application, but you can specify it a different target to build, e.g.:

make coreNPM

The following sections contain a brief overview of the explicit targets currently supported by the included Makefile.

  1. desktop

    The Ledger Live desktop application. (GitHub)

    This is likely the one you are most interested in building. It having no official binaries for ARM64 (and ARM in general) served as the primary motivation for this project.

  2. coreLib

    Ledger Core Library used by Ledger applications. (GitHub)

  3. coreNPM

    Ledger Core Library cross-platform C++ bindings for NodeJS. (GitHub)

Troubleshooting

Building stuff

  1. "No rule to make target" when building the core library

    When you switch versions, make may abort a core lib build with a message like

    make: *** No rule to make target '/build/core/lib/core/src/(some/filename).cpp', needed by '/build/.dep/coreLib/src'.  Stop.
    

    This can happen when make has cached the stats of the core lib source files used during the previous build, but some of them are missing from this new version.

    Solution: simply try again. The second run will succeed.

Running stuff

Even though the runtime portion of Ledger Live is outside the scope of this project, users have been encountering the same problems frequently enough to warrant a few words on dealing with them.

Unless you can also provide solutions that must be a part of this build environment, please, do not create additional issue reports for the Ledger Live runtime problems outlined below.

  1. Missing libz.so

    error while loading shared libraries: libz.so: cannot open shared object file: No such file or directory
    

    Likely caused by AppImage/AppImageKit#964. You are welcome to contribute to its resolution.

    Two workarounds are currently known:

    • symlink /lib/aarch64-linux-gnu/libz.so.1 to libz.so in the same directory, or
    • install the zlib1g-dev package (or the equivalent on your distribution).
  2. Unable to connect the physical device

    This issue with Ledger Live seems to be common enough for their official support site to offer tips on dealing with it. If none of those work for you, consider contributing your own solution to Ledger Live.

License

The source code of this project is released under Mozilla Public License Version 2.0. See LICENSE.

ledobe's People

Contributors

alejo-acevedo-deel avatar antichris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ledobe's Issues

Cannot build on Raspberry PI4 (Raspbian)

Hi,

I'm trying to follow the README instructions and when I perform bin/build or the docker instructions, in both cases I get the following issues

pi@raspberrypi:~/projects/ledobe $ ./bin/build 
Sending build context to Docker daemon  24.06kB
Step 1/46 : FROM ubuntu:20.04 AS pre-dl
 ---> 29275250a9ab
Step 2/46 : RUN set -x &&  apt-get update &&  apt-get install -y --no-install-suggests --no-install-recommends     ca-certificates=20210119~20.04.1     wget=1.20.3-1ubuntu1
 ---> Running in 59499bff64bf
+ apt-get update
Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [101 kB]
Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
  At least one invalid signature was encountered.
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
  At least one invalid signature was encountered.
Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
  At least one invalid signature was encountered.
Err:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
  At least one invalid signature was encountered.
Reading package lists...
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-security InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-security InRelease' is not signed.
The command '/bin/sh -c set -x &&  apt-get update &&  apt-get install -y --no-install-suggests --no-install-recommends     ca-certificates=20210119~20.04.1     wget=1.20.3-1ubuntu1' returned a non-zero code: 100

Unable to connect nano x to ledger live

Firstly the appimage doesn't run for me, says libz.so is missing.

When running the unpacked ledgerlive package, it simply won't connect to the ledger.

Also i've noticed the version of ledger is older than the current release, so maybe contributing to the problem?

can´t connect a ledger device

I was able to succesfully build on RPi 4 with Ubuntu 21.04, but got an error while trying to run the AppImage:

error while loading shared libraries: libz.so: cannot open shared object file: No such file or directory

Solved it with sudo apt-get install zlib1g-dev based on this issue

Now it runs (can´t connect my ledger device thought)

Version '245.4-4ubuntu3.7' for 'libudev-dev' was not found

In the release 0.1.1 I get the following error in step 40/46:

DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y --no-install-suggests --no-install-recommends cmake=3.16.3-1ubuntu1 g++=4:9.3.0-1ubuntu2 git=1:2.25.1-1ubuntu3.1 make=4.2.1-1.2 openjdk-8-jre-headless=8u292-b10-0ubuntu1~20.04 pkg-config=0.29.1-0ubuntu4 python-is-python3=3.8.2-4 libqt5websockets5-dev=5.12.8-0ubuntu1 libudev-dev=245.4-4ubuntu3.7 libusb-1.0-0-dev=2:1.0.23-2build1 qtbase5-dev=5.12.8+dfsg-0ubuntu1 bash-completion=1:2.10-1ubuntu1 gosu=1.10-1ubuntu0.20.04.1 openssh-client=1:8.2p1-4ubuntu0.2
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '245.4-4ubuntu3.7' for 'libudev-dev' was not found

This happened on a fresh clone of the repo, on the first build. I did not have this error in older versions of ledobe.

Edit: I manually tried to revert back to udev version 245.4-4ubuntu3.6, but I still get the same error. Since this worked before in ledobe 0.1.0, it might be an issue on my side, or on the package repo side...

Edit2: 245.4-4ubuntu3.11 seems to work fine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.