Merge pull request #5593 from ton31337/feature/rhel8_rpm

packaging: Add CentOS 8 support
This commit is contained in:
Donald Sharp 2020-01-01 08:35:31 -05:00 committed by GitHub
commit 62accebf8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 201 additions and 7 deletions

View File

@ -0,0 +1,156 @@
CentOS 8
========
This document describes installation from source. If you want to build an RPM,
see :ref:`packaging-redhat`.
Install required packages
-------------------------
Add packages:
::
sudo dnf install --enablerepo=PowerTools git autoconf pcre-devel \
automake libtool make readline-devel texinfo net-snmp-devel pkgconfig \
groff pkgconfig json-c-devel pam-devel bison flex python2-pytest \
c-ares-devel python2-devel systemd-devel libcap-devel
.. include:: building-libyang.rst
Get FRR, compile it and install it (from Git)
---------------------------------------------
**This assumes you want to build and install FRR from source and not
using any packages**
Add frr groups and user
^^^^^^^^^^^^^^^^^^^^^^^
::
sudo groupadd -g 92 frr
sudo groupadd -r -g 85 frrvty
sudo useradd -u 92 -g 92 -M -r -G frrvty -s /sbin/nologin \
-c "FRR FRRouting suite" -d /var/run/frr frr
Download Source, configure and compile it
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(You may prefer different options on configure statement. These are just
an example.)
::
git clone https://github.com/frrouting/frr.git frr
cd frr
./bootstrap.sh
./configure \
--bindir=/usr/bin \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--libdir=/usr/lib/frr \
--libexecdir=/usr/lib/frr \
--localstatedir=/var/run/frr \
--with-moduledir=/usr/lib/frr/modules \
--enable-snmp=agentx \
--enable-multipath=64 \
--enable-user=frr \
--enable-group=frr \
--enable-vty-group=frrvty \
--enable-systemd=yes \
--disable-exampledir \
--disable-ldpd \
--enable-fpm \
--with-pkg-git-version \
--with-pkg-extra-version=-MyOwnFRRVersion \
SPHINXBUILD=/usr/bin/sphinx-build
make
make check
sudo make install
Create empty FRR configuration files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
sudo mkdir /var/log/frr
sudo mkdir /etc/frr
sudo touch /etc/frr/zebra.conf
sudo touch /etc/frr/bgpd.conf
sudo touch /etc/frr/ospfd.conf
sudo touch /etc/frr/ospf6d.conf
sudo touch /etc/frr/isisd.conf
sudo touch /etc/frr/ripd.conf
sudo touch /etc/frr/ripngd.conf
sudo touch /etc/frr/pimd.conf
sudo touch /etc/frr/nhrpd.conf
sudo touch /etc/frr/eigrpd.conf
sudo touch /etc/frr/babeld.conf
sudo chown -R frr:frr /etc/frr/
sudo touch /etc/frr/vtysh.conf
sudo chown frr:frrvty /etc/frr/vtysh.conf
sudo chmod 640 /etc/frr/*.conf
Install daemon config file
^^^^^^^^^^^^^^^^^^^^^^^^^^
::
sudo install -p -m 644 redhat/daemons /etc/frr/
sudo chown frr:frr /etc/frr/daemons
Edit /etc/frr/daemons as needed to select the required daemons
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Look for the section with ``watchfrr_enable=...`` and ``zebra=...`` etc.
Enable the daemons as required by changing the value to ``yes``
Enable IP & IPv6 forwarding
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Create a new file ``/etc/sysctl.d/90-routing-sysctl.conf`` with the
following content:
::
# Sysctl for routing
#
# Routing: We need to forward packets
net.ipv4.conf.all.forwarding=1
net.ipv6.conf.all.forwarding=1
Load the modified sysctl's on the system:
::
sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
Install frr Service and redhat init files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
sudo install -p -m 644 redhat/frr.service /usr/lib/systemd/system/frr.service
sudo install -p -m 755 redhat/frr.init /usr/lib/frr/frr
Register the systemd files
^^^^^^^^^^^^^^^^^^^^^^^^^^
::
sudo systemctl preset frr.service
Enable required frr at startup
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
sudo systemctl enable frr
Reboot or start FRR manually
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
sudo systemctl start frr

View File

@ -10,6 +10,7 @@ Building FRR
building-frr-for-alpine building-frr-for-alpine
building-frr-for-centos6 building-frr-for-centos6
building-frr-for-centos7 building-frr-for-centos7
building-frr-for-centos8
building-frr-for-debian8 building-frr-for-debian8
building-frr-for-debian9 building-frr-for-debian9
building-frr-for-fedora building-frr-for-fedora

View File

@ -3,7 +3,7 @@
Packaging Red Hat Packaging Red Hat
================= =================
Tested on CentOS 6, CentOS 7 and Fedora 24. Tested on CentOS 6, CentOS 7, CentOS 8 and Fedora 24.
1. On CentOS 6, refer to :ref:`building-centos6` for details on installing 1. On CentOS 6, refer to :ref:`building-centos6` for details on installing
sufficiently up-to-date package versions to enable building FRR. sufficiently up-to-date package versions to enable building FRR.
@ -22,13 +22,31 @@ Tested on CentOS 6, CentOS 7 and Fedora 24.
yum install systemd-devel yum install systemd-devel
.. note::
For CentOS 8 you need to install ``platform-python-devel`` package
to provide ``/usr/bin/pathfix.py``::
yum install platform-python-devel
.. warning::
``python2-sphinx`` is not shipped for CentOS 8.
Development reached the end of life for Python 2.
We need to install it using ```pip``::
pip2 install sphinx
If ``yum`` is not present on your system, use ``dnf`` instead. If ``yum`` is not present on your system, use ``dnf`` instead.
3. Checkout FRR:: You should enable ``PowerTools`` repo if using CentOS 8 which
is disabled by default.
4. Checkout FRR::
git clone https://github.com/frrouting/frr.git frr git clone https://github.com/frrouting/frr.git frr
4. Run Bootstrap and make distribution tar.gz:: 5. Run Bootstrap and make distribution tar.gz::
cd frr cd frr
./bootstrap.sh ./bootstrap.sh
@ -40,7 +58,7 @@ Tested on CentOS 6, CentOS 7 and Fedora 24.
The only ``configure`` option respected when building RPMs is The only ``configure`` option respected when building RPMs is
``--with-pkg-extra-version``. ``--with-pkg-extra-version``.
5. Create RPM directory structure and populate with sources:: 6. Create RPM directory structure and populate with sources::
mkdir rpmbuild mkdir rpmbuild
mkdir rpmbuild/SOURCES mkdir rpmbuild/SOURCES
@ -48,7 +66,7 @@ Tested on CentOS 6, CentOS 7 and Fedora 24.
cp redhat/*.spec rpmbuild/SPECS/ cp redhat/*.spec rpmbuild/SPECS/
cp frr*.tar.gz rpmbuild/SOURCES/ cp frr*.tar.gz rpmbuild/SOURCES/
6. Edit :file:`rpm/SPECS/frr.spec` with configuration as needed. 7. Edit :file:`rpm/SPECS/frr.spec` with configuration as needed.
Look at the beginning of the file and adjust the following parameters to Look at the beginning of the file and adjust the following parameters to
enable or disable features as required:: enable or disable features as required::
@ -73,7 +91,7 @@ Tested on CentOS 6, CentOS 7 and Fedora 24.
%{!?with_pimd: %global with_pimd 1 } %{!?with_pimd: %global with_pimd 1 }
%{!?with_rpki: %global with_rpki 0 } %{!?with_rpki: %global with_rpki 0 }
7. Build the RPM:: 8. Build the RPM::
rpmbuild --define "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/frr.spec rpmbuild --define "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/frr.spec

View File

@ -169,9 +169,15 @@ BuildRequires: libyang-devel >= 0.16.74
BuildRequires: python27-devel BuildRequires: python27-devel
BuildRequires: python27-sphinx BuildRequires: python27-sphinx
%else %else
%if 0%{?rhel} && 0%{?rhel} > 7
BuildRequires: python2-devel
#platform-python-devel is needed for /usr/bin/pathfix.py
BuildRequires: platform-python-devel
%else
BuildRequires: python-devel >= 2.7 BuildRequires: python-devel >= 2.7
BuildRequires: python-sphinx BuildRequires: python-sphinx
%endif %endif
%endif
Requires: initscripts Requires: initscripts
%if %{with_pam} %if %{with_pam}
BuildRequires: pam-devel BuildRequires: pam-devel
@ -217,8 +223,13 @@ Contributed/3rd party tools which may be of use with frr.
%package pythontools %package pythontools
Summary: python tools for frr Summary: python tools for frr
%if 0%{?rhel} && 0%{?rhel} > 7
BuildRequires: python2
Requires: python2-ipaddress
%else
BuildRequires: python BuildRequires: python
Requires: python-ipaddress Requires: python-ipaddress
%endif
Group: System Environment/Daemons Group: System Environment/Daemons
%description pythontools %description pythontools
@ -397,6 +408,11 @@ install -m644 %{zeb_rh_src}/frr.pam %{buildroot}%{_sysconfdir}/pam.d/frr
install -m644 %{zeb_rh_src}/frr.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/frr install -m644 %{zeb_rh_src}/frr.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/frr
install -d -m750 %{buildroot}%{rundir} install -d -m750 %{buildroot}%{rundir}
%if 0%{?rhel} && 0%{?rhel} > 7
# avoid `ERROR: ambiguous python shebang in` errors
pathfix.py -pni "%{__python2} %{py2_shbang_opts}" %{buildroot}/usr/lib/frr/*.py
%py_byte_compile %{__python2} %{buildroot}/usr/lib/frr/*.py
%endif
%pre %pre
# add vty_group # add vty_group
@ -682,7 +698,10 @@ fi
%changelog %changelog
* Sun May 28 2018 Rafael Zalamena <rzalamena@opensourcerouting.org> - %{version} * Fri Dec 27 2019 Donatas Abraitis <donatas.abraitis@gmail.com>
- Add CentOS 8 support
* Mon May 28 2018 Rafael Zalamena <rzalamena@opensourcerouting.org> - %{version}
- Add BFDd support - Add BFDd support
* Sun May 20 2018 Martin Winter <mwinter@opensourcerouting.org> * Sun May 20 2018 Martin Winter <mwinter@opensourcerouting.org>