Here’s a little script I cooked up to automate the process (used it successfully on a Turris Omnia with a MC7430 installed and the most recent firmware from Sierra):
#! /bin/sh
device=/dev/cdc-wdm0
fullmodeusb=/dev/ttyUSB2
bootmodeusb=/dev/ttyUSB0
unsafe=
# uncomment this to enable unsafe mode
#unsafe=--ignore-mm-runtime-check
echo Locating firmware files...
ncwe=$(ls *.cwe 2>/dev/null|wc -l)
nnvu=$(ls *.nvu 2>/dev/null|wc -l)
if [ \( $ncwe -ne 1 \) -o \( $nnvu -ne 1 \) ]; then
echo Couldn\'t find the firmware update files
echo make sure exactly one .cwe and one .nvu are present
exit
fi
cwe=$(ls *.cwe|xargs)
nvu=$(ls *.nvu|xargs)
fwamssflavor=$(echo $cwe|sed -r 's,_.*,,')
fwamssvs=$(echo $cwe|sed -r 's,^[^_]+_(.+)\.cwe,\1,')
fwbootflavor=$(echo $nvu|sed -r 's,_.*,,')
fwbootvs=$(echo $nvu|sed -r 's,^[^_]+_([^_]+)_.*,\1,')
fwedition=$(echo $nvu|sed -r 's,^[^_]+_[^_]+_([^_]+).*,\1,')
fwconfigvs=$(echo $nvu|sed -r 's,^[^_]+_[^_]+_[^_]+_(.*)\.nvu,\1,')
echo " Using CWE: ./$cwe"
echo " Using NVU: ./$nvu"
echo " versions: device=$fwamssflavor boot=$fwbootvs amss=$fwamssvs config=$fwconfigvs edition=$fwedition"
if [ "$fwamssflavor" != "$fwbootflavor" ]; then
echo "ERROR! BOOT belongs to a different device ($fwbootflavor)."
echo "This is *very* likely to brick the modem. Aborting..."
exit
fi
if [ \( -z "$fwamssflavor" \) -o \( -z "$fwamssvs" \) -o \( -z "$fwbootvs" \) -o \( -z "$fwconfigvs" \) -o \( -z "$fwedition" \) ]; then
echo "ERROR! Cannot detect the exact update versions."
echo "Aborting..."
exit
fi
echo ""
echo "Detecting modem firmware..."
tmp=$(mktemp)
if ! qmicli -d $device -p --dms-swi-get-current-firmware 2>/dev/null >$tmp; then
echo Couldn\'t query the current firmware using $device
exit
fi
model=$(cat $tmp|grep Model:|awk '{print $2}')
sku=$(cat $tmp|grep 'SKU ID:'|awk '{print $3}')
boot=$(cat $tmp|grep 'Boot version:'|awk '{print $3}')
amss=$(cat $tmp|grep 'AMSS version:'|awk '{print $3}')
configvs=$(cat $tmp|grep 'Config version:'|awk '{print $3}')
rm -f $tmp
amssflavor=$(echo $amss|sed -r 's,_.*,,')
amssvs=$(echo $amss|sed -r 's,^[^_]+_,,')
bootflavor=$(echo $boot|sed -r 's,_.*,,')
bootvs=$(echo $boot|sed -r 's,^[^_]+_,,')
echo " Found $model (SKU $sku) on $device"
echo " versions: device=$amssflavor boot=$bootvs amss=$amssvs config=$configvs"
if [ "$amssflavor" != "$bootflavor" ]; then
echo "ERROR! BOOT belongs to a different ($bootflavor)."
echo "This is *seriously* wrong. Aborting..."
exit
fi
if [ \( -z "$amssflavor" \) -o \( -z "$amssvs" \) -o \( -z "$bootvs" \) -o \( -z "$configvs" \) ]; then
echo "ERROR! Cannot detect the exact installed versions."
echo "Aborting..."
exit
fi
if [ "$amssflavor" != "$fwamssflavor" ]; then
echo "ERROR! update files are for a different device."
echo "This is *very* likely to brick the modem. Aborting..."
exit
fi
if [ \( "$amssvs" = "$fwamssvs" \) -a \( "$bootvs" = "$fwbootvs" \) ]; then
echo "NOTE. Update already installed."
echo "Noting to do..."
exit
fi
echo ""
echo Rebooting modem into bootloader mode...
echo " # qmi-firmware-update -w $device $unsafe -b"
qmi-firmware-update -w $device $unsafe -b 2>&1 | sed 's,^, ,'
echo -n "(waiting for the modem to disappear..."
t=0
while [ $t -le 30 ]; do
if [ ! -e $fullmodeusb ]; then
echo " OK)"
break;
fi
t=$(( t + 1 ))
echo -n "."
sleep 1
done
if [ -e $fullmodeusb ]; then
echo " FAILED! - timeout)"
echo " # qmicli -d $device -p --dms-get-operating-mode"
qmicli -d $device -p --dms-get-operating-mode 2>&1 | sed 's,^, ,'
echo "Aborting..."
exit
fi
echo -n "(waiting for the boot interface to appear..."
t=0
while [ $t -le 30 ]; do
if [ -e $bootmodeusb ]; then
echo " OK)"
break;
fi
t=$(( t + 1 ))
echo -n "."
sleep 1
done
if [ ! -e $bootmodeusb ]; then
echo " FAILED - timeout)"
echo "Aborting..."
exit
fi
if [ -e $fullmodeusb ]; then
echo " FAILED - boot skipped, normal reboot happened)"
echo "Aborting. Please retry..."
exit
fi
echo ""
echo "Updating modem..."
echo "# qmi-firmware-update -t $bootmodeusb $unsafe --update-qdl \\"
echo " ./$cwe \\"
echo " ./$nvu"
qmi-firmware-update -t $bootmodeusb $unsafe --update-qdl $cwe $nvu
echo -n "(waiting for the modem to re-appear..."
t=0
while [ $t -le 30 ]; do
if [ -e $device ]; then
echo " OK)"
break;
fi
t=$(( t + 1 ))
echo -n "."
sleep 1
done
if [ ! -e $device ]; then
echo " FAILED! - timeout)"
echo "Aborting..."
exit
fi
echo ""
echo "Querying modem..."
echo -n "(waiting for the modem to finish boot..."
t=0
while [ $t -le 180 ]; do
if qmicli -d $device -p --dms-swi-get-current-firmware 2>/dev/null > $tmp; then
echo " OK)"
break;
fi
t=$(( t + 1 ))
echo -n "."
sleep 1
done
if ! qmicli -d $device -p --dms-swi-get-current-firmware 2>/dev/null > $tmp; then
echo " FAILED! - timeout)"
echo "Run \"qmicli -d $device -p --dms-swi-get-current-firmware\" later..."
else
echo " # qmicli -d $device -p --dms-swi-get-current-firmware"
cat $tmp | sed 's,^, ,'
fi
echo ""
echo "All done."
Sample output log:
Locating firmware files...
Using CWE: ./SWI9X30C_02.30.03.00.cwe
Using NVU: ./SWI9X30C_02.30.03.00_GENERIC_002.046_001.nvu
versions: device=SWI9X30C boot=02.30.03.00 amss=02.30.03.00 config=002.046_001 edition=GENERIC
Detecting modem firmware...
Found MC7430 (SKU 1102477) on /dev/cdc-wdm0
versions: device=SWI9X30C boot=02.14.03.00 amss=02.14.03.00 config=002.012_000
Rebooting modem into bootloader mode...
# qmi-firmware-update -w /dev/cdc-wdm0 --ignore-mm-runtime-check -b
reseter operation finished successfully
(waiting for the modem to disappear................ OK)
(waiting for the boot interface to appear.... OK)
Updating modem...
# qmi-firmware-update -t /dev/ttyUSB0 --ignore-mm-runtime-check --update-qdl \
./SWI9X30C_02.30.03.00.cwe \
./SWI9X30C_02.30.03.00_GENERIC_002.046_001.nvu
downloading cwe image: SWI9X30C_02.30.03.00.cwe (64.5 MB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 52.63s (1.2 MB/s)
downloading cwe image: SWI9X30C_02.30.03.00_GENERIC_002.046_001.nvu (3.2 kB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 0.05s (60.1 kB/s)
rebooting in normal mode...
firmware update operation finished successfully
(waiting for the modem to re-appear.............. OK)
Querying modem...
(waiting for the modem to finish boot..... OK)
# qmicli -d /dev/cdc-wdm0 -p --dms-swi-get-current-firmware
[/dev/cdc-wdm0] Successfully retrieved current firmware:
Model: MC7430
Boot version: SWI9X30C_02.30.03.00
AMSS version: SWI9X30C_02.30.03.00
SKU ID: 1102477
Package ID: unknown
Carrier ID: 1
Config version: 002.012_000
All done.
I hope this helps others just like this page helped me