# Path: auto_forensicate/recipes/base.py
# class BaseArtifact(object):
# class StringArtifact(BaseArtifact):
# class FileArtifact(BaseArtifact):
# class ProcessOutputArtifact(BaseArtifact):
# class BaseRecipe(object):
#   def __init__(self, name):
#   def _GetStream(self):
#   def CloseStream(self):
#   def OpenStream(self):
#   def size(self):
#   def readable_size(self):
#   def __init__(self, path, string_content):
#   def _GetStream(self):
#   def CloseStream(self):
#   def __init__(self, path):
#   def _GetStream(self):
#   def __init__(self, command, path, ignore_failure=False):
#   def _RunCommand(self):
#   def _GetStream(self):
#   def __init__(self, name, options=None):
#   def __enter__(self):
#   def __exit__(self, exc_type, exc_value, traceback):
#   def GetArtifacts(self):


from auto_forensicate.recipes import base
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Handles the acquisition of the system's firmware."""

from __future__ import unicode_literals



class ChipsecRecipe(base.BaseRecipe):
  """The ChipsecRecipe class, which acquires the system's Firmware."""

  _CHIPSEC_CMD = [
      'chipsec_util', '-l', '/dev/stderr', 'spi', 'dump', '/dev/stdout']

  def GetArtifacts(self):
    """Provides a list of Artifacts to upload.

    Returns:
      list(BaseArtifact): the artifacts for the system's firmware.
    """
    if self._platform == 'darwin':
      self._logger.info('Firmware acquisition only works on Linux, skipping.')
      return []

    # Firmware acquisition will fail on various platforms (ie: QEMU during e2e
    # tests, and shouldn't be a reason to mark the full upload as failed.
    # So we're setting ignore_failure to True.

# Path: auto_forensicate/recipes/base.py
# class BaseArtifact(object):
# class StringArtifact(BaseArtifact):
# class FileArtifact(BaseArtifact):
# class ProcessOutputArtifact(BaseArtifact):
# class BaseRecipe(object):
#   def __init__(self, name):
#   def _GetStream(self):
#   def CloseStream(self):
#   def OpenStream(self):
#   def size(self):
#   def readable_size(self):
#   def __init__(self, path, string_content):
#   def _GetStream(self):
#   def CloseStream(self):
#   def __init__(self, path):
#   def _GetStream(self):
#   def __init__(self, command, path, ignore_failure=False):
#   def _RunCommand(self):
#   def _GetStream(self):
#   def __init__(self, name, options=None):
#   def __enter__(self):
#   def __exit__(self, exc_type, exc_value, traceback):
#   def GetArtifacts(self):


# Path: auto_forensicate/recipes/firmware.py
from auto_forensicate.recipes import base

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Handles the acquisition of the system's firmware."""

from __future__ import unicode_literals



class ChipsecRecipe(base.BaseRecipe):
  """The ChipsecRecipe class, which acquires the system's Firmware."""

  _CHIPSEC_CMD = [
      'chipsec_util', '-l', '/dev/stderr', 'spi', 'dump', '/dev/stdout']

  def GetArtifacts(self):
    """Provides a list of Artifacts to upload.

    Returns:
      list(BaseArtifact): the artifacts for the system's firmware.
    """
    if self._platform == 'darwin':
      self._logger.info('Firmware acquisition only works on Linux, skipping.')
      return []

    # Firmware acquisition will fail on various platforms (ie: QEMU during e2e
    # tests, and shouldn't be a reason to mark the full upload as failed.
    # So we're setting ignore_failure to True.

    firmware_artifact = base.ProcessOutputArtifact(