├── .assets ├── DogDayAndroid.png └── artifacts.png ├── .github └── workflows │ └── build.yml ├── LICENSE ├── README.md ├── README_cn.md └── repos.json /.assets/DogDayAndroid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlackerState/Android-Kernel-Builder/ab372a086276def4bb9d34a437ad73171b28fd4f/.assets/DogDayAndroid.png -------------------------------------------------------------------------------- /.assets/artifacts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlackerState/Android-Kernel-Builder/ab372a086276def4bb9d34a437ad73171b28fd4f/.assets/artifacts.png -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: "Build kernels" 2 | 3 | env: 4 | CONFIGURATION: "repos.json" 5 | OUT_DIR: "out" 6 | 7 | on: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | Set-repos: 12 | name: "🐂 Parse repos.json" 13 | runs-on: ubuntu-latest 14 | outputs: 15 | repos: ${{ steps.generate-matrix.outputs.repos }} 16 | steps: 17 | - name: "😄 Checkout" 18 | uses: actions/checkout@v3 19 | 20 | - name: "😆 Generate Matrix" 21 | id: generate-matrix 22 | run: | 23 | echo "repos<> $GITHUB_OUTPUT 24 | cat ${{ env.CONFIGURATION }} >> $GITHUB_OUTPUT 25 | echo "EOF" >> $GITHUB_OUTPUT 26 | 27 | Build-Kernel: 28 | name: "🐎 Build kernel" 29 | runs-on: ubuntu-latest 30 | needs: 31 | - Set-repos 32 | strategy: 33 | max-parallel: 2 34 | fail-fast: false 35 | matrix: 36 | repos: ${{ fromJSON(needs.Set-repos.outputs.repos) }} 37 | env: 38 | kernelDir: ${{ matrix.repos.kernelSource.name }}_${{ matrix.repos.kernelSource.device }} 39 | 40 | kernelName: ${{ matrix.repos.kernelSource.name }} 41 | kernelRepo: ${{ matrix.repos.kernelSource.repo }} 42 | kernelBranch: ${{ matrix.repos.kernelSource.branch }} 43 | kernelDevice: ${{ matrix.repos.kernelSource.device }} 44 | 45 | DEFCONFIG_NAME: ${{ matrix.repos.kernelSource.device }}_defconfig 46 | 47 | withKernelSU: ${{ matrix.repos.withKernelSU }} 48 | useCustomtool: ${{ matrix.repos.useCustomtool }} 49 | isConfiginvendor: ${{ matrix.repos.isConfiginvendor }} 50 | dtbPath: ${{ matrix.repos.dtbPath }} 51 | steps: 52 | - name: "✨ Create working dir" 53 | run: mkdir -p $kernelDir 54 | 55 | - name: "⭐ Install prerequisites" 56 | run: | 57 | sudo apt-get update 58 | sudo apt-get install -y build-essential bc curl git zip ftp gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi libssl-dev lftp zstd wget libfl-dev python2 python3 libarchive-tools 59 | 60 | - name: "🌟 Clone kernel source => (${{ env.kernelRepo }})" 61 | working-directory: ./${{ env.kernelDir }} 62 | run: | 63 | git clone --recursive --branch $kernelBranch $kernelRepo $kernelName --depth=1 64 | 65 | - name: "💫 Get Customtoolchains" 66 | working-directory: ./${{ env.kernelDir }} 67 | env: 68 | toolchains: "${{ toJSON(matrix.repos.toolchains) }}" 69 | if: ${{ env.useCustomtool == 'true' }} 70 | run: | 71 | toolchains_num="$(echo $toolchains | jq 'length')" 72 | echo $toolchains_num 73 | for ((i=0;i> $GITHUB_PATH 79 | echo "$(pwd)/$name/toolgcc/bin" >> $GITHUB_PATH 80 | echo "$(pwd)/$name/toolclang/clang-r428724/bin" >> $GITHUB_PATH 81 | echo "$(pwd)/$name/toolgcc/arm/bin" >> $GITHUB_PATH 82 | done 83 | 84 | echo "PATH Variable: $PATH" 85 | 86 | - name: "💫 Get toolchains" 87 | working-directory: ./${{ env.kernelDir }} 88 | env: 89 | toolchains: "${{ toJSON(matrix.repos.toolchains) }}" 90 | if: ${{ env.useCustomtool != 'true' }} 91 | run: | 92 | toolchains_num="$(echo $toolchains | jq 'length')" 93 | echo $toolchains_num 94 | for ((i=0;i> $GITHUB_PATH 100 | echo "$(pwd)/$name/bin" >> $GITHUB_PATH 101 | done 102 | 103 | echo "PATH Variable: $PATH" 104 | 105 | - name: "😎 Set args" 106 | id: generate-args 107 | working-directory: ./${{ env.kernelDir }} 108 | env: 109 | params: "${{ toJSON(matrix.repos.params) }}" 110 | THREAD: $(nproc --all) 111 | run: | 112 | echo "PATH Variable: $PATH" 113 | ARCH=$(echo $params | jq -r ".ARCH") 114 | CROSS_COMPILE=$(echo $params | jq -r ".CROSS_COMPILE") 115 | CROSS_COMPILE_COMPAT=$(echo $params | jq -r ".CROSS_COMPILE_COMPAT") 116 | CROSS_COMPILE_ARM32=$(echo $params | jq -r ".CROSS_COMPILE_ARM32") 117 | CLANG_TRIPLE=$(echo $params | jq -r ".CLANG_TRIPLE") 118 | AR=$(echo $params | jq -r ".AR") 119 | CC=$(echo $params | jq -r ".CC") 120 | HOSTCXX=$(echo $params | jq -r ".HOSTCXX") 121 | NM=$(echo $params | jq -r ".NM") 122 | OBJCOPY=$(echo $params | jq -r ".OBJCOPY") 123 | OBJDUMP=$(echo $params | jq -r ".OBJDUMP") 124 | STRIP=$(echo $params | jq -r ".STRIP") 125 | LD=$(echo $params | jq -r ".LD") 126 | DTC_EXT=$(echo $params | jq -r ".DTC_EXT") 127 | 128 | echo "ARCH=$ARCH" >> $GITHUB_ENV 129 | 130 | args="-j$(nproc --all)" 131 | if [ -n "${{ env.OUT_DIR }}" ]; then 132 | mkdir -p $(pwd)/${{ env.OUT_DIR }} 133 | args="$args O=$(pwd)/${{ env.OUT_DIR }}" 134 | fi 135 | if [ -n "$ARCH" ]; then 136 | args="$args ARCH=$ARCH" 137 | fi 138 | if [ -n "$CROSS_COMPILE" ]; then 139 | args="$args CROSS_COMPILE=$CROSS_COMPILE" 140 | fi 141 | if [ -n "$CLANG_TRIPLE" ]; then 142 | args="$args CLANG_TRIPLE=$CLANG_TRIPLE" 143 | fi 144 | if [ -n "$CROSS_COMPILE_COMPAT" ]; then 145 | args="$args CROSS_COMPILE_ARM32=$CROSS_COMPILE_COMPAT" 146 | fi 147 | if [ -n "$AR" ]; then 148 | args="$args AR=$AR" 149 | fi 150 | if [ -n "$CC" ]; then 151 | args="$args CC=$CC" 152 | fi 153 | if [ -n "$HOSTCXX" ]; then 154 | args="$args HOSTCXX=$HOSTCXX" 155 | fi 156 | if [ -n "$NM" ]; then 157 | args="$args NM=$NM" 158 | fi 159 | if [ -n "$OBJCOPY" ]; then 160 | args="$args OBJCOPY=$OBJCOPY" 161 | fi 162 | if [ -n "$OBJDUMP" ]; then 163 | args="$args OBJDUMP=$OBJDUMP" 164 | fi 165 | if [ -n "$STRIP" ]; then 166 | args="$args STRIP=$STRIP" 167 | fi 168 | if [ -n "$LD" ]; then 169 | args="$args LD=$LD" 170 | fi 171 | if [ -n "$DTC_EXT" ]; then 172 | args="$args DTC_EXT=$DTC_EXT" 173 | fi 174 | echo "args=$args" >> $GITHUB_OUTPUT 175 | 176 | - name: "😋 Update KernelSU" 177 | working-directory: ./${{ env.kernelDir }}/${{ env.kernelName }} 178 | if: ${{ env.withKernelSU == 'true' }} 179 | run: | 180 | if [ -d "./KernelSU" ]; then 181 | rm -rf "./KernelSU" 182 | fi 183 | if [ -d "./drivers/kernelsu" ]; then 184 | rm -rf "./drivers/kernelsu" 185 | fi 186 | 187 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main 188 | 189 | echo -e "\nCONFIG_KPROBES=y" >> ./arch/${{ env.ARCH }}/configs/${{ env.DEFCONFIG_NAME }} 190 | echo -e "\nCONFIG_HAVE_KPROBES=y" >> ./arch/${{ env.ARCH }}/configs/${{ env.DEFCONFIG_NAME }} 191 | echo -e "\nCONFIG_KPROBE_EVENTS=y" >> ./arch/${{ env.ARCH }}/configs/${{ env.DEFCONFIG_NAME }} 192 | 193 | cat ./arch/${{ env.ARCH }}/configs/${{ env.DEFCONFIG_NAME }} 194 | 195 | - name: "👍 Make defconfig" 196 | working-directory: ./${{ env.kernelDir }}/${{ env.kernelName }} 197 | env: 198 | args: ${{ steps.generate-args.outputs.args }} 199 | if: ${{ env.isConfiginvendor == 'true' }} 200 | run: | 201 | echo "PATH Variable: $PATH" 202 | make ${{ env.args }} vendor/${{ env.DEFCONFIG_NAME }} 203 | 204 | - name: "👍 Make defconfig" 205 | working-directory: ./${{ env.kernelDir }}/${{ env.kernelName }} 206 | env: 207 | args: ${{ steps.generate-args.outputs.args }}4 208 | if: ${{ env.isConfiginvendor != 'true' }} 209 | run: | 210 | echo "PATH Variable: $PATH" 211 | make ${{ env.args }} ${{ env.DEFCONFIG_NAME }} 212 | 213 | - name: "🎶 Build kernel" 214 | working-directory: ./${{ env.kernelDir }}/${{ env.kernelName }} 215 | env: 216 | args: ${{ steps.generate-args.outputs.args }} 217 | run: | 218 | echo "PATH Variable: $PATH" 219 | make ${args} 220 | 221 | - name: "💛 Upload Image" 222 | uses: actions/upload-artifact@v3 223 | with: 224 | name: Image(${{ env.kernelDevice }}-${{ env.kernelName }}-${{ env.kernelBranch }}) 225 | path: ./${{ env.kernelDir }}/${{ env.OUT_DIR }}/arch/${{ env.ARCH }}/boot/Image 226 | if-no-files-found: ignore 227 | retention-days: 7 228 | 229 | - name: "💙 Upload Image.gz" 230 | uses: actions/upload-artifact@v3 231 | with: 232 | name: Image.gz(${{ env.kernelDevice }}-${{ env.kernelName }}-${{ env.kernelBranch }}) 233 | path: ./${{ env.kernelDir }}/${{ env.OUT_DIR }}/arch/${{ env.ARCH }}/boot/Image.gz 234 | if-no-files-found: ignore 235 | retention-days: 7 236 | 237 | - name: "💜 Upload dtb" 238 | uses: actions/upload-artifact@v3 239 | with: 240 | name: dtb(${{ env.kernelDevice }}-${{ env.kernelName }}-${{ env.kernelBranch }}) 241 | path: ./${{ env.kernelDir }}/${{ env.OUT_DIR }}/arch/${{ env.ARCH }}/${{ env.dtbPath }} 242 | if-no-files-found: ignore 243 | retention-days: 7 244 | 245 | - name: "❤️ Upload dtbo.img" 246 | uses: actions/upload-artifact@v3 247 | with: 248 | name: dtbo.img(${{ env.kernelDevice }}-${{ env.kernelName }}-${{ env.kernelBranch }}) 249 | path: ./${{ env.kernelDir }}/${{ env.OUT_DIR }}/arch/${{ env.ARCH }}/boot/dtbo.img 250 | if-no-files-found: ignore 251 | retention-days: 7 252 | 253 | - name: "Make Anykernel3" 254 | working-directory: ./${{ env.kernelDir }} 255 | run: | 256 | git clone https://github.com/SlackerState/AnyKernel3 257 | cp "${{ env.OUT_DIR }}/arch/${{ env.ARCH }}/boot/Image.gz" AnyKernel3/ 258 | cp "${{ env.OUT_DIR }}/arch/${{ env.ARCH }}/${{ env.dtbPath }}" AnyKernel3/dtb 259 | cp "${{ env.OUT_DIR }}/arch/${{ env.ARCH }}/boot/dtbo.img" AnyKernel3/ 260 | rm -rf AnyKernel3/.git* AnyKernel3/README.md 261 | 262 | - name: "❤️ Upload Anykernel3" 263 | uses: actions/upload-artifact@v3 264 | with: 265 | name: Anykernel3(${{ env.kernelDevice }}-${{ env.kernelName }}-${{ env.kernelBranch }}) 266 | path: ./${{ env.kernelDir }}/AnyKernel3/* 267 | if-no-files-found: ignore 268 | retention-days: 7 269 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution-NonCommercial-ShareAlike 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International 58 | Public License 59 | 60 | By exercising the Licensed Rights (defined below), You accept and agree 61 | to be bound by the terms and conditions of this Creative Commons 62 | Attribution-NonCommercial-ShareAlike 4.0 International Public License 63 | ("Public License"). To the extent this Public License may be 64 | interpreted as a contract, You are granted the Licensed Rights in 65 | consideration of Your acceptance of these terms and conditions, and the 66 | Licensor grants You such rights in consideration of benefits the 67 | Licensor receives from making the Licensed Material available under 68 | these terms and conditions. 69 | 70 | 71 | Section 1 -- Definitions. 72 | 73 | a. Adapted Material means material subject to Copyright and Similar 74 | Rights that is derived from or based upon the Licensed Material 75 | and in which the Licensed Material is translated, altered, 76 | arranged, transformed, or otherwise modified in a manner requiring 77 | permission under the Copyright and Similar Rights held by the 78 | Licensor. For purposes of this Public License, where the Licensed 79 | Material is a musical work, performance, or sound recording, 80 | Adapted Material is always produced where the Licensed Material is 81 | synched in timed relation with a moving image. 82 | 83 | b. Adapter's License means the license You apply to Your Copyright 84 | and Similar Rights in Your contributions to Adapted Material in 85 | accordance with the terms and conditions of this Public License. 86 | 87 | c. BY-NC-SA Compatible License means a license listed at 88 | creativecommons.org/compatiblelicenses, approved by Creative 89 | Commons as essentially the equivalent of this Public License. 90 | 91 | d. Copyright and Similar Rights means copyright and/or similar rights 92 | closely related to copyright including, without limitation, 93 | performance, broadcast, sound recording, and Sui Generis Database 94 | Rights, without regard to how the rights are labeled or 95 | categorized. For purposes of this Public License, the rights 96 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 97 | Rights. 98 | 99 | e. Effective Technological Measures means those measures that, in the 100 | absence of proper authority, may not be circumvented under laws 101 | fulfilling obligations under Article 11 of the WIPO Copyright 102 | Treaty adopted on December 20, 1996, and/or similar international 103 | agreements. 104 | 105 | f. Exceptions and Limitations means fair use, fair dealing, and/or 106 | any other exception or limitation to Copyright and Similar Rights 107 | that applies to Your use of the Licensed Material. 108 | 109 | g. License Elements means the license attributes listed in the name 110 | of a Creative Commons Public License. The License Elements of this 111 | Public License are Attribution, NonCommercial, and ShareAlike. 112 | 113 | h. Licensed Material means the artistic or literary work, database, 114 | or other material to which the Licensor applied this Public 115 | License. 116 | 117 | i. Licensed Rights means the rights granted to You subject to the 118 | terms and conditions of this Public License, which are limited to 119 | all Copyright and Similar Rights that apply to Your use of the 120 | Licensed Material and that the Licensor has authority to license. 121 | 122 | j. Licensor means the individual(s) or entity(ies) granting rights 123 | under this Public License. 124 | 125 | k. NonCommercial means not primarily intended for or directed towards 126 | commercial advantage or monetary compensation. For purposes of 127 | this Public License, the exchange of the Licensed Material for 128 | other material subject to Copyright and Similar Rights by digital 129 | file-sharing or similar means is NonCommercial provided there is 130 | no payment of monetary compensation in connection with the 131 | exchange. 132 | 133 | l. Share means to provide material to the public by any means or 134 | process that requires permission under the Licensed Rights, such 135 | as reproduction, public display, public performance, distribution, 136 | dissemination, communication, or importation, and to make material 137 | available to the public including in ways that members of the 138 | public may access the material from a place and at a time 139 | individually chosen by them. 140 | 141 | m. Sui Generis Database Rights means rights other than copyright 142 | resulting from Directive 96/9/EC of the European Parliament and of 143 | the Council of 11 March 1996 on the legal protection of databases, 144 | as amended and/or succeeded, as well as other essentially 145 | equivalent rights anywhere in the world. 146 | 147 | n. You means the individual or entity exercising the Licensed Rights 148 | under this Public License. Your has a corresponding meaning. 149 | 150 | 151 | Section 2 -- Scope. 152 | 153 | a. License grant. 154 | 155 | 1. Subject to the terms and conditions of this Public License, 156 | the Licensor hereby grants You a worldwide, royalty-free, 157 | non-sublicensable, non-exclusive, irrevocable license to 158 | exercise the Licensed Rights in the Licensed Material to: 159 | 160 | a. reproduce and Share the Licensed Material, in whole or 161 | in part, for NonCommercial purposes only; and 162 | 163 | b. produce, reproduce, and Share Adapted Material for 164 | NonCommercial purposes only. 165 | 166 | 2. Exceptions and Limitations. For the avoidance of doubt, where 167 | Exceptions and Limitations apply to Your use, this Public 168 | License does not apply, and You do not need to comply with 169 | its terms and conditions. 170 | 171 | 3. Term. The term of this Public License is specified in Section 172 | 6(a). 173 | 174 | 4. Media and formats; technical modifications allowed. The 175 | Licensor authorizes You to exercise the Licensed Rights in 176 | all media and formats whether now known or hereafter created, 177 | and to make technical modifications necessary to do so. The 178 | Licensor waives and/or agrees not to assert any right or 179 | authority to forbid You from making technical modifications 180 | necessary to exercise the Licensed Rights, including 181 | technical modifications necessary to circumvent Effective 182 | Technological Measures. For purposes of this Public License, 183 | simply making modifications authorized by this Section 2(a) 184 | (4) never produces Adapted Material. 185 | 186 | 5. Downstream recipients. 187 | 188 | a. Offer from the Licensor -- Licensed Material. Every 189 | recipient of the Licensed Material automatically 190 | receives an offer from the Licensor to exercise the 191 | Licensed Rights under the terms and conditions of this 192 | Public License. 193 | 194 | b. Additional offer from the Licensor -- Adapted Material. 195 | Every recipient of Adapted Material from You 196 | automatically receives an offer from the Licensor to 197 | exercise the Licensed Rights in the Adapted Material 198 | under the conditions of the Adapter's License You apply. 199 | 200 | c. No downstream restrictions. You may not offer or impose 201 | any additional or different terms or conditions on, or 202 | apply any Effective Technological Measures to, the 203 | Licensed Material if doing so restricts exercise of the 204 | Licensed Rights by any recipient of the Licensed 205 | Material. 206 | 207 | 6. No endorsement. Nothing in this Public License constitutes or 208 | may be construed as permission to assert or imply that You 209 | are, or that Your use of the Licensed Material is, connected 210 | with, or sponsored, endorsed, or granted official status by, 211 | the Licensor or others designated to receive attribution as 212 | provided in Section 3(a)(1)(A)(i). 213 | 214 | b. Other rights. 215 | 216 | 1. Moral rights, such as the right of integrity, are not 217 | licensed under this Public License, nor are publicity, 218 | privacy, and/or other similar personality rights; however, to 219 | the extent possible, the Licensor waives and/or agrees not to 220 | assert any such rights held by the Licensor to the limited 221 | extent necessary to allow You to exercise the Licensed 222 | Rights, but not otherwise. 223 | 224 | 2. Patent and trademark rights are not licensed under this 225 | Public License. 226 | 227 | 3. To the extent possible, the Licensor waives any right to 228 | collect royalties from You for the exercise of the Licensed 229 | Rights, whether directly or through a collecting society 230 | under any voluntary or waivable statutory or compulsory 231 | licensing scheme. In all other cases the Licensor expressly 232 | reserves any right to collect such royalties, including when 233 | the Licensed Material is used other than for NonCommercial 234 | purposes. 235 | 236 | 237 | Section 3 -- License Conditions. 238 | 239 | Your exercise of the Licensed Rights is expressly made subject to the 240 | following conditions. 241 | 242 | a. Attribution. 243 | 244 | 1. If You Share the Licensed Material (including in modified 245 | form), You must: 246 | 247 | a. retain the following if it is supplied by the Licensor 248 | with the Licensed Material: 249 | 250 | i. identification of the creator(s) of the Licensed 251 | Material and any others designated to receive 252 | attribution, in any reasonable manner requested by 253 | the Licensor (including by pseudonym if 254 | designated); 255 | 256 | ii. a copyright notice; 257 | 258 | iii. a notice that refers to this Public License; 259 | 260 | iv. a notice that refers to the disclaimer of 261 | warranties; 262 | 263 | v. a URI or hyperlink to the Licensed Material to the 264 | extent reasonably practicable; 265 | 266 | b. indicate if You modified the Licensed Material and 267 | retain an indication of any previous modifications; and 268 | 269 | c. indicate the Licensed Material is licensed under this 270 | Public License, and include the text of, or the URI or 271 | hyperlink to, this Public License. 272 | 273 | 2. You may satisfy the conditions in Section 3(a)(1) in any 274 | reasonable manner based on the medium, means, and context in 275 | which You Share the Licensed Material. For example, it may be 276 | reasonable to satisfy the conditions by providing a URI or 277 | hyperlink to a resource that includes the required 278 | information. 279 | 3. If requested by the Licensor, You must remove any of the 280 | information required by Section 3(a)(1)(A) to the extent 281 | reasonably practicable. 282 | 283 | b. ShareAlike. 284 | 285 | In addition to the conditions in Section 3(a), if You Share 286 | Adapted Material You produce, the following conditions also apply. 287 | 288 | 1. The Adapter's License You apply must be a Creative Commons 289 | license with the same License Elements, this version or 290 | later, or a BY-NC-SA Compatible License. 291 | 292 | 2. You must include the text of, or the URI or hyperlink to, the 293 | Adapter's License You apply. You may satisfy this condition 294 | in any reasonable manner based on the medium, means, and 295 | context in which You Share Adapted Material. 296 | 297 | 3. You may not offer or impose any additional or different terms 298 | or conditions on, or apply any Effective Technological 299 | Measures to, Adapted Material that restrict exercise of the 300 | rights granted under the Adapter's License You apply. 301 | 302 | 303 | Section 4 -- Sui Generis Database Rights. 304 | 305 | Where the Licensed Rights include Sui Generis Database Rights that 306 | apply to Your use of the Licensed Material: 307 | 308 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 309 | to extract, reuse, reproduce, and Share all or a substantial 310 | portion of the contents of the database for NonCommercial purposes 311 | only; 312 | 313 | b. if You include all or a substantial portion of the database 314 | contents in a database in which You have Sui Generis Database 315 | Rights, then the database in which You have Sui Generis Database 316 | Rights (but not its individual contents) is Adapted Material, 317 | including for purposes of Section 3(b); and 318 | 319 | c. You must comply with the conditions in Section 3(a) if You Share 320 | all or a substantial portion of the contents of the database. 321 | 322 | For the avoidance of doubt, this Section 4 supplements and does not 323 | replace Your obligations under this Public License where the Licensed 324 | Rights include other Copyright and Similar Rights. 325 | 326 | 327 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 328 | 329 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 330 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 331 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 332 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 333 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 334 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 335 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 336 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 337 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 338 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 339 | 340 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 341 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 342 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 343 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 344 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 345 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 346 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 347 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 348 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 349 | 350 | c. The disclaimer of warranties and limitation of liability provided 351 | above shall be interpreted in a manner that, to the extent 352 | possible, most closely approximates an absolute disclaimer and 353 | waiver of all liability. 354 | 355 | 356 | Section 6 -- Term and Termination. 357 | 358 | a. This Public License applies for the term of the Copyright and 359 | Similar Rights licensed here. However, if You fail to comply with 360 | this Public License, then Your rights under this Public License 361 | terminate automatically. 362 | 363 | b. Where Your right to use the Licensed Material has terminated under 364 | Section 6(a), it reinstates: 365 | 366 | 1. automatically as of the date the violation is cured, provided 367 | it is cured within 30 days of Your discovery of the 368 | violation; or 369 | 370 | 2. upon express reinstatement by the Licensor. 371 | 372 | For the avoidance of doubt, this Section 6(b) does not affect any 373 | right the Licensor may have to seek remedies for Your violations 374 | of this Public License. 375 | 376 | c. For the avoidance of doubt, the Licensor may also offer the 377 | Licensed Material under separate terms or conditions or stop 378 | distributing the Licensed Material at any time; however, doing so 379 | will not terminate this Public License. 380 | 381 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 382 | License. 383 | 384 | 385 | Section 7 -- Other Terms and Conditions. 386 | 387 | a. The Licensor shall not be bound by any additional or different 388 | terms or conditions communicated by You unless expressly agreed. 389 | 390 | b. Any arrangements, understandings, or agreements regarding the 391 | Licensed Material not stated herein are separate from and 392 | independent of the terms and conditions of this Public License. 393 | 394 | 395 | Section 8 -- Interpretation. 396 | 397 | a. For the avoidance of doubt, this Public License does not, and 398 | shall not be interpreted to, reduce, limit, restrict, or impose 399 | conditions on any use of the Licensed Material that could lawfully 400 | be made without permission under this Public License. 401 | 402 | b. To the extent possible, if any provision of this Public License is 403 | deemed unenforceable, it shall be automatically reformed to the 404 | minimum extent necessary to make it enforceable. If the provision 405 | cannot be reformed, it shall be severed from this Public License 406 | without affecting the enforceability of the remaining terms and 407 | conditions. 408 | 409 | c. No term or condition of this Public License will be waived and no 410 | failure to comply consented to unless expressly agreed to by the 411 | Licensor. 412 | 413 | d. Nothing in this Public License constitutes or may be interpreted 414 | as a limitation upon, or waiver of, any privileges and immunities 415 | that apply to the Licensor or You, including from the legal 416 | processes of any jurisdiction or authority. 417 | 418 | ======================================================================= 419 | 420 | Creative Commons is not a party to its public 421 | licenses. Notwithstanding, Creative Commons may elect to apply one of 422 | its public licenses to material it publishes and in those instances 423 | will be considered the “Licensor.” The text of the Creative Commons 424 | public licenses is dedicated to the public domain under the CC0 Public 425 | Domain Dedication. Except for the limited purpose of indicating that 426 | material is shared under a Creative Commons public license or as 427 | otherwise permitted by the Creative Commons policies published at 428 | creativecommons.org/policies, Creative Commons does not authorize the 429 | use of the trademark "Creative Commons" or any other trademark or logo 430 | of Creative Commons without its prior written consent including, 431 | without limitation, in connection with any unauthorized modifications 432 | to any of its public licenses or any other arrangements, 433 | understandings, or agreements concerning use of licensed material. For 434 | the avoidance of doubt, this paragraph does not form part of the 435 | public licenses. 436 | 437 | Creative Commons may be contacted at creativecommons.org. 438 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | banner 4 | 5 |

Build Your Own Kernel with Github Action

6 | 7 | English | [中文](./README_cn.md) 8 | 9 | ![License](https://img.shields.io/static/v1?label=License&message=BY-NC-SA&logo=creativecommons&color=green) 10 | ![Language](https://img.shields.io/github/languages/top/DogDayAndroid/Android-Kernel-Builder) 11 | ![Issues](https://img.shields.io/github/issues/DogDayAndroid/Android-Kernel-Builder) 12 | ![Pull Requests](https://img.shields.io/github/issues-pr/DogDayAndroid/Android-Kernel-Builder) 13 |
14 | 15 | This Github Action helps you build kernels. It reads multiple kernel sources from a configuration file and builds them using different toolchains. Additionally, it supports patching the kernel with KernelSU and uploading the built kernel image. 16 |
17 | 18 | --- 19 | 20 | **[
  Configure  
](#configuration-file-syntax)**  21 | **[
  Quick Start  
](#how-to-use)**  22 | **[
  Local testing  
](#local-testing)** 23 | 24 | --- 25 |
26 | 27 | # Github Action 28 | 29 | This action contains two jobs: `Set-repos` and `Build-Kernel`. 30 | 31 | The `Set-repos` job reads the kernel sources from the configuration file and outputs them to the `Build-Kernel` job. The `Build-Kernel` job uses the outputted kernel sources to build the kernels and upload the built kernel images. 32 | 33 | ## Trigger 34 | 35 | | Event name | Description | 36 | | ----------------- | ------------ | 37 | | workflow_dispatch | Manually run | 38 | 39 | ## Workflow 40 | 41 | | Build Step | Description | 42 | | -------------------------- | ---------------------------------------------- | 43 | | Checkout | Check out code | 44 | | Generate Matrix | Generate kernel source matrix from config file | 45 | | Create working dir | Create working directory | 46 | | Install prerequisites | Install necessary dependencies for build | 47 | | Clone kernel source | Clone kernel source code | 48 | | Get toolchains | Get toolchains | 49 | | Set args | Set build arguments | 50 | | Update KernelSU (optional) | Patch kernel with KernelSU | 51 | | Make defconfig | Generate kernel configuration file | 52 | | Build kernel | Build kernel | 53 | | Upload Image | Upload kernel image | 54 | | Upload Image.gz | Upload compressed kernel image | 55 | | Upload dtb | Upload device tree blob file | 56 | | Upload dtbo.img | Upload device tree overlay file | 57 | 58 | ## Configuration File Syntax 59 | 60 | Here is an example configuration file: 61 | 62 | ```json 63 | [ 64 | { 65 | "kernelSource": { 66 | "name": "DogDayAndroid", 67 | "repo": "https://codeberg.org/DogDayAndroid/android_kernel_xiaomi_thyme", 68 | "branch": "lineage-20.0", 69 | "device": "thyme" 70 | }, 71 | "withKernelSU": false, 72 | "toolchains": [ 73 | { 74 | "repo": "https://android.googlesource.com/platform/prebuilts/gas/linux-x86", 75 | "branch": "master", 76 | "name": "gas" 77 | }, 78 | { 79 | "repo": "https://gitlab.com/ThankYouMario/android_prebuilts_clang-standalone/", 80 | "branch": "11", 81 | "name": "clang" 82 | } 83 | ], 84 | "params": { 85 | "ARCH": "arm64", 86 | "CROSS_COMPILE": "aarch64-linux-gnu-", 87 | "CROSS_COMPILE_ARM32": "arm-linux-gnueabi-", 88 | "CROSS_COMPILE_COMPAT": "arm-linux-gnueabi-", 89 | "CLANG_TRIPLE": "aarch64-linux-gnu-", 90 | "AR": "", 91 | "CC": "clang" 92 | } 93 | }, 94 | { 95 | "kernelSource": { 96 | "name": "DogDay-KernelSU", 97 | "repo": "https://codeberg.org/DogDayAndroid/android_kernel_xiaomi_thyme", 98 | "branch": "lineage-20.0", 99 | "device": "thyme" 100 | }, 101 | "withKernelSU": true, 102 | "toolchains": [ 103 | { 104 | "repo": "https://android.googlesource.com/platform/prebuilts/gas/linux-x86", 105 | "branch": "master", 106 | "name": "gas" 107 | }, 108 | { 109 | "repo": "https://gitlab.com/ThankYouMario/android_prebuilts_clang-standalone/", 110 | "branch": "11", 111 | "name": "clang" 112 | } 113 | ], 114 | "params": { 115 | "ARCH": "arm64", 116 | "CROSS_COMPILE": "aarch64-linux-gnu-", 117 | "CROSS_COMPILE_ARM32": "arm-linux-gnueabi-", 118 | "CROSS_COMPILE_COMPAT": "arm-linux-gnueabi-", 119 | "CLANG_TRIPLE": "aarch64-linux-gnu-", 120 | "AR": "", 121 | "CC": "clang" 122 | } 123 | } 124 | ] 125 | ``` 126 | 127 | This JSON code describes a build configuration that includes the following: 128 | 129 | | Field Name | Description | 130 | | ------------ | ----------------------------------------------------------------------------------------------------------------------------------- | 131 | | kernelSource | Information about the kernel source code, including its name, repository URL, branch, and device. | 132 | | withKernelSU | A boolean value indicating whether the `KernelSU` kernel patch tool was used. | 133 | | toolchains | An array containing information about the required toolchains, including the repository URL, branch, and name. | 134 | | params | An object containing information about the build parameters, including architecture type, cross-compiler, and compiler information. | 135 | 136 | Here's a table of the parameters in the `params` object: 137 | 138 | | Parameter Name | Description | 139 | | -------------------- | ---------------------------------------------------------------------------------------------- | 140 | | ARCH | The architecture type, in this case `arm64`. | 141 | | CROSS_COMPILE | The cross-compiler prefix, in this case `aarch64-linux-gnu-`. | 142 | | CROSS_COMPILE_ARM32 | The cross-compiler prefix for 32-bit compatibility support, in this case `arm-linux-gnueabi-`. | 143 | | CROSS_COMPILE_COMPAT | The cross-compiler prefix for 32-bit compatibility support, in this case `arm-linux-gnueabi-`. | 144 | | CLANG_TRIPLE | The clang compiler's triple, in this case `aarch64-linux-gnu-`. | 145 | | AR | The archiving program for static libraries, which is empty in this case. | 146 | | CC | The C compiler, which is `clang` in this case. | 147 | 148 | These configuration details will be used in the build process to automate the creation of specific kernel image files. 149 | 150 | # How to use 151 | 152 | This project's basic usage is as follows: 153 | 154 | 1. Fork this project on GitHub. 155 | 156 | 2. Modify the `repos.json` file through the Github website or pull it to your local machine and commit the changes. 157 | 158 | 3. Go to the `Action` page on Github and find `Build kernels`, then `Run workflow`. 159 | 160 | 4. Wait for the compilation to finish, then download the compiled product from the corresponding page. 161 | 162 | 5. Use your preferred packaging software to package the kernel ([AnyKernel3](https://github.com/osm0sis/AnyKernel3), [Android-Image-Kitchen](https://github.com/osm0sis/Android-Image-Kitchen), [MagiskBoot](https://github.com/topjohnwu/Magisk/releases), etc.) 163 | 164 | ![Artifacts](./.assets/artifacts.png) 165 | 166 | # Local testing 167 | 168 | If you don't want to run the action on `Github`, you can use [nektos/act](https://github.com/nektos/act) to test this workflow locally and output the files. 169 | 170 | ## Normal local build (kernel source code is fetched using Git) 171 | 172 | This is the recommended local testing process. Simply install [nektos/act](https://github.com/nektos/act) and run the following command: 173 | 174 | ```sh 175 | # Collect artifacts to /tmp/artifacts folder: 176 | act --artifact-server-path /tmp/artifacts 177 | ``` 178 | 179 | If you want to store the artifacts in a different location, change `/tmp/artifacts` to your preferred directory. 180 | 181 | If there are errors, use the `-v` flag to generate an error report and submit an issue. Here's the command: 182 | 183 | ```sh 184 | # Collect artifacts to /tmp/artifacts folder: 185 | act --artifact-server-path /tmp/artifacts -v 186 | ``` 187 | 188 | ## Full local build (kernel source code is stored locally) 189 | 190 | If you need to perform a completely local build, consider building as follows: 191 | 192 | 1. Set up a local `Gitea` or `Gitlab` Git service and modify the configuration file address to point to the local service address. 193 | 194 | 2. Use `git daemon` to create a secondary image locally. 195 | 196 | This is just a suggestion, and we do not provide a specific guide. 197 | 198 | # Acknowledgments 199 | 200 | - [weishu](https://github.com/tiann) : Developer of KernelSU 201 | - [AKR Android Developer Community](https://www.akr-developers.com/) : Provides build tutorials 202 | - [DogDayAndroid/KSU_Thyme_BuildBot](https://github.com/DogDayAndroid/KSU_Thyme_BuildBot) : Predecessor of this project 203 | - [xiaoleGun/KernelSU_Action](https://github.com/xiaoleGun/KernelSU_Action) : Drawing on some Github Actions 204 | - [UtsavBalar1231/Drone-scripts](https://github.com/UtsavBalar1231/Drone-scripts) : Drawing on some Github Actions 205 | 206 | # Contributor 207 | 208 | 209 | contributors 210 | 211 | 212 | # Star history 213 | 214 | [![Star History](https://starchart.cc/DogDayAndroid/Android-Kernel-Builder.svg)](https://starchart.cc/DogDayAndroid/Android-Kernel-Builder) 215 | 216 | # License 217 | 218 | Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. 219 | -------------------------------------------------------------------------------- /README_cn.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | banner 4 | 5 |

构建属于你自己的安卓内核镜像

6 | 7 | ![License](https://img.shields.io/static/v1?label=License&message=BY-NC-SA&logo=creativecommons&color=green) 8 | ![Language](https://img.shields.io/github/languages/top/DogDayAndroid/Android-Kernel-Builder) 9 | ![Issues](https://img.shields.io/github/issues/DogDayAndroid/Android-Kernel-Builder) 10 | ![Pull Requests](https://img.shields.io/github/issues-pr/DogDayAndroid/Android-Kernel-Builder) 11 | 12 | 13 | 这个 Github Action 可以帮助你构建内核。它可以从一个配置文件中读取多个内核源,并使用不同的工具链构建它们。此外,它还支持使用 KernelSU 进行内核补丁,并上传构建好的内核镜像。 14 |
15 | 16 | --- 17 | 18 | **[
  配置文件使用方法  
](#配置文件解析)**  19 | **[
  快速开始  
](#使用方法)**  20 | **[
  本地构建  
](#本地构建)** 21 | 22 | --- 23 |
24 | 25 | # Github Action 26 | 27 | 该 Action 包含两个作业:`Set-repos` 和 `Build-Kernel`。 28 | 29 | Set-repos 作业从配置文件中读取内核源,并将其输出到 Build-Kernel 作业中。Build-Kernel 作业使用输出的内核源构建内核,并上传构建好的内核镜像。 30 | 31 | ## 启动方式 32 | 33 | | 事件名称 | 描述 | 34 | | ----------------- | -------------- | 35 | | workflow_dispatch | 手动触发构建。 | 36 | 37 | ## 构建流程 38 | 39 | | 构建步骤 | 描述 | 40 | | ---------------------- | -------------------------- | 41 | | Checkout | 检出代码 | 42 | | Generate Matrix | 从配置文件中生成内核源矩阵 | 43 | | Create working dir | 创建工作目录 | 44 | | Install prerequisites | 安装构建所需的依赖项 | 45 | | Clone kernel source | 克隆内核源代码 | 46 | | Get toolchains | 获取工具链 | 47 | | Set args | 设置构建参数 | 48 | | Update KernelSU (可选) | 使用 KernelSU 进行内核补丁 | 49 | | Make defconfig | 生成内核配置文件 | 50 | | Build kernel | 构建内核 | 51 | | Upload Image | 上传内核镜像 | 52 | | Upload Image.gz | 上传内核镜像压缩文件 | 53 | | Upload dtb | 上传设备树文件 | 54 | | Upload dtbo.img | 上传设备树覆盖文件 | 55 | 56 | ## 配置文件解析 57 | 58 | 下面是一个基本的配置文件例子: 59 | 60 | ```json 61 | [ 62 | { 63 | "kernelSource": { 64 | "name": "DogDayAndroid", 65 | "repo": "https://codeberg.org/DogDayAndroid/android_kernel_xiaomi_thyme", 66 | "branch": "lineage-20.0", 67 | "device": "thyme" 68 | }, 69 | "withKernelSU": false, 70 | "toolchains": [ 71 | { 72 | "repo": "https://android.googlesource.com/platform/prebuilts/gas/linux-x86", 73 | "branch": "master", 74 | "name": "gas" 75 | }, 76 | { 77 | "repo": "https://gitlab.com/ThankYouMario/android_prebuilts_clang-standalone/", 78 | "branch": "11", 79 | "name": "clang" 80 | } 81 | ], 82 | "params": { 83 | "ARCH": "arm64", 84 | "CROSS_COMPILE": "aarch64-linux-gnu-", 85 | "CROSS_COMPILE_ARM32": "arm-linux-gnueabi-", 86 | "CROSS_COMPILE_COMPAT": "arm-linux-gnueabi-", 87 | "CLANG_TRIPLE": "aarch64-linux-gnu-", 88 | "AR": "", 89 | "CC": "clang" 90 | } 91 | }, 92 | { 93 | "kernelSource": { 94 | "name": "DogDay-KernelSU", 95 | "repo": "https://codeberg.org/DogDayAndroid/android_kernel_xiaomi_thyme", 96 | "branch": "lineage-20.0", 97 | "device": "thyme" 98 | }, 99 | "withKernelSU": true, 100 | "toolchains": [ 101 | { 102 | "repo": "https://android.googlesource.com/platform/prebuilts/gas/linux-x86", 103 | "branch": "master", 104 | "name": "gas" 105 | }, 106 | { 107 | "repo": "https://gitlab.com/ThankYouMario/android_prebuilts_clang-standalone/", 108 | "branch": "11", 109 | "name": "clang" 110 | } 111 | ], 112 | "params": { 113 | "ARCH": "arm64", 114 | "CROSS_COMPILE": "aarch64-linux-gnu-", 115 | "CROSS_COMPILE_ARM32": "arm-linux-gnueabi-", 116 | "CROSS_COMPILE_COMPAT": "arm-linux-gnueabi-", 117 | "CLANG_TRIPLE": "aarch64-linux-gnu-", 118 | "AR": "", 119 | "CC": "clang" 120 | } 121 | } 122 | ] 123 | ``` 124 | 125 | 这段 JSON 代码描述了一个构建流程的配置,其中包括以下内容: 126 | 127 | | 字段名称 | 描述 | 128 | | ------------ | ---------------------------------------------------------------------------------- | 129 | | kernelSource | 内核源代码的相关信息,包括名称、仓库地址、分支和设备类型。 | 130 | | withKernelSU | 一个布尔值,表示是否使用了名为 `KernelSU` 的内核补丁工具。 | 131 | | toolchains | 一个数组,包含了需要用到的工具链的相关信息,包括仓库地址、分支和名称。 | 132 | | params | 一个对象,包含了构建参数的相关信息,其中包括了架构类型、交叉编译器、编译器等信息。 | 133 | 134 | `params` 对象中的具体参数信息可以用表格展示: 135 | 136 | | 参数名称 | 描述 | 137 | | -------------------- | ------------------------------------------------------------------------- | 138 | | ARCH | 架构类型,此处为 `arm64`。 | 139 | | CROSS_COMPILE | 交叉编译器前缀,此处为 `aarch64-linux-gnu-`。 | 140 | | CROSS_COMPILE_ARM32 | 用于 32 位兼容支持的交叉编译器前缀,此处为 `arm-linux-gnueabi-`。 | 141 | | CROSS_COMPILE_COMPAT | 用于指定编译 32 位兼容支持的交叉编译器前缀,此处为 `arm-linux-gnueabi-`。 | 142 | | CLANG_TRIPLE | 用于指定 clang 编译器的三元组(triple),此处为 `aarch64-linux-gnu-`。 | 143 | | AR | 用于指定静态库的归档程序,此处为空。 | 144 | | CC | 用于指定 C 编译器,此处为 `clang`。 | 145 | 146 | 这些配置信息将在构建流程中使用,以自动化地构建出特定的内核镜像文件。 147 | 148 | # 使用方法 149 | 150 | 本项目的基础使用方法如下: 151 | 152 | 1. 在 GitHub 上 `fork` 本项目 153 | 154 | 2. 通过 Github 网页或者拉取到本地修改 `repos.json` 文件,并提交修改 155 | 156 | 3. 查看 Github 网页的 `Action` 页面,找到 `Build kernels` 并 `Run workflow` 157 | 158 | 4. 等待编译完成,即可进入对应页面下载编译产物 159 | 160 | 5. 使用您喜欢的打包软件进行内核打包([AnyKernel3](https://github.com/osm0sis/AnyKernel3)、[Android-Image-Kitchen](https://github.com/osm0sis/Android-Image-Kitchen)、[MagiskBoot](https://github.com/topjohnwu/Magisk/releases) 等) 161 | 162 | ![Artifacts](./.assets/artifacts.png) 163 | 164 | # 本地构建 165 | 166 | 如果您并不想在 `Github` 上重复执行 `Action`,您可以利用 [nektos/act](https://github.com/nektos/act) 来在本地环境里测试本构建流程并输出。 167 | 168 | ## 普通本地构建(内核源码等使用 `Git` 拉取) 169 | 170 | 这种方式是推荐的本地测试流程,您只需要安装 [nektos/act](https://github.com/nektos/act) 并执行如下指令: 171 | 172 | ```sh 173 | # 将构建文件收集到 /tmp/artifacts 文件夹: 174 | act --artifact-server-path /tmp/artifacts 175 | ``` 176 | 177 | 如果您需要放在本地你喜欢的位置,请更改 `/tmp/artifacts` 为您喜欢的目录即可。 178 | 179 | 如果中途报错,请加入参数 `-v` 重新执行获取错误报告并提交 `issue` ,具体命令如下: 180 | 181 | ```sh 182 | # 将构建文件收集到 /tmp/artifacts 文件夹: 183 | act --artifact-server-path /tmp/artifacts -v 184 | ``` 185 | 186 | ## 完全本地构建(内核源码等均为本地存储) 187 | 188 | 用上述方式构建仍然需要内核源码等存储在云端,如果您一定有要**全部**本地构建的需求,请考虑通过如下方式构建: 189 | 190 | 1. 搭建本地 `Gitea` 或 `Gitlab` 等 `Git` 服务。随后修改配置文件地址为本地服务地址。 191 | 192 | 2. 在本地利用 `git daemon` 指令建立一个二级镜像。 193 | 194 | 此处仅仅提供思路,并不提供具体教程。 195 | 196 | # 致谢 197 | 198 | - [weishu](https://github.com/tiann) : KernelSU 的开发者 199 | - [AKR 安卓开发者社区](https://www.akr-developers.com/) : 编译教程提供 200 | - [DogDayAndroid/KSU_Thyme_BuildBot](https://github.com/DogDayAndroid/KSU_Thyme_BuildBot) : 此项目的前身 201 | - [xiaoleGun/KernelSU_Action](https://github.com/xiaoleGun/KernelSU_Action) : 借鉴部分 Github Action 202 | - [UtsavBalar1231/Drone-scripts](https://github.com/UtsavBalar1231/Drone-scripts) : 借鉴部分 Github Action 203 | 204 | # 贡献者 205 | 206 | 207 | contributors 208 | 209 | 210 | # Star 历史 211 | 212 | [![Star History](https://starchart.cc/DogDayAndroid/Android-Kernel-Builder.svg)](https://starchart.cc/DogDayAndroid/Android-Kernel-Builder) 213 | 214 | # 许可 215 | 216 | 知识共享许可协议
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。 217 | -------------------------------------------------------------------------------- /repos.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "kernelSource": { 4 | "name": "MIUI", 5 | "repo": "https://github.com/SlackerState/android_kernel_xiaomi_sm6150", 6 | "branch": "phoenix-r-oss", 7 | "device": "phoenix_ztc1997" 8 | }, 9 | "isConfiginvendor":true, 10 | "withKernelSU": true, 11 | "useCustomtool":true, 12 | "dtbPath":"boot/dts/qcom/sdmmagpie.dtb", 13 | "toolchains": [ 14 | { 15 | "repo": "https://github.com/SlackerState/kernel_bulid", 16 | "branch": "main", 17 | "name": "tools" 18 | } 19 | ], 20 | "params": { 21 | "ARCH": "arm64", 22 | "CROSS_COMPILE": "aarch64-linux-android-", 23 | "CROSS_COMPILE_ARM32": "arm-linux-androideabi-", 24 | "CROSS_COMPILE_COMPAT":"", 25 | "CLANG_TRIPLE": "aarch64-linux-gnu-", 26 | "AR": "llvm-ar", 27 | "CC": "clang", 28 | "HOSTCC":"gcc", 29 | "HOSTCXX":"clang++", 30 | "NM":"llvm-nm" , 31 | "OBJCOPY":"llvm-objcopy", 32 | "OBJDUMP":"llvm-objdump", 33 | "STRIP":"llvm-strip", 34 | "LD":"ld.lld", 35 | "DTC_EXT":"dtc" 36 | } 37 | }, 38 | { 39 | "kernelSource": { 40 | "name": "redcliff", 41 | "repo": "https://github.com/SlackerState/android_kernel_xiaomi_sm6150", 42 | "branch": "redcliff", 43 | "device": "phoenix" 44 | }, 45 | "isConfiginvendor":false, 46 | "withKernelSU": true, 47 | "useCustomtool":false, 48 | "dtbPath":"boot/dts/qcom/sdmmagpie.dtb", 49 | "toolchains": [ 50 | { 51 | "repo": "https://android.googlesource.com/platform/prebuilts/gas/linux-x86", 52 | "branch": "master", 53 | "name": "gas" 54 | }, 55 | { 56 | "repo": "https://gitlab.com/ThankYouMario/android_prebuilts_clang-standalone/", 57 | "branch": "11", 58 | "name": "clang" 59 | } 60 | ], 61 | "params": { 62 | "ARCH": "arm64", 63 | "CROSS_COMPILE": "aarch64-linux-gnu-", 64 | "CROSS_COMPILE_ARM32": "arm-linux-gnueabi-", 65 | "CROSS_COMPILE_COMPAT": "arm-linux-gnueabi-", 66 | "CLANG_TRIPLE": "aarch64-linux-gnu-", 67 | "AR": "", 68 | "CC": "clang", 69 | "HOSTCXX":"", 70 | "NM":"" , 71 | "OBJCOPY":"", 72 | "OBJDUMP":"", 73 | "STRIP":"", 74 | "LD":"", 75 | "DTC_EXT":"" 76 | } 77 | } 78 | ] 79 | --------------------------------------------------------------------------------