在虚拟机上为 Ubuntu 18.04 构建内核的问题

在虚拟机上为 Ubuntu 18.04 构建内核的问题

我正在尝试在虚拟机上构建内核。内核失败并出现以下错误:

AS arch/x86/boot/header.o
CC arch/x86/boot/version.o
LD arch/x86/boot/setup.elf
OBJCOPY arch/x86/boot/setup.bin
OBJCOPY arch/x86/boot/vmlinux.bin
BUILD arch/x86/boot/bzImage
Setup 为 15580 字节(填充为 15872 字节)。
系统为 4761 kB
CRC c6afaf7f
内核:arch/x86/boot/bzImage 已准备就绪(#4)
构建模块,第 2 阶段。MODPOST
856 个模块
错误:“put_tty_driver” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_unregister_driver”[ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_register_driver”[ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_set_operations”[ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_std_termios”[ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“__tty_alloc_driver”[ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_port_register_device” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_port_init” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_termios_baud_rate” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_port_open” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_insert_flip_string_fixed_flag” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_flip_buffer_push” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“__tty_insert_flip_char” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_standard_install” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_port_close” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_port_hangup” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_port_tty_wakeup” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_port_put” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_unregister_device” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_vhangup” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_port_tty_get” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
错误:“tty_port_tty_hangup” [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] 未定义!
scripts/Makefile.modpost:92:目标 '__modpost' 的配方
make[1] 失败:* [__modpost] 错误 1
​​Makefile:1286:目标“模块”的配方失败
:*
[模块] 错误 2

我发现有人在这篇文章中遇到了 USB 驱动程序问题Ubuntu 16.04.1 usbserial 丢失
。但这没有帮助。我已经从git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/bionic下载了构建内核所需的文件
,因此应该不会缺少任何东西

答案1

所以问题出在我的错误(或错误的假设)上,我假设我可以使用“make menuconfig”编辑 .config 文件,而不必担心我应该在编译中包含什么,以及我可以省略什么。我脑子里的想法是,如果编译中必须包含某些内容,GUI 会警告我,因为有些功能不能不包含在编译中。最终的问题是我没有在编译中包含某些功能,因此无法生成 xr_usb_serial_common.ko。我通过查看这两个问题的顶级答案找到了解决方案https://stackoverflow.com/questions/10476990/difference-between-o-and-ko-file , 和https://stackoverflow.com/questions/7812418/kernel-driver-external-modules-not-building-completely .希望它能帮助到别人

相关内容