]> sourceware.org Git - systemtap.git/commitdiff
Add a rpm require on 'mokutil' when needed.
authorDavid Smith <dsmith@redhat.com>
Tue, 18 Feb 2014 21:19:13 +0000 (15:19 -0600)
committerDavid Smith <dsmith@redhat.com>
Tue, 18 Feb 2014 21:19:13 +0000 (15:19 -0600)
* systemtap.spec: Make the client subpackage require 'mokutil' when
  needed.
* session.cxx (get_mok_info): Remove 'FIXME' comment about needing to
  require 'mokutil'.

session.cxx
systemtap.spec

index ece555f14066f3c78aec084d818a7bd1b8462dfe..1d23e56dffe311d816eb85249b7f222fa0de2b0d 100644 (file)
@@ -2263,10 +2263,6 @@ systemtap_session::get_mok_info()
   int rc;
   stringstream out;
 
-  // FIXME: we'll need to add mokutil to a 'Requires' line in the spec
-  // file, but only for F?+ and RHEL?+. Need to figure out exact
-  // release numbers.
-  //
   // FIXME: In theory, we should be able to read /sys files and use
   // some of the guts of read_cert_info_from_file() to get the
   // fingerprints. This would rid us of our mokutil
@@ -2277,7 +2273,9 @@ systemtap_session::get_mok_info()
   cmd.push_back("--list-enrolled");
   rc = stap_system_read(verbose, cmd, out);
   if (rc != 0)
-      throw runtime_error(_F("failed to get list of machine owner keys (MOK) fingerprints: rc %d", rc));
+    // If we're here, we know the client requires module signing, but
+    // we can't get the list of MOKs. Quit.
+    throw runtime_error(_F("failed to get list of machine owner keys (MOK) fingerprints: rc %d", rc));
 
   string line, fingerprint;
   while (! out.eof())
index 00b0b48a3cf0c707f0091c9a7050166ebe6a9784..3a0f1cb1fa17b4513231f707a64cb089bdc99202 100644 (file)
 %{!?with_virthost: %global with_virthost 0%{?fedora} >= 19 || 0%{?rhel} >= 7}
 %{!?with_virtguest: %global with_virtguest 1}
 %{!?with_dracut: %global with_dracut 0%{?fedora} >= 19 || 0%{?rhel} >= 7}
+%ifarch x86_64
+%{!?with_mokutil: %global with_mokutil 0%{?fedora} >= 18 || 0%{?rhel} >= 7}
+%else
+%{!?with_mokutil: %global with_mokutil 0}
+%endif
 
 %if 0%{?fedora} >= 18 || 0%{?rhel} >= 6
    %define initdir %{_initddir}
@@ -232,6 +237,9 @@ Requires: zip unzip
 Requires: systemtap-runtime = %{version}-%{release}
 Requires: coreutils grep sed unzip zip
 Requires: openssh-clients
+%if %{with_mokutil}
+Requires: mokutil
+%endif
 
 %description client
 This package contains/requires the components needed to develop
This page took 0.036423 seconds and 5 git commands to generate.