Kernel rebuild make clean or mrproper not removing object files "*.o"

Was the “=y” set from a configuration editor (such as “make menuconfig”)? If not, then dependencies will probably break. Also, I recommend a new CONFIG_LOCALVERSION and rebuilding all modules since you are integrating a feature which can be invasive to other drivers. Changing the output of “uname -r” is also a definitive method to know if the new kernel Image file is in place (remember, don’t use zImage on 64-bit Jetsons).

For specific questions you should also mention which L4T release this is being used in (see “head -n 1 /etc/nv_tegra_release”).

These expand on kernel build:

There are many ways to build the kernel. Related to your question, I recommend that in the original kernel source location that this be owned by root and not writable by anyone else (but readable). From there execute “sudo make mrproper”, which will make this a pristine source for anyone using it.

From then on, all compile operations would be best if performed by someone who is not root/sudo.

Once the source is pristine and only root can edit this, all commands would be with the “O=/some/where/temporary” option. Config editor changes, temporary output, so on, would end up there instead of in the source. The “/some/where/temporary” location would require write permission for whoever performs the build. Ten different developers could build their own content in their own home directories and never interfere with each other. Or one user could have ten different locations for ten different test configurations. Or one location could be recursively deleted to start over or to save space. In such a case, if you have configured the way you want, then the only file you need to back up before deleting that temp location is the “/some/where/temporary/.config” file (which is tiny, and each developer could share just that file).

Some notes:

  • make O=/some/where/temporary mrproper” will clean everything at the temp location, including removal of the .config.
  • make O=/some/where/temporary clean” will remove built temporary content at the temp location, but it will leave the .config in place.
  • If you have a saved read-only standard configuration saved as a “.config” file, then you can use a symbolic link or direct copy of that .config to the “O=/some/where/temporary” location to set up again.
  • If you want to start over all you have to do is recursively delete “/some/where/temporary”, recreate it, and build (if you have a saved “.config”, then just place that there).
  • Sometimes people modify the actual kernel source’s “tegra_defconfig” file when they get an option modification they like. This isn’t wrong, but you could instead just create a “tegra_custom” (or similar name) file and make that. It is dangerous in a multi-developer environment to change tegra_defconfig (this does work well for an individual developer).
  • I prefer to save my current .config and delete the entire temporary location. It is easy to script this, and to even have a git repository or subversion repo in the command to make sure you get the right .config when there is more than one.
  • It is easy to write a script which outputs the manual commands to perform for clean, build, so on, and when it works, have an option to actually do this (a “what if” default, and a “really do it” option).
1 Like