wok-next annotate firmware/receipt @ rev 20513

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