sudo apt-get install -y gnome-firmware

# see /usr/share/fwupd/remotes.d/vendor/firmware/README.md for the steps to add vendor firmware.

# enable fwupd local repository
sed -i 's/^Enabled=false/Enabled=true/' /etc/fwupd/remotes.d/vendor-directory.conf

REPO="the-modem-distro/pinephone_modem_sdk"
RELEASE="$(lastversion --format=tag ${REPO})"
FILE="package.tar.gz"
DEST="/usr/share/fwupd/remotes.d/vendor/firmware"
sudo wget -c -O "${DEST}/modem-${RELEASE}_${FILE}" https://github.com/"${REPO}"/releases/download/"${RELEASE}"/"${FILE}"


# back to stock using fastboot or EDL see: https://github.com/Biktorgj/quectel_eg25_recovery and https://github.com/the-modem-distro/pinephone_modem_sdk/blob/kirkstone/docs/RECOVERY.md

# change to the available biktorgj/community firmware
# fwupdtool get-devices
DEVICE_ID="8d0c4e07afd20ebc3da63aa53e68c764ff627b12"
# sudo fwupdtool --allow-older --allow-branch-switch --verbose switch-branch "${DEVICE_ID}"
sudo fwupdtool update "${DEVICE_ID}"


