【发布时间】:2021-12-08 15:25:44
【问题描述】:
我是内核社区的新手,我正在学习如何编译和安装 Linux 内核,但我无法安装它。我正在运行 6 核 Ryzen 5 和 Ubuntu 20.04 LTS,并且我的编译器使用 gcc。我当前的内核版本是 5.11.0-38-generic,我正在尝试编译和安装 5.14.14 版本。简而言之,我使用 Greg Kroah Heartman 的 Linux Kernel 作为指南。首先,我从 kernel.org 下载最新的主线内核。然后,我运行make menuconfig 为我的系统生成一个.config。接下来,我运行make -j12 编译内核,它运行良好并且没有返回任何错误。我一直在安装它时遇到麻烦。运行make install 后,我得到以下错误输出:
arch/x86/Makefile:148: CONFIG_X86_X32 enabled but no binutils support
sh ./arch/x86/boot/install.sh \
5.14.14 arch/x86/boot/bzImage \
System.map "/boot"
*** Missing file: arch/x86/boot/bzImage
*** You need to run "make" before "make install".
make[1]: *** [arch/x86/boot/Makefile:161: install] Error 1
make: *** [arch/x86/Makefile:280: install] Error 2
install.sh 告诉我我的 arch 目录中没有 bzImage 文件。我检查了,确实文件丢失了。我尝试查找“丢失的 bzImage 文件”,但找不到任何有用的信息。为什么 make 不生成一个大的 zImage 文件?
【问题讨论】:
-
安装部分需要root权限,即
sudo make modules_install && sudo make install。而且,也许您需要手动编译 bzImage,即在安装部分之前make bzImage -
我以 root 用户运行
make install并以非 root 用户身份编译,但它不起作用。我会在运行 make 之前尝试运行 make bzImage 看看它是否有效。
标签: gcc linux-kernel gnu-make ubuntu-12.04