├── .github └── workflows │ ├── build_kernelsu.yml │ └── build_source.yml ├── README.md └── wsa-kernelsu-addons.sh /.github/workflows/build_kernelsu.yml: -------------------------------------------------------------------------------- 1 | name: WSA Kernel Build (Superuser) 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - kernelsu 8 | 9 | jobs: 10 | WSA-Kernel-Build-Superuser: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Check out repository 14 | uses: actions/checkout@v2 15 | with: 16 | submodules: 'recursive' 17 | - name: Set up environment 18 | run: | 19 | sudo apt update -y 20 | sudo apt install -y build-essential flex bison libssl-dev libelf-dev git gcc curl make bc bison ca-certificates gnupg libelf-dev lsb-release software-properties-common wget libncurses-dev binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu 21 | wget https://apt.llvm.org/llvm.sh 22 | chmod +x llvm.sh 23 | export LLVM_VERSION=13 24 | sudo ./llvm.sh $LLVM_VERSION 25 | rm ./llvm.sh 26 | sudo ln -s --force /usr/bin/clang-$LLVM_VERSION /usr/bin/clang 27 | sudo ln -s --force /usr/bin/ld.lld-$LLVM_VERSION /usr/bin/ld.lld 28 | sudo ln -s --force /usr/bin/llvm-objdump-$LLVM_VERSION /usr/bin/llvm-objdump 29 | sudo ln -s --force /usr/bin/llvm-ar-$LLVM_VERSION /usr/bin/llvm-ar 30 | sudo ln -s --force /usr/bin/llvm-nm-$LLVM_VERSION /usr/bin/llvm-nm 31 | sudo ln -s --force /usr/bin/llvm-strip-$LLVM_VERSION /usr/bin/llvm-strip 32 | sudo ln -s --force /usr/bin/llvm-objcopy-$LLVM_VERSION /usr/bin/llvm-objcopy 33 | sudo ln -s --force /usr/bin/llvm-readelf-$LLVM_VERSION /usr/bin/llvm-readelf 34 | sudo ln -s --force /usr/bin/clang++-$LLVM_VERSION /usr/bin/clang++ 35 | - name: Switch branch to kernelsu 36 | uses: actions/checkout@v2 37 | with: 38 | ref: 'kernelsu' 39 | - name: Build WSA kernel - x86_64 (Superuser) 40 | run: | 41 | sed -i 's/CONFIG_LOCALVERSION=\"-windows-subsystem-for-android\"/CONFIG_LOCALVERSION=\"-WSA\"/g' configs/wsa/config-wsa-5.10 42 | make -j$(nproc) LLVM=1 KCONFIG_CONFIG=configs/wsa/config-wsa-5.10 43 | mv -f ./arch/x86/boot/bzImage ./arch/x86/boot/kernel 44 | - name: Upload artifact - x86_64 (Superuser) 45 | uses: actions/upload-artifact@v2 46 | with: 47 | name: WSA-Kernel-x86_64-Superuser 48 | path: './arch/x86/boot/kernel' 49 | - name: Build WSA kernel - arm64 (Superuser) 50 | run: | 51 | sed -i 's/CONFIG_LOCALVERSION=\"-windows-subsystem-for-android\"/CONFIG_LOCALVERSION=\"-WSA\"/g' configs/wsa/config-wsa-arm64-5.10 52 | make -j$(nproc) LLVM=1 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- KCONFIG_CONFIG=configs/wsa/config-wsa-arm64-5.10 53 | mv -f ./arch/arm64/boot/Image ./arch/arm64/boot/kernel 54 | - name: Upload artifact - arm64 (Superuser) 55 | uses: actions/upload-artifact@v2 56 | with: 57 | name: WSA-Kernel-arm64-Superuser 58 | path: './arch/arm64/boot/kernel' 59 | -------------------------------------------------------------------------------- /.github/workflows/build_source.yml: -------------------------------------------------------------------------------- 1 | name: WSA Kernel Build 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - source 8 | 9 | jobs: 10 | WSA-Kernel-Build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Check out repository 14 | uses: actions/checkout@v2 15 | with: 16 | submodules: 'recursive' 17 | - name: Set up environment 18 | run: | 19 | sudo apt update -y 20 | sudo apt install -y build-essential flex bison libssl-dev libelf-dev git gcc curl make bc bison ca-certificates gnupg libelf-dev lsb-release software-properties-common wget libncurses-dev binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu 21 | wget https://apt.llvm.org/llvm.sh 22 | chmod +x llvm.sh 23 | export LLVM_VERSION=13 24 | sudo ./llvm.sh $LLVM_VERSION 25 | rm ./llvm.sh 26 | sudo ln -s --force /usr/bin/clang-$LLVM_VERSION /usr/bin/clang 27 | sudo ln -s --force /usr/bin/ld.lld-$LLVM_VERSION /usr/bin/ld.lld 28 | sudo ln -s --force /usr/bin/llvm-objdump-$LLVM_VERSION /usr/bin/llvm-objdump 29 | sudo ln -s --force /usr/bin/llvm-ar-$LLVM_VERSION /usr/bin/llvm-ar 30 | sudo ln -s --force /usr/bin/llvm-nm-$LLVM_VERSION /usr/bin/llvm-nm 31 | sudo ln -s --force /usr/bin/llvm-strip-$LLVM_VERSION /usr/bin/llvm-strip 32 | sudo ln -s --force /usr/bin/llvm-objcopy-$LLVM_VERSION /usr/bin/llvm-objcopy 33 | sudo ln -s --force /usr/bin/llvm-readelf-$LLVM_VERSION /usr/bin/llvm-readelf 34 | sudo ln -s --force /usr/bin/clang++-$LLVM_VERSION /usr/bin/clang++ 35 | - name: Switch branch to source 36 | uses: actions/checkout@v2 37 | with: 38 | ref: 'source' 39 | - name: Build WSA kernel - x86_64 40 | run: | 41 | sed -i 's/CONFIG_LOCALVERSION=\"-windows-subsystem-for-android\"/CONFIG_LOCALVERSION=\"-WSA\"/g' configs/wsa/config-wsa-5.10 42 | make -j$(nproc) LLVM=1 KCONFIG_CONFIG=configs/wsa/config-wsa-5.10 43 | mv -f ./arch/x86/boot/bzImage ./arch/x86/boot/kernel 44 | - name: Upload artifact - x86_64 45 | uses: actions/upload-artifact@v2 46 | with: 47 | name: WSA-Kernel-x86_64 48 | path: './arch/x86/boot/kernel' 49 | - name: Build WSA kernel - arm64 50 | run: | 51 | sed -i 's/CONFIG_LOCALVERSION=\"-windows-subsystem-for-android\"/CONFIG_LOCALVERSION=\"-WSA\"/g' configs/wsa/config-wsa-arm64-5.10 52 | make -j$(nproc) LLVM=1 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- KCONFIG_CONFIG=configs/wsa/config-wsa-arm64-5.10 53 | mv -f ./arch/arm64/boot/Image ./arch/arm64/boot/kernel 54 | - name: Upload artifact - arm64 55 | uses: actions/upload-artifact@v2 56 | with: 57 | name: WSA-Kernel-arm64 58 | path: './arch/arm64/boot/kernel' 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WSA-Linux-Kernel 2 | Mirror for the Windows Subsystem for Android (WSA) kernel source code, and superuser. 3 | 4 | ## Branches 5 | - [master](https://github.com/WSA-Community/WSA-Linux-Kernel/tree/master): (Default) Description and solutions 6 | - [source](https://github.com/WSA-Community/WSA-Linux-Kernel/tree/source): Windows Subsystem for Android kernel source code 7 | - [kernelsu](https://github.com/WSA-Community/WSA-Linux-Kernel/tree/kernelsu): Windows Subsystem for Android kernel with [Kernel-Assisted Superuser](https://github.com/MlgmXyysd/kernel-assisted-superuser) patched source code 8 | 9 | ## GitHub Actions 10 | This repository uses GitHub Actions to automatically build kernel images from source. 11 | 12 | [![WSA Kernel Build](https://github.com/WSA-Community/WSA-Linux-Kernel/actions/workflows/build_source.yml/badge.svg)](https://github.com/WSA-Community/WSA-Linux-Kernel/actions/workflows/build_source.yml) 13 | - x86_64 14 | - arm64 15 | 16 | [![WSA Kernel Build (Superuser)](https://github.com/WSA-Community/WSA-Linux-Kernel/actions/workflows/build_kernelsu.yml/badge.svg)](https://github.com/WSA-Community/WSA-Linux-Kernel/actions/workflows/build_kernelsu.yml) 17 | - X86_64 - Superuser 18 | - arm64 - Superuser 19 | 20 | ## wsa-kernelsu-addons 21 | Automatically add stuffs required by kernelsu for WSA kernel tree. From inside a kernelsu-patched kernel tree of yours: 22 | ``` 23 | curl -LsS "https://raw.githubusercontent.com/WSA-Community/WSA-Linux-Kernel/master/wsa-kernelsu-addons.sh" | bash - 24 | ``` 25 | 26 | ## Kernel source commit history 27 | The repository only mirrors the official source code provided by Microsoft. Microsoft does not provide an official commit history. 28 | 29 | However, according to [alk3pInjection](https://github.com/alk3p/), the WSA kernel source code is a merge of Android Common Kernel on top of WSL2. 30 | 31 | For more details, please refer to [alk3p/WSA-Linux-Kernel](https://github.com/alk3p/WSA-Linux-Kernel). 32 | 33 | ## Credits 34 | - [MlgmXyysd](https://github.com/MlgmXyysd/) 35 | - [alk3pInjection](https://github.com/alk3p/) 36 | - [LibXZR](https://github.com/libxzr/) 37 | - [Shelling](https://github.com/cjybyjk/) 38 | - [Jason A. Donenfeld](https://github.com/zx2c4/) - [Original Kernel-Assisted Superuser](https://git.zx2c4.com/kernel-assisted-superuser/) 39 | - [Microsoft LLC.](https://thirdpartysource.microsoft.com/) - Remote kernel source code 40 | 41 | ## License 42 | Kernel source code (source and kernelsu branch) is licensed under the GPL v2. 43 | -------------------------------------------------------------------------------- /wsa-kernelsu-addons.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2002-2022 Jim Wu . All Rights Reserved. 4 | # 5 | 6 | if ! [[ -d .git && -f configs/wsa/config-wsa-5.10 && -f configs/wsa/config-wsa-arm64-5.10 ]]; then 7 | echo "[!] Please run this from the top level of your kernel tree." >&2 8 | exit 1 9 | fi 10 | 11 | config_patch="# 12 | # Kernel-Assisted Superuser 13 | # 14 | # Jim.Wu, 2021/10/25 15 | # 16 | CONFIG_ASSISTED_SUPERUSER=y 17 | # end of Kernel-Assisted Superuser" 18 | 19 | echo "[+] Patching" 20 | 21 | # 22 | # Config patch 23 | # 24 | # Jim.Wu, 2021/10/25 25 | # 26 | grep -q CONFIG_ASSISTED_SUPERUSER=y configs/wsa/config-wsa-5.10 || echo "${config_patch}" >> configs/wsa/config-wsa-5.10 27 | grep -q CONFIG_ASSISTED_SUPERUSER=y configs/wsa/config-wsa-arm64-5.10 || echo "${config_patch}" >> configs/wsa/config-wsa-arm64-5.10 28 | 29 | echo "[+] Committing" 30 | git add configs/wsa/config-wsa-5.10 configs/wsa/config-wsa-arm64-5.10 31 | git commit -s -m "android: Add superuser addons" configs/wsa/config-wsa-5.10 configs/wsa/config-wsa-arm64-5.10 32 | 33 | echo "[+] Done!" 34 | 35 | --------------------------------------------------------------------------------