0

I have a server with RHEL 7.5 OS. The inbox kernel version on the system is 4.14.0-49. I have a requirement to use the latest available kernel, so I downloaded the Kernel 4.17.18 source package and compiled it on my system. So now I have both the kernels in place.

However I cannot boot to the newly compiled kernel version 4.17.18, I see the following error message when I instruct it to boot.

        error: invalid magic number.
        error: you need to load the kernel first.

        Press any key to continue...

Here is the splash screen of the boot options available on my server. Fortunately I can still boot to the old kernel version(4.14.0-49) on my system.

  Red Hat Enterprise Linux Server (4.17.18) 7.5 (Maipo)
  Red Hat Enterprise Linux Server (4.14.0-49.el7a.aarch64) 7.5 (Maipo)
  Red Hat Enterprise Linux Server (0-rescue-68f1601b5f1c4eb09734921b3db38f

Is there a configuration step that I'm missing?

2
  • It seems you tried to load the wrong file. What are the names of your file and file file that works? What is the output of file for both files?
    – RalfFriedl
    Aug 28, 2018 at 5:28
  • I think new kernel is not able to chroot or not able to understand filesystem, can you try to mount with live media and try to boot manually?
    – asktyagi
    May 3, 2019 at 3:25

1 Answer 1

0

Looks like you try to load the wrong architecture kernel file aarch64 where your working kernel seems to be amd64. Use file command on the kernel images, or uname -a on a running system, to see what architecture you need, and use the proper version then.

aarch64 is related to ARM Processors.

4
  • My system's kernel architecture is aarch64. i download the kernel compilation source from this link - git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git. Aug 31, 2018 at 6:04
  • There is a difference in the file type between the newly compiled kernel(of type data) and the previous kernel(of type gzip compressed data). [root@localhost boot]# file * | grep vmlinuz vmlinuz: symbolic link to `/boot/vmlinuz-4.17.18' vmlinuz-0-rescue-68f1601b5f1c4eb09734921b3db38f87: gzip compressed data, from Unix, max compression vmlinuz-4.14.0-49.el7a.aarch64: gzip compressed data, from Unix, max compression vmlinuz-4.17.18: data Aug 31, 2018 at 6:12
  • It looks like you've used the uncompressed version. It should be possible to load that with bootloaders (which might need configuration changes), but I don't recommend doing it. The uncompressed file is ways bigger than the gzipped one, and will take ways longer to load during boot.
    – hargut
    Aug 31, 2018 at 13:33
  • As your target architecture is quite specific, I'd recommend to look through the location where you built the kernel, and check arch/aarch64/linux/boot. I expect that you can find the proper compressed file there. Typically this location contains several kernel images, often there is a bzImage which is compressed with bzip, one with zImage which should be gzipped, and the raw image often called vmlinux. It might be that you need to re-run your build command with something like make bzImage or make zImage to create these compressed files.
    – hargut
    Aug 31, 2018 at 13:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .