{"id":21861372,"url":"https://github.com/gmh5225/android-kernel-driver-template","last_synced_at":"2025-04-14T19:33:50.119Z","repository":{"id":222864618,"uuid":"758582790","full_name":"gmh5225/android-kernel-driver-template","owner":"gmh5225","description":"A GKI Android kernel driver(ARMv8.3) template compiled by llvm-msvc","archived":false,"fork":false,"pushed_at":"2024-05-17T07:27:02.000Z","size":74,"stargazers_count":36,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T05:24:56.583Z","etag":null,"topics":["android","armv8","driver","gki","kernel","linux","llvm-msvc","vscode","wsl"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmh5225.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["gmh5225"]}},"created_at":"2024-02-16T16:21:49.000Z","updated_at":"2025-03-25T16:30:40.000Z","dependencies_parsed_at":"2024-03-18T20:48:30.016Z","dependency_job_id":"fd076e8f-f199-4652-bdbb-ab8815096b12","html_url":"https://github.com/gmh5225/android-kernel-driver-template","commit_stats":null,"previous_names":["gmh5225/android-kernel-driver-template"],"tags_count":6,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmh5225%2Fandroid-kernel-driver-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmh5225%2Fandroid-kernel-driver-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmh5225%2Fandroid-kernel-driver-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmh5225%2Fandroid-kernel-driver-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmh5225","download_url":"https://codeload.github.com/gmh5225/android-kernel-driver-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248946345,"owners_count":21187491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","armv8","driver","gki","kernel","linux","llvm-msvc","vscode","wsl"],"created_at":"2024-11-28T03:11:23.847Z","updated_at":"2025-04-14T19:33:50.094Z","avatar_url":"https://github.com/gmh5225.png","language":"Makefile","funding_links":["https://github.com/sponsors/gmh5225"],"categories":[],"sub_categories":[],"readme":"# `android-kernel-driver-template`\n\n[![build](https://github.com/gmh5225/android-kernel-driver-template/actions/workflows/build.yml/badge.svg)](https://github.com/gmh5225/android-kernel-driver-template/actions/workflows/build.yml)\n[![GitHub license](https://img.shields.io/github/license/gmh5225/android-kernel-driver-template)](https://github.com/gmh5225/android-kernel-driver-template/blob/main/LICENSE)\n\nThis is a GKI Android kernel driver(``ARMv8.3``) template compiled using ``llvm-msvc``, aimed at facilitating the development of GKI Android kernel drivers.The development environment used is ``Win11``+``WSL2``+``VSCode``.\n\n### What's [Android GKI](https://source.android.com/docs/core/architecture/kernel/generic-kernel-image)?\nA product kernel, also known as a device kernel or OEM kernel, is the kernel that you ship on your device. Prior to GKI, the product kernel was derived from a series of upstream kernel changes. Following shows how kernel additions yield a product kernel (OEM/device kernel):\n![image](https://github.com/gmh5225/android-kernel-driver-template/assets/13917777/612e37d0-341a-4f90-9038-c366a05e72fa)\n\n\n### Requirements\n- Rooted Android devices``(ARMv8.3)`` with [Magisk](https://github.com/topjohnwu/Magisk) or [KernelSU](https://github.com/tiann/KernelSU)\n- [AndroidDriveSignity](https://github.com/gmh5225/AndroidDriveSignity)\n- ADB\n- VSCode\n- WSL/WSL2(Ubuntu-22.04)\n- [clangd plugin for VSCode](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd)\n- [WSL plugin for VSCode](https://code.visualstudio.com/docs/remote/wsl)\n- [llvm-msvc](https://github.com/backengineering/llvm-msvc/releases)\n- [GKI Kit](https://github.com/gmh5225/common-android12-5.10-KernelSU/releases)\n\n\n### Setup build deps for your WSL/WSL2\n```\nsudo passwd root\nsudo apt update\nsudo apt install python-is-python3\nsudo apt install build-essential make cmake\nsudo apt install p7zip-full p7zip-rar\nsudo apt install bear\n```\n\n### Remove environment variables on windows\nOpen ``wsl.conf`` by running:\n```\nsudo vim /etc/wsl.conf\n```\nAppend the following lines to the end of the file:\n```\n[interop]\nappendWindowsPath = false\n```\nRestart your WSL instance by executing:\n```\nwsl --terminate \u003cdistro\u003e\n```\nReplace \u003cdistro\u003e with the name of your distribution, which can be found using the command:\n```\nwsl --list --verbose\n```\n\n### Building\n```\nwget -nv https://github.com/gmh5225/common-android12-5.10-KernelSU/releases/download/v1.0.1/GKI-android12-5.10-kit.zip \u0026\u0026 7z x GKI-android12-5.10-kit.zip\nwget -nv https://github.com/backengineering/llvm-msvc/releases/download/llvm-msvc-v777.1.4/android-wrapper-llvm-msvc.zip \u0026\u0026 7z x android-wrapper-llvm-msvc.zip\n\nexport ANDROID_GKI_KIT_PATH=$(pwd)/GKI-android12-5.10-kit/\nexport ANDROID_OLLVM_INSTALLER=$(pwd)/install/\n\ngit clone --recursive https://github.com/gmh5225/android-kernel-driver-template\ncd android-kernel-driver-template\nbear -- make \u0026\u0026 make clean\n```\n\n## Testing on android12-5.10\n```\nadb push demo.ko /data/local/tmp\nadb shell su -c insmod /data/local/tmp/demo.ko\nadb shell su -c \"lsmod |grep demo\"\nadb shell su -c rmmod /data/local/tmp/demo.ko\n```\n\n## Credits\n- ``Linux``\n- ``Android``\n- Some anonymous people\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmh5225%2Fandroid-kernel-driver-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmh5225%2Fandroid-kernel-driver-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmh5225%2Fandroid-kernel-driver-template/lists"}