-
Notifications
You must be signed in to change notification settings - Fork 314
/
Copy pathHTCM7_patch_steps
119 lines (70 loc) · 2.89 KB
/
HTCM7_patch_steps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
This patch is for the HTC ONE M7 running kernels 3.4.111 or 3.4.113
I used the source kernels cm-13.0 and cm14.1 from the below github, however, the following steps may or may not work on other kernels for the HTC M7
https://github.com/9Lukas5/android_kernel_htc_msm8960
Some of the below steps do require you to go into the files and manually add/edit lines, if you don't feel you can do this, then please don't attempt it.
Step 1,
Download the patch kernel-3.10-nexus6.patch and place it within the root of your building enviroment.
Step 2,
Run the following cmd
patch -p1 < kernel-3.10-nexus6.patch
You should be greeted with the below print out.
patching file drivers/usb/gadget/Makefile
Hunk #1 FAILED at 67.
1 out of 1 hunk FAILED -- saving rejects to file drivers/usb/gadget/Makefile.rej
patching file drivers/usb/gadget/android.c
Hunk #1 FAILED at 62.
Hunk #2 succeeded at 1813 with fuzz 2 (offset -879 lines).
Hunk #3 FAILED at 2755.
Hunk #4 succeeded at 2148 (offset -959 lines).
2 out of 4 hunks FAILED -- saving rejects to file drivers/usb/gadget/android.c.rej
patching file drivers/usb/gadget/f_hid.c
Hunk #1 FAILED at 17.
Hunk #2 succeeded at 52 with fuzz 1 (offset -8 lines).
Hunk #3 succeeded at 177 with fuzz 1 (offset -36 lines).
Hunk #4 succeeded at 236 (offset -52 lines).
Hunk #5 succeeded at 255 (offset -52 lines).
Hunk #6 succeeded at 300 (offset -52 lines).
Hunk #7 succeeded at 401 (offset -9 lines).
Hunk #8 succeeded at 420 (offset -9 lines).
Hunk #9 succeeded at 524 (offset -112 lines).
Hunk #10 succeeded at 596 (offset -114 lines).
Hunk #11 succeeded at 618 (offset -112 lines).
Hunk #12 succeeded at 668 (offset -109 lines).
Hunk #13 succeeded at 719 (offset -112 lines).
1 out of 13 hunks FAILED -- saving rejects to file drivers/usb/gadget/f_hid.c.rej
patching file drivers/usb/gadget/f_hid.h
patching file drivers/usb/gadget/f_hid_android_keyboard.c
patching file drivers/usb/gadget/f_hid_android_mouse.c
Step 3,
Now navigate to the directory
drivers/usb/gadget/Makefile
find the line
g_android-y := android.o
Replace it with the below line and save
g_android-y := android.o f_hid.o
Step 4
Navigate to the file
drivers/usb/gadget/android.c
Find the line
#include "f_accessory.c"
Make a new line and add the following three lines
#include "f_hid.h"
#include "f_hid_android_keyboard.c"
#include "f_hid_android_mouse.c"
In the same file, find the line
&audio_source_function,
Create a new line, add the following and save the file.
&hid_function,
Step 5,
Navigate to the file
drivers/usb/gadget/f_hid.c
find the line
#include <linux/wait.h>
create a new line, add the following line.
#include <linux/delay.h>
In the same file, directly below
#include <linux/usb/g_hid.h>
add the following file, then save.
#include "f_hid.h"
--------------------------------------------------------------------
That's it, you're now done and can carry on building your kernel.