-
Notifications
You must be signed in to change notification settings - Fork 0
/
buster-migration-script.sh
321 lines (286 loc) · 7.91 KB
/
buster-migration-script.sh
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
#!/bin/sh
set -e
export LC_ALL=C
# Decide which packages should be reinstalled
KODI_DBGSYMS=$(dpkg -l | awk '/kodi.*-dbgsym/{print $2}')
KODI_PACKAGES=$(dpkg -l | awk '/kodi/{print $2}' | grep -v dbgsym)
NON_KODI_DBGSYMS=$(dpkg -l \
ffmpeg-dbgsym \
flatbuffers-compiler-dbgsym \
gstreamer1.0-pocketsphinx-dbgsym \
kissfft-tools-dbgsym \
libavcodec58-dbgsym \
libavcodec-extra58-dbgsym \
libavdevice58-dbgsym \
libavfilter7-dbgsym \
libavfilter-extra7-dbgsym \
libavformat58-dbgsym \
libavresample4-dbgsym \
libavutil56-dbgsym \
libcdio19-dbgsym \
libcdio++1-dbgsym \
libcdio-utils-dbgsym \
libdav1d4-dbgsym \
libdc1394-25-dbgsym \
libdc1394-utils-dbgsym \
libflatbuffers1-dbgsym \
libiso9660++0-dbgsym \
libiso9660-11-dbgsym \
libkissfft-float131-dbgsym \
libldap-2.4-2-dbgsym \
libmfx1-dbgsym \
libmfx-tools-dbgsym \
libmysofa1-dbgsym \
libmysofa-utils-dbgsym \
libpocketsphinx3-dbgsym \
libpostproc55-dbgsym \
libshairplay0-dbgsym \
libspdlog1-dbgsym \
libsrt1-gnutls-dbgsym \
libsrt1-openssl-dbgsym \
libswresample3-dbgsym \
libswscale5-dbgsym \
libudf0-dbgsym \
libudfread0-dbgsym \
libva2-dbgsym \
libva-drm2-dbgsym \
libva-glx2-dbgsym \
libva-wayland2-dbgsym \
libva-x11-2-dbgsym \
libwayland-client++0-dbgsym \
libwayland-client-extra++0-dbgsym \
libwayland-cursor++0-dbgsym \
libwayland-egl++0-dbgsym \
libwebm1-dbgsym \
libwebm-tools-dbgsym \
pocketsphinx-dbgsym \
srt-tools-dbgsym \
wayland-scanner++-dbgsym \
2>/dev/null | awk '/dbgsym/{print $2}')
NON_KODI_PACKAGES_BUSTER_BACKPORTS=$(dpkg -l \
dav1d \
flatbuffers-compiler \
flatbuffers-compiler-dev \
google-mock \
googletest \
googletest-tools \
hdhomerun-config \
kissfft-tools \
libcdio++1 \
libcdio19 \
libcdio++-dev \
libcdio-dev \
libcdio-utils \
libdav1d-dev \
libdav1d4 \
libfmt-dev \
libfmt-doc \
libflatbuffers1 \
libflatbuffers-dev \
libgmock-dev \
libgtest-dev \
libhdhomerun-dev \
libhdhomerun4 \
libiso9660++0 \
libiso9660-11 \
libiso9660-dev \
libiso9660++-dev \
libkissfft-dev \
libkissfft-float131 \
libshairplay-dev \
libshairplay0 \
libspdlog-dev \
libspdlog1 \
libudf0 \
libudf-dev \
libudfread-dev \
libudfread0 \
libwayland-client++0 \
libwayland-client-extra++0 \
libwayland-cursor++0 \
libwayland-egl++0 \
libwebm1 \
libwebm-dev \
libwebm-tools \
python3-flatbuffers \
shairplay \
waylandpp-dev \
wayland-scanner++ \
2>/dev/null | awk '/^ii /{print $2"/buster-backports"}')
NON_KODI_PACKAGES_BUSTER=$(dpkg -l \
ffmpeg \
ffmpeg-doc \
libavcodec58 \
libavcodec-dev \
libavcodec-extra \
libavcodec-extra58 \
libavdevice58 \
libavdevice-dev \
libavfilter7 \
libavfilter-dev \
libavfilter-extra \
libavfilter-extra7 \
libavformat58 \
libavformat-dev \
libavresample4 \
libavresample-dev \
libavutil56 \
libavutil-dev \
libpostproc55 \
libpostproc-dev \
libswresample3 \
libswresample-dev \
libswscale5 \
libswscale-dev \
libva2 \
libva-dev \
libva-drm2 \
libva-glx2 \
libva-wayland2 \
libva-x11-2 \
va-driver-all \
2>/dev/null | awk '/^ii /{print $2"/buster"}')
SYSTEM_PACKAGES_BUSTER=$(dpkg -l \
dirmngr \
gnupg \
gnupg-l10n \
gnupg-utils \
gpg \
gpgconf \
gpgsm \
gpgv \
gpg-agent \
gpg-wks-client \
gpg-wks-server \
libbluetooth3 \
libcryptsetup12 \
libcurl3-gnutls \
libdrm2 \
libdrm-amdgpu1 \
libdrm-common \
libdrm-intel1 \
libdrm-nouveau2 \
libdrm-radeon1 \
libegl1 \
libgl1 \
libglvnd0 \
libglx0 \
libjs-jquery \
libldap-2.4-2 \
libldap-common \
libnss-systemd \
libpam-systemd \
libpulse0 \
libpulse-mainloop-glib0 \
libsystemd0 \
libudev1 \
libzstd1 \
node-jquery \
pulseaudio \
systemd \
systemd-sysv \
systemd-timesyncd \
udev \
2>/dev/null | awk '/^ii .*~bpo10\+/{print $2"/buster"}')
# Delete old APT preferences
rm -f /etc/apt/sources.list.d/kodi-nightly-debian-repo.list
rm -f /etc/apt/preferences.d/01kodi-nightly-debian-repo
# Create temporary APT pinning
cat > /etc/apt/preferences.d/01kodi-nightly-debian-repo <<.p
# Debian Backports
Package: dav1d libdav1d-dev libdav1d4
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: flatbuffers-compiler flatbuffers-compiler-dev libflatbuffers1 libflatbuffers-dev python3-flatbuffers
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: libfmt-dev libfmt-doc
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: googletest googletest-tools google-mock libgmock-dev libgtest-dev
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: kissfft-tools libkissfft-dev libkissfft-float131
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: kodi*
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: libcdio19 libcdio++1 libcdio++-dev libcdio-dev libcdio-utils libiso9660++0 libiso9660++-dev libiso9660-11 libiso9660-dev libudf0 libudf-dev
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: hdhomerun-config libhdhomerun-dev libhdhomerun4
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: shairplay libshairplay-dev libshairplay0
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: libspdlog-dev libspdlog1-dev
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: libudfread-dev libudfread0
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: libwebm1 libwebm-dev libwebm-tools
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
Package: libwayland-client++0 libwayland-client-extra++0 libwayland-cursor++0 libwayland-egl++0 waylandpp-dev wayland-scanner++
Pin: release l="Debian Backports" n=buster-backports
Pin-Priority: 1001
# Debian buster
Package: dirmngr gnupg gnupg-l10n gnupg-utils gpg gpgconf gpgsm gpgv gpg-agent gpg-wks-client gpg-wks-server
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: ffmpeg ffmpeg-doc libavcodec* libavdevice* libavfilter* libavformat* libavresample* libavutil* libpostproc* libswresample* libswscale*
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libbluetooth3
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libcryptsetup12
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libcurl3-gnutls
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libdrm2 libdrm-amdgpu1 libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libegl1 libgl1 libglvnd0 libglx0
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libjs-jquery node-jquery
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libldap-2.4-2 libldap-common
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libpulse0 libpulse-mainloop-glib0 pulseaudio
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libnss-systemd libsystemd0 libpam-systemd libudev1 systemd systemd-sysv systemd-timesyncdudev
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libva2 libva-dev libva-drm2 libva-glx2 libva-wayland2 libva-x11-2 va-driver-all
Pin: release l=Debian n=buster
Pin-Priority: 1001
Package: libzstd1
Pin: release l=Debian n=buster
Pin-Priority: 1001
.p
# Perform migration
export DEBIAN_FRONTEND=noninteractive
apt-get update
[ ! -z "$KODI_DBGSYMS$NON_KODI_DBGSYMS" ] && apt-get remove -yq $KODI_DBGSYMS $NON_KODI_DBGSYMS
[ ! -z "$KODI_PACKAGES" ] && apt-get install --reinstall --allow-downgrades -yq $KODI_PACKAGES
[ ! -z "$NON_KODI_PACKAGES_BUSTER_BACKPORTS" ] && apt-get install --reinstall --allow-downgrades -yq $NON_KODI_PACKAGES_BUSTER_BACKPORTS
[ ! -z "$NON_KODI_PACKAGES_BUSTER" ] && apt-get install --reinstall --allow-downgrades -yq $NON_KODI_PACKAGES_BUSTER
[ ! -z "$SYSTEM_PACKAGES_BUSTER" ] && apt-get install --reinstall --allow-downgrades -yq $SYSTEM_PACKAGES_BUSTER
# Clean up
rm -f /etc/apt/preferences.d/01kodi-nightly-debian-repo
apt-mark auto node-jquery
apt-get update
apt-get full-upgrade -yq
apt-get --purge autoremove -yq
apt-get autoclean
apt-get clean