From 63f85b54739ecb2b3e266c5beaecb67ab849e45c Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys <mitchelh@codeaurora.org> Date: Fri, 12 Feb 2016 16:31:18 -0800 Subject: [PATCH] lrdp-v2: ramdump: Handle equals signs in config values Currently we split each config line on the equals sign, assuming that there's only one equals sign there. This isn't a valid assumption for cases like: CONFIG_CMDLINE="console=ttyAMA0" Fix this by splitting at the first equals sign, rather than splitting at *all* equals signs. Change-Id: I01e44fe2e9a0f09a8bebdd76715002f6b12cf0b5 --- linux-ramdump-parser-v2/ramdump.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux-ramdump-parser-v2/ramdump.py b/linux-ramdump-parser-v2/ramdump.py index 91d1bc5..4196adf 100755 --- a/linux-ramdump-parser-v2/ramdump.py +++ b/linux-ramdump-parser-v2/ramdump.py @@ -1,4 +1,4 @@ -# Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. +# Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 and @@ -604,7 +604,9 @@ class RamDump(): for l in t: self.config.append(l.rstrip().decode('ascii', 'ignore')) if not l.startswith('#') and l.strip() != '': - cfg, val = l.split('=') + eql = l.find('=') + cfg = l[:eql] + val = l[eql+1:] self.config_dict[cfg] = val.strip() return True -- GitLab