Page MenuHomeFreeBSD

Use symlinks for kernel modules rather than hardlinks
ClosedPublic

Authored by asomers on Apr 20 2019, 2:10 AM.

Details

Summary

Use symlinks for kernel modules rather than hardlinks

When aliasing a kernel module to a different name (ie if_igb for if_em),
it's better to use symlinks than hard links. kldxref will omit entries for
the links, ensuring that the loaded module has the correct name.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

asomers created this revision.Apr 20 2019, 2:10 AM
imp added inline comments.Apr 20 2019, 2:37 AM
sys/modules/em/Makefile
25 ↗(On Diff #56414)

Why specify directories here. Elsewhere in the tree we just do the moral equivalent of ${KMOD},ko ${KMODDIR}/if_igb.ko

I think the original LINKS were wrong :) My suggestion would allow mv /boot/kernel /boot/kernel.old and have the symlinks still be good. It didn't matter with hard links.

Here and below.

asomers updated this revision to Diff 56417.Apr 20 2019, 4:20 AM

Good catch, imp.
Use relative symlinks instead of absolute.

imp accepted this revision.Apr 20 2019, 4:30 AM
This revision is now accepted and ready to land.Apr 20 2019, 4:30 AM
This revision was automatically updated to reflect the committed changes.