diff --git a/.github/workflows/PixelOS-SUSFS.yml b/.github/workflows/PixelOS-SUSFS.yml new file mode 100644 index 0000000..bf5b607 --- /dev/null +++ b/.github/workflows/PixelOS-SUSFS.yml @@ -0,0 +1,154 @@ +name: Pixel OS SUSFS + + +on: + + workflow_dispatch: + inputs: + RELEASE_CONFIG: + description: 'Upload to Releases' + required: true + default: true + type: boolean + KERNEL_SOURCE: + description: 'Kernel Source' + required: true + default: "https://github.com/natsumerinchan/android_kernel_oneplus_sm8350.git" + type: string + KERNEL_SOURCE_BRANCH: + description: 'kernel Branch' + required: true + default: "fourteen-qpr2" + type: string + KERNEL_DEFCONFIG: + description: 'Kernel Config' + required: true + default: "vendor/lahaina-qgki_defconfig" + type: string + KERNELSU_CONFIG: + description: 'Compile KernelSU' + required: true + default: true + type: boolean + CCACHE_CONFIG: + description: 'Use Ccache' + required: true + default: true + type: boolean + KERNELSU_TAG: + description: 'Choose KernelSU branch or tag' + required: false + default: "main" + type: string + +jobs: + + build: + + runs-on: ubuntu-latest + env: + CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion" + CCACHE_NOHASHDIR: "true" + CCACHE_MAXSIZE: "2G" + CCACHE_HARDLINK: "true" + + steps: + + - uses: actions/checkout@v4 + + - name: Ccache + if: github.event.inputs.CCACHE_CONFIG == 'true' + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: PixelOS-inline + + - name: Setup Environment + run: | + export CLANG_PATH=~/clang + git clone --depth=1 https://github.com/kdrag0n/proton-clang $CLANG_PATH + sh -c "$(curl -sSL https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/android_build_env.sh)" + sudo apt install --fix-missing + export LLVM_VERSION=13 + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh $LLVM_VERSION + rm ./llvm.sh + sudo apt install --fix-missing + sudo ln -s --force /usr/bin/clang-$LLVM_VERSION /usr/bin/clang + sudo ln -s --force /usr/bin/ld.lld-$LLVM_VERSION /usr/bin/ld.lld + sudo ln -s --force /usr/bin/llvm-objdump-$LLVM_VERSION /usr/bin/llvm-objdump + sudo ln -s --force /usr/bin/llvm-ar-$LLVM_VERSION /usr/bin/llvm-ar + sudo ln -s --force /usr/bin/llvm-nm-$LLVM_VERSION /usr/bin/llvm-nm + sudo ln -s --force /usr/bin/llvm-strip-$LLVM_VERSION /usr/bin/llvm-strip + sudo ln -s --force /usr/bin/llvm-objcopy-$LLVM_VERSION /usr/bin/llvm-objcopy + sudo ln -s --force /usr/bin/llvm-readelf-$LLVM_VERSION /usr/bin/llvm-readelf + sudo ln -s --force /usr/bin/clang++-$LLVM_VERSION /usr/bin/clang++ + + - name: Git kernel + run: | + git clone "${{ github.event.inputs.KERNEL_SOURCE }}" -b "${{ github.event.inputs.KERNEL_SOURCE_BRANCH }}" kernel --depth=1 + echo "TAG_NAME=v5.4.$(grep "^SUBLEVEL =" kernel/Makefile | awk '{print $3}')-$(date +"%Y%m%d")" >> $GITHUB_ENV + + - name: Setup KernelSU + if: github.event.inputs.KERNELSU_CONFIG == 'true' + run: | + cd $GITHUB_WORKSPACE/kernel + git clone https://github.com/natsumerinchan/KernelSU.git KernelSU + curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s "${{ github.event.inputs.KERNELSU_TAG }}" + scripts/config --file "arch/arm64/configs/${{ github.event.inputs.KERNEL_DEFCONFIG }}" -e MODULES -e KPROBES -e HAVE_KPROBES -e KPROBE_EVENTS + + - name: Make kernel + run: | + cd $GITHUB_WORKSPACE/kernel + export KERNEL_DEFCONFIG=${{ github.event.inputs.KERNEL_DEFCONFIG }} + echo "===================Setup Export=========================" + export KERNEL_PATH=$PWD + export CLANG_PATH=~/clang + export PATH=${CLANG_PATH}/bin:${PATH} + export CLANG_TRIPLE=aarch64-linux-gnu- + export ARCH=arm64 + export SUBARCH=arm64 + echo "===================Setup Environment Again===================" + if [ ! -e "$CLANG_PATH/README.md" ]; then + git clone --depth=1 https://github.com/kdrag0n/proton-clang $CLANG_PATH + fi + sudo apt install --fix-missing + echo "=========================Make==========================" + make O=out CC="ccache clang" CXX="ccache clang++" ARCH=arm64 CROSS_COMPILE=$CLANG_PATH/bin/aarch64-linux-gnu- CROSS_COMPILE_ARM32=$CLANG_PATH/bin/arm-linux-gnueabi- LD=ld.lld $KERNEL_DEFCONFIG + # Disable LTO + if [[ $(echo "$(awk '/MemTotal/ {print $2}' /proc/meminfo) < 16000000" | bc -l) -eq 1 ]]; then + scripts/config --file out/.config -d LTO -d LTO_CLANG -d THINLTO -e LTO_NONE + fi + make O=out CC="ccache clang" CXX="ccache clang++" ARCH=arm64 -j`nproc` CROSS_COMPILE=$CLANG_PATH/bin/aarch64-linux-gnu- CROSS_COMPILE_ARM32=$CLANG_PATH/bin/arm-linux-gnueabi- LD=ld.lld 2>&1 | tee kernel.log + + + - name: Create Anykernel3 file + run: | + cd $GITHUB_WORKSPACE/kernel + export KERNEL_PATH=$PWD + git clone https://gitlab.com/inferno0230/AnyKernel3.git --depth=1 $KERNEL_PATH/AnyKernel3 + if test -e $KERNEL_PATH/out/arch/arm64/boot/Image && test -d $KERNEL_PATH/AnyKernel3; then + zip_name="PixelOS-SUSFS-martini-${{ env.TAG_NAME }}.zip" + cd $KERNEL_PATH/AnyKernel3 + cp $KERNEL_PATH/out/arch/arm64/boot/Image $KERNEL_PATH/AnyKernel3 + zip -r ${zip_name} * + mv ${zip_name} $KERNEL_PATH/out/arch/arm64/boot + fi + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: PixelOS-SUSFS-martini-${{ env.TAG_NAME }} + path: | + kernel/AnyKernel3/* + + - name: Upload to Release + if: github.event.inputs.RELEASE_CONFIG == 'true' + uses: ncipollo/release-action@v1 + with: + artifacts: "kernel/out/arch/arm64/boot/PixelOS-SUSFS-martini-${{ env.TAG_NAME }}.zip" + tag: "ONEPLUS9RT-PixelOS-SUSFS-${{ env.TAG_NAME }}" + name: "PixelOS SUSFS martini ${{ env.TAG_NAME }}" + allowUpdates: true + replacesArtifacts: true + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index f05afa0..905479e 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Guide of compile KernelSU for Oneplus 9RT(martini)[MT2110/MT2111] |:--:|:--:|:--:|:--:|:--:| | Pixel Experience | [PixelExperience-Devices/kernel_oneplus_martini](https://github.com/PixelExperience-Devices/kernel_oneplus_martini.git) | thirteen | [inferno0230](https://github.com/inferno0230) | Unsupport OOS and ColorOS. | | Pixel OS | [beet-stuffs/android_kernel_oneplus_sm8350](https://github.com/beet-stuffs/android_kernel_oneplus_sm8350.git) | fourteen-qpr2 | [bheatleyyy](https://github.com/bheatleyyy) | Unsupport OOS and ColorOS. | +| Pixel OS SUSFS | [natsumerinchan/android_kernel_oneplus_sm8350](https://github.com/natsumerinchan/android_kernel_oneplus_sm8350.git) | fourteen-qpr2 | [bheatleyyy](https://github.com/bheatleyyy) | Based on [beet-stuffs/android_kernel_oneplus_sm8350](https://github.com/beet-stuffs/android_kernel_oneplus_sm8350.git) and modify by me,add [SUSFS](https://gitlab.com/simonpunk/susfs4ksu) and `path_umount` features.Unsupport OOS and ColorOS. | ## How to build ### 1.Github Action diff --git a/README_zh_cn.md b/README_zh_cn.md index 70b9022..3972d1a 100644 --- a/README_zh_cn.md +++ b/README_zh_cn.md @@ -14,6 +14,7 @@ |:--:|:--:|:--:|:--:|:--:| | Pixel Experience | [PixelExperience-Devices/kernel_oneplus_martini](https://github.com/PixelExperience-Devices/kernel_oneplus_martini.git) | thirteen | [inferno0230](https://github.com/inferno0230) | 不支持ColorOS和OOS。 | | Pixel OS | [beet-stuffs/android_kernel_oneplus_sm8350](https://github.com/beet-stuffs/android_kernel_oneplus_sm8350.git) | fourteen-qpr2 | [bheatleyyy](https://github.com/bheatleyyy) | 不支持ColorOS和OOS。 | +| Pixel OS SUSFS | [natsumerinchan/android_kernel_oneplus_sm8350](https://github.com/natsumerinchan/android_kernel_oneplus_sm8350.git) | fourteen-qpr2 | [bheatleyyy](https://github.com/bheatleyyy) | 由本人基于[beet-stuffs/android_kernel_oneplus_sm8350](https://github.com/beet-stuffs/android_kernel_oneplus_sm8350.git)修改,添加了[SUSFS](https://gitlab.com/simonpunk/susfs4ksu)和path_umount功能。不支持ColorOS和OOS。 | ## 如何编译 ### 1.Github Action