我正在尝试从源代码编译最新的内核,但出现了错误

我正在尝试从源代码编译最新的内核,但出现了错误

因此我遵循这个指南:http://kernelnewbies.org/OPWfirstpatchSetup

我按照步骤从源代码安装了内核。当我启动新内核时,Ubuntu 加载成功,但随后只出现黑屏。

这是我运行后得到的输出结果sudo make modules_install install

  DEPMOD  3.17.0-rc6+
sh ./arch/x86/boot/install.sh 3.17.0-rc6+ arch/x86/boot/bzImage \
        System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.17.0-rc6+ /boot/vmlinuz-3.17.0-rc6+
run-parts: executing /etc/kernel/postinst.d/dkms 3.17.0-rc6+ /boot/vmlinuz-3.17.0-rc6+
Error! Bad return status for module build on kernel: 3.17.0-rc6+ (x86_64)
Consult /var/lib/dkms/nvidia-331/331.38/build/make.log for more information.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.17.0-rc6+ /boot/vmlinuz-3.17.0-rc6+
update-initramfs: Generating /boot/initrd.img-3.17.0-rc6+
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.17.0-rc6+ /boot/vmlinuz-3.17.0-rc6+
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.17.0-rc6+ /boot/vmlinuz-3.17.0-rc6+
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.17.0-rc6+ /boot/vmlinuz-3.17.0-rc6+
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.17.0-rc6+
Found initrd image: /boot/initrd.img-3.17.0-rc6+
Found linux image: /boot/vmlinuz-3.13.0-36-generic
Found initrd image: /boot/initrd.img-3.13.0-36-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda3
done

看起来我遇到了错误。以下是 /var/lib/dkms/nvidia-331/331.38/build/make.log 输出的结尾:

make -f ./scripts/Makefile.fwinst obj=firmware __fw_modbuild
NVIDIA: left KBUILD.
 nvidia.ko failed to build!
make[2]: *** [nvidia.ko] Error 1

不幸的是,make.log这个文件有 23MB,所以我不能全部分享。

如果有人想查看的话,这是压缩的 make.log:http://www.filedropper.com/makelog

我该如何修复这个错误,以便能够成功编译内核,并在我的 Ubuntu 机器上运行它?

答案1

内核编译并安装成功,只有 nvidia 驱动程序编译失败,很可能是因为它与该版本的内核不兼容。如果您希望 nvidia 驱动程序与新内核兼容,则必须找到并安装较新版本的驱动程序。

相关内容