Created
January 27, 2021 22:45
-
-
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)
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
# 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