create linuxptp user and /run/ptp directory
Related: RHEL-12183
This commit is contained in:
parent
e4f8767eea
commit
d8990e86aa
@ -18,6 +18,8 @@ Source2: ptp4l.service
|
||||
Source3: timemaster.service
|
||||
Source4: timemaster.conf
|
||||
Source5: ptp4l.conf
|
||||
Source6: linuxptp.sysusers
|
||||
Source7: linuxptp.tmpfiles
|
||||
# external test suite
|
||||
Source10: https://github.com/mlichvar/linuxptp-testsuite/archive/%{testsuite_ver}/linuxptp-testsuite-%{testsuite_ver}.tar.gz
|
||||
# simulator for test suite
|
||||
@ -48,7 +50,11 @@ Patch13: linuxptp-ppsmiss.patch
|
||||
|
||||
BuildRequires: gcc gcc-c++ gnutls-devel make systemd
|
||||
|
||||
# require the clock group to be defined
|
||||
Requires(pre): setup >= 2.14.5-7
|
||||
|
||||
%{?systemd_requires}
|
||||
%{?sysusers_requires_compat}
|
||||
|
||||
%if 0%{?with_selinux}
|
||||
Requires: (%{name}-selinux if selinux-policy-%{selinuxtype})
|
||||
@ -108,8 +114,11 @@ bzip2 -9 selinux/linuxptp.pp
|
||||
%makeinstall
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir}/sysconfig,%{_unitdir},%{_mandir}/man5}
|
||||
mkdir -p $RPM_BUILD_ROOT{%{_sysusersdir},%{_tmpfilesdir}}
|
||||
install -m 644 -p %{SOURCE1} %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}
|
||||
install -m 644 -p %{SOURCE4} %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}
|
||||
install -m 644 -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysusersdir}/linuxptp.conf
|
||||
install -m 644 -p %{SOURCE7} $RPM_BUILD_ROOT%{_tmpfilesdir}/linuxptp.conf
|
||||
|
||||
echo 'OPTIONS="-f /etc/ptp4l.conf"' > \
|
||||
$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ptp4l
|
||||
@ -132,7 +141,11 @@ export CLKNETSIM_RANDOM_SEED=26743
|
||||
%{make_build} -C clknetsim
|
||||
PATH=..:$PATH ./run
|
||||
|
||||
%pre
|
||||
%sysusers_create_package linuxptp %{SOURCE6}
|
||||
|
||||
%post
|
||||
%tmpfiles_create_package linuxptp %{SOURCE7}
|
||||
%systemd_post phc2sys.service ptp4l.service timemaster.service
|
||||
|
||||
%preun
|
||||
@ -171,6 +184,8 @@ fi
|
||||
%{_unitdir}/phc2sys.service
|
||||
%{_unitdir}/ptp4l.service
|
||||
%{_unitdir}/timemaster.service
|
||||
%{_sysusersdir}/linuxptp.conf
|
||||
%{_tmpfilesdir}/linuxptp.conf
|
||||
%{_sbindir}/hwstamp_ctl
|
||||
%{_sbindir}/nsm
|
||||
%{_sbindir}/phc2sys
|
||||
|
||||
3
linuxptp.sysusers
Normal file
3
linuxptp.sysusers
Normal file
@ -0,0 +1,3 @@
|
||||
#Type Name ID GECOS Home directory Shell
|
||||
u linuxptp - "linuxptp system user" /run/ptp /sbin/nologin
|
||||
m linuxptp clock
|
||||
1
linuxptp.tmpfiles
Normal file
1
linuxptp.tmpfiles
Normal file
@ -0,0 +1 @@
|
||||
d /run/ptp 0750 linuxptp linuxptp
|
||||
Loading…
Reference in New Issue
Block a user