]> git.proxmox.com Git - pve-kernel-3.10.0.git/blame - assemble-firmware.pl
bump version to 3.10.0-21
[pve-kernel-3.10.0.git] / assemble-firmware.pl
CommitLineData
38ac51bd
DM
1#!/usr/bin/perl -w
2
3use strict;
4use File::Basename;
5use File::Path;
6
00557136 7my $fwsrc0 = "linux-2.6-3.10.0/firmware";
38ac51bd 8my $fwsrc1 = "linux-firmware.git";
00557136 9my $fwsrc2 = "dvb-firmware.git";
38ac51bd
DM
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
18my $force_skip = {
19
20 # not needed, the HBA has burned-in firmware
21 'ql8100_fw.bin' => 1,
22};
23
24my $skip = {};
25# debian squeeze also misses those files
26foreach my $fw (qw(
00557136
DM
27sms1xxx-stellar-dvbt-01.fw
28sms1xxx-nova-b-dvbt-01.fw
29sms1xxx-nova-a-dvbt-01.fw
30mrvl/sd8897_uapsta.bin
31mrvl/pcie8766_uapsta.bin
32mrvl/sd8786_uapsta.bin
33cxgb4/t5fw.bin
34brcm/brcmfmac-sdio.txt
35brcm/brcmfmac-sdio.bin
36brcm/brcmfmac43242a.bin
37brcm/brcmfmac43143.bin
38ct2fw-3.1.0.0.bin
39ctfw-3.1.0.0.bin
40cbfw-3.1.0.0.bin
41
42phanfw-4.0.579.bin
43
44
38ac51bd
DM
45libertas/gspi8385.bin libertas/gspi8385_hlp.bin
46ctfw.bin ct2fw.bin ctfw-3.0.3.1.bin ct2fw-3.0.3.1.bin
47cbfw.bin cbfw-3.0.3.1.bin
48tehuti/firmware.bin
49cyzfirm.bin
50isi4616.bin
51isi4608.bin
52isi616em.bin
53isi608.bin
54isi608em.bin
55c320tunx.cod
56cp204unx.cod
57c218tunx.cod
58isight.fw
59BT3CPCC.bin
60bfubase.frm
61solos-db-FPGA.bin
62solos-Firmware.bin
63solos-FPGA.bin
64pca200e_ecd.bin2
65prism2_ru.fw
66tms380tr.bin
67FW10
68FW13
69comedi/jr3pci.idm
70
71sd8686.bin
72sd8686_helper.bin
73usb8388.bin
74libertas_cs_helper.fw
75lbtf_usb.bin
76
77wl1271-fw.bin
78wl1251-fw.bin
79symbol_sp24t_sec_fw
80symbol_sp24t_prim_fw
81prism_ap_fw.bin
82prism_sta_fw.bin
83ar9170.fw
84iwmc3200wifi-lmac-sdio.bin
85iwmc3200wifi-calib-sdio.bin
86iwmc3200wifi-umac-sdio.bin
87iwmc3200top.1.fw
88zd1201.fw
89zd1201-ap.fw
90isl3887usb
91isl3886usb
92isl3886pci
933826.arm
94
95i2400m-fw-sdio-1.3.sbcf
96
97nx3fwmn.bin
98nx3fwct.bin
99nxromimg.bin
100
101myri10ge_rss_eth_z8e.dat
102myri10ge_rss_ethp_z8e.dat
103myri10ge_eth_z8e.dat
104myri10ge_ethp_z8e.dat
105
106i1480-phy-0.0.bin
107i1480-usb-0.0.bin
108i1480-pre-phy-0.0.bin
109
110go7007fw.bin
111go7007tv.bin
112
113sep/resident.image.bin
114sep/cache.image.bin
115b43legacy/ucode4.fw
116b43legacy/ucode2.fw
117b43/ucode9.fw
118b43/ucode5.fw
119b43/ucode15.fw
120b43/ucode14.fw
121b43/ucode13.fw
122b43/ucode11.fw
123b43/ucode16_mimo.fw
124orinoco_ezusb_fw
125isl3890
126isl3886
127isl3877
128mwl8k/fmimage_8366.fw
129mwl8k/helper_8366.fw
130mwl8k/fmimage_8363.fw
131mwl8k/helper_8363.fw
132iwlwifi-6000g2a-4.ucode
133iwlwifi-6000g2a-6.ucode
134iwlwifi-130-5.ucode
135iwlwifi-100-6.ucode
136iwlwifi-1000-6.ucode
137cxgb4/t4fw.bin
138cxgb4/t4fw-1.3.10.0.bin
139
140)) {
141 $skip->{$fw} = 1;
142}
143
144sub copy_fw {
145 my ($src, $dstfw) = @_;
146
147 my $dest = "$target/$dstfw";
148
149 return if -f $dest;
150
151 mkpath dirname($dest);
152 system ("cp '$src' '$dest'") == 0 || die "copy $src to $dest failed";
153}
154
155my $fwdone = {};
156
157open(TMP, $fwlist);
158while(defined(my $line = <TMP>)) {
159 chomp $line;
160 my ($fw, $mod) = split(/\s+/, $line, 2);
161
162 next if $mod =~ m|^kernel/sound|;
163 next if $mod =~ m|^kernel/drivers/isdn|;
164
165 # skip ZyDas usb wireless, use package zd1211-firmware instead
166 next if $fw =~ m|^zd1211/|;
167
168 # skip atmel at76c50x wireless networking chips.
169 # use package atmel-firmware instead
170 next if $fw =~ m|^atmel_at76c50|;
171
172 # skip Bluetooth dongles based on the Broadcom BCM203x
173 # use package bluez-firmware instead
174 next if $fw =~ m|^BCM2033|;
175
00557136
DM
176 next if $fw =~ m|^xc3028-v27\.fw|; # found twice!
177 next if $fw =~ m|.inp|; # where are those files?
178 next if $fw =~ m|^ueagle-atm/|; # where are those files?
179
38ac51bd
DM
180 next if $force_skip->{$fw};
181
182 next if $fwdone->{$fw};
183 $fwdone->{$fw} = 1;
184
185 my $fwdest = $fw;
186 if ($fw eq 'libertas/gspi8686.bin') {
187 $fw = 'libertas/gspi8686_v9.bin';
188 }
189 if ($fw eq 'libertas/gspi8686_hlp.bin') {
190 $fw = 'libertas/gspi8686_v9_helper.bin';
191 }
192
193 if ($fw eq 'PE520.cis') {
194 $fw = 'cis/PE520.cis';
195 }
196
197 # the rtl_nic/rtl8168d-1.fw file is buggy in current kernel tree
198 if (-f "$fwsrc0/$fw" &&
199 ($fw ne 'rtl_nic/rtl8168d-1.fw')) {
200 copy_fw("$fwsrc0/$fw", $fwdest);
201 next;
202 }
203 if (-f "$fwsrc1/$fw") {
204 copy_fw("$fwsrc1/$fw", $fwdest);
205 next;
206 }
207 if (-f "$fwsrc3/$fw") {
208 copy_fw("$fwsrc3/$fw", $fwdest);
209 next;
210 }
211
212 if ($fw =~ m|/|) {
213 next if $skip->{$fw};
00557136 214
38ac51bd
DM
215 die "unable to find firmware: $fw $mod\n";
216 }
217
218 my $name = basename($fw);
219
220 my $sr = `find '$fwsrc1' -type f -name '$name'`;
221 chomp $sr;
222 if ($sr) {
223 #print "found $fw in $sr\n";
224 copy_fw($sr, $fwdest);
225 next;
226 }
00557136
DM
227
228 $sr = `find '$fwsrc2' -type f -name '$name'`;
229 chomp $sr;
230 if ($sr) {
231 print "found $fw in $sr\n";
232 copy_fw($sr, $fwdest);
233 next;
234 }
235
38ac51bd
DM
236 $sr = `find '$fwsrc3' -type f -name '$name'`;
237 chomp $sr;
238 if ($sr) {
239 #print "found $fw in $sr\n";
240 copy_fw($sr, $fwdest);
241 next;
242 }
243
244 next if $skip->{$fw};
00557136 245 next if $fw =~ m|^dvb-|;
38ac51bd
DM
246
247 die "unable to find firmware: $fw $mod\n";
248}
249close(TMP);
250
251exit(0);