Skip to main content

Utility to generate a sysroot tree from a Linux distribution

Project description

cross-sysroot Build Status

cross-sysroot is a utility to generate sysroot for cross-compilation.

The tool expects the name of the targeted Linux distribution, its version, the targeted architecture and a file containing the list of the main required packages.
The tool will solve package dependencies and extract them into a given sysroot path.

The generated sysroot can be used as an argument for the toolchain command line argument --sysroot=

  • To install the utility: pip3 install cross-sysroot

  • Command usage:

usage: cross-sysroot [-h] [--verbose] --distribution {debian,ubuntu,raspbian}
                  --distribution-version DISTRIBUTION_VERSION
                  [--distribution-url DISTRIBUTION_URL] --architecture
                  {amd64,arm64,armhf,armel} --build-root BUILD_ROOT

Build package list for Linux Distribution.

positional arguments:
  package_list_file     File containing the list of packages (and their

optional arguments:
  -h, --help            show this help message and exit
  --verbose             Verbose mode
  --distribution {debian,ubuntu, raspbian}
                        Linux distribution
  --distribution-version DISTRIBUTION_VERSION
                        Linux distribution
  --distribution-url DISTRIBUTION_URL
                        Linux distribution URL
  --architecture {amd64,arm64,armhf,armel}
                        CPU Architecture
  --build-root BUILD_ROOT
                        Location to store the Linux Distribution package.
  --cross-gcc CROSS_GCC
                        GCC Path used to build the cross application. When
                        set, all GCC sysroot files are copied into the
  • Example 1:
cross-sysroot --distribution debian --distribution-version stable --architecture arm64 --build-root /tmp/cross-sysroot tests/requirements-debian-jessie-arm64.txt
  • Example 2: Considering CROSS_COMPILE environment variable points to your cross-compilation toolchain:
cross-sysroot --distribution debian --distribution-version stable --architecture arm64 --build-root /tmp/cross-sysroot --cross-gcc ${CROSS_COMPILE}gcc tests/requirements-debian-jessie-arm64.txt

Notes about Development/CI

  • Launch the python application from source tree: PYTHONPATH=$PWD python3 -m cross_sysroot.cross_sysroot --help

  • Generate a new PIP package

  • Run Python linter on the code:

    sudo apt-get install pylint3 pylint3 cross_sysroot

  • Run test in the source tree: PYTHONPATH=$PWD pytest

Development Information

Format of the Debian-based distribution repository

Location of Packages.gz:

Content of Packages.gz:

Package: automake1.9
Priority: optional
Section: devel
Installed-Size: 1137
Maintainer: Ubuntu Developers <>
Original-Maintainer: Eric Dorland <>
Architecture: all
Version: 1.9.6+nogfdl-4ubuntu1
Provides: automaken
Depends: autoconf (>= 2.58), autotools-dev (>= 20020320.1)
Suggests: automake1.9-doc
Conflicts: automake (<< 1:1.4-p5-1), automake1.5 (<< 1.5-2), automake1.6 (<< 1.6.1-4)
Filename: pool/main/a/automake1.9/automake1.9_1.9.6+nogfdl-4ubuntu1_all.deb
Size: 338192
MD5sum: 5bc0b73852c50927a98ac4150cf2c585
SHA1: 8dbab4e448dd095f7ab9dc6defe308823cd1b16a
SHA256: 75358908ffe09e115d3971273c967306dd931b94edd846dbd6a762448e40cb56
Description: A tool for generating GNU Standards-compliant Makefiles
Description-md5: 16f7c6a70ae85327f4522569aa2e0cc9
Origin: Ubuntu
Supported: 9m

Package: automoc
Priority: extra
Section: devel
Installed-Size: 122
Maintainer: Ubuntu Developers <>
Original-Maintainer: Debian Qt/KDE Maintainers <>
Architecture: amd64
Version: 1.0~version-0.9.88-5build1
Depends: libc6 (>= 2.2.5), libgcc1 (>= 1:4.1.1), libqtcore4 (>= 4:4.8.0), libstdc++6 (>= 4.1.1), libqt4-dev
Filename: pool/main/a/automoc/automoc_1.0~version-0.9.88-5build1_amd64.deb
Size: 32888

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cross-sysroot-0.4.tar.gz (21.5 kB view hashes)

Uploaded source

Built Distribution

cross_sysroot-0.4-py3-none-any.whl (21.6 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page