forked from mer-hybris/hybris-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfixup-mountpoints
executable file
·246 lines (230 loc) · 11.4 KB
/
fixup-mountpoints
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
#!/bin/sh
# Fix up mount points device node names.
# This is broken pending systemd > 191-2 so hack the generated unit files :(
# See: https://bugzilla.redhat.com/show_bug.cgi?id=859297
DEVICE=$1
shift
echo "Fixing mount-points for device $DEVICE"
case "$DEVICE" in
"FP2")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p13 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p20 ' \
-e 's block/platform/msm_sdcc.1/by-name/recovery mmcblk0p16 ' \
-e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p14 ' \
-e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
-e 's block/platform/msm_sdcc.1/by-name/modemst1 mmcblk0p11 ' \
-e 's block/platform/msm_sdcc.1/by-name/modemst2 mmcblk0p12 ' \
-e 's block/platform/msm_sdcc.1/by-name/fsg mmcblk0p17 ' \
-e 's block/platform/msm_sdcc.1/by-name/fsc mmcblk0p18 ' \
-e 's block/platform/msm_sdcc.1/by-name/dbi mmcblk0p3 ' \
-e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p15 ' \
-e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p8 ' \
"$@"
;;
"onyx")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p7 ' \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p27 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p28 ' \
-e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p15 ' \
-e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p14 ' \
-e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
"$@"
;;
"bullhead")
sed -i \
-e 's block/platform/soc.0/f9824900.sdhci/by-name/modem mmcblk0p1 ' \
-e 's block/platform/soc.0/f9824900.sdhci/by-name/persist mmcblk0p24 ' \
-e 's block/platform/soc.0/f9824900.sdhci/by-name/system mmcblk0p41 ' \
-e 's block/platform/soc.0/f9824900.sdhci/by-name/userdata mmcblk0p45 ' \
"$@"
;;
"hammerhead")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
-e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p16 ' \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p25 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p28 ' \
"$@"
;;
"mako")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
-e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p20 ' \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p21 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p23 ' \
"$@"
;;
"grouper")
sed -i \
-e 's block/platform/sdhci-tegra.3/by-name/APP mmcblk0p3 ' \
-e 's block/platform/sdhci-tegra.3/by-name/CAC mmcblk0p4 ' \
-e 's block/platform/sdhci-tegra.3/by-name/UDA mmcblk0p9 ' \
-e 's block/platform/sdhci-tegra.3/by-name/MSC mmcblk0p5 ' \
-e 's block/platform/sdhci-tegra.3/by-name/LNX mmcblk0p2 ' \
-e 's block/platform/sdhci-tegra.3/by-name/SOS mmcblk0p1 ' \
"$@"
;;
"tilapia")
sed -i \
-e 's block/platform/sdhci-tegra.3/by-name/APP mmcblk0p3 ' \
-e 's block/platform/sdhci-tegra.3/by-name/CAC mmcblk0p5 ' \
-e 's block/platform/sdhci-tegra.3/by-name/UDA mmcblk0p10 ' \
-e 's block/platform/sdhci-tegra.3/by-name/MSC mmcblk0p6 ' \
-e 's block/platform/sdhci-tegra.3/by-name/LNX mmcblk0p2 ' \
-e 's block/platform/sdhci-tegra.3/by-name/SOS mmcblk0p1 ' \
"$@"
;;
"i9305" | "encore" | "n7000" | "n7100" | "i9300" | "anzu" | \
"coconut" | "haida" | "hallon" | "iyokan" | "mango" | "phoenix" | \
"satsuma" | "smultron" | "urushi" | "zeus")
sed -i \
-e 's /block/ / ' \
"$@"
;;
"p3110")
sed -i \
-e 's block/platform/omap/omap_hsmmc.1/by-name/DATAFS mmcblk0p10 ' \
-e 's block/platform/omap/omap_hsmmc.1/by-name/KERNEL mmcblk0p5 ' \
-e 's block/platform/omap/omap_hsmmc.1/by-name/FACTORYFS mmcblk0p9 ' \
-e 's block/platform/omap/omap_hsmmc.1/by-name/EFS mmcblk0p1 ' \
-e 's block/platform/omap/omap_hsmmc.1/by-name/CACHE mmcblk0p7 ' \
"$@"
;;
"maguro")
sed -i \
-e 's block/platform/omap/omap_hsmmc.0/by-name/system mmcblk0p10 ' \
-e 's block/platform/omap/omap_hsmmc.0/by-name/cache mmcblk0p11 ' \
-e 's block/platform/omap/omap_hsmmc.0/by-name/userdata mmcblk0p12 ' \
-e 's block/platform/omap/omap_hsmmc.0/by-name/misc mmcblk0p5 ' \
-e 's block/platform/omap/omap_hsmmc.0/by-name/boot mmcblk0p7 ' \
-e 's block/platform/omap/omap_hsmmc.0/by-name/recovery mmcblk0p8 ' \
-e 's block/platform/omap/omap_hsmmc.0/by-name/sbl mmcblk0p2 ' \
-e 's block/platform/omap/omap_hsmmc.0/by-name/xloader mmcblk0p1 ' \
-e 's block/platform/omap/omap_hsmmc.0/by-name/radio mmcblk0p9 ' \
-e 's block/platform/omap/omap_hsmmc.0/by-name/efs mmcblk0p3 ' \
"$@"
;;
"bacon")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
-e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p15 ' \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p14 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p28 ' \
"$@"
;;
"ace")
sed -i \
-e 's block/platform/msm_sdcc.2/by-num/p25 mmcblk0p25 ' \
-e 's block/platform/msm_sdcc.2/by-num/p26 mmcblk0p26 ' \
-e 's block/platform/msm_sdcc.2/by-num/p27 mmcblk0p27 ' \
-e 's block/platform/msm_sdcc.2/by-num/p28 mmcblk0p28 ' \
"$@"
;;
"flo"|"deb")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p4 ' \
-e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p14 ' \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p22 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p30 ' \
-e 's block/platform/msm_sdcc.1/by-name/radio mmcblk0p1 ' \
-e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p4 ' \
-e 's block/platform/msm_sdcc.1/by-name/recovery mmcblk0p25 ' \
-e 's block/platform/msm_sdcc.1/by-name/misc mmcblk0p24 ' \
"$@"
;;
"yuga")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p17 ' \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p24 ' \
-e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p25 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p26 ' \
-e 's block/platform/msm_sdcc.1/by-name/LTALabel mmcblk1 ' \
"$@"
;;
"z3c" | "sirius")
# Z3 compact is also called "aries" | "d5803" in aosp (called z3c in cm12.1)
# Z2 is also called "d6503" in aosp (called sirius in cm12.1)
# untested for "amami" | "leo" | "tianchi")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/DDR mmcblk0p17 ' \
-e 's block/platform/msm_sdcc.1/by-name/FOTAKernel mmcblk0p16 ' \
-e 's block/platform/msm_sdcc.1/by-name/LTALabel mmcblk0p18 ' \
-e 's block/platform/msm_sdcc.1/by-name/TA mmcblk0p1 ' \
-e 's block/platform/msm_sdcc.1/by-name/aboot mmcblk0p5 ' \
-e 's block/platform/msm_sdcc.1/by-name/alt_aboot mmcblk0p11 ' \
-e 's block/platform/msm_sdcc.1/by-name/alt_dbi mmcblk0p10 ' \
-e 's block/platform/msm_sdcc.1/by-name/alt_rpm mmcblk0p12 ' \
-e 's block/platform/msm_sdcc.1/by-name/alt_s1sbl mmcblk0p9 ' \
-e 's block/platform/msm_sdcc.1/by-name/alt_sbl1 mmcblk0p8 ' \
-e 's block/platform/msm_sdcc.1/by-name/alt_tz mmcblk0p13 ' \
-e 's block/platform/msm_sdcc.1/by-name/apps_log mmcblk0p22 ' \
-e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p14 ' \
-e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p24 ' \
-e 's block/platform/msm_sdcc.1/by-name/dbi mmcblk0p4 ' \
-e 's block/platform/msm_sdcc.1/by-name/fsg mmcblk0p21 ' \
-e 's block/platform/msm_sdcc.1/by-name/modemst1 mmcblk0p19 ' \
-e 's block/platform/msm_sdcc.1/by-name/modemst2 mmcblk0p20 ' \
-e 's block/platform/msm_sdcc.1/by-name/ramdump mmcblk0p15 ' \
-e 's block/platform/msm_sdcc.1/by-name/rpm mmcblk0p6 ' \
-e 's block/platform/msm_sdcc.1/by-name/s1sbl mmcblk0p3 ' \
-e 's block/platform/msm_sdcc.1/by-name/sbl1 mmcblk0p2 ' \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p23 ' \
-e 's block/platform/msm_sdcc.1/by-name/tz mmcblk0p7 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p25 ' \
"$@"
;;
"kis3")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p12 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p13 ' \
-e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p15 ' \
-e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p7 ' \
-e 's block/platform/msm_sdcc.1/by-name/recovery mmcblk0p16 ' \
-e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
-e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p14 ' \
"$@"
;;
"m7spr")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p35 ' \
-e 's block/platform/msm_sdcc.1/by-name/recovery mmcblk0p36 ' \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p37 ' \
-e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p38 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p39 ' \
"$@"
;;
"wt88047")
sed -i \
-e 's block/bootdevice/by-name/userdata mmcblk0p30 ' \
-e 's block/bootdevice/by-name/boot mmcblk0p22 ' \
-e 's block/bootdevice/by-name/system mmcblk0p23 ' \
-e 's block/bootdevice/by-name/modem mmcblk0p1 ' \
-e 's block/bootdevice/by-name/modemst1 mmcblk0p13 ' \
-e 's block/bootdevice/by-name/modemst2 mmcblk0p14 ' \
-e 's block/bootdevice/by-name/persist mmcblk0p25 ' \
"$@"
;;
"find5")
sed -i \
-e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
-e 's block/platform/msm_sdcc.1/by-name/persist tmmcblk0p21 ' \
-e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p19 ' \
-e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p18 ' \
-e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p20 ' \
"$@"
;;
*)
cat <<EOF
****************************************************************
****************************************************************
ERROR: $DEVICE does not have mountpoint fixup data - see
SailfishOS HADK for details on how to fix this
Check: device/$VENDOR/$DEVICE/recovery.fstab
****************************************************************
****************************************************************
EOF
exit 1
;;
esac