Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribute speculos as a single binary #194

Open
greenknot opened this issue Jun 28, 2021 · 0 comments
Open

Distribute speculos as a single binary #194

greenknot opened this issue Jun 28, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@greenknot
Copy link
Contributor

Here are a few notes on how to use pyinstaller to produce a single binary (qemu-user-static is still a requirement, but I guess it can also be embedded):

pyinstaller --onefile --windowed --add-data api/resources/:/api/resources/ --add-data api/swagger/:/api/swagger/ --add-binary build/src/launcher:/build/src/ --add-data cxlib:/cxlib/ speculos.py

which runs successfuly:

root@c3a1333f6f08:/speculos# ls -lh dist/speculos 
-rwxr-xr-x 1 root root 12M Jun 28 00:07 dist/speculos
root@c3a1333f6f08:/speculos# ldd dist/speculos 
	linux-vdso.so.1 (0x00007ffda37b3000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe6e15fd000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fe6e15e1000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe6e15be000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe6e13cc000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fe6e162f000)
root@c3a1333f6f08:/speculos# ./dist/speculos --display headless ./apps/btc.elf 
[*] speculos launcher revision: 027fd47
[*] using SDK version 2.0
[*] loading CXLIB from "/tmp/_MEIlTzPby/cxlib/cx-2.0.elf"
[*] patching svc instruction at 0x125c74
[*] patching svc instruction at 0x40005d8c
 * Serving Flask app 'api.api' (lazy loading)
 * Environment: development
 * Debug mode: off
00:12:32.236:werkzeug:  * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
00:12:32.236:werkzeug:  * Running on http://172.17.0.2:5000/ (Press CTRL+C to quit)
@greenknot greenknot added the enhancement New feature or request label Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant