]> git.proxmox.com Git - pve-firmware.git/blame - assemble-firmware.pl
assemble: print when skip list can be reduced and do so
[pve-firmware.git] / assemble-firmware.pl
CommitLineData
8422a0e2 1#!/usr/bin/perl
7bbca2e6
FG
2
3use strict;
8422a0e2
TL
4use warnings;
5
7bbca2e6
FG
6use File::Basename;
7use File::Path;
8
7bbca2e6
FG
9my $fwsrc2 = "dvb-firmware.git";
10my $fwsrc3 = "firmware-misc";
11
12my $fwlist = shift;
13die "no firmware list specified" if !$fwlist || ! -f $fwlist;
14
15my $target = shift;
16die "no target directory" if !$target || ! -d $target;
17
7bbca2e6
FG
18my $skip = {};
19# debian squeeze also misses those files
20foreach my $fw (qw(
11262e92
TL
213826.arm
22BT3CPCC.bin
23FW10
24FW13
25RTL8192U/boot.img
26RTL8192U/data.img
27RTL8192U/main.img
d31fb1a1
TL
28amdgpu/arcturus_asd.bin
29amdgpu/arcturus_gpu_info.bin
30amdgpu/arcturus_mec.bin
31amdgpu/arcturus_mec2.bin
32amdgpu/arcturus_rlc.bin
33amdgpu/arcturus_sdma.bin
34amdgpu/arcturus_smc.bin
35amdgpu/arcturus_sos.bin
36amdgpu/arcturus_vcn.bin
64cbf07c 37amdgpu/navi10_mes.bin
11262e92
TL
38ar9170.fw
39ast_dp501_fw.bin
11262e92 40ath10k/QCA6174/hw2.1/firmware-4.bin
11262e92 41ath10k/QCA6174/hw3.0/firmware-5.bin
11262e92
TL
42ath10k/QCA9887/hw1.0/board-2.bin
43ath10k/QCA988X/hw2.0/board-2.bin
11262e92
TL
44ath10k/QCA988X/hw2.0/firmware-2.bin
45ath10k/QCA988X/hw2.0/firmware-3.bin
11262e92
TL
46ath10k/QCA988X/hw2.0/firmware.bin
47ath6k/AR6003/hw2.0/bdata.bin
48ath6k/AR6003/hw2.1.1/bdata.bin
49ath6k/AR6004/hw1.0/bdata.DB132.bin
50ath6k/AR6004/hw1.0/bdata.bin
51ath6k/AR6004/hw1.0/fw.ram.bin
52ath6k/AR6004/hw1.1/bdata.DB132.bin
53ath6k/AR6004/hw1.1/bdata.bin
54ath6k/AR6004/hw1.1/fw.ram.bin
55ath6k/AR6004/hw1.2/fw.ram.bin
56ath6k/AR6004/hw1.3/fw.ram.bin
57b43/ucode11.fw
58b43/ucode13.fw
59b43/ucode14.fw
60b43/ucode15.fw
61b43/ucode16_lp.fw
62b43/ucode16_mimo.fw
63b43/ucode24_lcn.fw
64b43/ucode25_lcn.fw
65b43/ucode25_mimo.fw
66b43/ucode26_mimo.fw
67b43/ucode29_mimo.fw
68b43/ucode30_mimo.fw
69b43/ucode33_lcn40.fw
70b43/ucode40.fw
71b43/ucode42.fw
72b43/ucode5.fw
73b43/ucode9.fw
74b43legacy/ucode2.fw
75b43legacy/ucode4.fw
76bfubase.frm
7bbca2e6 77brcm/brcmfmac-sdio.bin
11262e92
TL
78brcm/brcmfmac-sdio.txt
79brcm/brcmfmac43143-sdio.txt
7bbca2e6 80brcm/brcmfmac43241b0-sdio.txt
11262e92
TL
81brcm/brcmfmac43241b4-sdio.txt
82brcm/brcmfmac43241b5-sdio.txt
11262e92
TL
83brcm/brcmfmac4329-sdio.txt
84brcm/brcmfmac4330-sdio.txt
85brcm/brcmfmac4334-sdio.txt
86brcm/brcmfmac43340-sdio.txt
87brcm/brcmfmac4335-sdio.txt
88brcm/brcmfmac43362-sdio.txt
11262e92 89brcm/brcmfmac4339-sdio.txt
11262e92 90brcm/brcmfmac43430-sdio.txt
11262e92 91brcm/brcmfmac43455-sdio.txt
64cbf07c 92brcm/brcmfmac43456-sdio.bin
11262e92
TL
93brcm/brcmfmac4350-pcie.txt
94brcm/brcmfmac4354-pcie.bin
95brcm/brcmfmac4354-pcie.txt
96brcm/brcmfmac4354-sdio.txt
7bbca2e6 97brcm/brcmfmac4356-pcie.txt
11262e92 98brcm/brcmfmac43570-pcie.txt
11262e92
TL
99brcm/brcmfmac4358-pcie.txt
100brcm/brcmfmac4359-pcie.bin
101brcm/brcmfmac43602-pcie.txt
102brcm/brcmfmac4365b-pcie.bin
103brcm/brcmfmac4365b-pcie.txt
104brcm/brcmfmac4365c-pcie.bin
105brcm/brcmfmac4366b-pcie.txt
11262e92
TL
106brcm/brcmfmac4371-pcie.txt
107c218tunx.cod
108c320tunx.cod
433982b1
TL
109cbfw-3.0.3.1.bin
110cbfw.bin
11262e92
TL
111comedi/jr3pci.idm
112cp204unx.cod
433982b1
TL
113ct2fw-3.0.3.1.bin
114ct2fw.bin
115ctfw-3.0.3.1.bin
116ctfw.bin
11262e92 117cxgb4/t4fw-1.3.10.0.bin
7bbca2e6 118cyzfirm.bin
11262e92
TL
119daqboard2000_firmware.bin
120fw.ram.bin
11262e92
TL
121i1480-phy-0.0.bin
122i1480-pre-phy-0.0.bin
123i1480-usb-0.0.bin
124i2400m-fw-sdio-1.3.sbcf
7bbca2e6 125isi4608.bin
11262e92 126isi4616.bin
7bbca2e6
FG
127isi608.bin
128isi608em.bin
11262e92 129isi616em.bin
7bbca2e6 130isight.fw
7bbca2e6 131isl3886pci
11262e92
TL
132isl3886usb
133isl3887usb
7bbca2e6
FG
134iwlwifi-100-6.ucode
135iwlwifi-1000-6.ucode
11262e92 136iwlwifi-130-5.ucode
11262e92
TL
137iwlwifi-3165-10.ucode
138iwlwifi-3168-26.ucode
139iwlwifi-6000-6.ucode
b3bdbd58 140iwlwifi-6000g2b-IWL6000G2B_UCODE_API_MAX.ucode
11262e92
TL
141iwlwifi-7265D-26.ucode
142iwlwifi-8000-10.ucode
143iwlwifi-8000-12.ucode
144iwlwifi-8000-13.ucode
7bbca2e6 145iwlwifi-8000-8.ucode
11262e92
TL
146iwlwifi-8000C-26.ucode
147iwlwifi-8000C-33.ucode
148iwlwifi-8265-26.ucode
149iwlwifi-8265-33.ucode
150iwlwifi-9000-pu-a0-jf-a0--26.ucode
151iwlwifi-9000-pu-a0-jf-a0--33.ucode
152iwlwifi-9000-pu-a0-jf-a0-34.ucode
b3bdbd58 153iwlwifi-9000-pu-a0-jf-a0-43.ucode
11262e92
TL
154iwlwifi-9000-pu-a0-jf-b0--33.ucode
155iwlwifi-9000-pu-a0-jf-b0-34.ucode
b3bdbd58 156iwlwifi-9000-pu-a0-jf-b0-43.ucode
11262e92
TL
157iwlwifi-9000-pu-a0-lc-a0--26.ucode
158iwlwifi-9260-th-a0-jf-a0--26.ucode
159iwlwifi-9260-th-a0-jf-a0--33.ucode
160iwlwifi-9260-th-a0-jf-a0-34.ucode
b3bdbd58 161iwlwifi-9260-th-a0-jf-a0-43.ucode
11262e92
TL
162iwlwifi-9260-th-b0-jf-b0--33.ucode
163iwlwifi-Qu-a0-hr-a0--33.ucode
164iwlwifi-Qu-a0-hr-a0-34.ucode
b3bdbd58 165iwlwifi-Qu-a0-hr-a0-43.ucode
64cbf07c 166iwlwifi-Qu-a0-hr-a0-48.ucode
d31fb1a1 167iwlwifi-Qu-a0-hr-a0-50.ucode
11262e92
TL
168iwlwifi-Qu-a0-jf-b0--26.ucode
169iwlwifi-Qu-a0-jf-b0--33.ucode
170iwlwifi-Qu-a0-jf-b0-34.ucode
b3bdbd58 171iwlwifi-Qu-a0-jf-b0-43.ucode
64cbf07c 172iwlwifi-Qu-a0-jf-b0-48.ucode
d31fb1a1 173iwlwifi-Qu-a0-jf-b0-50.ucode
b3bdbd58
TL
174iwlwifi-Qu-b0-hr-b0-43.ucode
175iwlwifi-Qu-b0-jf-b0-43.ucode
11262e92 176iwlwifi-QuQnj-a0-hr-a0-34.ucode
b3bdbd58 177iwlwifi-QuQnj-a0-hr-a0-43.ucode
64cbf07c 178iwlwifi-QuQnj-a0-hr-a0-48.ucode
d31fb1a1 179iwlwifi-QuQnj-a0-hr-a0-50.ucode
11262e92 180iwlwifi-QuQnj-a0-jf-b0-34.ucode
b3bdbd58
TL
181iwlwifi-QuQnj-a0-jf-b0-43.ucode
182iwlwifi-QuQnj-b0-hr-b0-43.ucode
64cbf07c 183iwlwifi-QuQnj-b0-hr-b0-48.ucode
d31fb1a1 184iwlwifi-QuQnj-b0-hr-b0-50.ucode
64cbf07c 185iwlwifi-QuQnj-b0-jf-b0-48.ucode
d31fb1a1 186iwlwifi-QuQnj-b0-jf-b0-50.ucode
11262e92 187iwlwifi-QuQnj-f0-hr-a0-34.ucode
b3bdbd58 188iwlwifi-QuQnj-f0-hr-a0-43.ucode
64cbf07c 189iwlwifi-QuQnj-f0-hr-a0-48.ucode
d31fb1a1 190iwlwifi-QuQnj-f0-hr-a0-50.ucode
64cbf07c 191iwlwifi-so-a0-gf-a0-48.ucode
d31fb1a1 192iwlwifi-so-a0-gf-a0-50.ucode
64cbf07c 193iwlwifi-so-a0-hr-b0-48.ucode
d31fb1a1 194iwlwifi-so-a0-hr-b0-50.ucode
64cbf07c 195iwlwifi-so-a0-jf-b0-48.ucode
d31fb1a1 196iwlwifi-so-a0-jf-b0-50.ucode
b3bdbd58 197iwlwifi-su-z0-43.ucode
64cbf07c 198iwlwifi-ty-a0-gf-a0-48.ucode
d31fb1a1 199iwlwifi-ty-a0-gf-a0-50.ucode
11262e92
TL
200iwmc3200wifi-calib-sdio.bin
201iwmc3200wifi-lmac-sdio.bin
202iwmc3200wifi-umac-sdio.bin
203ks7010sd.rom
b3bdbd58
TL
204lantiq/xrx200_phy11g_a14.bin
205lantiq/xrx200_phy11g_a22.bin
206lantiq/xrx200_phy22f_a14.bin
207lantiq/xrx200_phy22f_a22.bin
208lantiq/xrx300_phy11g_a21.bin
209lantiq/xrx300_phy22f_a21.bin
11262e92 210lattice-ecp3.bit
11262e92 211libertas/cf8305.bin
433982b1 212libertas/gspi8385.bin
11262e92 213libertas/gspi8385_helper.bin
433982b1 214libertas/gspi8385_hlp.bin
11262e92
TL
215libertas/usb8388.bin
216libertas_cs.fw
217libertas_cs_helper.fw
218liquidio/lio_210nv.bin
219liquidio/lio_210sv.bin
220liquidio/lio_23xx.bin
221liquidio/lio_410nv.bin
7bbca2e6
FG
222me2600_firmware.bin
223me4000_firmware.bin
11262e92
TL
224mrvl/pcie8766_uapsta.bin
225mrvl/pcie8997_uapsta.bin
226mrvl/sd8786_uapsta.bin
64cbf07c
TL
227mrvl/sd8977_uapsta.bin
228mrvl/sd8987_uapsta.bin
11262e92 229mrvl/sd8997_uapsta.bin
11262e92 230mrvl/usb8997_uapsta.bin
64cbf07c
TL
231mt7603_e1.bin
232mt7603_e2.bin
233mt7628_e1.bin
234mt7628_e2.bin
11262e92 235mwl8k/fmimage_8363.fw
11262e92 236mwl8k/helper_8363.fw
11262e92
TL
237ni6534a.bin
238niscrb01.bin
239niscrb02.bin
240nx3fwct.bin
241nx3fwmn.bin
242nxromimg.bin
243orinoco_ezusb_fw
244pca200e_ecd.bin2
245phanfw-4.0.579.bin
246prism2_ru.fw
247prism_ap_fw.bin
248prism_sta_fw.bin
6017019c
TL
249ql2600_fw.bin
250ql2700_fw.bin
251ql8100_fw.bin
252ql8300_fw.bin
b3bdbd58
TL
253rtl_bt/rtl8723b_config.bin
254rtl_bt/rtl8723bs_config.bin
255rtl_bt/rtl8723ds_config.bin
256rtl_bt/rtl8723ds_fw.bin
257rtl_bt/rtl8761a_config.bin
258rtl_bt/rtl8821a_config.bin
7bbca2e6 259rtlwifi/rtl8723bu_bt.bin
11262e92 260rtlwifi/rtl8723efw.bin
64cbf07c 261s5k4ecgx.bin
11262e92
TL
262sd8686.bin
263sd8686_helper.bin
11262e92
TL
264softing-4.6/bcard.bin
265softing-4.6/bcard2.bin
266softing-4.6/cancard.bin
267softing-4.6/cancrd2.bin
268softing-4.6/cansja.bin
269softing-4.6/ldcard.bin
270softing-4.6/ldcard2.bin
271solos-FPGA.bin
272solos-Firmware.bin
273solos-db-FPGA.bin
274symbol_sp24t_prim_fw
275symbol_sp24t_sec_fw
276tehuti/firmware.bin
277ti-connectivity/wl18xx-conf.bin
278tms380tr.bin
279usb8388.bin
280wd719x-risc.bin
281wd719x-wcs.bin
faefccd2 282wil6210_sparrow_plus.fw
b3bdbd58
TL
283wil6436.brd
284wil6436.fw
11262e92
TL
285wlan/prima/WCNSS_qcom_wlan_nv.bin
286zd1201-ap.fw
287zd1201.fw
7bbca2e6
FG
288)) {
289 $skip->{$fw} = 1;
290}
291
292sub copy_fw {
293 my ($src, $dstfw) = @_;
294
295 my $dest = "$target/$dstfw";
296
297 return if -f $dest;
298
299 mkpath dirname($dest);
300 system ("cp '$src' '$dest'") == 0 || die "copy $src to $dest failed";
301}
302
303my $fwdone = {};
304
6bc6bdcb
FG
305my $error = 0;
306
7bbca2e6
FG
307open(TMP, $fwlist);
308while(defined(my $line = <TMP>)) {
309 chomp $line;
310 my ($fw, $mod) = split(/\s+/, $line, 2);
311
312 next if $mod =~ m|^kernel/sound|;
313 next if $mod =~ m|^kernel/drivers/isdn|;
314
315 # skip ZyDas usb wireless, use package zd1211-firmware instead
316 next if $fw =~ m|^zd1211/|;
317
318 # skip atmel at76c50x wireless networking chips.
319 # use package atmel-firmware instead
320 next if $fw =~ m|^atmel_at76c50|;
321
322 # skip Bluetooth dongles based on the Broadcom BCM203x
323 # use package bluez-firmware instead
324 next if $fw =~ m|^BCM2033|;
325
326 next if $fw =~ m|^xc3028-v27\.fw|; # found twice!
327 next if $fw =~ m|.inp|; # where are those files?
328 next if $fw =~ m|^ueagle-atm/|; # where are those files?
329
7bbca2e6
FG
330 next if $fwdone->{$fw};
331 $fwdone->{$fw} = 1;
332
333 my $fwdest = $fw;
334 if ($fw eq 'libertas/gspi8686.bin') {
335 $fw = 'libertas/gspi8686_v9.bin';
336 }
337 if ($fw eq 'libertas/gspi8686_hlp.bin') {
338 $fw = 'libertas/gspi8686_v9_helper.bin';
339 }
340
341 if ($fw eq 'PE520.cis') {
342 $fw = 'cis/PE520.cis';
343 }
344
279821b7 345 if (-e "$target/$fw") {
6017019c 346 warn "WARN: allowed to skip existing '$fw'\n" if $skip->{$fw};
7bbca2e6
FG
347 next;
348 }
349 if (-f "$fwsrc3/$fw") {
350 copy_fw("$fwsrc3/$fw", $fwdest);
351 next;
352 }
353
354 if ($fw =~ m|/|) {
355 next if $skip->{$fw};
356
6bc6bdcb
FG
357 warn "unable to find firmware: $fw $mod\n";
358 $error++;
359 next;
7bbca2e6
FG
360 }
361
362 my $name = basename($fw);
363
279821b7 364 my $sr = `find '$target' \\( -type f -o -type l \\) -name '$name'`;
7bbca2e6
FG
365 chomp $sr;
366 if ($sr) {
279821b7
TL
367 my $found = 0;
368 for my $f (split("\n", $sr)) {
369 if ($f =~ /$fw$/) {
370 print "found $fw in $f\n";
371 $found = 1;
372 }
373 }
374 next if $found;
7bbca2e6
FG
375 }
376
377 $sr = `find '$fwsrc2' -type f -name '$name'`;
378 chomp $sr;
379 if ($sr) {
380 print "found $fw in $sr\n";
381 copy_fw($sr, $fwdest);
382 next;
383 }
384
385 $sr = `find '$fwsrc3' -type f -name '$name'`;
386 chomp $sr;
387 if ($sr) {
33e03db5 388 print "found $fw in $sr\n";
7bbca2e6
FG
389 copy_fw($sr, $fwdest);
390 next;
391 }
392
393 next if $skip->{$fw};
394 next if $fw =~ m|^dvb-|;
395
6bc6bdcb
FG
396 warn "unable to find firmware: $fw $mod\n";
397 $error++;
398 next;
7bbca2e6
FG
399}
400close(TMP);
401
6bc6bdcb 402exit($error);