Is it possible to deduplicate kernel's config and System.map between /boot and /lib/modules?

I’ve noticed the config and System.map files for a given kernel are presents in /boot and in /lib/modules … but, unlike symvers.xz, they’re not symlinks from /boot to /lib/modules files, hence are being duplicates. And please note, they’re both owned by kernel-core RPM package.

Could it possible to remove one copy and use a symlink like symvers.xz ?

If you did that then you’d not be able to boot anything, as you’d be trying to boot using files which only exist on a filesystem which was not yet mounted.

Therefore you’d have to have the symlinks going the other way with the originals on /boot and symlinks in /lib/modules/, which wouldn’t make your /boot any smaller.

The config and System.map files are located in /boot because they are installed there by Linux’s make install … and some tools then expect to find the files there (depmod for example expect to find System.map in /boot).

It’s unlikely the boot loader (grub) has a need to access kernel configuration (/boot/config) or symbol tables (/boot/System.map) in order to boot a Linux kernel.

Perhaps userspace need them later during initialisation. I will do the test.

Test complete: I’ve booted a kernel for which config and System.map were symlinks to /lib/modules files, and saw no issue. As I expected, the files are not required to boot and initialize the system.