diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddebd26dc..2be748786 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,9 +41,8 @@ jobs: kernelRepo: ${{ matrix.repos.kernelSource.repo }} kernelBranch: ${{ matrix.repos.kernelSource.branch }} kernelDevice: ${{ matrix.repos.kernelSource.device }} - - DEFCONFIG_NAME: ${{ matrix.repos.kernelSource.device }}_defconfig - + useCustomDefconfig: ${{ matrix.repos.kernelSource.useCustomDefconfig }} + customDefconfig: ${{ matrix.repos.kernelSource.customDefconfig }} withKernelSU: ${{ matrix.repos.withKernelSU }} steps: - name: "✨ Create working dir" @@ -59,6 +58,16 @@ jobs: run: | git clone --recursive --branch $kernelBranch $kernelRepo $kernelName --depth=1 + - name: "🔧 Set defconfig" + id: set-defconfig + run: | + if [ ${{ env.useCustomDefconfig }} == 'true' ]; then + DEFCONFIG_NAME="${{ env.customDefconfig }}" + else + DEFCONFIG_NAME="${{ env.kernelDevice }}_defconfig" + fi + echo "defconfig=$DEFCONFIG_NAME" >> $GITHUB_OUTPUT + - name: "💫 Get toolchains" working-directory: ./${{ env.kernelDir }} env: @@ -122,6 +131,8 @@ jobs: - name: "😋 Update KernelSU" working-directory: ./${{ env.kernelDir }}/${{ env.kernelName }} + env: + defconfig: ${{ steps.set-defconfig.outputs.defconfig }} if: ${{ env.withKernelSU == 'true' }} run: | if [ -d "./KernelSU" ]; then @@ -133,19 +144,20 @@ jobs: curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main - echo -e "\nCONFIG_KPROBES=y" >> ./arch/${{ env.ARCH }}/configs/${{ env.DEFCONFIG_NAME }} - echo -e "\nCONFIG_HAVE_KPROBES=y" >> ./arch/${{ env.ARCH }}/configs/${{ env.DEFCONFIG_NAME }} - echo -e "\nCONFIG_KPROBE_EVENTS=y" >> ./arch/${{ env.ARCH }}/configs/${{ env.DEFCONFIG_NAME }} + echo -e "\nCONFIG_KPROBES=y" >> ./arch/${{ env.ARCH }}/configs/${{ env.defconfig }} + echo -e "\nCONFIG_HAVE_KPROBES=y" >> ./arch/${{ env.ARCH }}/configs/${{ env.defconfig }} + echo -e "\nCONFIG_KPROBE_EVENTS=y" >> ./arch/${{ env.ARCH }}/configs/${{ env.defconfig }} - cat ./arch/${{ env.ARCH }}/configs/${{ env.DEFCONFIG_NAME }} + cat ./arch/${{ env.ARCH }}/configs/${{ env.defconfig }} - name: "👍 Make defconfig" working-directory: ./${{ env.kernelDir }}/${{ env.kernelName }} env: args: ${{ steps.generate-args.outputs.args }} + defconfig: ${{ steps.set-defconfig.outputs.defconfig }} run: | echo "PATH Variable: $PATH" - make ${{ env.args }} ${{ env.DEFCONFIG_NAME }} + make ${{ env.args }} ${{ env.defconfig }} - name: "🎶 Build kernel" working-directory: ./${{ env.kernelDir }}/${{ env.kernelName }} diff --git a/README.md b/README.md index 799ad6f2c..5db153d54 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ The `Set-repos` job reads the kernel sources from the configuration file and out | Create working dir | Create working directory | | Install prerequisites | Install necessary dependencies for build | | Clone kernel source | Clone kernel source code | +| Set defconfig | Set default or custom defconfig | | Get toolchains | Get toolchains | | Set args | Set build arguments | | Update KernelSU (optional) | Patch kernel with KernelSU | @@ -66,7 +67,9 @@ Here is an example configuration file: "name": "DogDayAndroid", "repo": "https://codeberg.org/DogDayAndroid/android_kernel_xiaomi_thyme", "branch": "lineage-20.0", - "device": "thyme" + "device": "thyme", + "useCustomDefconfig": true, + "customDefconfig": "thyme_defconfig" }, "withKernelSU": false, "toolchains": [ diff --git a/repos.json b/repos.json index a977b01a3..9cdb2a6eb 100644 --- a/repos.json +++ b/repos.json @@ -3,7 +3,8 @@ "name": "miku-KernelSU", "repo": "https://github.com/PhamtomK12/kernel_xiaomi_odin", "branch": "TDA", - "device": "odin" + "device": "odin", + "useCustomDefconfig": false }, "withKernelSU": true, "toolchains": [