diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..68d134f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/v2.0.1.tar.gz diff --git a/.librtas.metadata b/.librtas.metadata new file mode 100644 index 0000000..ef69c26 --- /dev/null +++ b/.librtas.metadata @@ -0,0 +1 @@ +183b0f8770a14c3203f20107414d3e0d9ead7c52 SOURCES/v2.0.1.tar.gz diff --git a/SOURCES/librtas-2.0.1-libversion.patch b/SOURCES/librtas-2.0.1-libversion.patch new file mode 100644 index 0000000..e572c3a --- /dev/null +++ b/SOURCES/librtas-2.0.1-libversion.patch @@ -0,0 +1,27 @@ +From 2c954feaa59657fd8a13cf6e7208c4bf8c46f0dc Mon Sep 17 00:00:00 2001 +From: Sinny Kumari +Date: Sun, 19 Mar 2017 00:21:22 +0530 +Subject: [PATCH] Update library version to 2.0.1 to match with release version + +--- + Makefile.am | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index e02d007..5f819c3 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -19,7 +19,9 @@ AM_CFLAGS = -I$(top_srcdir)/librtas_src/ -I$(top_srcdir)/librtasevent_src/ + + library_includedir=$(includedir) + +-LIBRTAS_LIBRARY_VERSION = 2:0:0 ++# CURRENT:REVISION:AGE(C:R:A) ++# For calculating version number of library, formula used is (C - A).(A).(R) ++LIBRTAS_LIBRARY_VERSION = 2:1:0 + + lib_LTLIBRARIES += librtas.la + librtas_la_LDFLAGS = -version-info $(LIBRTAS_LIBRARY_VERSION) +-- +2.9.3 + diff --git a/SOURCES/librtas-2.0.1-rtas-call.patch b/SOURCES/librtas-2.0.1-rtas-call.patch new file mode 100644 index 0000000..346689d --- /dev/null +++ b/SOURCES/librtas-2.0.1-rtas-call.patch @@ -0,0 +1,107 @@ +From 26970c42bc017ad68b864e7134cf941c07443aa8 Mon Sep 17 00:00:00 2001 +From: Chris Engel +Date: Tue, 22 Aug 2017 14:59:06 -0500 +Subject: [PATCH] Interface for ibm,physical-attestation rtas call + +The physical attestation interfaces are provided to allow a +trusted 3rd party client to retrieve information about the +trusted boot state of the target PowerVM system. This makes +use of the systems physical TPM(s). These TPM(s) are used +by system firmware to extend measurements during the +boot process. + +Signed-off-by: Chris Engel +Reviewed-by: Vasant Hegde +Signed-off-by: Tyrel Datwyler +--- + librtas_src/librtas.h | 2 ++ + librtas_src/syscall_calls.c | 63 +++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 65 insertions(+) + +diff --git a/librtas_src/librtas.h b/librtas_src/librtas.h +index ccab3d9..b84fab1 100644 +--- a/librtas_src/librtas.h ++++ b/librtas_src/librtas.h +@@ -105,6 +105,8 @@ extern int rtas_set_time(uint32_t year, uint32_t month, uint32_t day, + extern int rtas_suspend_me(uint64_t streamid); + extern int rtas_update_nodes(char *workarea, unsigned int scope); + extern int rtas_update_properties(char *workarea, unsigned int scope); ++extern int rtas_physical_attestation(char *workarea, int seq_num, ++ int *next_seq_num, int *work_area_bytes); + + #ifdef __cplusplus + } +diff --git a/librtas_src/syscall_calls.c b/librtas_src/syscall_calls.c +index a194e4b..35b6d66 100644 +--- a/librtas_src/syscall_calls.c ++++ b/librtas_src/syscall_calls.c +@@ -1329,3 +1329,66 @@ int rtas_update_properties(char *workarea, unsigned int scope) + dbg("(%p) %d = %d\n", workarea, scope, rc ? rc : status); + return rc ? rc : status; + } ++ ++/** ++ * rtas_physical_attestation ++ * @brief Interface for ibm,physical-attestation rtas call. ++ * ++ * @param workarea input/output work area for rtas call ++ * @param seq_num sequence number of the rtas call ++ * @param next_seq_num next sequence number ++ * @param work_area_bytes size of work area ++ * @return 0 on success, !0 on failure ++ */ ++int rtas_physical_attestation(char *workarea, int seq_num, int *next_seq_num, ++ int *work_area_bytes) ++{ ++ uint32_t workarea_pa; ++ uint64_t elapsed = 0; ++ void *kernbuf; ++ int kbuf_sz = 4096; ++ int rc, status; ++ int resp_bytes = *work_area_bytes; ++ ++ rc = sanity_check(); ++ if (rc) ++ return rc; ++ ++ /* Caller provided more data than FW can handle */ ++ if (*work_area_bytes == 0 || ++ *work_area_bytes > kbuf_sz) ++ return RTAS_IO_ASSERT; ++ ++ rc = rtas_get_rmo_buffer(kbuf_sz, &kernbuf, &workarea_pa); ++ if (rc) ++ return rc; ++ memcpy(kernbuf, workarea, *work_area_bytes); ++ ++ do { ++ rc = rtas_call("ibm,physical-attestation", 3, 3, ++ htobe32(workarea_pa), htobe32(kbuf_sz), ++ htobe32(seq_num), ++ &status, next_seq_num, &resp_bytes); ++ if (rc < 0) ++ break; ++ ++ rc = handle_delay(status, &elapsed); ++ } while (rc == CALL_AGAIN); ++ ++ *next_seq_num = be32toh(*next_seq_num); ++ ++ /* FW returned more data than we can handle */ ++ if (be32toh(resp_bytes) > *work_area_bytes) { ++ (void)rtas_free_rmo_buffer(kernbuf, workarea_pa, kbuf_sz); ++ return RTAS_IO_ASSERT; ++ } ++ ++ *work_area_bytes = be32toh(resp_bytes); ++ ++ if (rc == 0) ++ memcpy(workarea, kernbuf, *work_area_bytes); ++ ++ (void)rtas_free_rmo_buffer(kernbuf, workarea_pa, kbuf_sz); ++ ++ return rc ? rc : status; ++} +-- +2.9.5 + diff --git a/SPECS/librtas.spec b/SPECS/librtas.spec new file mode 100644 index 0000000..895e12a --- /dev/null +++ b/SPECS/librtas.spec @@ -0,0 +1,199 @@ +Summary: Libraries to provide access to RTAS calls and RTAS events +Name: librtas +Version: 2.0.1 +Release: 2%{?dist} +URL: http://librtas.ozlabs.org +License: LGPL +Group: System Environment/Libraries + +Source: https://github.com/nfont/librtas/archive/v%{version}.tar.gz + +BuildRequires: autoconf +BuildRequires: libtool + +Patch0: librtas-2.0.1-libversion.patch +Patch1: librtas-2.0.1-rtas-call.patch + +Obsoletes: librtas(ppc) +ExclusiveArch: ppc64 ppc64le + +%description +The librtas shared library provides userspace with an interface +through which certain RTAS calls can be made. The library uses +either of the RTAS User Module or the RTAS system call to direct +the kernel in making these calls. + +The librtasevent shared library provides users with a set of +definitions and common routines useful in parsing and dumping +the contents of RTAS events. + +%package devel +Summary: C header files for development with librtas +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +The librtas-devel packages contains the header files necessary for +developing programs using librtas. + +%prep +%setup -q -n %{name}-%{version} +%patch0 -p1 -b .ln +%patch1 -p1 -b .rtas + +%build +./autogen.sh +# disable "-Werror=format-security" checking gcc option until we fix +# these errors in our code. +%configure --disable-silent-rules --disable-static +CFLAGS="%{optflags} -fPIC -DPIC -I." +CFLAGS=`echo $CFLAGS | sed 's/-Werror=format-security//'` +%make_build CFLAGS="$CFLAGS" + +%install +%make_install +find %{buildroot} -name '*.la' -exec rm -f {} ';' +rm -f %{buildroot}/%{_docdir}/librtas/* + + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%doc COPYING.LESSER README Changelog +%{_libdir}/librtas.so.* +%{_libdir}/librtasevent.so.* + +%files devel +%{_libdir}/librtas.so +%{_libdir}/librtasevent.so +%{_libdir}/pkgconfig/librtas.pc +%{_includedir}/librtas.h +%{_includedir}/librtasevent.h +%{_includedir}/librtasevent_v4.h +%{_includedir}/librtasevent_v6.h + +%changelog +* Wed Sep 13 2017 Sinny Kumari 2.0.1-2 +- Resolves: #1457407 - Apply feature from librtas-2.0.1-rtas-call.patch + +* Fri Mar 17 2017 Sinny Kumari 2.0.1-1 +- Resolves: #1380656 Rebase to 2.0.1 + +* Mon Jun 27 2016 Sinny Kumari 1.4.1-2 +- Resolves: #1349878 - EEH_Tool fails to inject error with librtas-1.4.1-1.ppc64le file + +* Thu Apr 28 2016 Sinny Kumari 1.4.1-1 +- Resolves: #1182039 - librtas package update +- Resolves: #1302727 - License change from CPL to LGPL +- Resolves: #1300542 - If mmap() of /dev/mem fails, librtas does not release /run/lock/LCK. +- Removed patch librtas-papr.patch, changes included in upstream release 1.3.14 + +* Mon Jun 08 2015 Jakub Čajka 1.3.13-2 +- Resolves: #1184466 - errinct failed with error " errinjct: RTAS: ioa-bus-error: Argument error (-3)" + +* Mon Nov 10 2014 Jakub Čajka 1.3.13-1 +- Resolves: #1161551 - librtas package update for RHEL7.1 Beta + +* Thu Aug 21 2014 Jakub Čajka 1.3.12-1 +- Related: #1088538 - [7.1 FEAT] librtas package update - ppc64 + +* Mon Aug 18 2014 Jakub Čajka 1.3.11-2 +- Related: #1098215 - [7.1 FEAT] librtas - drop 32bit package - ppc64 + +* Tue Aug 12 2014 Jakub Čajka 1.3.11-1 +- Resolves: #1124003 - librtas needs ppc64le added to ExclusiveArch +- Resolves: #1084063 - add support to recognize qemu pci hotplug events +- Resolves: #1088538 - [7.1 FEAT] librtas package update - ppc64 + +* Wed Mar 19 2014 Karsten Hopp 1.3.8-6 +- delete all *.so.* files after unpacking the tarball to make sure they get rebuilt +- Resolves: rhbz 1024888 + +* Fri Mar 07 2014 Karsten Hopp 1.3.8-5 +- fix CFLAGS +- Related: rhbz 1024888 + +* Fri Mar 07 2014 Karsten Hopp 1.3.8-4 +- remove precompiled binaries before building +- Resolves: rhbz 1024888 + +* Fri Dec 27 2013 Daniel Mach - 1.3.8-3 +- Mass rebuild 2013-12-27 + +* Tue Jul 30 2013 Filip Kocina - 1.3.8-2 +- Source URL fix + +* Thu May 16 2013 Vasant Hegde - 1.3.8 +- Update to latest upstream 1.3.8 + +* Thu Feb 14 2013 Fedora Release Engineering - 1.3.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 1.3.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 1.3.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Aug 11 2011 Jiri Skala 1.3.6-1 +- update to latest upstream 1.3.6 + +* Mon Aug 08 2011 Jiri Skala 1.3.5-1 +- update to latest upstream 1.3.5 + +* Tue Feb 08 2011 Fedora Release Engineering - 1.3.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sat Sep 11 2010 Parag Nemade 2.30.3-3 +- Merge-review cleanup (#226059) + +* Mon Sep 21 2009 Roman Rakus - 1.3.4-1 +- Upstream release 1.3.4 + +* Sat Jul 25 2009 Fedora Release Engineering - 1.3.3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 1.3.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Feb 08 2008 David Cantrell - 1.3.3-3 +- Rebuild for gcc-4.3 + +* Tue Dec 18 2007 David Cantrell - 1.3.3-2 +- Spec cleanups + +* Tue Dec 18 2007 David Cantrell - 1.3.3-1 +- Upgraded to librtas-1.3.3 (#253522) + +* Mon Sep 10 2007 David Cantrell - 1.3.2-1 +- Upgraded to librtas-1.3.2 +- Cleaned up spec file to conform to Fedora packaging guidelines + +* Tue Aug 21 2007 David Cantrell - 1.2.4-4 +- Rebuild + +* Sat Mar 31 2007 David Woodhouse - 1.2.4-3 +- Install libraries into /usr/lib64 on PPC64. + +* Tue Aug 01 2006 Paul Nasrat - 1.2.4-2 +- Backport syscall fix from upstream + +* Wed Jul 12 2006 Jesse Keating - 1.2.4-1.2.2 +- rebuild + +* Fri Feb 10 2006 Jesse Keating - 1.2.4-1.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1.2.4-1.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Thu Nov 03 2005 Paul Nasrat 1.2.4-1 +- Update to latest version + +* Thu Nov 03 2005 Paul Nasrat 1.2.2-1 +- Initial release