Skip to content

Instantly share code, notes, and snippets.

@martin-v
Created January 27, 2021 22:45
Show Gist options
  • Save martin-v/91234a61a29d91b793d1123dbba8bc6c to your computer and use it in GitHub Desktop.
Save martin-v/91234a61a29d91b793d1123dbba8bc6c to your computer and use it in GitHub Desktop.
Snippets to create or write a img from current boot partition (with a bit of safety check)
# Create a boot image form active slot
bootctl is-slot-bootable 0 \
&& bootctl is-slot-bootable 1 \
&& bootctl is-slot-marked-successful 1 \
&& bootctl is-slot-marked-successful 0 \
&& dd if=/dev/block/by-name/boot$(bootctl get-suffix $(bootctl get-current-slot)) of=/sdcard/boot.img
# Write boot image to active slot
bootctl is-slot-bootable 0 \
&& bootctl is-slot-bootable 1 \
&& bootctl is-slot-marked-successful 1 \
&& bootctl is-slot-marked-successful 0 \
&& dd of=/dev/block/by-name/boot$(bootctl get-suffix $(bootctl get-current-slot)) if=$PATH_OF_YOUR_NEW_IMG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment