Skip to content

Bisect kernel to microsoft/WSL2-Linux-Kernel@3f1b210a7f97f7e75c56174a… #29

Bisect kernel to microsoft/WSL2-Linux-Kernel@3f1b210a7f97f7e75c56174a…

Bisect kernel to microsoft/WSL2-Linux-Kernel@3f1b210a7f97f7e75c56174a… #29

Workflow file for this run

name: Build
on:
push:
branches:
- '**'
paths:
- WSL2-Linux-Kernel
jobs:
Build:
runs-on: ubuntu-latest
env:
# All of these will be set dynamically in a later step
UID:
GID:
GIT_VERSION:
KERNEL_VERSION:
defaults:
run:
working-directory: WSL2-Linux-Kernel
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
# Necessary for git describe. This takes some time, but we want to make sure
# to have the correct version baked into the kernel image in the end.
# v5.4-rc8 is the tag right before v5.4, which is the start for our bisect.
- name: Fetch history up to tag "v5.4-rc8"
run: git fetch --shallow-exclude=v5.4-rc8
- name: Fetch tag "linux-msft-5.4.91"
run: git fetch --depth 1 origin tag linux-msft-5.4.91
- name: Get kernel config from tag "linux-msft-5.4.91"
run: git show linux-msft-5.4.91:Microsoft/config-wsl > .config
# These are needed to be passed to the docker container, so that "git describe"
# does not complain about dubious ownership during kernel build.
- name: Determine UID and GID
run: |
echo "UID=$(id -u ${USER})" >> $GITHUB_ENV
echo "GID=$(id -g ${USER})" >> $GITHUB_ENV
- name: Build kernel
uses: addnab/docker-run-action@v3
with:
image: carlfriedrich/wsl-kernel-build:latest
options: |
-v ${{ github.workspace }}:/src
-u ${{env.UID}}:${{env.GID}}
--hostname wsl-kernel-build
run: bash -c "make -j 32 -C WSL2-Linux-Kernel CONFIG_LOCALVERSION_AUTO=y KCONFIG_CONFIG=.config"
- name: Get kernel version
run: |
KERNEL_VERSION=$(scripts/extract-vmlinux arch/x86/boot/bzImage \
| grep -a 'Linux version' | head -1 | cut -d" " -f3)
echo "KERNEL_VERSION=${KERNEL_VERSION}" >> $GITHUB_ENV
- name: Get git version
run: echo "GIT_VERSION=$(git describe)" >> $GITHUB_ENV
- name: Put kernel version into filename
run: mv arch/x86/boot/bzImage bzImage-${{env.KERNEL_VERSION}}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: bzImage-${{env.KERNEL_VERSION}}
path: |
WSL2-Linux-Kernel/bzImage-${{env.KERNEL_VERSION}}
- name: Publish release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{env.GIT_VERSION}}
files: WSL2-Linux-Kernel/bzImage-${{env.KERNEL_VERSION}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}