Skip to main content

A helper to get exact versions based on commit changes to maintain compatibility across kernel versions.

Project description

linux-kernel-compat-helper

Linux kernel compatibility helper to add version guards for an out-of-tree modules or to get the tag information for a particular commit.

Build and Coverage status

Build Status codecov

Introduction

For maintaining an out-of-tree module it is important to support multiple kernel version compatibility using Linux kernel version guards, we can get the exact commit for the fix by using git blame or git bisect etc, but the main problem is to figure out the version number which the fix is present first.

The problem statement

Clone Linus's linux.git

If you have clone Linus tovarlds linux.git then we can use below command to figure out the tag in which the commit first appeared. But cloning this repo and keeping it up-to-date is inconvinient.

$ git describe --contains <commit_sha>

Solution

Github Linus's linux.git

This repo is kept up-to-date and we can use the Github API to query commits and tags without cloning the repo and maintaining it. This module uses this approach and does a simple binary search based on commit and tag date.

Usage

Prerequisites

  • Github API token with proper permissions
  • pipenv installed
  • Tested on Ubuntu Distribution, but should work in others.

Running

  • Create and Install the virtual environment

    • pipenv install
  • Run the application, below command will display the usage.

    • pipenv run lk-get-tag -h

Example commands

$ export GITHUB_API_TOKEN=<token>
$ pipenv install
$ pipenv run lk-get-tag -c <commit_sha>

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

linux-kernel-compat-helper-1.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linux_kernel_compat_helper-1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file linux-kernel-compat-helper-1.0.tar.gz.

File metadata

  • Download URL: linux-kernel-compat-helper-1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for linux-kernel-compat-helper-1.0.tar.gz
Algorithm Hash digest
SHA256 14484efe8f642c4ae81a5d5f01d70069305f5235f7f566e1568605fa1c6cd2e2
MD5 7655134f87cb6951b2819a1447a7e590
BLAKE2b-256 09bc30c47d5624cbf16360179043d96cb4328027ce2b0a58004309e9e887cb3e

See more details on using hashes here.

File details

Details for the file linux_kernel_compat_helper-1.0-py3-none-any.whl.

File metadata

  • Download URL: linux_kernel_compat_helper-1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for linux_kernel_compat_helper-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96a10ce7384cd74bf4954002f834c2c1a2034173d1c5fa26068d99129676a554
MD5 1ce9328d61734315e9c13651d4b7e683
BLAKE2b-256 a3af26b65a929146fdb78636a523f77137e09243237338b1cc5708be44498ca4

See more details on using hashes here.

Supported by

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