Signed-off-by: zhangcui <zhangcui11@huawei.com>
This commit is contained in:
zhangcui 2023-01-18 09:19:11 +00:00 committed by Gitee
parent 56b3befcd1
commit 65e4d1a18c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -193,9 +193,16 @@ class GetLibFiles(object):
if os.path.isfile(file_path):
os.remove(file_path)
if self.hdc.switch_root():
os.system('hdc shell cat /proc/sys/kernel/kptr_restrict > tmp.txt')
file_object = open('./tmp.txt','r')
text = file_object.read()
file_object.close()
os.remove('./tmp.txt')
self.hdc.run_hdc_cmd(['shell',
'"echo 0 >/proc/sys/kernel/kptr_restrict"'])
self.hdc.run_hdc_cmd(['file recv', '/proc/kallsyms', file_path])
self.hdc.run_hdc_cmd(['shell',
'"echo ' + text[0] + ' >/proc/sys/kernel/kptr_restrict"'])
def main():