Sr_mod kernel module for CD/DVD drive

Dear Experts,

I just attempted to use my USB CD/DVD drive with my Xavier NX, and it seems to not work because the kernel is missing the sr_mod (SCSI Raw?) module. Can someone confirm? I believe the kernel config option is CONFIG_BLK_DEV_SR.

The kernel is 5.10.120-tegra, which I think is L4T 35.4.1.

Might additional modules be added in future updates? Note there may be more than one required to get this working.

I can’t answer specifically, but if you monitor “dmesg --follow”, and examine what appears as a result of plugging in the USB cable, what shows up? It would be most informative if you have a DVD in the drive at the time you connect the USB cable.

There are basically two sets of requirements:

  • The hardware support.
  • The filesystem type support for what is on the DVD you use.

Plug-in should provide clues. Very likely you can simply copy kernel loadable module files to the correct place for whichever support the dmesg says is missing. Step one is to see if a device is created, e.g., “/dev/sr0”, and step two is to see if the media itself can be interpreted.

Thanks for the reply but I know what’s missing (or at least the first thing that’s missing); it lacks the sr_mod (SCSI raw) module because CONFIG_BLK_DEV_SR is not set. dmesg shows that the USB-level stuff works but no sr0 device is created. If you or anyone else could check if this is still the case in newer kernel packages that would be useful. find /lib/modules -name 'sr_mod.ko' -print

This isn’t complete information, but it sounds like if you run this command:
zcat /proc/config.gz | grep 'CONFIG_BLK_DEV_SR'
…then it’ll show not configured.

Before I go further I’m going to describe module search. The kernel has a base version, and during build, someone would have set up a string for “CONFIG_LOCALVERSION” (this is what so many people fail to think of until module load fails). If your kernel is release 5.10.104, and if your CONFIG_LOCALVERSION was “-tegra” during that kernel build, then the command “uname -r” will output “5.10.104-tegra”. This means the kernel Image will search for modules at:
/lib/modules/$(uname -r)/kernel/
…which is:
/lib/modules/5.10.104-tegra/kernel/

Within that location the module file is in the same subdirectory as the subdirectory of the kernel source that built that module. If you fail to use the same kernel source version, or if you fail to set CONFIG_LOCALVERSION, then modules will fail to be found. The “/proc/config.gz” reflects the current configuration except for CONFIG_LOCALVERSION. The default for all Jetsons is:

CONFIG_LOCALVERSION="-tegra"

Please note that this is the first requirement to being able to simply build a module and copy it in place instead of replacing the entire kernel and 100% of the modules. The other requirement is that the integrated features of the kernel (those in the actual Image file) should be the same during the build of a module as that of the Image which will load those modules. If you were to build sr_mod.ko, but the source was not correctly configured to match the existing kernel, then the module would not load. If you were to build sr_mod.ko without a valid CONFIG_LOCALVERSION, then you can expect load to fail. If all of this is correct, then you can expect this to be as simple as a copy of the module as a file, and perhaps telling the kernel to note its presence.

When you build a kernel for a Jetson there is a configuration target “tegra_defconfig”. This, in combination with setting CONFIG_LOCALVERSION to “-tegra”, matches the default Jetson kernel.

The Jetson’s L4T release version is found via “head -n 1 /etc/nv_tegra_release”. You can find the kernel source that ships with that L4T release here:
https://developer.nvidia.com/linux-tegra
(the kernel source is a tar archive within another tar archive)

Documentation for cross compile also exists there. The installation information if far more complicated than what you actually need. Those instructions are for updating the flash software and installing this via flash. Just copy the .ko to the correct location in the subdirectory that mirrors the kernel source subdirectory the .ko is actually placed in. Then run “sudo depmod -a” (and maybe reboot). This adds your module without flash.

Do note that if you boot to external media, then there might be other requirements (especially if the content is required for boot and not just after the o/s is up and running).

Maybe someone else knows whether newer kernels include the sr_mod module???

Maybe an Nvidia person could comment on the possibility of enabling this in future L4T versions???

Please enable the config and build the kernel yourself.
We don’t by default enable everything.

All kernels have all drivers. Nobody will ship every driver with every release. Embedded systems are even more so this way since they have limited space. Adding a driver is more or less one of the basic functions regardless of o/s. The difference between doing this on some system like Windows is that you’d use an install disk or update through a web download that knows which driver is which. Linux can do much of this as well, but when you get to an alternate hardware architecture with a custom kernel this just isn’t practical. You will probably need to build the module via the specific kernel source version and configuration.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.