DEVFS.RULES(5)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1, nixpkgs unstable

🌸 NAME 🌸

devfs.rules β€” devfs configuration information πŸ’–

okay bestie, welcome to devfs.rules(5) from the File Formats Manual β€” this is the page that makes devfs rules feel like main character energy πŸ’…βœ¨


πŸ’– DESCRIPTION πŸ’–

the devfs.rules file is your easy-peasy way to create and apply devfs(8) rules, even for devices that are not available at boot. for devices that are available at boot, see devfs.conf(5) πŸ‘€

the format of this file is simple, no cap. empty lines and lines beginning with a hash sign (#) are ignored. a line between brackets denotes the start of a ruleset. in the brackets should be the name of the ruleset and its number, separated by an equal sign πŸŽ€

other lines are rule specifications as documented in devfs(8), in the section β€œRule Specification”. these lines are prepended with rule and are passed to devfs(8) by the startup scripts of the system.

important: it is important to put path elements that contain glob(3) special characters between quotes 🧚

rulesets should have a unique name and number. all rules that follow a ruleset declaration belong to that ruleset, until a new ruleset is started. periodt. πŸ’…

one custom ruleset has to be enabled in /etc/rc.conf, otherwise it will not be applied to the /dev file system by the default system startup process. for example, to enable a β€œlocalrules” ruleset for the /dev file system, you would have to use something like this in your rc.conf file:

devfs_system_ruleset="localrules"

the rules are loaded at boot via the devfs service. to load modified rules after the system has booted, run the command:

service devfs restart

πŸŽ€ FILES πŸŽ€

  • /etc/defaults/devfs.rules β€” Default devfs.rules configuration file πŸ“
  • /etc/devfs.rules β€” Local devfs.rules configuration file. Rulesets in here override those in /etc/defaults/devfs.rules with the same ruleset number, otherwise the two files are effectively merged πŸ’–

πŸ¦‹ EXAMPLES πŸ¦‹

to make all the partitions of da(4) devices readable and writable by their owner and the β€œusb” group, the following rule may be used:

[localrules=10]
add path 'da*s*' mode 0660 group usb

The first line declares and starts a new ruleset, with the name localrules and the number 10 ✨

to give usbconfig(8) and libusb(3) enabled applications permission to all usb devices for their owner and the β€œusb” group, a similar rule may be used:

add path 'usb/*' mode 0660 group usb

πŸ”₯ SEE ALSO πŸ”₯


πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Roland Smith (rsmith@xs4all.nl) 🫢


πŸ’– and that’s the whole DEVFS.RULES(5) vibe β€” source/version: Debian, dated December 1, 2020. now go make /dev iconic, bestie πŸŽ€βœ¨

πŸ“¦ where this page comes from