mirror of
https://github.com/chipsec/chipsec
synced 2026-06-08 13:31:00 +00:00
change to allow clonefile naming
This commit is contained in:
committed by
Erik Bjorge
parent
825f2a58c0
commit
dd9ecaa155
+1
-1
@@ -419,7 +419,7 @@ class Chipset:
|
||||
if logger().DEBUG: logger().error("pci.read_dword couldn't read PCH VID/DID")
|
||||
return (vid, did, pch_vid, pch_did)
|
||||
|
||||
def init( self, platform_code, req_pch_code, start_driver, driver_exists=False, to_file=False ):
|
||||
def init( self, platform_code, req_pch_code, start_driver, driver_exists=False, to_file=None ):
|
||||
|
||||
_unknown_platform = False
|
||||
self.helper.start(start_driver, driver_exists, to_file)
|
||||
|
||||
@@ -29,9 +29,12 @@ from chipsec.helper.oshelper import Helper
|
||||
import json
|
||||
|
||||
class FileCmds:
|
||||
def __init__(self):
|
||||
def __init__(self, filename):
|
||||
self.data = {}
|
||||
self.filename = "clone.json"
|
||||
if filename == "":
|
||||
self.filename = "clone.json"
|
||||
else:
|
||||
self.filename = filename
|
||||
|
||||
def AddElement(self,cmd,args,ret):
|
||||
if self.data.has_key(cmd):
|
||||
|
||||
@@ -124,10 +124,10 @@ class OsHelper:
|
||||
except:
|
||||
pass
|
||||
|
||||
def start(self, start_driver, driver_exists=False, to_file=False):
|
||||
if to_file:
|
||||
def start(self, start_driver, driver_exists=False, to_file=None):
|
||||
if not to_file is None:
|
||||
from chipsec.helper.file.helper import FileCmds
|
||||
self.filehelper = FileCmds()
|
||||
self.filehelper = FileCmds(to_file)
|
||||
try:
|
||||
if not self.helper.create( start_driver ):
|
||||
raise OsHelperError("failed to create OS helper")
|
||||
|
||||
+1
-1
@@ -386,7 +386,7 @@ class ChipsecMain:
|
||||
adv_options.add_argument('--failfast', help="fail on any exception and exit (don't mask exceptions)",action='store_true')
|
||||
adv_options.add_argument('--no_time', help="don't log timestamps",action='store_true')
|
||||
adv_options.add_argument('--deltas',dest='_deltas_file', help='specifies a JSON log file to compute result deltas from')
|
||||
adv_options.add_argument('--clone',dest='_to_file',help='run chipsec and clone helper results into clone.json')
|
||||
adv_options.add_argument('--clone',dest='_to_file',help='run chipsec and clone helper results into JSON file')
|
||||
|
||||
parser.parse_args(self.argv,namespace=ChipsecMain)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user