Skip to content
Snippets Groups Projects
Commit 75e18b5e authored by Mitchel Humpherys's avatar Mitchel Humpherys
Browse files

lrdp-v2: ramdump: Save config values in a dictionary

It can be useful to look up the values of config items.  Store a
dictionary mapping config options to their values.

Change-Id: I99f7615b2c5926558dfba100fa0c45b6e29ecdb5
parent 707f84af
No related branches found
No related tags found
No related merge requests found
......@@ -496,6 +496,7 @@ class RamDump():
self.phys_offset = options.phys_offset
self.lookup_table = []
self.config = []
self.config_dict = {}
if self.arm64:
self.page_offset = 0xffffffc000000000
self.thread_size = 16384
......@@ -618,8 +619,14 @@ class RamDump():
os.remove(zconfig.name)
for l in t:
self.config.append(l.rstrip().decode('ascii', 'ignore'))
if not l.startswith('#') and l.strip() != '':
cfg, val = l.split('=')
self.config_dict[cfg] = val.strip()
return True
def get_config_val(self, config):
return self.config_dict.get(config)
def is_config_defined(self, config):
s = config + '=y'
return s in self.config
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment