1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-25 18:50:18 +03:00

udev: set clock group for PTP and RTC devices

Add a new group for clock devices to enable applications like linuxptp
to open clocks without root privileges.
This commit is contained in:
Miroslav Lichvar 2025-01-16 15:34:47 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 0ec19b311b
commit af96ccfc24
5 changed files with 8 additions and 1 deletions

3
README
View File

@ -368,7 +368,8 @@ USERS AND GROUPS:
need to be resolvable by getgrnam() at any time, even in the very early
boot stages, where no other databases and network are available:
audio, cdrom, dialout, disk, input, kmem, kvm, lp, render, tape, tty, video
audio, cdrom, clock, dialout, disk, input, kmem, kvm, lp, render, tape,
tty, video
During runtime, the journal daemon requires the "systemd-journal" system
group to exist. New journal files will be readable by this group (but

View File

@ -937,6 +937,7 @@ static_ugids = []
foreach option : ['adm-gid',
'audio-gid',
'cdrom-gid',
'clock-gid',
'dialout-gid',
'disk-gid',
'input-gid',

View File

@ -291,6 +291,8 @@ option('audio-gid', type : 'integer', value : 0,
description : 'soft-static allocation for the "audio" group')
option('cdrom-gid', type : 'integer', value : 0,
description : 'soft-static allocation for the "cdrom" group')
option('clock-gid', type : 'integer', value : 0,
description : 'soft-static allocation for the "clock" group')
option('dialout-gid', type : 'integer', value : 0,
description : 'soft-static allocation for the "dialout" group')
option('disk-gid', type : 'integer', value : 0,

View File

@ -10,6 +10,7 @@ SUBSYSTEM=="block", KERNEL=="md*", ENV{ID_IGNORE_DISKSEQ}="1"
SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"
SUBSYSTEM=="rtc", GROUP="clock", MODE="0660"
# select "system RTC" or just use the first one
SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc"
SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
@ -30,6 +31,7 @@ SUBSYSTEM=="pci|usb|platform", IMPORT{builtin}="path_id"
SUBSYSTEM=="net", IMPORT{builtin}="net_driver"
SUBSYSTEM=="ptp", GROUP="clock", MODE="0660"
SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK+="ptp_kvm"
SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK+="ptp_hyperv"

View File

@ -25,6 +25,7 @@ g utmp {{UTMP_GID }} - -
# Physical and virtual hardware access groups
g audio {{AUDIO_GID }} - -
g cdrom {{CDROM_GID }} - -
g clock {{CLOCK_GID }} - -
g dialout {{DIALOUT_GID}} - -
g disk {{DISK_GID }} - -
g input {{INPUT_GID }} - -