Last active
November 17, 2022 15:23
-
-
Save MagneFire/f0bbd8f862c7f5c72840922e2add0461 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
#!/bin/bash | |
set -x | |
dump_file=$1 | |
if [[ -z "$dump_file" ]]; then | |
echo "No dump provided assuming \"mmcblk0\"" | |
dump_file="mmcblk0" | |
fi | |
line=$(sfdisk -d $dump_file | grep "start" | awk -F'[, ]*' '{print "dd if='$dump_file' of=" substr($9, 7, length($9)-7) ".img skip=" $4 " count=" $6}') | |
while IFS= read -r l; do | |
$l | |
done <<< "$line" |
Another way to get the image using ssh
access is to execute this on the host Linux computer:
ssh root@watch "dd bs=1M if=/dev/mmcblk0" | dd of=mmcblk0_b.img bs=1M
This assumes that watch
has been set up with the IP address of the watch. This works over WiFi, but of course, transferring 4G via WiFi is going to be relatively slow.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the command
sfdisk -d mmcblk0 > partition_mapping
to get a partition map.Get the entire disk image by using
adb pull /dev/mmcblk0 .
.