简体   繁体   English

错误:无法mmap文件:vmlinux

[英]Error: Could not mmap file: vmlinux

In a newly installed virtual machine I get this error when compiling the kernel for the x86 architecture: 在新安装的虚拟机中,我在编译x86架构的内核时遇到此错误:

$ Could not mmap file: vmlinux

$ make: *** [vmlinux] Error 1

It is the first time I see it. 这是我第一次看到它。 I have increased the size of /proc/sys/kernel/shmmax to 128MB, but it does not solve the issue. 我已将/proc/sys/kernel/shmmax的大小增加到128MB,但它没有解决问题。 Any ideas? 有任何想法吗?

Thanks! 谢谢! :) :)

I had the same issue when compiling kernel in virtual box shared folder. 在虚拟盒共享文件夹中编译内核时遇到了同样的问题。 Error comes from mmap_file() function in source file scripts/sortextable.c . 错误来自源文件scripts/sortextable.c mmap_file()函数。 Moreover, all mmap functions failed with errno EINVAL within shared folder. 此外,所有mmap函数都在共享文件夹中使用errno EINVAL失败。

I fixed it with copying linux sources into non shared folder like /home/Name/linux and compiled there. 我修复了它将linux源复制到非共享文件夹,如/ home / Name / linux并在那里编译。

I had the same problem compiling linux kernel on the VirtualBox shared folder here and I make a little fix in the function sortextable at line 104 (+/-) of script link-vmlinux.sh localized in scripts/ directory 我在VirtualBox共享文件夹上编译linux内核时遇到了同样的问题,我在脚本/目录中本地化的脚本link-vmlinux.sh的第104行(+/-)函数sortextable中做了一些修复。

I change this: 我改变了这个:

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

for this: 为了这:

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

And works for me! 并为我工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM