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
                  package_list_file

Build package list for Linux Distribution.

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

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
                        sysroot.
  • 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 <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Eric Dorland <eric@debian.org>
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
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 9m

Package: automoc
Priority: extra
Section: devel
Installed-Size: 122
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file cross-sysroot-0.4.tar.gz.

File metadata

  • Download URL: cross-sysroot-0.4.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

File hashes

Hashes for cross-sysroot-0.4.tar.gz
Algorithm Hash digest
SHA256 44b3ff6a725534102597218aafa85f216d5c8f4239f07efcd74482a406604eb3
MD5 78ce3e0e1e6314b1acd9e99a42ea8923
BLAKE2b-256 e8594d749ba214461e85fc869c601bb52e067d208c86d2d3c44af6ef9654a953

See more details on using hashes here.

File details

Details for the file cross_sysroot-0.4-py3-none-any.whl.

File metadata

  • Download URL: cross_sysroot-0.4-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

File hashes

Hashes for cross_sysroot-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 de4b98fec0076cc612adf333959ec2685d17f7db7ccdde0f620cd3969fbd73fa
MD5 64e07bf1678402c06814ad4f415fc52f
BLAKE2b-256 ef0894f3d6a44fa7ca31c76ade8f3c2edf49ed6aa1c3ae16156a1ca65a22179b

See more details on using hashes here.

Supported by

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