Skip to content

ci: move make olddefconfig #74

ci: move make olddefconfig

ci: move make olddefconfig #74

Workflow file for this run

name: Build
on:
pull_request:
branches:
- '*'
push:
branches:
- 'ci/build_rpm'
workflow_dispatch:
inputs:
branch:
description: 'branch name to build'
required: true
default: 'kvm-nyx-5.10.73'
publish:
description: 'publish a Github release'
required: true
default: 'false'
jobs:
debian_package:
runs-on: intellabs-01
steps:
- run: |
BRANCH=kvm-nyx-6.0
# remove / (forbidden character in upload-artifact name)
BRANCH=${BRANCH///}
# env.ref = kafl/sdv-6.1
echo "ref=kvm-nyx-6.0" >> $GITHUB_ENV
# env.ref_art = kaflsdv-6.1 (for artifact name)
echo "ref_art=${BRANCH///}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: ${{ env.ref }}
path: sources
- name: Install ccache
run: sudo apt-get install -y ccache
- name: Install build deps
run: sudo apt-get install -y libelf-dev dwarves debhelper-compat
- name: Get ubuntu's 22.04 5.15.0-25-generic kernel config
run: |
sudo apt install -y zstd
apt download linux-modules-5.15.0-25-generic
ar x linux-modules-5.15.0-25-generic_5.15.0-25.25_amd64.deb data.tar.zst
tar -xvf data.tar.zst './boot/config-5.15.0-25-generic'
mv boot/config-5.15.0-25-generic sources/.config
rm -r boot/ data.tar.zst linux-modules-5.15.0-25-generic_5.15.0-25.25_amd64.deb
- name: make olddefconfig
run: make olddefconfig
working-directory: sources
- name: Configure kernel and enable Nyx
run: |
# disable kernel signature
./scripts/config --disable SYSTEM_TRUSTED_KEYS
./scripts/config --disable SYSTEM_REVOCATION_KEYS
./scripts/config --disable MODULE_SIG
# enable KVM
./scripts/config --module KVM
# disable KVM_WERROR (otherwise compilation issues in modified KVM)
./scripts/config --disable KVM_WERROR
# enable Nyx
./scripts/config --enable KVM_NYX
# disable KVM_HYPERV due to compilation issue
./scripts/config --disable KVM_HYPERV
# tweak locaversion
./scripts/config --set-str LOCALVERSION -nyx
# save space
./scripts/config --disable DEBUG_INFO
./scripts/config --enable MODULE_COMPRESS
./scripts/config --enable MODULE_COMPRESS_ZSTD
working-directory: sources
- name: Configure SDV kernel
if: "contains(env.ref, 'sdv')"
run: |
./scripts/config --enable INTEL_TDX_HOST
# tweak locaversion
./scripts/config --set-str LOCALVERSION -sdv
working-directory: sources
- uses: actions/cache@v3
with:
path: ~/.cache/ccache
key: "${{ runner.os }}-${{ env.ref }}-${{ hashFiles('.config') }}"
restore-keys: |
"${{ runner.os }}-${{ env.ref }}"
"${{ runner.os }}"
# - name: Build kernel
# run: |
# export PATH="/usr/lib/ccache:$PATH"
# make -j$(nproc) bindeb-pkg
# working-directory: sources
- uses: actions/upload-artifact@v3
with:
name: config
path: 'sources/.config'
# - uses: actions/upload-artifact@v3
# with:
# name: linux-${{ env.ref_art }}
# path: '*.deb'
# - run: rm -rf *.deb
release:
# this job makes an official Github release
if: ${{ inputs.publish }}
needs: [debian_package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
BRANCH=${{ inputs.branch }}
# remove / (forbidden character in upload-artifact name)
BRANCH=${BRANCH///}
# env.ref_art = kaflsdv-6.1 (for artifact name)
echo "ref_art=${BRANCH///}" >> $GITHUB_ENV
# download all artifacts to the current dir
- uses: actions/download-artifact@v3
with:
name: linux-${{ env.ref_art }}
- name: Create a Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: 'Prebuild host kernel package for ${{ inputs.branch }}'
tag_name: ${{ inputs.branch }}
files: '*.deb'