Bultin to loadable driver module without recompile

Can you specify is there any option to replace built-in driver module to loadable without recompile the kernel image on jetson nano? If yes, can you mention the steps?

If a driver is built in, then it cannot be unloaded. This is mandatory before adding the driver. Which driver symbol are you speaking of? You can search for the current symbol configuration via:
zcat /proc/config.gz

If for example you had some driver with “SCSI” in the symbol, you could do this:
zcat /proc/config.gz | egrep -i 'scsi'

Mostly though I’m suspecting you won’t be able to do this. If you do convert to a module, beware that you need to use a dependency-aware editor, e.g., the “nconfig” or “menuconfigmake target.

You can search for the current symbol configuration via:
zcat /proc/config.gz

symbol loaded is Y

Mostly though I’m suspecting you won’t be able to do this. If you do convert to a module, beware that you need to use a dependency-aware editor, e.g., the “nconfig” or “menuconfigmake target.

Can you clarify this point?

So can we conclude that without recompile, there is no option to make the module loadable from the device itself?

I don’t see how this is possible.

@DaveYYY It would be fine for us if there was an option to not load the built-in kernel module, our aim is to avoid recompile the image

NO.
This is impossible.

When built in it is not a module. You cannot unload a module if it isn’t a module. You could blacklist a driver, and that might help your situation, but you could not load it dynamically (you’d have to remove blacklist and reboot to then use it). I’m also not sure how blacklist would work with an integrated driver.

What is it you want to accomplish? Are you experimenting with something in conflict? Are you working with an alternative driver? Without knowing more it isn’t likely we can say anything particularly useful other than “you can’t do that”.

In terms of what I see now, you would have to take the configuration of the existing kernel, edit the driver you are interested in to either be a module format (the “=y” means it is integrated) without modifying other configuration, and then rebuild and install the entire kernel and all modules. The method of editing would be the make target of either nconfig or menuconfig (these understand dependencies and will disable or enable other features needed to avoid conflicts). Do be aware that not all features can be a module, and not all features can be integrated. It just depends on how the feature was written, although most can be a module (an example of something which cannot be a module is the invasive ability to use virtual memory, e.g., swap).

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