Skip to content

Commit

Permalink
Added support for using doas instead of sudo if sudo isnt there.
Browse files Browse the repository at this point in the history
  • Loading branch information
Spagett1 authored Oct 30, 2022
1 parent 9c07673 commit 4f2b049
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/helpers/flashall
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
# reboot the modem into fastboot mode
# flash kernel + rootfs and reboot
echo "Sending AT+QFASTBOOT..."
sudo sh -c 'echo -ne "AT+QFASTBOOT\r" > /dev/ttyUSB2'
if command -v doas >> /dev/null; then
root=doas
else
root=sudo
fi
$root sh -c 'echo -ne "AT+QFASTBOOT\r" > /dev/ttyUSB2'
fastboot oem stay
fastboot flash aboot appsboot.mbn || exit "Failed to flash the bootloader"
fastboot reboot
Expand All @@ -15,4 +20,4 @@ fastboot flash:raw recovery boot-mdm9607.img || exit "Failed to flash recovery k
fastboot flash system rootfs-mdm9607.ubi || exit "Failed to flash the system partition"
fastboot flash recoveryfs recoveryfs.ubi || exit "Failed to flash the recovery partition"
fastboot reboot
echo "Done!"
echo "Done!"

0 comments on commit 4f2b049

Please sign in to comment.