Created
August 8, 2023 17:33
-
-
Save hkboujrida/6475b86aa8265905171c4efa87882d59 to your computer and use it in GitHub Desktop.
build wsl2 kernel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WSL_COMMIT_REF=linux-msft-wsl-5.15.90.4 | |
apt update && apt install -y git build-essential flex bison libssl-dev libelf-dev bc dwarves | |
mkdir src | |
cd src | |
git init | |
git remote add origin https://github.com/microsoft/WSL2-Linux-Kernel.git | |
git config --local gc.auto 0 | |
git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +${WSL_COMMIT_REF}:refs/remotes/origin/build/linux-msft-wsl-5.15.y | |
git checkout --progress --force -B build/linux-msft-wsl-5.15.y refs/remotes/origin/build/linux-msft-wsl-5.15.y | |
# adds support for clientIP-based session affinity | |
sed -i 's/# CONFIG_NETFILTER_XT_MATCH_RECENT is not set/CONFIG_NETFILTER_XT_MATCH_RECENT=y/' Microsoft/config-wsl | |
# required modules for Cilium | |
sed -i 's/# CONFIG_NETFILTER_XT_TARGET_CT is not set/CONFIG_NETFILTER_XT_TARGET_CT=y/' Microsoft/config-wsl | |
sed -i 's/# CONFIG_NETFILTER_XT_TARGET_TPROXY is not set/CONFIG_NETFILTER_XT_TARGET_TPROXY=y/' Microsoft/config-wsl | |
# build the kernel | |
make -j2 KCONFIG_CONFIG=Microsoft/config-wsl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment