]> git.dujemihanovic.xyz Git - u-boot.git/commit
boot: android: fix booting without a ramdisk
authorMichael Walle <mwalle@kernel.org>
Mon, 29 Jul 2024 21:36:57 +0000 (23:36 +0200)
committerMattijs Korpershoek <mkorpershoek@baylibre.com>
Thu, 22 Aug 2024 07:23:33 +0000 (09:23 +0200)
commit6509c3fe1c7dddf1d598a9fd8234ed760b3a428b
treee705f9c408046fcd417e59fd641fd78b6346e511
parent61faa6dd21f661cab95aa00a6660441a5f04f8db
boot: android: fix booting without a ramdisk

android_image_get_ramdisk() will return an error if there is no ramdisk.
Using the android image without a ramdisk worked until commit
1ce8e10f3b4b ("image: Fix up ANDROID_BOOT_IMAGE ramdisk code") because
the return code wasn't checked until then. Return -ENOENT in case
there is no ramdisk and translate that into -ENOPKG in the calling
code, which will then indicate "no ramdisk" to its caller
(boot_get_ramdisk()).

This way, we can get rid of the "*rd_data = *rd_len = 0;" in the error
path, too.

With this, I'm able to boot a linux kernel using fastboot again:

  fastboot --base 0x41000000 --header-version 2 --dtb /path/to/dtb \
  --cmdline "root=/dev/mmcblk0p1 rootwait" boot path/to/Image

Signed-off-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20240729213657.2550935-1-mwalle@kernel.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
boot/image-android.c
boot/image-board.c
include/image.h