Skip to content

Commit 850321e

Browse files
Fix ramdisk setup to correctly handle initbootimage assignment
The previous implementation did not update the bootimage pointer when an initbootimage was present, which was leading to improper memcpy in subsequent operations. This commit ensures that when initbootimage is provided, both the boot_hdr and bootimage pointers are updated to reference initbootimage. Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
1 parent eb5393f commit 850321e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

libkernelflinger/android.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,10 @@ static EFI_STATUS setup_ramdisk(UINT8 *bootimage, UINT8 *initbootimage, UINT8 *v
628628
struct vendor_boot_img_hdr_v4 *vendor_hdr = (struct vendor_boot_img_hdr_v4 *)vendorbootimage;
629629
struct boot_img_hdr_v4 *boot_hdr = (struct boot_img_hdr_v4 *)bootimage;
630630

631-
if (initbootimage)
632-
boot_hdr = (struct boot_img_hdr_v4 *)initbootimage;
631+
if (initbootimage) {
632+
boot_hdr = (struct boot_img_hdr_v4 *)initbootimage;
633+
bootimage = initbootimage;
634+
}
633635

634636
UINT32 page_size = vendor_hdr->page_size;
635637
UINT32 vendor_ramdisk_offset = ALIGN(sizeof(struct vendor_boot_img_hdr_v4), page_size);

0 commit comments

Comments
 (0)