I am trying to work on the IIO driver by doing what is said
here, which is a collection of starter tasks for those new to kernel development. Anyway, so I begin by first updating my kernel source, and also selecting the .config options that they require. Then I built the source and am now running Linux version 5.7.0-rc1+ (it wasn't my first choice to build to the latest kernel, but I didn't know how to update my source otherwise). While that all worked fine, I keep receiving errors while trying to compile the modules to build kernel objects (.ko files). For example, when I run
Code:
make drivers/iio/dummy/iio_dummy.ko
. I receive this long list of modpost errors (here is the full output):
Code:
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
MODPOST 1 modules
ERROR: modpost: "iio_register_sw_device_type" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_trigger_notify_done" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_dummy_evgen_get_regs" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_kfifo_allocate" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_device_unregister" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_get_time_ns" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_triggered_buffer_postenable" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_dummy_evgen_get_irq" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "__iio_device_register" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_device_attach_buffer" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "config_group_init_type_name" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_unregister_sw_device_type" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_device_free" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_device_alloc" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_triggered_buffer_predisable" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_kfifo_free" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_dummy_evgen_release_irq" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_alloc_pollfunc" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_push_to_buffers" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_push_event" [drivers/iio/dummy/iio_dummy.ko] undefined!
ERROR: modpost: "iio_dealloc_pollfunc" [drivers/iio/dummy/iio_dummy.ko] undefined!
scripts/Makefile.modpost:94: recipe for target '__modpost' failed
make[1]: *** [__modpost] Error 1
Makefile:1701: recipe for target 'single_modpost' failed
make: *** [single_modpost] Error 2
By grepping the source for some of these symbols, I found that they are, as expected, all defined somewhere in the
subdirectory. AND by grepping my .config file for "IIO", I can see that, these are, in fact selected (not everything in the subsystem is selected, but everything necessary, I presume):
Code:
# CONFIG_SENSORS_IIO_HWMON is not set
CONFIG_IIO=m
CONFIG_IIO_BUFFER=y
CONFIG_IIO_BUFFER_CB=m
CONFIG_IIO_BUFFER_HW_CONSUMER=m
CONFIG_IIO_KFIFO_BUF=m
CONFIG_IIO_CONFIGFS=m
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
CONFIG_IIO_SW_DEVICE=m
CONFIG_IIO_SW_TRIGGER=m
# CONFIG_IIO_ST_ACCEL_3AXIS is not set
# Hid Sensor IIO Common
# end of Hid Sensor IIO Common
# IIO dummy driver
CONFIG_IIO_DUMMY_EVGEN=m
CONFIG_IIO_SIMPLE_DUMMY=m
CONFIG_IIO_SIMPLE_DUMMY_EVENTS=y
CONFIG_IIO_SIMPLE_DUMMY_BUFFER=y
# end of IIO dummy driver
# CONFIG_IIO_ST_GYRO_3AXIS is not set
# CONFIG_IIO_ST_LSM6DSX is not set
# CONFIG_IIO_ST_MAGN_3AXIS is not set
# CONFIG_IIO_HRTIMER_TRIGGER is not set
# CONFIG_IIO_INTERRUPT_TRIGGER is not set
# CONFIG_IIO_TIGHTLOOP_TRIGGER is not set
# CONFIG_IIO_SYSFS_TRIGGER is not set
# CONFIG_IIO_ST_PRESS is not set
I looked into what the Modpost step does at
https://www.kernel.org/doc/Documenta...ld/modules.txt and found that it essentially dives into the Module.symvers file to look through its recorded symbols, none of which are the ones the output says is missing (I grepped Module.symvers for "iio" and received no results).
Unfortunately, I'm at a loss for how to fix this. Could it be that I did not build the kernel properly with these settings? How else do I check? Most importantly, how do I export these symbols to the kernel so it knows to find them.
One final remark that may have some relevance is that I am unable to run
Code:
sudo apt-get install linux-headers-$(uname -r)
because it can't find the headers for my kernel version (5.7.0-rc1+).