uImage is not supported in kexec_file

35 views Asked by At

I have pulled vanilla linux kernel 6.5.0 from upstream and compiled it using defconfig for arm64 target. I have used latest buildroot (Feb 2024 release) for rootfs.

So far I am able to boot this kernel image and rootfs on qemu-system-aarch64 and standing at busybox shell. So far so good.

The problem is that I am not able to load my crashkernel into memory :

# kexec --type uImage -p /uImage --append="console=ttyAMA0,115200n8 root=/dev/nf
s rw nfsroot=10.105.226.234:/home/user/nfsroot/rootfs-buildroot-arm64/,nolock,
vers=4,tcp ip=10.105.226.235"
uImage is not supported in kexec_file
Cannot load /uImage
#
# file /uImage
uImage: u-boot legacy uImage, Linux Kernel Image, Linux/ARM 64-bit, OS Kernel Image (Not compressed), 41095680 bytes, Wed Mar 13 17:30:02 2024, Load Address: 0X40400000, Entry Point: 0X40400000, Header CRC: 0X81580154, Data CRC: 0X545CE003

If I use Image version instead of uImage then it works fine.

user@workstation:~/.repos/src/arm64/linux/arch/arm64/boot$ file Image
Image: Linux kernel ARM64 boot executable Image, little-endian, 4K pages

What's wrong in the first usage?

My kexec clearly says that uImage is supported :

Supported kernel file types and options:
vmlinux
     An ARM64 ELF image, big or little endian.
     Typically vmlinux or a stripped version of vmlinux.

Image
     An ARM64 binary image, compressed or not, big or little endian.
     Typically an Image file.

uImage
     An ARM64 U-boot uImage file, compressed or not, big or little endian.

vmlinuz
     An ARM64 vmlinuz, PE image of a compressed, little endian.
     kernel, built with ZBOOT enabled.

EDIT

Following approach is used to prepare the uImage.

${CROSS_COMPILE}objcopy -O binary -R .note -R .comment -S vmlinux linux.bin
mkimage -A arm64 -O linux -T kernel -C none -a 0x40400000 -e 0x40400000 -n "Linux Kernel Image" -d linux.bin uImage
0

There are 0 answers