wok-next view firmware/receipt @ rev 20636
Fix "can't execute '/usr/bin/update-mime-database': No such file or directory"
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Apr 27 15:12:17 2018 +0300 (2018-04-27) |
parents | c3d04e304a7a |
children | d5aab818505e |
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 @rm
154 CAT="kernel|misc firmware"
155 ;;
156 b43|b43legacy)
157 path=$(find $WOK/linux/install -type f -name $module.ko.xz)
158 desc=$(modinfo -Fdescription $path)
159 CAT="kernel|$desc"
160 DEPENDS="b43-fwcutter"
161 COOKOPTS="empty-pkg"
162 ;;
164 # Meta-packages for backward compatibility with previous release
165 *-atheros)
166 # Some files from old "firmware-atheros" package are not packaged
167 # because they are not required by any of current kernel module.
168 CAT="meta|atheros meta"
169 DEPENDS="firmware-ar5523 firmware-ath3k"
170 ;;
171 *-rt2x00)
172 # Some files are not packaged as well
173 CAT="meta|rt2x00 meta"
174 DEPENDS="firmware-rt61pci firmware-rt2800pci firmware-rt2800usb \
175 firmware-rt73usb"
176 ;;
177 *-rtlnic)
178 CAT="meta|Realtek ethernet meta"
179 DEPENDS="firmware-r8169"
180 ;;
181 *-rtlwifi)
182 # Some files are not packaged as well
183 CAT="meta|rtlwifi meta"
184 DEPENDS="firmware-rtl8188ee firmware-rtl8192ce firmware-rtl8192cu \
185 firmware-rtl8192de firmware-rtl8192ee firmware-rtl8192se \
186 firmware-r8712u firmware-rtl8xxxu firmware-rtl8723be \
187 firmware-rtl8821ae"
188 ;;
189 # End meta-packages
191 *)
192 path=$(find $WOK/linux/install -type f -name $module.ko.xz)
193 fw=$(modinfo -Ffirmware $path | sort -u)
194 copy $fw
195 # check copied files
196 for i in $fw; do
197 if [ ! -f "$fs/lib/firmware/$i" ]; then
198 echo " Error: $i missing!"
199 mkdir -p $fs/lib/firmware/$(dirname $i)
200 touch $fs/lib/firmware/$i.missing
201 chmod 400 $fs/lib/firmware/$i.missing
202 fi
203 done
205 # TODO: copy licenses
206 DEPENDS=" "
208 desc=$(modinfo -Fdescription $path | head -n1)
209 CAT="kernel|${desc:-$module}"
211 # copy the whole folder
212 case $module in
213 acenic|amdgpu|b43|b43legacy|bnx2|bnx2x|cxgb3|cxgb4|e100|emi26|\
214 emi62|vicam|i915|kaweth|keyspan|keyspan_pda|mwl8k|qed|r128|\
215 slicoss)
216 copy $module/;;
217 zd1211rw) copy zd1211/;;
218 mga) copy matrox/;;
219 r8169) copy rtl_nic/;;
220 r8192e_pci) copy RTL8192E/;;
221 r8192u_usb) copy RTL8192U/;;
222 esac
224 # follow version (not realized yet)
225 case $module in
226 at76c50x-usb|atmel)
227 VERSION='1.3-4';;
228 bcm203x)
229 VERSION='1.2-3';;
230 zd1211rw)
231 VERSION='1.5-4';;
232 esac
233 ;;
234 esac
235 }
237 post_install_firmware_b43() {
238 drv=$(mktemp -d)
239 [ -n "$quiet" ] || echo -e '\nDownloading firmware (12.9MiB)...'
240 # download
241 wget -P $drv http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2
242 # extract tarball
243 tar -C $drv -xf $drv/*.tar.bz2
244 mkdir -p "$1/tmp" "$1/lib/firmware"
245 # copy driver to chroot
246 cp "$drv/broadcom-wl-5.100.138/linux/wl_apsta.o" "$1/tmp"
247 # extract firmware in the chroot
248 chroot "$1/" b43-fwcutter -w '/lib/firmware' '/tmp/wl_apsta.o'
249 # clean
250 rm -rf "$drv" "$1/tmp/wl_apsta.o"
251 # permissions
252 chmod 755 "$1/lib/firmware/b43"
253 find "$1/lib/firmware/b43" -type f -exec chmod 644 '{}' \;
254 }
255 post_remove_firmware_b43() {
256 rm -rf "$1/lib/firmware/b43"
257 }
259 post_install_firmware_b43legacy() {
260 drv=$(mktemp -d)
261 [ -n "$quiet" ] || echo -e '\nDownloading firmware (0.6MiB)...'
262 # download
263 wget -P $drv http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o
264 mkdir -p "$1/tmp" "$1/lib/firmware"
265 # copy driver to chroot
266 cp "$drv/wl_apsta-3.130.20.0.o" "$1/tmp"
267 # extract firmware in the chroot
268 chroot "$1/" b43-fwcutter -w '/lib/firmware' '/tmp/wl_apsta-3.130.20.0.o'
269 # clean
270 rm -rf "$drv" "$1/tmp/wl_apsta-3.130.20.0.o"
271 # permissions
272 chmod 755 "$1/lib/firmware/b43legacy"
273 find "$1/lib/firmware/b43legacy" -type f -exec chmod 644 '{}' \;
274 }
275 post_remove_firmware_b43legacy() {
276 rm -rf "$1/lib/firmware/b43legacy"
277 }