From a0d147ead12406fa4bf8bb8cdcfc31593982429b Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Jun 16 2023 18:11:31 +0000 Subject: Import openvswitch2.17-2.17.0-92 from Fast DataPath --- diff --git a/SOURCES/openvswitch-hugetlbfs.sysusers b/SOURCES/openvswitch-hugetlbfs.sysusers new file mode 100644 index 0000000..08b2fb1 --- /dev/null +++ b/SOURCES/openvswitch-hugetlbfs.sysusers @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +m openvswitch hugetlbfs diff --git a/SOURCES/openvswitch.sysusers b/SOURCES/openvswitch.sysusers new file mode 100644 index 0000000..a8d06aa --- /dev/null +++ b/SOURCES/openvswitch.sysusers @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u openvswitch - "Open vSwitch Daemons" / /sbin/nologin diff --git a/SPECS/openvswitch2.17.spec b/SPECS/openvswitch2.17.spec index b8afa7d..5729040 100644 --- a/SPECS/openvswitch2.17.spec +++ b/SPECS/openvswitch2.17.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.17.0 -Release: 91%{?dist} +Release: 92%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -80,6 +80,8 @@ Source: https://github.com/openvswitch/ovs/archive/%{commit}.tar.gz#/openvswitch %else Source: https://github.com/openvswitch/ovs/archive/v%{version}.tar.gz#/openvswitch-%{version}.tar.gz %endif +Source2: openvswitch.sysusers +Source3: openvswitch-hugetlbfs.sysusers Source10: https://fast.dpdk.org/rel/dpdk-%{dpdkver}.tar.xz %define docutilsver 0.12 @@ -131,7 +133,7 @@ BuildRequires: python-nose BuildRequires: gcc gcc-c++ make BuildRequires: autoconf automake libtool -BuildRequires: systemd-units openssl openssl-devel +BuildRequires: systemd-units systemd-rpm-macros openssl openssl-devel BuildRequires: python3-devel python3-setuptools BuildRequires: desktop-file-utils BuildRequires: groff-base graphviz @@ -169,10 +171,8 @@ Requires: openssl iproute module-init-tools #Requires: kernel >= 3.15.0-0 Requires: openvswitch-selinux-extra-policy -Requires(pre): shadow-utils +%{?sysusers_requires_compat} Requires(post): /bin/sed -Requires(post): /usr/sbin/usermod -Requires(post): /usr/sbin/groupadd Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units @@ -444,6 +444,11 @@ install -d -m 0755 $RPM_BUILD_ROOT%{_rundir}/openvswitch install -d -m 0750 $RPM_BUILD_ROOT%{_localstatedir}/log/openvswitch install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch +install -p -D -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysusersdir}/openvswitch.conf +%ifarch %{dpdkarches} +install -p -D -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysusersdir}/openvswitch-hugetlbfs.conf +%endif + install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \ $RPM_BUILD_ROOT%{_udevrulesdir}/91-vfio.rules @@ -576,16 +581,10 @@ rm -rf $RPM_BUILD_ROOT %endif %pre -getent group openvswitch >/dev/null || groupadd -r openvswitch -getent passwd openvswitch >/dev/null || \ - useradd -r -g openvswitch -d / -s /sbin/nologin \ - -c "Open vSwitch Daemons" openvswitch - +%sysusers_create_compat %{SOURCE2} %ifarch %{dpdkarches} - getent group hugetlbfs >/dev/null || groupadd hugetlbfs - usermod -a -G hugetlbfs openvswitch +%sysusers_create_compat %{SOURCE3} %endif -exit 0 %post if [ $1 -eq 1 ]; then @@ -740,6 +739,10 @@ exit 0 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs %endif +%{_sysusersdir}/openvswitch.conf +%ifarch %{dpdkarches} +%{_sysusersdir}/openvswitch-hugetlbfs.conf +%endif %if %{with ipsec} %files ipsec @@ -748,6 +751,13 @@ exit 0 %endif %changelog +* Fri Jun 16 2023 Timothy Redaelli - 2.17.0-92 +- redhat: Use sysusers instead of useradd/groupadd directly [RH git: aeeb5c020a] (#2193168) + Reported-at: https://bugzilla.redhat.com/2193168 + Reported-by: Dan Williams + Signed-off-by: Timothy Redaelli + + * Fri Jun 09 2023 Open vSwitch CI - 2.17.0-91 - Merging upstream branch-2.17 [RH git: 0e0cb5d889] Commit list: