#################################################################################
# RealTek firmware for the Compulab Trimslice, NVIDIA Tegra20 SoC.
#################################################################################

# The Trimslice page says to apt-get the 'firmware-nonfree' Debian package, so
# I'll make it easy on myself by using Debian's 'source' package as an upstream for this.
# http://trimslice.com/wiki/index.php/Trim-Slice_Linux_Kernel
#
# http://packages.debian.org/sid/firmware-linux-nonfree
#
CWD=$PWD
rm -f rtl_nic.tar.xz
TMP=/tmp/fwtegra20
rm -rf $TMP
mkdir -p $TMP
cd $TMP || exit 1

wget http://deb.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-nonfree_20210315.orig.tar.xz
tar xf firmware*z
rm -f firmware*z
# Copy firmware:
cp -fav firmware-nonfree*/rtl_nic .
# Copy licences - expect an error as some licence files are named
# according to Purple Granny's English, and others American:
# Note: there's no licence for the RTL NIC firmware - although there
# is for the wifi.
#install -vpm644 firmware-nonfree*/LICEN{S,C}*rtl* rtl_nic/
tar -cf- rtl_nic | xz -ze9 - > $CWD/assets/rtl_nic.tar.xz
