从 3.7.5 升级到内核 3.7.6 时出现问题

从 3.7.5 升级到内核 3.7.6 时出现问题

内核 3.7.6 是否与 nvidia 驱动程序 313.18 兼容。我尝试通过 upubuntu 指南安装它,但出现错误。我尝试使用他们的修复程序,但它说找不到目录。有什么建议吗

这就是我得到的

Unpacking replacement linux-headers-3.7.6-030706-generic ...
Preparing to replace linux-headers-3.7.6-030706 3.7.6-030706.201302040006 (using linux-headers-3.7.6-030706_3.7.6-030706.201302040006_all.deb) ...
Unpacking replacement linux-headers-3.7.6-030706 ...
Selecting previously unselected package linux-image-3.7.6-030706-generic.
Unpacking linux-image-3.7.6-030706-generic (from linux-image-3.7.6-030706-generic_3.7.6-030706.201302040006_amd64.deb) ...
Done.
Selecting previously unselected package linux-image-extra-3.7.6-030706-generic.
Unpacking linux-image-extra-3.7.6-030706-generic (from linux-image-extra-3.7.6-030706-generic_3.7.6-030706.201302040006_amd64.deb) ...
Setting up linux-headers-3.7.6-030706 (3.7.6-030706.201302040006) ...
Setting up linux-image-3.7.6-030706-generic (3.7.6-030706.201302040006) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
ERROR (dkms apport): kernel package linux-headers-3.7.6-030706-generic is not supported
Error! Bad return status for module build on kernel: 3.7.6-030706-generic (x86_64)
Consult /var/lib/dkms/nvidia-313/313.18/build/make.log for more information.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
update-initramfs: Generating /boot/initrd.img-3.7.6-030706-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.7.6-030706-generic
Found initrd image: /boot/initrd.img-3.7.6-030706-generic
Found linux image: /boot/vmlinuz-3.7.5-030705-generic
Found initrd image: /boot/initrd.img-3.7.5-030705-generic
Found linux image: /boot/vmlinuz-3.7.4-030704-generic
Found initrd image: /boot/initrd.img-3.7.4-030704-generic
Found linux image: /boot/vmlinuz-3.7.3-030703-generic
Found initrd image: /boot/initrd.img-3.7.3-030703-generic
Found linux image: /boot/vmlinuz-3.7.2-030702-generic
Found initrd image: /boot/initrd.img-3.7.2-030702-generic
Found linux image: /boot/vmlinuz-3.7.1-030701-generic
Found initrd image: /boot/initrd.img-3.7.1-030701-generic
Found linux image: /boot/vmlinuz-3.7.0-030700-generic
Found initrd image: /boot/initrd.img-3.7.0-030700-generic
Found linux image: /boot/vmlinuz-3.7.0-7-generic
Found initrd image: /boot/initrd.img-3.7.0-7-generic
Found linux image: /boot/vmlinuz-3.7.0-4-generic
Found initrd image: /boot/initrd.img-3.7.0-4-generic
Found linux image: /boot/vmlinuz-3.6.10-030610-generic
Found initrd image: /boot/initrd.img-3.6.10-030610-generic
Found linux image: /boot/vmlinuz-3.6.9-030609-generic
Found initrd image: /boot/initrd.img-3.6.9-030609-generic
Found linux image: /boot/vmlinuz-3.5.0-19-generic
Found initrd image: /boot/initrd.img-3.5.0-19-generic
Found linux image: /boot/vmlinuz-3.5.0-17-generic
Found initrd image: /boot/initrd.img-3.5.0-17-generic
Found memtest86+ image: /boot/memtest86+.bin
done
Setting up linux-image-extra-3.7.6-030706-generic (3.7.6-030706.201302040006) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
ERROR (dkms apport): kernel package linux-headers-3.7.6-030706-generic is not supported
Error! Bad return status for module build on kernel: 3.7.6-030706-generic (x86_64)
Consult /var/lib/dkms/nvidia-313/313.18/build/make.log for more information.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
update-initramfs: Generating /boot/initrd.img-3.7.6-030706-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.7.6-030706-generic
Found initrd image: /boot/initrd.img-3.7.6-030706-generic
Found linux image: /boot/vmlinuz-3.7.5-030705-generic
Found initrd image: /boot/initrd.img-3.7.5-030705-generic
Found linux image: /boot/vmlinuz-3.7.4-030704-generic
Found initrd image: /boot/initrd.img-3.7.4-030704-generic
Found linux image: /boot/vmlinuz-3.7.3-030703-generic
Found initrd image: /boot/initrd.img-3.7.3-030703-generic
Found linux image: /boot/vmlinuz-3.7.2-030702-generic
Found initrd image: /boot/initrd.img-3.7.2-030702-generic
Found linux image: /boot/vmlinuz-3.7.1-030701-generic
Found initrd image: /boot/initrd.img-3.7.1-030701-generic
Found linux image: /boot/vmlinuz-3.7.0-030700-generic
Found initrd image: /boot/initrd.img-3.7.0-030700-generic
Found linux image: /boot/vmlinuz-3.7.0-7-generic
Found initrd image: /boot/initrd.img-3.7.0-7-generic
Found linux image: /boot/vmlinuz-3.7.0-4-generic
Found initrd image: /boot/initrd.img-3.7.0-4-generic
Found linux image: /boot/vmlinuz-3.6.10-030610-generic
Found initrd image: /boot/initrd.img-3.6.10-030610-generic
Found linux image: /boot/vmlinuz-3.6.9-030609-generic
Found initrd image: /boot/initrd.img-3.6.9-030609-generic
Found linux image: /boot/vmlinuz-3.5.0-19-generic
Found initrd image: /boot/initrd.img-3.5.0-19-generic
Found linux image: /boot/vmlinuz-3.5.0-17-generic
Found initrd image: /boot/initrd.img-3.5.0-17-generic
Found memtest86+ image: /boot/memtest86+.bin
done
Setting up linux-headers-3.7.6-030706-generic (3.7.6-030706.201302040006) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 3.7.6-030706-generic /boot/vmlinuz-3.7.6-030706-generic
ERROR (dkms apport): kernel package linux-headers-3.7.6-030706-generic is not supported
Error! Bad return status for module build on kernel: 3.7.6-030706-generic (x86_64)
Consult /var/lib/dkms/nvidia-313/313.18/build/make.log for more information.

答案1

感谢 cogitoergosum,效果很好!

conftest.sh在( )中编辑/usr/src/nvidia-current-310.19让我安装了带有 nvidia 310.19 的内核。

我注释掉了第 1703、1704 和 1706 行,使其看起来像这样:

PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
            SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
            # if [ -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \
            #         -a -n "$SUBLEVEL" -a $SUBLEVEL -le 5 ]; then
                SELECTED_MAKEFILE=Makefile.kbuild
                RET=0
            # fi
        fi

然后重新安装 nvidia 驱动程序(sudo apt-get install --reinstall nvidia-current),并确保在完成后保存了 conftest.sh 文件“ Unpacking replacement nvidia-current ...”。

瞧,内核模块构建完成了!

答案2

建议检查 /usr/src/nvidia-'version' 目录中的 conftest.sh。当 PATCHLEVEL 为 6 或更高版本时(本例中为 3.7.6),确定内核版本时会出现一个小问题。注释掉 (#) if 和 fi 行,保留 SELECTED_MAKEFILE 和 RET 行。重新安装内核头文件和映像 debs,nvidia.ko 应该可以正确构建。

更新:如果您还遇到了内核 3.7.* 和 virtualbox 之间的兼容性问题,解决方案是 1) 将 virtualbox 升级到 4.2.6 -或- 2) 修补 memobj-r0drv-linux.c 以将 VM_RESERVED 宏替换为 (VM_DONTEXPAND | VM_DONTDUMP)。祝你好运。

相关内容