Last active
February 25, 2025 13:43
-
-
Save pagkly/da7dc44d7427093e58bb4d92fa54d904 to your computer and use it in GitHub Desktop.
WSL2 - Compile Kernel with Ashmem and Binder
This file contains 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
# Waydroid | |
# WSl custom kernel | |
# https://gist.github.com/oleksis/eb6d2f1cd2a6946faefb139aa0e38c35 | |
# https://github.com/waydroid/waydroid/issues/217 | |
# https://www.youtube.com/watch?v=SfK4PBcFq0w | |
# Powershell shutdown & remove config | |
wsl --shutdown | |
rm /mnt/c/Users/user/.wslconfig | |
# install dependencies | |
sudo apt install -y git bc build-essential flex bison libssl-dev libelf-dev dwarves libncurses-dev | |
sudo apt install -y aria2 | |
cd ~ | |
#kernelver="WSL2-Linux-Kernel-4.19.121-microsoft-standard" | |
#kernellink="https://github.com/microsoft/WSL2-Linux-Kernel/archive/${kernelver}.tar.gz" | |
#kernelver="5.15.79.1" | |
kernelver="5.15.90.1" | |
kernellinkname="linux-msft-wsl-${kernelver}" | |
kerneldir="WSL2-Linux-Kernel-linux-msft-wsl-${kernelver}" | |
#kernellink="https://github.com/microsoft/WSL2-Linux-Kernel/archive/${kernellinkname}.tar.gz" | |
kernellink="https://github.com/microsoft/WSL2-Linux-Kernel/archive/refs/tags/${kernellinkname}.tar.gz" | |
#kernellink="https://github.com/microsoft/WSL2-Linux-Kernel/archive/refs/tags/${kernellinkname}.zip" | |
# download and extract | |
aria2c -x 10 $kernellink | |
#https://github.com/microsoft/WSL2-Linux-Kernel/archive/refs/tags/linux-msft-wsl-5.15.79.1.zip | |
#https://github.com/microsoft/WSL2-Linux-Kernel/archive/linux-msft-wsl-5.15.79.1.tar.gz | |
tar -xf ${kerneldir}.tar.gz | |
cd ${kerneldir}/ | |
cp Microsoft/config-wsl .config | |
# Add ashmem and binder | |
echo "CONFIG_ANDROID=y | |
CONFIG_ASHMEM=y | |
CONFIG_ANDROID_BINDER_IPC=y | |
CONFIG_ANDROID_BINDERFS=y | |
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder" | |
CONFIG_ANDROID_BINDER_IPC_SELFTEST=y | |
CONFIG_STAGING=y" | tee -a .config | |
# compile | |
make menuconfig | |
make -j $(expr $(nproc) - 1) | |
sudo make modules_install | |
# move new kernel to C drive | |
cp arch/x86/boot/bzImage /mnt/c/Users/user/bzImage | |
echo "[wsl2] | |
kernel=C:\\\\Users\\\\user\\\\bzimage" | tee -a /mnt/c/Users/user/.wslconfig | |
#nano /mnt/c/Users/user/.wslconfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't the .wslconfig contain
bzImage
and notbzimage
?