|
| 1 | +name: Pixel OS SUSFS |
| 2 | + |
| 3 | + |
| 4 | +on: |
| 5 | + |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + RELEASE_CONFIG: |
| 9 | + description: 'Upload to Releases' |
| 10 | + required: true |
| 11 | + default: true |
| 12 | + type: boolean |
| 13 | + KERNEL_SOURCE: |
| 14 | + description: 'Kernel Source' |
| 15 | + required: true |
| 16 | + default: "https://github.com/natsumerinchan/android_kernel_oneplus_sm8350.git" |
| 17 | + type: string |
| 18 | + KERNEL_SOURCE_BRANCH: |
| 19 | + description: 'kernel Branch' |
| 20 | + required: true |
| 21 | + default: "fourteen-qpr3" |
| 22 | + type: string |
| 23 | + KERNEL_DEFCONFIG: |
| 24 | + description: 'Kernel Config' |
| 25 | + required: true |
| 26 | + default: "vendor/lahaina-qgki_defconfig" |
| 27 | + type: string |
| 28 | + KERNELSU_CONFIG: |
| 29 | + description: 'Compile KernelSU' |
| 30 | + required: true |
| 31 | + default: true |
| 32 | + type: boolean |
| 33 | + CCACHE_CONFIG: |
| 34 | + description: 'Use Ccache' |
| 35 | + required: true |
| 36 | + default: true |
| 37 | + type: boolean |
| 38 | + KERNELSU_TAG: |
| 39 | + description: 'Choose KernelSU branch or tag' |
| 40 | + required: false |
| 41 | + default: "main" |
| 42 | + type: string |
| 43 | + |
| 44 | +jobs: |
| 45 | + |
| 46 | + build: |
| 47 | + |
| 48 | + runs-on: ubuntu-latest |
| 49 | + env: |
| 50 | + CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion" |
| 51 | + CCACHE_NOHASHDIR: "true" |
| 52 | + CCACHE_MAXSIZE: "2G" |
| 53 | + CCACHE_HARDLINK: "true" |
| 54 | + |
| 55 | + steps: |
| 56 | + |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Ccache |
| 60 | + if: github.event.inputs.CCACHE_CONFIG == 'true' |
| 61 | + uses: hendrikmuhs/ccache-action@v1.2 |
| 62 | + with: |
| 63 | + key: PixelOS-inline |
| 64 | + |
| 65 | + - name: Setup Environment |
| 66 | + run: | |
| 67 | + export CLANG_PATH=~/clang |
| 68 | + git clone --depth=1 https://github.com/kdrag0n/proton-clang $CLANG_PATH |
| 69 | + sh -c "$(curl -sSL https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/android_build_env.sh)" |
| 70 | + sudo apt install --fix-missing |
| 71 | + export LLVM_VERSION=13 |
| 72 | + wget https://apt.llvm.org/llvm.sh |
| 73 | + chmod +x llvm.sh |
| 74 | + sudo ./llvm.sh $LLVM_VERSION |
| 75 | + rm ./llvm.sh |
| 76 | + sudo apt install --fix-missing |
| 77 | + sudo ln -s --force /usr/bin/clang-$LLVM_VERSION /usr/bin/clang |
| 78 | + sudo ln -s --force /usr/bin/ld.lld-$LLVM_VERSION /usr/bin/ld.lld |
| 79 | + sudo ln -s --force /usr/bin/llvm-objdump-$LLVM_VERSION /usr/bin/llvm-objdump |
| 80 | + sudo ln -s --force /usr/bin/llvm-ar-$LLVM_VERSION /usr/bin/llvm-ar |
| 81 | + sudo ln -s --force /usr/bin/llvm-nm-$LLVM_VERSION /usr/bin/llvm-nm |
| 82 | + sudo ln -s --force /usr/bin/llvm-strip-$LLVM_VERSION /usr/bin/llvm-strip |
| 83 | + sudo ln -s --force /usr/bin/llvm-objcopy-$LLVM_VERSION /usr/bin/llvm-objcopy |
| 84 | + sudo ln -s --force /usr/bin/llvm-readelf-$LLVM_VERSION /usr/bin/llvm-readelf |
| 85 | + sudo ln -s --force /usr/bin/clang++-$LLVM_VERSION /usr/bin/clang++ |
| 86 | +
|
| 87 | + - name: Git kernel |
| 88 | + run: | |
| 89 | + git clone "${{ github.event.inputs.KERNEL_SOURCE }}" -b "${{ github.event.inputs.KERNEL_SOURCE_BRANCH }}" kernel --depth=1 |
| 90 | + echo "TAG_NAME=v5.4.$(grep "^SUBLEVEL =" kernel/Makefile | awk '{print $3}')-$(date +"%Y%m%d")" >> $GITHUB_ENV |
| 91 | +
|
| 92 | + - name: Setup KernelSU |
| 93 | + if: github.event.inputs.KERNELSU_CONFIG == 'true' |
| 94 | + run: | |
| 95 | + cd $GITHUB_WORKSPACE/kernel |
| 96 | + git clone https://github.com/natsumerinchan/KernelSU.git KernelSU |
| 97 | + curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s "${{ github.event.inputs.KERNELSU_TAG }}" |
| 98 | + scripts/config --file "arch/arm64/configs/${{ github.event.inputs.KERNEL_DEFCONFIG }}" -e MODULES -e KPROBES -e HAVE_KPROBES -e KPROBE_EVENTS |
| 99 | +
|
| 100 | + - name: Make kernel |
| 101 | + run: | |
| 102 | + cd $GITHUB_WORKSPACE/kernel |
| 103 | + export KERNEL_DEFCONFIG=${{ github.event.inputs.KERNEL_DEFCONFIG }} |
| 104 | + echo "===================Setup Export=========================" |
| 105 | + export KERNEL_PATH=$PWD |
| 106 | + export CLANG_PATH=~/clang |
| 107 | + export PATH=${CLANG_PATH}/bin:${PATH} |
| 108 | + export CLANG_TRIPLE=aarch64-linux-gnu- |
| 109 | + export ARCH=arm64 |
| 110 | + export SUBARCH=arm64 |
| 111 | + echo "===================Setup Environment Again===================" |
| 112 | + if [ ! -e "$CLANG_PATH/README.md" ]; then |
| 113 | + git clone --depth=1 https://github.com/kdrag0n/proton-clang $CLANG_PATH |
| 114 | + fi |
| 115 | + sudo apt install --fix-missing |
| 116 | + echo "=========================Make==========================" |
| 117 | + 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 |
| 118 | + # Disable LTO |
| 119 | + if [[ $(echo "$(awk '/MemTotal/ {print $2}' /proc/meminfo) < 16000000" | bc -l) -eq 1 ]]; then |
| 120 | + scripts/config --file out/.config -d LTO -d LTO_CLANG -d THINLTO -e LTO_NONE |
| 121 | + fi |
| 122 | + 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 |
| 123 | +
|
| 124 | + |
| 125 | + - name: Create Anykernel3 file |
| 126 | + run: | |
| 127 | + cd $GITHUB_WORKSPACE/kernel |
| 128 | + export KERNEL_PATH=$PWD |
| 129 | + git clone https://gitlab.com/inferno0230/AnyKernel3.git --depth=1 $KERNEL_PATH/AnyKernel3 |
| 130 | + if test -e $KERNEL_PATH/out/arch/arm64/boot/Image && test -d $KERNEL_PATH/AnyKernel3; then |
| 131 | + zip_name="PixelOS-SUSFS-martini-${{ env.TAG_NAME }}.zip" |
| 132 | + cd $KERNEL_PATH/AnyKernel3 |
| 133 | + cp $KERNEL_PATH/out/arch/arm64/boot/Image $KERNEL_PATH/AnyKernel3 |
| 134 | + zip -r ${zip_name} * |
| 135 | + mv ${zip_name} $KERNEL_PATH/out/arch/arm64/boot |
| 136 | + fi |
| 137 | +
|
| 138 | + - name: Upload Artifact |
| 139 | + uses: actions/upload-artifact@v4 |
| 140 | + with: |
| 141 | + name: PixelOS-SUSFS-martini-${{ env.TAG_NAME }} |
| 142 | + path: | |
| 143 | + kernel/AnyKernel3/* |
| 144 | +
|
| 145 | + - name: Upload to Release |
| 146 | + if: github.event.inputs.RELEASE_CONFIG == 'true' |
| 147 | + uses: ncipollo/release-action@v1 |
| 148 | + with: |
| 149 | + artifacts: "kernel/out/arch/arm64/boot/PixelOS-SUSFS-martini-${{ env.TAG_NAME }}.zip" |
| 150 | + tag: "ONEPLUS9RT-PixelOS-SUSFS-${{ env.TAG_NAME }}" |
| 151 | + name: "PixelOS SUSFS martini ${{ env.TAG_NAME }}" |
| 152 | + allowUpdates: true |
| 153 | + replacesArtifacts: true |
| 154 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments