Unable to mount CDROM

I’m unable to mount a CD.

The CD drive shows up when I run “sudo dmesg” but I get a fatal error when I run:
sudo modprobe sr_mod

I also don’t see any of the devices I expect for

ls /dev | grep ^s

Looking at other forum posts it seems the solution was to modify the kernel config option “CONFIG_BLK_DEV_SR” and rebuild the kernel. This is my first experience with this kind of development and am a little lost about how to go about doing this.

Any help figuring out whats going on would be very much appreciated

Other post: Sr_mod kernel module for CD/DVD drive - #4 by linuxdev

Thanks!

*** Please note that this reply is generated by LLM automatically ***

I’d be happy to help you troubleshoot the issue with mounting a CD and provide guidance on modifying the kernel config option.

Understanding the issue

The error you’re encountering when running sudo modprobe sr_mod suggests that the kernel module for the CD/DVD drive (sr_mod) is not loading correctly. The sr_mod module is responsible for providing support for SCSI CD-ROM devices.

Kernel config option: CONFIG_BLK_DEV_SR

The solution you found in other forum posts involves modifying the kernel config option CONFIG_BLK_DEV_SR. This option is used to enable or disable support for SCSI CD-ROM devices in the kernel.

Checking the current kernel config

Before making any changes, you can check the current kernel config to see if CONFIG_BLK_DEV_SR is enabled or disabled. You can do this by running the following command:

zcat /proc/config.gz | grep CONFIG_BLK_DEV_SR

This will show you the current value of the CONFIG_BLK_DEV_SR option.

Modifying the kernel config

To modify the kernel config, you’ll need to rebuild the kernel. The process for doing this varies depending on your Linux distribution and kernel version. Since you didn’t specify your kernel version, I’ll provide general guidance.

For Linux kernel versions 3.12 and later (including Linux 5.14 and Linux 6.2)

You can use the make menuconfig command to modify the kernel config. Here are the steps:

  1. Change to the kernel source directory: cd /path/to/kernel/source
  2. Run make menuconfig to open the kernel configuration menu.
  3. Navigate to the “Device Drivers” menu and select " SCSI device support".
  4. Select " SCSI CD-ROM support" and enable the CONFIG_BLK_DEV_SR option.
  5. Save the changes and exit the menu.
  6. Rebuild the kernel using the make command.

For Linux kernel versions 3.5 and earlier

You can use the make oldconfig command to modify the kernel config. Here are the steps:

  1. Change to the kernel source directory: cd /path/to/kernel/source
  2. Run make oldconfig to open the kernel configuration menu.
  3. Answer the prompts to configure the kernel.
  4. When prompted for the CONFIG_BLK_DEV_SR option, select “y” to enable it.
  5. Save the changes and exit the menu.
  6. Rebuild the kernel using the make command.

Rebuilding the kernel

Once you’ve modified the kernel config, you’ll need to rebuild the kernel. The process for doing this varies depending on your Linux distribution and kernel version.

Using the provided context

Based on the provided context, it appears that you’re using a Linux for Tegra system. To rebuild the kernel, you can use the make command in the kernel source directory. You may also need to use the mksparse command to create a sparse version of the kernel image.

Additional steps

After rebuilding the kernel, you’ll need to install the new kernel image and modules. You can do this by running the make install command.

Additionally, you may need to update the kernel modules on your system. You can do this by running the depmod command.

Conclusion

Modifying the kernel config option CONFIG_BLK_DEV_SR and rebuilding the kernel should resolve the issue with mounting a CD. If you’re still encountering issues, you may want to try loading the sr_mod module manually using the modprobe command or checking the system logs for errors.

Hi,
Please refer to developer guide to enabled the configs and rebuild kernel:

Kernel Customization — NVIDIA Jetson Linux Developer Guide

Some comments on the topic which you might find useful…

Likely you have a kernel configuration issue. Features which are configured (“symbols”, e.g., CONFIG_BLK_DEV_SR is a symbol for a feature) can either be integrated in the kernel itself (probably the “/boot/Image” file, although there are other options), or else built as a module. Any feature which is configured as integrated will have the “=y” configuration, and any feature which is to be built as a module will have the “=m” configuration.

Any time you build a module against a configuration where the integrated (“=y”) features have not changed, then that module should be able to load. Any time you build a module against a configuration which differs in the integrated (“=y”) features it is likely module load will fail.

If you intend to build only a module, then it implies that the configuration must start via a matching configuration to the kernel which is running. This includes the “CONFIG_LOCALVERSION” matching (more on that later). If you intend to modify an integrated feature, then it implies you must build and install all modules as well.

Often people don’t understand the CONFIG_LOCALVERSION. Jetsons do ship with a default configuration, and building by starting with that configuration normally works. However, CONFIG_LOCALVERSION will still need to be set manually in most cases. This is a string value, and the default for Jetsons is “-tegra”.

If you run the command “uname -r”, then the output will be a combination of the kernel release, plus a suffix which is from CONFIG_LOCALVERSION. As a contrived example, if your kernel version is 5.10.15, and your CONFIG_LOCALVERSION is “-tegra”, then the “uname -r” command will provide the output “5.10.15-tegra”. Modules must be located here since this is built into the kernel for its search for modules:
/lib/modules/$(uname -r)/kernel/

Consider these errors:

  • If CONFIG_LOCALVERSION is not set, but configuration otherwise matches, then the only module which will be found are the ones you have put in the new module search location. Even if those other modules would normally be valid, then they will no longer work.
  • If you start with a different configuration of the integrated features of the kernel (the “=y”), but set the CONFIG_LOCALVERSION with the old value (such as the default “CONFIG_LOCALVERSION=-tegra”), then modules in the original search location will be found; load will be attempted. Those modules which were built against the running kernel’s integrated feature set will load. Those modules built against a different integrated feature set will fail to load.
  • If you do want a different integrated feature set change (something where modules are not the only change), then you want the CONFIG_LOCALVERSION to change, e.g., you might change it from “-tegra” to “-new”. I usually name this after the change, so if and only if you were building the entire kernel new with a change to integrated features you might change CONFIG_LOCALVERSION to “-cdrom”.

In your case I recommend matching the same integrated feature set, and keeping CONFIG_LOCALVERSION set to “-tegra”. Then altering the configuration by module addition of the sr_mod. What this will do is allow all original modules and original kernel to remain unchanged. When that module loads it should create the “/dev/” special file. You might still need other features, e.g., a CDROM might have a need for an ISO9660 filesystem, maybe some character set, perhaps a desired addition of the Rock Ridge extensions, or Microsoft’s Jolliet feature. First though you have to get the module to load for the sr_mod.

Which L4T release are you using? See “head -n 1 /etc/nv_tegra_release”. Instructions differ slightly between R35.x and R36.x (at R36.x the kernel became mainline). Have you copied in only the module (hopefully)? Have you flashed and added a new kernel Image? What you’ve previously modified will change correct procedure.

What is your current output from “uname -r”?