I need to use a CD/DVD drive with my AGX Orin running Jetson Linux 36.3. By following the instructions here:
Sr_mod kernel module for CD/DVD drive
Compiling a single kernel module
Kernel Customization - NVIDIA Jetson Linux Developer Guide
I attempted to compile the missing sr_mod.ko kernel module.
Here are the steps I followed:
1.Download and extract kernel sources for Jetson Linux 36.3 from Jetson Linux | NVIDIA Developer
2. Copy config from /proc/config.gz
3. Run make menuconfig
4. Set LOCALVERSION to “-tegra”
5. Set BLK_DEV_SR to “m”
6. Exit menuconfig
7. Run make -j12 modules_prepare
8. Run make -j12 modules
9. Copy the compiled sr_mod.ko to /lib/modules/5.15.136-tegra/kernel/drivers/scsi/sr_mod.ko
10. Copy the compiled cdrom.ko to /lib/modules/5.15.136-tegra/kernel/drivers/cdrom/cdrom.ko
11. Run sudo depmod -a
12. Attempt to use drive
This does not work due to an apparent version mismatch as reported in dmesg:
...
cdrom: disagrees about version of symbol kmalloc_caches
cdrom: Unknown symbol kmalloc_caches (err -22)
sr_mod: disagrees about version of symbol scsi_mode_sense
sr_mod: Unknown symbol scsi_mode_sense (err -22)
...
Existing modules and my compiled modules have the same vermagic as reported by modinfo, and everything matches uname -r
.
I have tried disabling MODVERSIONS and recompiling but then insmod reports insmod: ERROR: could not insert module drivers/scsi/sr_mod.ko: Invalid module format
.
I am also unable to compile just the missing modules by copying /lib/modules/5.15.136-tegra/build/Module.symvers then running make -j12 M=drivers/scsi
which reports ERROR: modpost: "<symbol>" [drivers/scsi/sr_mod.ko] undefined!
for every symbol in sr_mod.ko.
What am I doing wrong and is what I am trying to do even possible? I would like to avoid compiling a new kernel image and flashing that if at all possible.