Last active
November 18, 2021 20:59
-
-
Save klutchell/2b2d8fabf6820c27e9b8d85458820952 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eux | |
cleanup() { | |
sudo umount /mnt/flasher | |
sudo losetup -d "${loopback_device:-}" | |
} | |
trap cleanup EXIT | |
sudo mkdir -p /mnt/flasher | |
loopback_device=$(sudo losetup -fP --show "${1}") | |
sudo mount "${loopback_device}p2" /mnt/flasher | |
cp -v /mnt/flasher/opt/*.balenaos-img . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment