#!/bin/bash
#############################################################################
# Helper script: source/a/kernel-firmware/platform/aarch64/sc8280xp
# Purpose......: Add the firmware for the sc8280xp SOC to the
#                Slackware installer.
#                This script is sourced from the 'kernel-firmware.SlackBuild'
#                script.
#                This script also serves as an example to the Slackware ARM
#                community about how to add firmware for new boards.
# Credits & References:
#                Stuart Winter
#                Patrick Volkerding
#                Manjaro Linux for ARM Architecture
# Date.........: 07-May-2024
# Maintainer...: Brenton Earl <el0226@slackware.com>
# Also see:
# https://github.com/ironrobin/x13s-alarm/blob/trunk/x13s-firmware/PKGBUILD
#############################################################################

#install -Dvpm644 $platformdir/assets/qcvss8280.mbn $PKG/lib/firmware/qcom/sc8280xp/LENOVO/21BX/
xz -dc $platformdir/assets/qcvss8280.mbn.xz > $PKG/lib/firmware/qcom/sc8280xp/LENOVO/21BX/qcvss8280.mbn
#install -Dvpm644 $platformdir/assets/hpnv21.b8c $PKG/lib/firmware/qca/
xz -dc $platformdir/assets/hpnv21.b8c.xz > $PKG/lib/firmware/qca/hpnv21.b8c
#install -Dvpm644 $platformdir/assets/a690_gmu.bin $PKG/lib/firmware/qcom/
xz -dc $platformdir/assets/a690_gmu.bin.xz > $PKG/lib/firmware/qcom/690_gmu.bin

# To be removed once confirmed:
# This is unnecessary since it's already a symlink within the kernel-firmware package:
#( cd $PKG/lib/firmware/qcom/sc8280xp/LENOVO/21BX
#  # Create a symlink for X13s sound firmware
#  ln -vfs audioreach-tplg.bin SC8280XP-LENOVO-X13S-tplg.bin )
# This is already a directory within the kernel-firmware package:
#( cd $PKG/lib/firmware/ath11k/WCN6855
#  # Create a symlink for X13s's WiFi card
#  ln -vfs hw2.0 hw2.1 )

# Keep as reference from PKGBUILD referenced in header of this file
# Create a symlink for X13s sound firmware
#cd $PKG/lib/firmware/qcom/sc8280xp/LENOVO/21BX
#ln -vfs LENOVO/21BX/audioreach-tplg.bin SC8280XP-LENOVO-X13S-tplg.bin

# Create a symlink for X13s's WiFi card
#cd $PKG/lib/firmware/ath11k/WCN6855
#ln -vfs hw2.0/ hw2.1
