| [ Web Proxy ] |
| Viewing: https://github-redirect.dependabot.com/alexandrglm/kobo-python3-crosscompile | [Back] [Original] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
View all files | ||||
After countless failed attempts, Docker experiments, sysroot nightmares, and GLIBC version errors, the final result is a fully functional Python 3.11.16 with pip, SSL, sqlite3, lzma, and all essential modules running on the Kobo, for the sake of tinkering =) !
This repository documents the entire process, step by step, from building a custom crosstool-NG toolchain to deploying a working Python interpreter on the device's FAT32 user partition. Every step is broken down into its own document under DOCS/, in the exact order they must be followed.
The entire process is a full headache that follows this approach:
Toolchain Setup. The crosstool-NG toolchain is built with exact specifications: GLIBC 2.19, GCC 9.5.0, and Linux headers 3.2.101. This ensures all generated binaries are compatible with the Kobo's kernel and libraries.
Build Required Libraries. Seven essential libraries are cross-compiled using the toolchain: OpenSSL (SSL/TLS), zlib, bzip2, libffi, libuuid, lzma, and sqlite3. These provide Python's core functionality (HTTPS, compression, UUID, etc.).
Pre-requisites Before Building Python. Python 3.11.16 requires a matching Python 3.11 interpreter on the host. This step compiles a native (x86_64) Python 3.11.16 and creates a virtual environment to serve as --with-build-python during cross-compilation.
Cross-Compile Python. Using the toolchain and compiled libraries, Python 3.11.16 is cross-compiled for ARMv7 (armhf). The setup.py file is patched to fix a cross-compilation bug, and the final product is installed to a staging directory.
Latest Fixes Before Deploying. After the initial installation, several fixes are applied: pip is installed, OpenSSL libraries are copied to staging, shebangs in pip/scripts are corrected to point to the Kobo's Python location, symlinks are removed (FAT32 compatibility), and permissions are set.
Deploy to Kobo. A FAT32-compatible tarball (without symlinks) is created and copied to the Kobo's user partition (/mnt/onboard/.python/). Wrapper scripts are installed in /usr/bin/ to set environment variables and execute Python from the user partition.
Verification. Core modules, SSL, and pip tested directly on the device.
Compiling Compiled pip Modules. Notes on installing packages that require native compilation (numpy, cryptography, etc.), which the Kobo itself cannot build.
Part 2: Building Required Libraries
Part 3: Pre-requisites Before Building Python
Part 4: Cross-Compile Python 3.11.16 for the Kobo
setup.py (CRITICAL)./configure with All LibrariesPart 5: Fixes for Pip, Missing Libraries, Shebangs and Others
Part 8: Compiling Compiled pip Modules
build-essential, and basic development toolsWarning
Since the root partition is typically full on most Kobo devices, this guide installs Python on the FAT32 partition (/mnt/onboard/) using wrapper scripts. This also solves the symlink issue that FAT32 does not support.
| Component | Version |
|---|---|
| Python | 3.11.16 |
| OpenSSL | 1.1.1w |
| GLIBC | 2.19 |
| GCC | 9.5.0 |
| Binutils | 2.32 |
| Linux Headers | 3.2.101 |
| zlib | 1.3.1 |
| bzip2 | 1.0.8 |
| libffi | 3.4.6 |
| util-linux | 2.40.2 |
| xz-utils | 5.6.2 |
| sqlite3 | 3.46.0 |
Last Updated: August 2026
| Web Proxy Viewer | New URL | Original Page |