0

In this video, the host is trying to modify an existing TWRP disk image file and flash the modified image in his Moto G. What surprised me is the content of that TWRP recovery image. The video shows the contents of the TWRP recovery image as:

  1. zImage (Kernal)
  2. initrd.img (initial ramdisk)

How is that possible? I was under the impression that the kernel and the initial ramdisk reside in the /boot partition. He simply booted the image without giving any partition argument for fastboot:

sudo fastboot boot <recovery.img>

So, where would that disk image file go? /boot or /recovery? Flashing the kernel and its ramdisk (with init.rc script) into the boot partition makes sense, but I am confused because he was working with a recovery disk image, which he should have flashed into the /recovery partition. Does the recovery image also have its own kernel and ramdisk? I tried to download and see the contents of an Android recovery disk image by myself, but I couldn't open the .img file in Windows.

1 Answer 1

1

fastboot boot does not perform a flash. From fastboot help:

usage: fastboot [ <option> ] <command>

commands:
  [...]
  flash <partition> [ <filename> ]             Write a file to a flash partition.
  [...]
  boot <kernel> [ <ramdisk> [ <second> ] ]     Download and boot kernel.

Does the recovery image also have its own kernel and ramdisk?

Yup. Recovery is essentially a miniature OS and boots similarly to the main boot image.

1
  • Thanks a lot! One question though. If I execute something like this: fastboot flash recovery <recovery.img>, the kernel and ramdisk will also be pushed into the /recovery partition? If not, then what exactly will be copied into the /recovery (I was under the impression that kernel and ramdisk will go into /boot partition)? In the video, I saw the only content of TWRP recovery image was bootconfig file, kernel, and the ramdisk. Jan 9, 2017 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .