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