TL;DR: choose mdev
as your device manager, and use the tty
group instead of dialout
.
The kernel's devtmpfs
creates device nodes with a default name, owner and permissions. It also sends out a uevent
when the node is created, which allows a uevent handler to change the name, ownership or permissions, or do anything else it wants. Previously this was called the hotplug system, but nowadays it's much more generic.
Buildroot offers the choice between three uevent handlers: mdev
, which is part of busybox, eudev
which is a standalone udev
fork, and udev
which is part of the systemd
init system. These handlers are configured with rules files that specify what to do with a specific type of device when it appears.
For your specific need, mdev
is the best choice since it is very simple, easy to understand, doesn't take up much space, and the default configuration is sufficient. In Buildroot's menuconfig, go to System configuration → /dev management and select Dynamic using mdev. Then rebuild your root filesystem. It will now be populated with the mdev
binary (part of busybox
), an init script to start it, and a default rules file in /etc/mdev.conf
. This default file contains:
tty[0-9]* root:tty 660
This means that the tty
devices will get their group changed to tty
and their permissions to group read and write. So you can just make sure that the logged in user belongs to the tty
group, and Bob's your uncle.
If the default mdev.conf
file is not sufficient for you (for instance, if you really need the group to be dialout
), then you can create a filesystem overlay, copy package/busybox/mdev.conf
to /etc/mdev.conf
and modify it as needed. Full documentation on the mdev.conf
format can be found in the busybox sources.