CentOS 7:内核版本没有模块目录

CentOS 7:内核版本没有模块目录

我正在尝试编译并安装内核。下载代码并配置安装后,我已成功执行这些命令:

# make bzImage
# make modules
# make

但是当我尝试执行另一个命令时:

# make install

我有这个错误:

[root@Asterix linux-4.18.5]# make install
sh ./arch/x86/boot/install.sh 4.18.5 arch/x86/boot/bzImage \
        System.map "/boot"
depmod: ERROR: could not open directory /lib/modules/4.18.5: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
Kernel version 4.18.5 has no module directory /lib/modules/4.18.5
[root@Asterix linux-4.18.5]#

我究竟做错了什么?我该如何修复这个错误?

答案1

修复!!!

@Andy Dalton 给了我解决方案!创建新内核并安装它的正确命令顺序是:

# make
# make install modules_install

答案2

现代香草内核甚至包括几种格式的直接包装选项:

.../linux$ make help

[...]

Kernel packaging:
  rpm-pkg             - Build both source and binary RPM kernel packages
  binrpm-pkg          - Build only the binary kernel RPM package
  deb-pkg             - Build both source and binary deb kernel packages
  bindeb-pkg          - Build only the binary kernel deb package
  snap-pkg            - Build only the binary kernel snap package (will connect to external hosts)
  tar-pkg             - Build the kernel as an uncompressed tarball
  targz-pkg           - Build the kernel as a gzip compressed tarball
  tarbz2-pkg          - Build the kernel as a bzip2 compressed tarball
  tarxz-pkg           - Build the kernel as a xz compressed tarball

[...]

因此make binrpm-pkg应该直接构建一个(或几个)包以便于处理。

相关内容