File tree 8 files changed +92
-10
lines changed
8 files changed +92
-10
lines changed Original file line number Diff line number Diff line change 1
1
public
2
2
resources
3
- .hugo_build.lock
3
+ .hugo_build.lock
4
+ .vscode
Original file line number Diff line number Diff line change 1
1
---
2
- title : 雜談
3
- description : 就是想隨便說點什麼!
2
+ title : 杂谈
3
+ description : 随便聊聊
4
4
slug : bullshit
5
- image :
6
5
7
6
style :
8
7
background : " #1f1e33"
Original file line number Diff line number Diff line change 1
1
---
2
2
title : 探索
3
- description : 到處亂看亂學的經驗!
3
+ description : 到处乱学
4
4
slug : explores
5
- image :
6
5
7
6
style :
8
7
background : " #39c5bb"
Original file line number Diff line number Diff line change 1
1
---
2
- title : 筆記
3
- description : 有在好好學習的說!
2
+ title : 笔记
3
+ description : 有在读书
4
4
slug : notes
5
- image :
6
5
7
6
style :
8
7
background : " #f4884f"
Original file line number Diff line number Diff line change 1
1
---
2
2
title : " 8051单片机练习 | 电子时钟"
3
3
date : 2023-12-13T08:33:24+08:00
4
- slug : 8051clock
4
+ slug : stc51clock
5
5
6
6
categories :
7
7
- explores
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : " Build a kernel for my picasso"
3
+ date : 2024-02-12T13:53:49+08:00
4
+ slug : picasso-kernel-build
5
+
6
+ categories :
7
+ - explores
8
+ tags :
9
+ - android
10
+ - root
11
+
12
+ links :
13
+ - title : KernelSU官网
14
+ website : https://kernelsu.org/
15
+ image : https://kernelsu.org/logo.png
16
+ - title : EndCredits
17
+ description : 赞美大佬🌟
18
+ website : https://blog.crepuscular-aosp.icu/
19
+ image : https://blog.crepuscular-aosp.icu/logo.png
20
+ ---
21
+
22
+ 想试试新的root方案 * KernelSU* ,但我手机的内核版本是4.19,用不得通用内核镜像,需要自行编译内核,幸好KernelSU的[ 非官方支持列表] ( https://kernelsu.org/zh_CN/guide/unofficially-support-devices.html ) 中有大佬在维护picasso的内核源码。
23
+
24
+ 本篇记录我借助 ** @EndCredits ** 大佬维护的[ kernel_xiaomi_sm7250] ( https://github.com/EndCredits/kernel_xiaomi_sm7250 ) 给我的手机编译内核。
25
+
26
+ ## 搭建环境
27
+
28
+ 写了个dockerfile简化环境搭建,刚接触docker的时候不知道dockerfile,每次开新容器都要手动再配一遍环境,累到癫去😢。
29
+
30
+ ``` sh
31
+ git clone https://github.com/Proxyerium/picasso-build-host.git
32
+ cd picasso-build-host
33
+ docker build --rm -t picasso-build-host .
34
+ ```
35
+
36
+ 等待docker镜像生成完毕,然後运行一个虚拟机:
37
+
38
+ ``` sh
39
+ docker run -it --name picasso picasso-build-host
40
+ ```
41
+
42
+ ## 集成KernelSU
43
+
44
+ > 如果curl连接失败的话,换个DNS试试
45
+
46
+ 将KernelSU添加到内核源码的根目录:
47
+
48
+ ``` sh
49
+ curl -LSs " https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -
50
+ ```
51
+
52
+ defconfig中添加相关配置:
53
+
54
+ ``` sh
55
+ echo -e " CONFIG_KPROBES=y\nCONFIG_HAVE_KPROBES=y\nCONFIG_KPROBE_EVENTS=y" >> ./arch/arm64/configs/vendor/picasso_user_defconfig
56
+ ```
57
+
58
+ ## 编译内核
59
+
60
+ > 在编译之前,如果需要配置编译进内核的内容:
61
+ > ``` sh
62
+ > make ARCH=arm64 LLVM=1 O=../out -j$( nproc --all) menuconfig
63
+ > ` ` `
64
+
65
+ 现在是编译时间:
66
+
67
+ ` ` ` sh
68
+ sudo ./build.sh all
69
+ ```
70
+
71
+ 等待编译结束,脚本会自动打包好所有东西,找到 ` Target File ` 指示的文件,传到宿主机,把该文件刷进手机就得了:
72
+
73
+ ``` sh
74
+ docker cp picasso:/build-host/out/AnyKernel3-picasso/xxxxx.zip .
75
+ ```
76
+
77
+ > <img src =" kernelsu.webp " style =" width : 50% ; height : auto ;" >
78
+ > 成功,KernelSU工作中😋
79
+
80
+ ## 参考资料
81
+
82
+ [ KernelSU - 如何为非 GKI 内核集成 KernelSU] ( https://kernelsu.org/zh_CN/guide/how-to-integrate-for-non-gki.html )
83
+
84
+ [ EndCredits - Build a Kernel for Redmi K30 5G by your self.] ( https://blog.crepuscular-aosp.icu/blogs/linux/build-kernel.html )
You can’t perform that action at this time.
0 commit comments