wok-next view firmware/receipt @ rev 21521
updated bleachbit (2.0 -> 4.0.0)
author | Hans-G?nter Theisgen |
---|---|
date | Fri Jun 19 13:23:49 2020 +0100 (2020-06-19) |
parents | d5aab818505e |
children |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="firmware"
4 VERSION="20170906"
5 COMMIT="a61ac5cf8374edbfe692d12f805a1b194f7fead2"
6 CATEGORY="meta"
7 SHORT_DESC="Linux firmware"
8 MAINTAINER="devel@slitaz.org"
9 LICENSE="other"
10 WEB_SITE="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
11 HOST_ARCH="any"
13 TARBALL="linux-firmware-$COMMIT.tar.gz"
14 WGET_URL="$WEB_SITE/snapshot/$TARBALL"
16 #BUILD_DEPENDS="b43-fwcutter"
18 # Package name matched to kernel module.
19 # For example, firmware-b43 contains firmware for b43 kernel module.
20 f='firmware'
21 SPLIT="\
22 $PACKAGE-acenic $PACKAGE-af9013 $PACKAGE-aic94xx \
23 $PACKAGE-amdgpu $PACKAGE-ar5523 $PACKAGE-at76c50x-usb \
24 $PACKAGE-ath10k_pci $PACKAGE-ath3k $PACKAGE-ath6kl_sdio \
25 $PACKAGE-ath6kl_usb $PACKAGE-ath9k_htc $PACKAGE-atmel \
26 $PACKAGE-b43 $PACKAGE-b43legacy $PACKAGE-bcm203x \
27 $PACKAGE-bfusb $PACKAGE-bna $PACKAGE-bnx2 \
28 $PACKAGE-bnx2x $PACKAGE-brcmfmac $PACKAGE-brcmsmac \
29 $PACKAGE-bt3c_cs $PACKAGE-btintel $PACKAGE-btmrvl_sdio \
30 $PACKAGE-carl9170 $PACKAGE-cassini $PACKAGE-cpia2 \
31 $PACKAGE-cx18 $PACKAGE-cx231xx $PACKAGE-cx23885 \
32 $PACKAGE-cx24117 $PACKAGE-cx25840 $PACKAGE-cxgb3 \
33 $PACKAGE-cxgb4 $PACKAGE-daqboard2000 $PACKAGE-drx39xyj \
34 $PACKAGE-ds3000 $PACKAGE-dvb-ttpci $PACKAGE-dvb-ttusb-budget \
35 $PACKAGE-dvb-usb-af9015 $PACKAGE-dvb-usb-af9035 $PACKAGE-dvb-usb-az6007 \
36 $PACKAGE-dvb-usb-dib0700 $PACKAGE-dvb-usb-dw2102 $PACKAGE-dvb-usb-ec168 \
37 $PACKAGE-dvb-usb-lmedm04 $PACKAGE-e100 $PACKAGE-emi26 \
38 $PACKAGE-emi62 $PACKAGE-go7007 $PACKAGE-go7007-loader \
39 $PACKAGE-gspca_vicam $PACKAGE-i1480-dfu-usb $PACKAGE-i2400m-usb \
40 $PACKAGE-i915 $PACKAGE-io_edgeport $PACKAGE-io_ti \
41 $PACKAGE-ipw2100 $PACKAGE-ipw2200 $PACKAGE-isci \
42 $PACKAGE-isight_firmware $PACKAGE-ivtv $PACKAGE-iwl3945 \
43 $PACKAGE-iwl4965 $PACKAGE-iwlwifi $PACKAGE-jr3_pci \
44 $PACKAGE-kaweth $PACKAGE-keyspan $PACKAGE-keyspan_pda \
45 $PACKAGE-lgs8gxx $PACKAGE-libertas_cs $PACKAGE-libertas_sdio \
46 $PACKAGE-libertas_tf_usb $PACKAGE-m88ds3103 $PACKAGE-me4000 \
47 $PACKAGE-me_daq $PACKAGE-mga $PACKAGE-mn88472 \
48 $PACKAGE-mn88473 $PACKAGE-mt7601u $PACKAGE-mwifiex_sdio \
49 $PACKAGE-mwifiex_usb $PACKAGE-mwl8k $PACKAGE-myri10ge \
50 $PACKAGE-netxen_nic $PACKAGE-ni_pcidio $PACKAGE-nouveau \
51 $PACKAGE-orinoco $PACKAGE-orinoco_usb $PACKAGE-p54pci \
52 $PACKAGE-p54usb $PACKAGE-pcnet_cs $PACKAGE-prism2_usb \
53 $PACKAGE-pvrusb2 $PACKAGE-qat_dh895xcc $PACKAGE-qed \
54 $PACKAGE-qlcnic $PACKAGE-r128 $PACKAGE-r8169 \
55 $PACKAGE-r8192e_pci $PACKAGE-r8192u_usb $PACKAGE-r8712u \
56 $PACKAGE-radeon $PACKAGE-rsi_sdio $PACKAGE-rsi_usb \
57 $PACKAGE-rt2800pci $PACKAGE-rt2800usb $PACKAGE-rt61pci \
58 $PACKAGE-rt73usb $PACKAGE-rtl8188ee $PACKAGE-rtl8192ce \
59 $PACKAGE-rtl8192cu $PACKAGE-rtl8192de $PACKAGE-rtl8192ee \
60 $PACKAGE-rtl8192se $PACKAGE-rtl8723ae $PACKAGE-rtl8723be \
61 $PACKAGE-rtl8821ae $PACKAGE-rtl8xxxu $PACKAGE-s2255drv \
62 $PACKAGE-saa7134-go7007 $PACKAGE-serial_cs $PACKAGE-si2157 \
63 $PACKAGE-si2165 $PACKAGE-si2168 $PACKAGE-slicoss \
64 $PACKAGE-smc91c92_cs $PACKAGE-smsmdtv $PACKAGE-snd-asihpi \
65 $PACKAGE-snd-cs46xx $PACKAGE-snd-darla20 $PACKAGE-snd-darla24 \
66 $PACKAGE-snd-echo3g $PACKAGE-snd-emu10k1 $PACKAGE-snd-gina20 \
67 $PACKAGE-snd-gina24 $PACKAGE-snd-hda-codec-ca0132 $PACKAGE-snd-hdsp \
68 $PACKAGE-snd-indigo $PACKAGE-snd-indigodj $PACKAGE-snd-indigodjx \
69 $PACKAGE-snd-indigoio $PACKAGE-snd-indigoiox $PACKAGE-snd-korg1212 \
70 $PACKAGE-snd-layla20 $PACKAGE-snd-layla24 $PACKAGE-snd-maestro3 \
71 $PACKAGE-snd-mia $PACKAGE-snd-mixart $PACKAGE-snd-mona \
72 $PACKAGE-snd-pcxhr $PACKAGE-snd-riptide $PACKAGE-snd-usb-6fire \
73 $PACKAGE-snd-vx-lib $PACKAGE-snd-ymfpci $PACKAGE-speedfax \
74 $PACKAGE-starfire $PACKAGE-tda10071 $PACKAGE-tehuti \
75 $PACKAGE-tg3 $PACKAGE-ti_usb_3410_5052 $PACKAGE-tuner-xc2028 \
76 $PACKAGE-typhoon $PACKAGE-ueagle-atm $PACKAGE-usb8xxx \
77 $PACKAGE-usbdux $PACKAGE-usbduxfast $PACKAGE-usbduxsigma \
78 $PACKAGE-wcn36xx $PACKAGE-wd719x $PACKAGE-whiteheat \
79 $PACKAGE-wil6210 $PACKAGE-wl1251 $PACKAGE-wl12xx \
80 $PACKAGE-wl18xx $PACKAGE-xc4000 $PACKAGE-xc5000 \
81 $PACKAGE-zd1201 $PACKAGE-zd1211rw \
82 \
83 $PACKAGE-atheros $PACKAGE-rt2x00 $PACKAGE-rtlnic \
84 $PACKAGE-rtlwifi"
86 compile_rules() {
87 # mainline linux kernel firmware
88 make install
89 mkdir -p $install/usr/share/licenses
90 cp $src/LICENSE.* $src/LICENCE.* $install/usr/share/licenses
91 mv $install/lib/firmware/GPL* $install/usr/share/licenses
92 rm $install/lib/firmware/Makefile
94 # separate firmware from Debian repository
95 while read deb; do
96 pkg="$(basename $deb)"
97 title "Additional firmware from ${pkg%_all.deb}"
98 url="http://ftp.ch.debian.org/debian/pool/$deb"
99 [ -f "$SRC/$pkg" ] || wget -O $SRC/$pkg $url
100 dpkg-deb -X $SRC/$pkg $install | sed 's|^.| |'
101 done <<EOT
102 non-free/a/atmel-firmware/atmel-firmware_1.3-4_all.deb
103 non-free/b/bluez-firmware/bluez-firmware_1.2-3_all.deb
104 non-free/z/zd1211-firmware/firmware-zd1211_1.5-4_all.deb
105 main/h/hdmi2usb-fx2-firmware/hdmi2usb-fx2-firmware_0.0.0~git20151225-1_all.deb
106 EOT
108 # random firmware
109 while read dir url; do
110 [ -z "$dir" -o "$dir" == '#' ] && continue
111 title "Additional firmware from $dir"
112 tarball=$dir-$(basename $url)
113 [ -f $SRC/$tarball ] || wget -O $SRC/$tarball $url
114 mkdir -p $src/$dir
115 case $tarball in
116 *.tar.*) tar -C $src/$dir -xf $SRC/$tarball;;
117 *) cp $SRC/$tarball $src/$dir;;
118 esac
119 cd $src/$dir
120 [ $(ls . | wc -l) -eq 1 -a -d ./$(ls .) ] && cd ./$(ls .)
122 fdir="$install/lib/firmware"
123 case $dir in
124 dvb-firmware)
125 ./install;;
126 adaptec-firmware)
127 rpm2cpio *.rpm | cpio -idm; cp -r lib/ $install;;
128 ath10k-firmware)
129 cp -r ath10k $fdir;;
130 # prohibited
131 # broadcom-firmware)
132 # b43-fwcutter -w $fdir linux/wl_apsta.o
133 # cp linux/wl_apsta.o $fdir
134 # ;;
135 # broadcom-legacy-firmware)
136 # b43-fwcutter -w $fdir wl_apsta-3.130.20.0.o
137 # cp *.o $fdir/wl_apsta-3.130.20.0.o
138 # ;;
139 bfusb)
140 cp *.frm $fdir;;
141 alsa-firmware)
142 ./configure $CONFIGURE_ARGS &&
143 make &&
144 make install;;
145 esac
147 done <<EOT
148 # https://github.com/OpenELEC/dvb-firmware
149 dvb-firmware https://github.com/OpenELEC/dvb-firmware/archive/3fef04a.tar.gz
151 # https://adaptec.com/en-us/speed/scsi/linux/aic94xx-seq-30-1_tar_gz.php
152 adaptec-firmware http://download.adaptec.com/scsi/linux/aic94xx-seq-30-1.tar.gz
154 # https://wireless.wiki.kernel.org/en/users/Drivers/ath10k/firmware
155 # https://github.com/sumdog/ath10k-firmware
156 # https://github.com/kvalo/ath10k-firmware
157 ath10k-firmware https://github.com/sumdog/ath10k-firmware/archive/5faf5bb.tar.gz
159 # https://wiki.debian.org/bcm43xx
160 # broadcom-firmware http://mirror2.openwrt.org/sources/broadcom-wl-5.100.138.tar.bz2
161 # broadcom-legacy-firmware http://mirror2.openwrt.org/sources/wl_apsta-3.130.20.0.o
163 # https://wiki.ubuntuusers.de/Archiv/Bluetooth/BlueFritz%21/
164 bfusb ftp://ftp.in-berlin.de/pub/capi4linux/firmware/bluefusb/3-18-39/bfubase.frm
166 # http://alsa-project.org/main/index.php/Main_Page
167 # http://git.alsa-project.org/?p=alsa-firmware.git;a=summary
168 alsa-firmware ftp://ftp.alsa-project.org/pub/firmware/alsa-firmware-1.0.29.tar.bz2
169 EOT
171 # fix permissions
172 find $install -type f -exec chmod 644 '{}' \;
173 find $install -type d -exec chmod 755 '{}' \;
174 }
176 genpkg_rules() {
177 module=${PACKAGE#*-}
178 case $module in
179 firmware)
180 CAT="meta|all firmware"
181 DEPENDS="$SPLIT"
182 ;;
183 misc)
184 copy @std @rm
185 CAT="kernel|misc firmware"
186 ;;
187 b43|b43legacy)
188 path=$(find $WOK/linux/install -type f -name $module.ko.xz)
189 desc=$(modinfo -Fdescription $path)
190 CAT="kernel|$desc"
191 DEPENDS="b43-fwcutter"
192 COOKOPTS="empty-pkg"
193 ;;
195 # Meta-packages for backward compatibility with previous release
196 *-atheros)
197 # Some files from old "firmware-atheros" package are not packaged
198 # because they are not required by any of current kernel module.
199 CAT="meta|atheros meta"
200 DEPENDS="firmware-ar5523 firmware-ath3k"
201 ;;
202 *-rt2x00)
203 # Some files are not packaged as well
204 CAT="meta|rt2x00 meta"
205 DEPENDS="firmware-rt61pci firmware-rt2800pci firmware-rt2800usb \
206 firmware-rt73usb"
207 ;;
208 *-rtlnic)
209 CAT="meta|Realtek ethernet meta"
210 DEPENDS="firmware-r8169"
211 ;;
212 *-rtlwifi)
213 # Some files are not packaged as well
214 CAT="meta|rtlwifi meta"
215 DEPENDS="firmware-rtl8188ee firmware-rtl8192ce firmware-rtl8192cu \
216 firmware-rtl8192de firmware-rtl8192ee firmware-rtl8192se \
217 firmware-r8712u firmware-rtl8xxxu firmware-rtl8723be \
218 firmware-rtl8821ae"
219 ;;
220 # End meta-packages
222 *)
223 path=$(find $WOK/linux/install -type f -name $module.ko.xz)
224 fw=$(modinfo -Ffirmware $path | sort -u)
225 copy $fw
226 # check copied files
227 for i in $fw; do
228 if [ ! -f "$fs/lib/firmware/$i" ]; then
229 echo " Error: $i missing!"
230 mkdir -p $fs/lib/firmware/$(dirname $i)
231 touch $fs/lib/firmware/$i.missing
232 chmod 400 $fs/lib/firmware/$i.missing
233 fi
234 done
236 # TODO: copy licenses
237 DEPENDS=" "
239 desc=$(modinfo -Fdescription $path | head -n1)
240 CAT="kernel|${desc:-$module}"
242 # copy the whole folder
243 case $module in
244 acenic|amdgpu|b43|b43legacy|bnx2|bnx2x|cxgb3|cxgb4|e100|emi26|\
245 emi62|vicam|i915|kaweth|keyspan|keyspan_pda|mwl8k|qed|r128|\
246 slicoss)
247 copy $module/;;
248 zd1211rw) copy zd1211/;;
249 mga) copy matrox/;;
250 r8169) copy rtl_nic/;;
251 r8192e_pci) copy RTL8192E/;;
252 r8192u_usb) copy RTL8192U/;;
253 esac
255 # follow version (not realized yet)
256 case $module in
257 at76c50x-usb|atmel)
258 VERSION='1.3-4';;
259 bcm203x)
260 VERSION='1.2-3';;
261 zd1211rw)
262 VERSION='1.5-4';;
263 esac
264 ;;
265 esac
266 }
268 post_install_firmware_b43() {
269 drv=$(mktemp -d)
270 [ -n "$quiet" ] || echo -e '\nDownloading firmware (12.9MiB)...'
271 # download
272 wget -P $drv http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2
273 # extract tarball
274 tar -C $drv -xf $drv/*.tar.bz2
275 mkdir -p "$1/tmp" "$1/lib/firmware"
276 # copy driver to chroot
277 cp "$drv/broadcom-wl-5.100.138/linux/wl_apsta.o" "$1/tmp"
278 # extract firmware in the chroot
279 chroot "$1/" b43-fwcutter -w '/lib/firmware' '/tmp/wl_apsta.o'
280 # clean
281 rm -rf "$drv" "$1/tmp/wl_apsta.o"
282 # permissions
283 chmod 755 "$1/lib/firmware/b43"
284 find "$1/lib/firmware/b43" -type f -exec chmod 644 '{}' \;
285 }
286 post_remove_firmware_b43() {
287 rm -rf "$1/lib/firmware/b43"
288 }
290 post_install_firmware_b43legacy() {
291 drv=$(mktemp -d)
292 [ -n "$quiet" ] || echo -e '\nDownloading firmware (0.6MiB)...'
293 # download
294 wget -P $drv http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o
295 mkdir -p "$1/tmp" "$1/lib/firmware"
296 # copy driver to chroot
297 cp "$drv/wl_apsta-3.130.20.0.o" "$1/tmp"
298 # extract firmware in the chroot
299 chroot "$1/" b43-fwcutter -w '/lib/firmware' '/tmp/wl_apsta-3.130.20.0.o'
300 # clean
301 rm -rf "$drv" "$1/tmp/wl_apsta-3.130.20.0.o"
302 # permissions
303 chmod 755 "$1/lib/firmware/b43legacy"
304 find "$1/lib/firmware/b43legacy" -type f -exec chmod 644 '{}' \;
305 }
306 post_remove_firmware_b43legacy() {
307 rm -rf "$1/lib/firmware/b43legacy"
308 }