0

I am trying to build kernel on VM. The kernel fails with these errors:

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 is 15580 bytes (padded to 15872 bytes).
System is 4761 kB
CRC c6afaf7f
Kernel: arch/x86/boot/bzImage is ready (#4)
Building modules, stage 2.
MODPOST 856 modules
ERROR:"put_tty_driver" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_unregister_driver"[ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_register_driver" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_set_operations" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_std_termios" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "__tty_alloc_driver" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_port_register_device" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_port_init" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_termios_baud_rate" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_port_open" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_insert_flip_string_fixed_flag" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko]undefined!
ERROR: "tty_flip_buffer_push" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "__tty_insert_flip_char" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_standard_install" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_port_close" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_port_hangup" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_port_tty_wakeup" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_port_put" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_unregister_device" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_vhangup" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_port_tty_get" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
ERROR: "tty_port_tty_hangup" [ubuntu/xr-usb-serial/xr_usb_serial_common.ko] undefined!
scripts/Makefile.modpost:92: recipe for target'__modpost' failed
make[1]: * [__modpost] Error 1
Makefile:1286: recipe for target 'modules' failed
make: *
[modules] Error 2

I found sombody having problem with USB drivers on this post Ubuntu 16.04.1 usbserial missing . But this doesnt help. I have downloaded neceaserry files for building the kernel from:
git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/bionic
, so there shouldnt be anything missing

  • It looks like you did something wrong when setting up the build environment but it's hard to guess from the error output alone. What exactly did you do? Which instructions did you follow? – Tilman Apr 11 at 12:36
  • Hi, well I am folowing: <embedded.com/getting-started-with-embedded-linux-part-five>, togeather with <wiki.ubuntu.com/Kernel/BuildYourOwnKernel>. I did remove some drivers in .config file (with make menufonfig), not sure if this could be caused by those changes – Darko Trogrlić Apr 11 at 13:18
  • No, removing a driver in make menuconfig shouldn't cause those errors. For one thing, make menuconfig manages dependencies and won't let you deselect a feature that is needed by some other feature you selected. What do you mean by "following together"? Those two recipes are quite different approaches, one using the fakeroot debian/rules command and the other, the standard kernel make mechanism. Mixing the two may well lead to problems. – Tilman Apr 11 at 13:39
  • The first one (embedded.com/getting-started-with-embedded-linux-part-five) mentions: "Each of the major distributions describes how they build a kernel. For Fedora, the description is on the Fedora Wiki and for Ubuntu it is available on the community site. Each of these will install the source used to build your VM system." – Darko Trogrlić Apr 11 at 13:48
  • I'm not sure the "BuildYourOwnKernel" page is what the author of "Getting started with Embedded Linux" had in mind when he wrote that. Okay, so what were the actual commands you used? – Tilman Apr 11 at 13:58
0

so the problem was my mistake (or my wrong presumption), I presumed that I can edit .config file with "make menuconfig" without worrying what should I include in compile, and what I could leave out. The idea in my head was that GUI would warn me if something must be included in the compile, because some features couldnt be NOT included in compile. The problem in the end was that I didnt include some features in the compile, so the xr_usb_serial_common.ko couldnt be generated. I found the solution by going through top answers of these two https://stackoverflow.com/questions/10476990/difference-between-o-and-ko-file , and https://stackoverflow.com/questions/7812418/kernel-driver-external-modules-not-building-completely . Hope it helps somebody

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.