Skip to content

allow users to use different defconfig file #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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": [
Expand Down
3 changes: 2 additions & 1 deletion repos.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down