wok-next annotate firmware/receipt @ rev 21020

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