2

I am trying to make an image backup of boot. The script must work on any android. I think on any Android the boot location is

/dev/block/platform/???/by-name/boot

My command line

find /dev/block/platform -name boot -exec dd={} of=/sdcard/boot.img \;

doesn't work: {} no such file or directory

1 Answer 1

5

Fortunately, there's a static path available for you:

/dev/block/bootdevice/by-name/boot
           ^^^^^^^^^^

Problem solved 😊

dd if=/dev/block/bootdevice/by-name/boot of=boot.img

Stay away from /dev/block/platform, it'll only make things harder.

4
  • wow, it's really works with any android version, CPU and ROM?
    – user191256
    Commented Jan 25, 2018 at 3:41
  • 1
    @СергейГрушин Sure.
    – iBug
    Commented Jan 25, 2018 at 3:42
  • @iBug Will this work on the A/B partitions? I see in the directory that there is boot_a and boot_b. I tried to extract boot_a and it comes out at 64MB, whereas I'm sure that the boot.img in the stock ROM is only 32MB. Any leads?
    – singhnsk
    Commented Aug 9, 2018 at 11:15
  • @singhnsk It works, despite a few differences. You need to back up the image from ghe slot you're running. And the backed up image will be the size of the partition, not the size of actual data, because of the use of dd.
    – iBug
    Commented Aug 9, 2018 at 13:18

You must log in to answer this question.