Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
j005u committed Dec 12, 2022
0 parents commit 2db5da8
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 0 deletions.
19 changes: 19 additions & 0 deletions LICENESE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2022 fpv.wtf

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# butter
### Episode 3: The ¯\\\_(ツ)_/¯ Strikes Back

# Purpose
This program will enable fastboot on DJI Air Unit (Lite), DJI FPV Goggles V1 and DJI FPV Goggles V2. This means you can recover or forcefully downgrade your devices firmware ignoring antirollback.

# Usage
For end users the reccomended method is to download premade flashing packages available at:
- [Air Unit - V01.00.0608](https://mega.nz/file/4ygSlZLZ#ZJ7aEwO0s-1ucK1QJTDf1gzA6ZXRncBP_8IH0U_5iQQ)
- [Air Unit Lite / Caddx Vista / Runcam Link - V01.00.0608](https://mega.nz/file/4yoAnDKZ#WB4n3KlsB69nIAt1p2gIdqZEsnNf_u1UgO0xPG9Oqx4)
- [FPV Goggles V1 - V01.00.0608](https://mega.nz/file/YnI0TJYB#FVGdEwXERCzGnJCWPdDLZg2U2VWGJUZWo52WYCHyQkM)
- [FPV Goggles V2 - V01.00.0606](https://mega.nz/file/Uz4V1L4Q#XQAXasHy95XYuhj1Mc4yac5Gg-uX2kmrmay_yr92_iI)

Then simply follow the README.txt contained within.

# Advanced usage

To boot your device for fastboot flashing launch the butter binary and power on your device.

```
butter.exe [device]
```
Where device is one of:
- wm150
- lt150
- gl150
- gl170

If no argument is supplied you can select the device interactively.

Then use `fastboot` to flash your devices partitions. Note that you will need raw partition images. Methods for using DDD firmware archives will be released at a later date. See [Usage](#Usage) for pre-converted archives.

# Todo
- Add support for DDD tar archives

# Why isn't it spelled wrong?
[Because](https://www.youtube.com/watch?v=3ds0vWfoTwU).

## Support the effort
If you'd like, you can support the effort on [Open Collective](https://opencollective.com/fpv-wtf/donate?amount=10).
Binary file added bin/butter-aarch64-linux-gnu
Binary file not shown.
Binary file added bin/butter-arm-linux-gnueabihf
Binary file not shown.
Binary file added bin/butter-x86_64-linux-gnu
Binary file not shown.
Binary file added bin/butter-x86_64-w64-mingw32.exe
Binary file not shown.
43 changes: 43 additions & 0 deletions scripts/linux-runme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
set -e

echo "Please connect and power on your device"
DEVICE=$(cat firmware/device)
ARCH=$(uname -m)

case $ARCH in

"x86_64")
BIN="x86_64-linux-gnu"
;;
"armv"*)
BIN="arm-linux-gnueabihf"
;;
"aarch64"*)
BIN="aarch64-linux-gnu"
;;
*)
echo "Your platform ${ARCH} is not supported."
exit 1
;;
esac

if ! command -v fastboot &> /dev/null
then
echo "Error: fastboot not found. please install it eg. via 'sudo apt install fastboot'."
exit
fi

bin/butter-${BIN} ${DEVICE}

cd firmware
fastboot erase blackbox

while IFS="" read -r p || [ -n "$p" ]
do
fastboot flash $p
done < partitions

fastboot reboot

echo "Flashing complete"
12 changes: 12 additions & 0 deletions scripts/windows-runme.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@echo off
echo Please connect and power on your device
set /p Device=<firmware\device || exit /b 666
bin\butter-x86_64-w64-mingw32.exe %Device%

cd firmware
..\bin\fastboot.exe erase blackbox || exit /b 666
for /F "tokens=*" %%A in (partitions) do ..\bin\fastboot.exe flash %%A || exit /b 666
..\bin\fastboot.exe reboot || exit /b 666

echo Flashing complete
pause

0 comments on commit 2db5da8

Please sign in to comment.