Create a device file with default SELinux security context

mknod

  • Create block or character device special files.
    More information: <https://www.gnu.org/software/coreutils/mknod>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

sudo mknod -Z {{path/to/device_file}} {{type}} {{major_device_number}} {{minor_device_number}}

click the source code to copy install mknod on any operating system with command-not-found.com