1

I am trying to build kernel image in LEDE for Atmel at91 SAMA5D3 platforms and the compressed type is XZ. Once uImage is successfully, I transferred this image to my SD card and tried to boot up with it. However, the boot up is always failed with following message:

Booting uImage … The uImage compress type not supported SD/MMC: Failed to load image

I tried with some other’s image and that will work well so I am not sure if there is any kernel config I also need to enable or disable.

Could anyone help with this? Thanks!

1 Answers1

2

The message seems to indicate that whatever boot program that you're using to load the Linux kernel does not have any decompression capability.
Therefore instead of expecting the boot program to perform the decompression, you need to build a kernel image that is self-decompressing, i.e. a zImage.
If you insist, you can wrap the zImage in a uImage header, but since the zImage is self-extracting the image needs to be marked as "uncompressed".

Note that the file type uImage is produced by the U-Boot utility mkimage, and this type of image is for the benefit of U-Boot.
Other boot programs may or may not recognize a uImage.
Boot programs for ARM are expected to support zImage.

Your post is sparse in terms of details.
If all you did was select XZ instead of the default gzip for the Kernel compression mode in the kernel's menuconfig, and did build a zImage, then the mkimage was used with incorrect arguments.
A zImage within a uImage must be marked as "uncompressed".

sawdust
  • 16,103
  • 3
  • 40
  • 50
  • Thanks @sawdust! I got it, but is there any kernel config to mark the uImage as 'uncompressed' type? – user4826904 Sep 24 '17 at 18:19
  • *"there any kernel config to mark the uImage as 'uncompressed' type?"* -- No, because kernel config specifies how the kernel *is to be* built, and the **mkimage** command is performed *after* the kernel Image (and zImage) has been built. Study the **man** page for the **mkimage** command. The type of compression used is an argument to the **mkimage** command. **But maybe you're asking the wrong follow-up question.** Do you know exactly what kind of kernel image you have? – sawdust Sep 24 '17 at 23:38
  • Thanks. I have a uImage for my kernel image, the error message showed after the magic has been verified. So maybe I have to find where 'mkimage' is executed and check the arguments right? – user4826904 Sep 25 '17 at 00:58
  • *"I have a uImage for my kernel image"* -- We already know that you loaded a uImage; that was reported in the error message. By "kind of kernel image", I meant what is *in* the uImage. Re-read my answer and https://stackoverflow.com/questions/22322304/image-vs-zimage-vs-uimage and https://stackoverflow.com/questions/45314335/why-using-a-uimage-instead-of-a-zimage. What file was submitted in the **mkimage** command (which is probably executed from a make script)? Try a `grep` for "mkimage" in your build directory. – sawdust Sep 25 '17 at 05:51
  • Thanks @sawdust! Looks like I can use my kernel image with explicitly marking it as a uncompressed image. I did choose uncompressed type in kernel menuconfig but somehow it's overrided with some other configs. – user4826904 Sep 25 '17 at 08:50