Replaces https://reviews.freebsd.org/D37577
As per GitHub PR https://github.com/freebsd/freebsd-ports/pull/166
This is done (and tested) using devd rules.
It was suggested to try devfs for this but it is not suitable for two main reasons:
- devd allows putting the rule in a separate file only inside this port package, otherwise a patch to system devfs is not comfortable because devd rule refers to _tss user/group created during pkg install
- for some reasons, I made a quick test on pfSense 2.7.0 (freebsd:14-current) with devfs.rules by setting a new system default ruleset and extending the previous default ruleset with a new extra rule for tpm. It didn't work until I restarted devfs despite tpm.ko was correctly loaded during boot with tpm_load="YES". Not sure if pfSense is doing strange things with devfs or this tpm driver couldn't work with devfs
I would be happy to get help on devfs if you know how to handle the non-existing _tss user, and how to make it as portable as a package.