GithubHelp home page GithubHelp logo

antoineco / kernel-devel-vm-action Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 25 KB

Bootstraps a Lima instance with the selected Linux kernel version for building and testing kernel modules.

License: MIT License

Shell 100.00%
action fedora kernel lima

kernel-devel-vm-action's Introduction

Kernel Devel VM Action

A GitHub Action that bootstraps a Lima instance running Fedora Linux with the selected kernel version.

Its main purpose is to facilitate the building and testing of kernel modules in CI workflows. It was originally written to support the automated build pipeline for the broadcom-wl wireless driver.

How It Works

The Action queries Fedora's public mirrors to retrieve the latest QEMU image and SHA256 checksum for the selected OS version, and generates a Lima instance configuration using this information.

It then mounts provisioning scripts inside that instance, which Lima executes as part of its initialization process (cloud-init). The scripts query Bodhi — Fedora's updates system — to find and download the most suitable kernel candidate for the selected version. If a candidate is found, it is installed and the bootloader configuration gets updated to boot on that specific kernel version.

Usage

Pre-requisites

  • A runner with Virtualization enabled, to support QEMU/KVM
  • Lima ≥ 0.12.x
  • yq ≥ 4.x

Inputs

  • kernel (required): The desired kernel version in <major>.<minor> semantic format (e.g. "5.19").
  • os: The version code of the Fedora Linux release to bootstrap the instance with (e.g. "f38"). Defaults to f39.

Outputs

  • kernel: The full version string of the kernel running inside the bootstrapped instance (e.g. "5.19.17-300.fc37.x86_64").
  • kernel-short: The short, SemVer compatible version string of the kernel running inside the bootstrapped instance (e.g. "5.19.17").
  • logs: Location on the runner of the exported cloud-init logs (e.g. "/tmp/lima/myinstance").

Environment variables

Upon execution, this Action sets the LIMA_INSTANCE environment variable to the name of the bootstrapped Lima instance, and makes it available to all subsequent job steps.

Example workflow

name: Build Kernel Module

on: push

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        include:
        - kernel: '6.3'
          os: f37
        - kernel: '6.4'
          os: f38
        - kernel: '6.5'
          os: f39

    steps:
    - name: Bootstrap Lima instance
      id: builder
      uses: antoineco/kernel-devel-vm-action@v1
      with:
        kernel: ${{ matrix.kernel }}
        os: ${{ matrix.os }}

    - name: Build kernel module
      id: build
      run: lima make

For more elaborate usage examples, take a look at the build workflow for broadcom-wl, or the CI workflow for this Action.

kernel-devel-vm-action's People

Contributors

antoineco avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

kernel-devel-vm-action's Issues

Fedora Rawhide images can't be used with kernel versions other than latest

Fedora Rawhide images always ship with the latest Linux kernel, so using them with a kernel input value other than the absolute latest fails due to dnf / rpm refusing to downgrade the current kernel package(s).

Older builds can be downloaded from Bodhi without any issue, they just cannot be installed with the current method:

dnf install -y "${rpms[@]}" || return

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.