diff --git a/content/drone-stuff/ardupilot-setup-checklist.md b/content/drone-stuff/ardupilot-setup-checklist.md index 14668bf..d930bdb 100644 --- a/content/drone-stuff/ardupilot-setup-checklist.md +++ b/content/drone-stuff/ardupilot-setup-checklist.md @@ -43,14 +43,14 @@ git submodule update --init --recursive git checkout Dockerfile echo "RUN pip install intelhex" >> Dockerfile -echo 'ENV PATH="/home/ardupilot/.local/bin:/usr/lib/ccache:/ardupilot/Tools/autotest:/opt/'$(ls -1 /opt/ | grep gcc-arm-none-eabi)'/bin:${PATH}"' >> Dockerfile +echo 'ENV PATH="/home/ardupilot/.local/bin:/usr/lib/ccache:/opt/gcc-arm-none-eabi-10-2020-q4-major/bin:/ardupilot/Tools/autotest:${PATH}"' >> Dockerfile cat Dockerfile docker build . -t ardupilot git checkout Dockerfile -docker run --rm -it -v "$(pwd)":/ardupilot ardupilot:latest ./waf configure --board="$BOARD" -docker run --rm -it -v "$(pwd)":/ardupilot ardupilot:latest ./waf build +docker run --rm -it -v "$(pwd)":/ardupilot ardupilot ./waf configure --board="$BOARD" +docker run --rm -it -v "$(pwd)":/ardupilot ardupilot ./waf build ``` diff --git a/content/software/_index.md b/content/software/_index.md index 04b6e4f..a800f7a 100644 --- a/content/software/_index.md +++ b/content/software/_index.md @@ -9,3 +9,4 @@ insert_anchor_links = "right" Click on a link in the list below to go to that page: 1. [Monero GUI syncing stuck with Ledger](../../software/monero-gui-syncing-stuck-with-ledger) +1. [Test and format SD cards](../../software/test-and-format-sd-cards) diff --git a/content/software/test-and-format-sd-cards.md b/content/software/test-and-format-sd-cards.md new file mode 100644 index 0000000..38ed63f --- /dev/null +++ b/content/software/test-and-format-sd-cards.md @@ -0,0 +1,31 @@ ++++ +title = "Test and format SD cards" +weight = 2 +sort_by = "weight" +insert_anchor_links = "right" ++++ +I wrote a short bash script that tests SD cards with [F3](https://3ds.hacks.guide/f3-(linux).html) to see if they're fake, deletes everything on them, creates a new partition table and one exFAT partition on them. + +Here it is: + +```bash +#!/usr/bin/env bash + +set -euox pipefail + +sudo umount --force "$1"1 || true +sudo f3probe --destructive --time-ops "$1" +sudo parted --script "$1" "mklabel msdos" "mkpart primary ext4 0% 100%" +sleep 1 +sudo mkfs.exfat -n Stavros "$1"1 +eject "$1" +``` + +Save it as `formatsd.sh` and run it as `./formatsd.sh /dev/sdX`. + +* * * + +

+Last updated on August 18, 2021. For any questions/feedback, +email me at hi@stavros.io. +