Error: Failed to create mmap file: vmlinux

In a newly installed virtual machine, I get this error when compiling the kernel for the x86 architecture:

$ Could not mmap file: vmlinux $ make: *** [vmlinux] Error 1 

This is the first time I see it. I increased the size of /proc/sys/kernel/shmmax to 128 MB, but this does not solve the problem. Any ideas?

Thanks!:)

+7
linux kernel mmap
source share
2 answers

I had the same problem when compiling the kernel in a shared folder with a virtual box. The error occurs from the mmap_file() function in the source scripts/sortextable.c . In addition, all mmap failed to execute with errno EINVAL in the shared folder.

I fixed it with copying Linux sources to a non-shared folder like / home / Name / linux and compiled there.

+17
source share

I had the same problem compiling the Linux kernel in the VirtualBox shared folder, and I am making a small correction to the sortextable function on line 104 (+/-) from the script link-vmlinux.sh localized in the scripts / directory

I am changing this:

 sortextable() { ${objtree}/scripts/sortextable ${1} } 

for this:

 sortextable() { cp ${1} /tmp/.${1} scripts/sortextable /tmp/.${1} cp /tmp/.${1} ${1} } 

And it works for me!

+8
source share

All Articles