Skip to main content

Thin wrapper to build Linux kernels

Project description

TuxMake Logo

Pipeline Status coverage report PyPI version Code style: black PyPI - License

Documentation - Repository - Issues

TuxMake, by Linaro, is a command line tool and Python library that provides portable and repeatable Linux kernel builds across a variety of architectures, toolchains, kernel configurations, and make targets. TuxMake is a part of TuxSuite, a suite of tools and services to help with Linux kernel development.

[[TOC]]

About TuxMake

Building Linux is easy, right? You just run "make defconfig; make"!

It gets complicated when you want to support the following combinations:

  • Architectures (arc, arm, arm64, i386, mips, parisc, powerpc, riscv, s390, sh, sparc, x86_64, etc)
  • Toolchains (gcc-8, gcc-9, gcc-10, clang-10, clang-11, clang-nightly, etc)
  • Configurations (defconfig, distro configs, allmodconfigs, randconfig, etc)
  • Targets (kernel image, documentation, selftests, perf, cpupower, etc)
  • Build-time validation (coccinelle, sparse checker, etc)

Each of those items requires specific configuration, and supporting all combinations is difficult. TuxMake seeks to simplify Linux kernel building by providing a consistent command line interface to each of those combinations listed above. You specify what to build at the command line, and TuxMake drives the build for you, doing the same steps the same way every time.

The real power comes from using TuxMake's curated, portable build environments distributed as Docker/Podman container images. When using these versioned and hermetic filesystem images, your team can use the same exact toolchain(s) across different workstation platforms. Reporting and reproducing build failures is trivial by sharing TuxMake command lines with others.

Installing TuxMake

There are several options for installing TuxMake:

Using TuxMake

To use TuxMake, navigate to a Linux source tree (where you might usually run make), and run tuxmake. By default, it will perform a defconfig build on your native architecture, using a default compiler (gcc).

The behavior of the build can be modified with command-line arguments. Run tuxmake --help to see all command-line arguments.

Examples

Build from current directory:

$ tuxmake

Build using Podman:

$ tuxmake --runtime podman

Build from specific directory:

$ tuxmake --directory /path/to/linux

Build an arm64 kernel:

$ tuxmake --target-arch=arm64

Build an arm64 kernel with gcc-10:

$ tuxmake --target-arch=arm64 --toolchain=gcc-10

Build an arm64 kernel with clang-10:

$ tuxmake --target-arch=arm64 --toolchain=clang-10

Build tinyconfig on arm64 with gcc-9:

$ tuxmake -a arm64 -t gcc-9 -k tinyconfig

Build defconfig with additional config from file:

$ tuxmake --kconfig-add /path/to/my.config

Build defconfig with additional config from URL:

$ tuxmake --kconfig-add https://foo.com/my.config

Build defconfig with additional in-tree config:

$ tuxmake --kconfig-add kvm_guest.config

Build defconfig with additional inline config:

$ tuxmake --kconfig-add CONFIG_KVM_GUEST=y

Build tinyconfig on arm64 with gcc-9 using docker:

$ tuxmake -r docker -a arm64 -t gcc-9 -k tinyconfig

Build DTBs on arm64 using podman:

$ tuxmake -r podman -a arm64 -t gcc-9 dtbs

Incremental builds can be done by reusing a build directory:

$ tuxmake --build-dir=/path/to/output
# hack on source ...
$ tuxmake --build-dir=/path/to/output
# only rebuilds what is needed

Using configuration files:

# reads command line options from ~/.config/tuxmake/myconfig
$ tuxmake @myconfig
# reads command line options from /tmp/myconfig
$ tuxmake @/tmp/myconfig

Display all options:

$ tuxmake --help

Contributing to TuxMake

See the Contribution Guidelines document for details in how to contribute to TuxMake. Contributors are expected to follow the TuxMake Code of Conduct (the same adopted in the Linux kernel community).

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

tuxmake-1.9.0.tar.gz (122.2 kB view details)

Uploaded Source

Built Distribution

tuxmake-1.9.0-py3-none-any.whl (64.3 kB view details)

Uploaded Python 3

File details

Details for the file tuxmake-1.9.0.tar.gz.

File metadata

  • Download URL: tuxmake-1.9.0.tar.gz
  • Upload date:
  • Size: 122.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for tuxmake-1.9.0.tar.gz
Algorithm Hash digest
SHA256 1a7f2579dc65e4502a21eac3be4189d19e2db0ff4ff51a038b3effc71e1a6c47
MD5 de30695292786e6e20e3f4b60c5e8baf
BLAKE2b-256 63d61a0d16774332729db06319fca66d2207f8696e0d3c2e8b3197b625cccb7b

See more details on using hashes here.

File details

Details for the file tuxmake-1.9.0-py3-none-any.whl.

File metadata

  • Download URL: tuxmake-1.9.0-py3-none-any.whl
  • Upload date:
  • Size: 64.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for tuxmake-1.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17466f73afb971eb3e3b2e5d6e5dfa89f177dc16705fecff9171dd2d1cfc114a
MD5 8dab6e7359f7626f00553bc1c0625833
BLAKE2b-256 1c729d268116094381093ce782ce98cdfe91e1684e4b0fe9dbacba3e8d1bc3a5

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