summaryrefslogtreecommitdiffstats
path: root/.github/workflows/build-kernel-modules.yml
blob: 7c78bb2e9e5250170177e37b5178d7394c163f2a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build xloop kernel modules

on:
  push:
    branches:
      - master
  pull_request:
  release:

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        config:
          - name: kernel modules [Linux kernel 5.4.x]
            build-os: ubuntu-20.04
            kernel-type: vanilla
            kernel-version: 5.4.y
          - name: kernel modules [Linux kernel 5.10.x]
            build-os: ubuntu-20.04
            kernel-type: vanilla
            kernel-version: 5.10.y
          - name: kernel modules [Linux kernel 5.15.x]
            build-os: ubuntu-20.04
            kernel-type: vanilla
            kernel-version: 5.15.y
          - name: kernel modules [Linux kernel 6.1.x]
            build-os: ubuntu-22.04
            kernel-type: vanilla
            kernel-version: 6.1.y
          - name: kernel modules [Linux kernel 6.6.x]
            build-os: ubuntu-22.04
            kernel-type: vanilla
            kernel-version: 6.6.y
    name: Build xloop ${{ matrix.config.name }}
    runs-on: ${{ matrix.config.build-os }}
    steps:
      - name: Install xloop dependencies
        run: |
          sudo apt-get update -y -qq
          sudo apt-get install -y -qq make \
                                      clang-format \
                                      libelf-dev \
                                      libcap-dev \
                                      rpm2cpio \
                                      rpm
      - name: Checkout xloop repository
        uses: actions/checkout@v2
      - name: Fetch xloop repository tags
        run: git fetch --prune --unshallow
      - name: Checkout Vanilla kernel version
        if: matrix.config.kernel-type == 'vanilla'
        run: git clone --depth 1  --branch "linux-${{ matrix.config.kernel-version }}" "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git" "../kernel"
      - name: Checkout CentOS kernel version
        if: matrix.config.kernel-type == 'centos'
        run: |
          mkdir "${{ github.workspace }}/../kernel"
          mkdir "${{ github.workspace }}/../kernel-download"
          wget -q -O "${{ github.workspace }}/../kernel-download/kernel.rpm" "${{ matrix.config.kernel-source }}"
          cd "${{ github.workspace }}/../kernel-download"
          rpm2cpio "${{ github.workspace }}/../kernel-download/kernel.rpm" | cpio --extract --make-directories
          tar --strip 1 -a -x -f linux-${{ matrix.config.kernel-version }}*.tar.xz -C "${{ github.workspace }}/../kernel"
      - name: Configure kernel version
        working-directory: ${{ github.workspace }}/../kernel
        run: |
          make defconfig
          make modules_prepare
      - name: Configure xloop build
        run: |
          cmake -B ${{ github.workspace }}/build \
                -S ${{ github.workspace }} \
                -D CMAKE_BUILD_TYPE=Release \
                -D KERNEL_BUILD_DIR=${{ github.workspace }}/../kernel \
                -D KERNEL_INSTALL_DIR=${{ github.workspace }}/../kernel/extra \
                -D KERNEL_SCRIPTS_DIR=${{ github.workspace }}/../kernel/scripts
      - name: Build xloop kernel modules
        working-directory: ${{ github.workspace }}/build
        run: make xloop xloop_file_fmt_qcow xloop_file_fmt_raw