I don't think examples of kernel source code belong in /usr/share/examples. That's for example config etc. to use with programs that are part of NetBSD; this is about extending the system by writing code rather than using the system. I think an example module belongs in the source tree as a module named example, with the intent that it exercise enough features to be useful as a reference to people who are already familiar with writing kernel code but unfamiliar with modules. It would make sense to build it, not so that it can be used, but to guard against bitrot. Presumably it will be small, so this shouldn't be troublesome. If it is in /usr/share/examples, it needs to be under /usr/share/examples/sys, because "module" is not well-bound in the system-wide namespace; these are specifically kernel modules, not modules for any of the other programs that do or could exist.
Attachment:
pgpYUJfYjt4sF.pgp
Description: PGP signature