Build error with custom nerves firmware

I am trying to compile the nerves rpi custom firmware linux kernel with all USB handling modularized so I can disable it as I need for a USB hub project I am working on. I was able to follow the instructions here for customizing the kernel. But after modularizing the USB handling in the kernel I am getting some build errors.

Can anyone point me how to resolve these?

This commit contains my only changes from the nerves_system_rpi git.

Error:

** (Mix) The Nerves Docker build_runner encountered an error while building:

-----
dwc_otg_hcd_linux.c:(.text+0xa98): undefined reference to `usb_hcd_resume_root_hub'
/nerves/build/host/bin/armv6-nerves-linux-gnueabihf-ld: drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.o: in function `_complete':
dwc_otg_hcd_linux.c:(.text+0xb40): undefined reference to `usb_hcd_check_unlink_urb'
/nerves/build/host/bin/armv6-nerves-linux-gnueabihf-ld: dwc_otg_hcd_linux.c:(.text+0xb98): undefined reference to `usb_hcd_unlink_urb_from_ep'
/nerves/build/host/bin/armv6-nerves-linux-gnueabihf-ld: dwc_otg_hcd_linux.c:(.text+0xc70): undefined reference to `usb_hcd_unlink_urb_from_ep'
/nerves/build/host/bin/armv6-nerves-linux-gnueabihf-ld: dwc_otg_hcd_linux.c:(.text+0xc84): undefined reference to `usb_hcd_giveback_urb'
/nerves/build/host/bin/armv6-nerves-linux-gnueabihf-ld: drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.o: in function `hcd_init':
dwc_otg_hcd_linux.c:(.text+0xe4c): undefined reference to `usb_create_hcd'
/nerves/build/host/bin/armv6-nerves-linux-gnueabihf-ld: dwc_otg_hcd_linux.c:(.text+0xec8): undefined reference to `usb_add_hcd'
/nerves/build/host/bin/armv6-nerves-linux-gnueabihf-ld: dwc_otg_hcd_linux.c:(.text+0xef4): undefined reference to `usb_put_hcd'
/nerves/build/host/bin/armv6-nerves-linux-gnueabihf-ld: drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.o: in function `hcd_remove':
dwc_otg_hcd_linux.c:(.text+0xf54): undefined reference to `usb_remove_hcd'
/nerves/build/host/bin/armv6-nerves-linux-gnueabihf-ld: dwc_otg_hcd_linux.c:(.text+0xf74): undefined reference to `usb_put_hcd'
make[2]: *** [Makefile:1218: vmlinux] Error 1
make[1]: *** [package/pkg-generic.mk:293: /nerves/build/build/linux-custom/.stamp_built] Error 2
make: *** [Makefile:23: _all] Error 2

-----

See /Users/ej/Documents/pfist_usbhub_custom_rpi/build.log.

Think I figured it out, dwc_otg_hcd_linux is built as part of the Synopsis DWC host support feature. I had marked the USB Host Controller as module but could not mark the DWC host controller driver as a module.

It would still be nice to have the USB host controller loaded as a module rather than being built with the kernel so I could more easily experiment with writing my own, but I really think I just need all the USB Device Drivers disabled so I can talk to the USB devices exclusively.

1 Like