Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
exec &> /var/log/sdm845-modem-prepare.log
AID=$(qmicli -d qrtr://0 -p --uim-get-card-status | grep -E "([A-Z0-9]{2}:){15}[A-Z0-9]{2}" | xargs)
while [ -z "$AID" ]; do
sleep 2
AID=$(qmicli -d qrtr://0 -p --uim-get-card-status | grep -E "([A-Z0-9]{2}:){15}[A-Z0-9]{2}" | xargs)
done
qmicli -p -d qrtr://0 --uim-change-provisioning-session="slot=1,activate=yes,session-type=primary-gw-provisioning,aid=$AID"
qmicli -d qrtr://0 -p --dpm-open-port="hw-data-ep-type=embedded,hw-data-ep-iface-number=1,hw-data-rx-id=2,hw-data-tx-id=10"
exit 0
@calebccff
Copy link
Author

calebccff commented Apr 26, 2021

Place script in /usr/libexec/sdm845-modem-prepare
Then chmod +x /usr/libexec/sdm845-modem-prepare

Add service file /etc/init.d/sdm845-modem-prepare:

#!/sbin/openrc-run

command=/usr/libexec/sdm845-modem-prepare

description="HACK: Get the modem ready"

depend() {
	before modemmanager
}

Enable: sudo rc-update add sdm845-modem-prepare default

@joelselvaraj
Copy link

joelselvaraj commented Apr 29, 2021

minor correction. its not

Enable: sudo rc-update add default sdm845-modem-prepare

its
sudo rc-update add sdm845-modem-prepare default

@calebccff
Copy link
Author

calebccff commented Apr 29, 2021

minor correction. its not

Enable: sudo rc-update add default sdm845-modem-prepare

its
sudo rc-update add sdm845-modem-prepare default

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment