aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStephan Gerhold <stephan@gerhold.net>2021-07-01 20:33:16 +0200
committerTom Rini <trini@konsulko.com>2021-07-15 19:06:49 -0400
commitbc599042d4ca1a6c3956e86005c7be8debb8a2ff (patch)
tree107b517104cdc860960f15f58f97d5b10c209214 /common
parent4c531d9f58b19442780f9b209ab4ec23addd044a (diff)
downloadu-boot-bc599042d4ca1a6c3956e86005c7be8debb8a2ff.zip
u-boot-bc599042d4ca1a6c3956e86005c7be8debb8a2ff.tar.gz
u-boot-bc599042d4ca1a6c3956e86005c7be8debb8a2ff.tar.bz2
image: android: Automatically detect more compression types
At the moment android_image_get_kcomp() can automatically detect LZ4 compressed kernels and the compression specified in uImages. However, especially on ARM64 Linux is often compressed with GZIP. Attempting to boot an Android image with a GZIP compressed kernel image currently results in a very strange crash, e.g. Starting kernel ... "Synchronous Abort" handler, esr 0x02000000 ... Code: 5555d555 55555d55 555f5555 5d555d55 (00088b1f) Note the 1f8b, which are the "magic" bytes for GZIP images. U-Boot already has the image_decomp_type() function that checks for the magic bytes of bzip2, gzip, lzma and lzo. It's easy to make use of it here to increase the chance that we do the right thing and the user does not become confused with strange crashes. This allows booting Android boot images that contain GZIP-compressed kernel images. Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Diffstat (limited to 'common')
-rw-r--r--common/image-android.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/image-android.c b/common/image-android.c
index d07b0e0..1fbbbba 100644
--- a/common/image-android.c
+++ b/common/image-android.c
@@ -164,7 +164,7 @@ ulong android_image_get_kcomp(const struct andr_img_hdr *hdr)
else if (get_unaligned_le32(p) == LZ4F_MAGIC)
return IH_COMP_LZ4;
else
- return IH_COMP_NONE;
+ return image_decomp_type(p, sizeof(u32));
}
int android_image_get_ramdisk(const struct andr_img_hdr *hdr,