5917b8
%global project skiboot
802f9d
5917b8
Name:		opal-prd
5917b8
Version:	6.0.4
c83195
Release:	5%{?dist}
5917b8
Summary:	OPAL Processor Recovery Diagnostics Daemon
802f9d
5917b8
Group:		System Environment/Daemons
5917b8
License:	ASL 2.0
5917b8
URL:		http://github.com/open-power/skiboot
802f9d
5917b8
# Presently opal-prd is supported on ppc64le architecture only.
5917b8
ExclusiveArch:	ppc64le
5917b8
5917b8
BuildRequires:	systemd
5917b8
BuildRequires:	gcc
5917b8
%if 0%{?fedora}
5917b8
BuildRequires:	gcc-powerpc64-linux-gnu
5917b8
%endif
5917b8
BuildRequires:	openssl-devel
5917b8
5917b8
Requires(post):		systemd
5917b8
Requires(preun):	systemd
5917b8
Requires(postun):	systemd
5917b8
5917b8
Source0:	https://github.com/open-power/%{project}/archive/v%{version}/%{project}-%{version}.tar.gz
c83195
Source1: opal-prd-rsyslog
c83195
Source2: opal-prd-logrotate
5917b8
# https://github.com/open-power/skiboot/issues/160
5917b8
Patch0:  skiboot-5.10.2-alignment.patch
5917b8
# 1596245 - "diag_encl -d" creates xml file with blank space in file name also
5917b8
# file contains attributes with NULL value. 
5917b8
Patch1:  skiboot-6.0.4-77f510d35e8d60faed989496fac2de16663ff332.patch
5917b8
Patch2:  skiboot-6.0.4-861350941f9a3fb76ebcae3e5a32b3cbec929d03.patch
c83195
# bz#1704699 - RHEL-Alt-7.6 - opal-gard binary doesn't list GUARD records from PNOR
c83195
Patch3:  skiboot-6.0.4-e247710814227a7122915ff44474e0c8aa26fd3a.patch
802f9d
802f9d
%description
802f9d
This package provides a daemon to load and run the OpenPower firmware's
802f9d
Processor Recovery Diagnostics binary. This is responsible for run time
802f9d
maintenance of OpenPower Systems hardware.
802f9d
802f9d
802f9d
%package -n	opal-utils
5917b8
Summary:	OPAL firmware utilities
5917b8
Group:		Applications/System
802f9d
802f9d
%description -n opal-utils
802f9d
This package contains utility programs.
802f9d
802f9d
The 'gard' utility, can read, parse and clear hardware gard partitions
802f9d
on OpenPower platforms. The 'getscom' and 'putscom' utilities provide
802f9d
an interface to query or modify the registers of the different chipsets
802f9d
of an OpenPower system. 'pflash' is a tool to access the flash modules
802f9d
on such systems and update the OpenPower firmware.
802f9d
802f9d
%package -n	opal-firmware
802f9d
Summary:	OPAL firmware
802f9d
BuildArch:	noarch
802f9d
802f9d
%description -n	opal-firmware
802f9d
OPAL firmware, aka skiboot, loads the bootloader and provides runtime
802f9d
services to the OS (Linux) on IBM Power and OpenPower systems.
802f9d
802f9d
%prep
802f9d
5917b8
%setup -q -n %{project}-%{version}
802f9d
%patch0 -p1
802f9d
%patch1 -p1
b1660c
%patch2 -p1
c83195
%patch3 -p1
802f9d
802f9d
%build
5917b8
OPAL_PRD_VERSION=%{version} make V=1 CC="gcc" CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" -C external/opal-prd
5917b8
GARD_VERSION=%{version} make V=1 CC="gcc" CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" -C external/gard
5917b8
PFLASH_VERSION=%{version} make V=1 CC="gcc" CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" -C external/pflash
5917b8
XSCOM_VERSION=%{version} make V=1 CC="gcc" CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" -C external/xscom-utils
5917b8
5917b8
# build skiboot with a cross-compiler on Fedora and with system compiler otherwise
5917b8
# and always use upstream compiler flags for the firmware (no CFLAGS override)
5917b8
%if 0%{?fedora}
5917b8
SKIBOOT_VERSION=%{version} make V=1 CROSS="powerpc64-linux-gnu-"
5917b8
%else
5917b8
SKIBOOT_VERSION=%{version} make V=1 CROSS=
5917b8
%endif
802f9d
802f9d
%install
802f9d
make -C external/opal-prd install DESTDIR=%{buildroot} prefix=/usr
802f9d
make -C external/gard install DESTDIR=%{buildroot} prefix=/usr
c83195
make -C external/pflash install DESTDIR=%{buildroot} prefix=/usr
c83195
make -C external/xscom-utils install DESTDIR=%{buildroot} prefix=/usr
c83195
c83195
# drop getsram for 7.6.x
c83195
rm -f %{buildroot}%{_sbindir}/getsram %{buildroot}%{_mandir}/man1/getsram*
802f9d
802f9d
mkdir -p %{buildroot}%{_unitdir}
5917b8
install -m 644 -p external/opal-prd/opal-prd.service %{buildroot}%{_unitdir}/opal-prd.service
802f9d
802f9d
mkdir -p %{buildroot}%{_datadir}/qemu
802f9d
install -m 644 -p skiboot.lid %{buildroot}%{_datadir}/qemu/skiboot.lid
5917b8
install -m 644 -p skiboot.lid.xz %{buildroot}%{_datadir}/qemu/skiboot.lid.xz
802f9d
c83195
# log opal-prd messages to /var/log/opal-prd.log
c83195
mkdir -p %{buildroot}%{_sysconfdir}/{rsyslog.d,logrotate.d}
c83195
install -m 644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/rsyslog.d/opal-prd.conf
c83195
install -m 644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/opal-prd
c83195
802f9d
%post
802f9d
%systemd_post opal-prd.service
802f9d
802f9d
%preun
802f9d
%systemd_preun opal-prd.service
802f9d
802f9d
%postun
802f9d
%systemd_postun_with_restart opal-prd.service
802f9d
802f9d
%files
802f9d
%doc README.md
802f9d
%license LICENCE
c83195
%config(noreplace) %{_sysconfdir}/logrotate.d/opal-prd
c83195
%config(noreplace) %{_sysconfdir}/rsyslog.d/opal-prd.conf
802f9d
%{_sbindir}/opal-prd
802f9d
%{_unitdir}/opal-prd.service
802f9d
%{_mandir}/man8/*
802f9d
802f9d
%files -n opal-utils
802f9d
%doc README.md
802f9d
%license LICENCE
802f9d
%{_sbindir}/opal-gard
802f9d
%{_sbindir}/getscom
802f9d
%{_sbindir}/putscom
802f9d
%{_sbindir}/pflash
802f9d
%{_mandir}/man1/*
802f9d
802f9d
%files -n opal-firmware
802f9d
%doc README.md
802f9d
%license LICENCE
802f9d
%{_datadir}/qemu/
802f9d
802f9d
%changelog
c83195
* Tue Jun 04 2019 Than Ngo <than@redhat.com> - 6.0.4-5
c83195
- Resolves: #1716855, log messages to /var/log/opal-prd.log
c83195
c83195
* Mon May 13 2019 Than Ngo <than@redhat.com> - 6.0.4-4
c83195
- Related: #1704699 - added missing manpages
c83195
c83195
* Mon May 13 2019 Than Ngo <than@redhat.com> - 6.0.4-3
c83195
- Resolves: #1704699 - opal-gard binary doesn't list GUARD records from PNO
c83195
5917b8
* Thu Jun 28 2018 Than Ngo <than@redhat.com> - 6.0.4-2
5917b8
- Resolves: #1596245 - "diag_encl -d" creates xml file with blank space in file name
5917b8
5917b8
* Thu Jun 21 2018 Than Ngo <than@redhat.com> - 6.0.4-1
5917b8
- Resolves: #1537001 - update to 6.0.4
b1660c
f021ee
* Mon Jan 22 2018 Than Ngo <than@redhat.com> - 5.9-2
f021ee
- Related: rhbz#1456536 - add support for runtime OCC load/start in ZZ
f021ee
f021ee
* Tue Oct 31 2017 Dan HorĂ¡k <dhorak@redhat.com> - 5.9-1
f021ee
- Resolves: rhbz#1456536 - opal-prd update to 5.9
802f9d
f021ee
* Wed Oct 25 2017 Than Ngo <than@redhat.com> - 5.8-1
f021ee
- Resolves: rhbz#1456536 - opal-prd update to 5.8
802f9d
802f9d
* Thu Apr 20 2017 Rafael Fonseca <rdossant@redhat.com> - 5.5.0-1
802f9d
- Resolves: rhbz#1368702 - [Pegas1.0 FEAT] opal-prd package update
802f9d
802f9d
* Tue Mar 14 2017 Rafael Fonseca <rdossant@redhat.com> - 5.4.3-2
802f9d
- Resolves: rhbz#1430332 - Restart opal-prd daemon on any kind of failure
802f9d
802f9d
* Wed Jan 18 2017 Rafael Fonseca <rdossant@redhat.com> - 5.4.3-1
802f9d
- Resolves: rhbz#1384952 - [7.4 FEAT] opal-prd package update for ppc64le
802f9d
802f9d
* Thu Sep 22 2016 Rafael Fonseca <rdossant@redhat.com> - 5.2.0-3
802f9d
- Resolves: rhbz#1375449
802f9d
802f9d
* Thu Aug 25 2016 Rafael Fonseca <rdossant@redhat.com> - 5.2.0-2
802f9d
- Resolves: rhbz#1367342
802f9d
- Remove systemd socket.
802f9d
802f9d
* Fri May 20 2016 Rafael dos Santos <rdossant@redhat.com> - 5.2.0-1
802f9d
- Importing package from Fedora.
802f9d