1
'''apport package hook for plymouth
3
Copyright 2010 Canonical Ltd.
4
Authors: Steve Langasek <steve.langasek@ubuntu.com>,
5
Brian Murray <brian@ubuntu.com>
8
from apport.hookutils import *
13
def _attach_file_filtered(report, path, key=None):
14
'''filter out password from grub configuration'''
16
key = path_to_key(path)
18
if os.path.exists(path):
19
with open(path,'r') as f:
20
filtered = [l if not l.startswith('password')
21
else '### PASSWORD LINE REMOVED ###'
22
for l in f.readlines()]
23
report[key] = ''.join(filtered)
27
attach_hardware(report)
28
attach_file(report, '/proc/fb', 'ProcFB')
29
attach_file(report, '/proc/cmdline', 'ProcCmdLine')
30
attach_file(report, '/var/log/boot.log', 'BootLog')
31
debug_log = '/var/log/plymouth-debug.log'
32
if os.path.exists(debug_log):
33
attach_root_command_outputs(report,
34
{'PlymouthDebug': 'cat %s' % debug_log})
35
_attach_file_filtered(report, '/etc/default/grub', 'EtcDefaultGrub')
36
default_alternative = '/etc/alternatives/default.plymouth'
37
if os.path.exists(default_alternative):
38
report['DefaultPlymouth'] = command_output(['readlink', default_alternative])
39
text_alternative = '/etc/alternatives/text.plymouth'
40
if os.path.exists(text_alternative):
41
report['TextPlymouth'] = command_output(['readlink', text_alternative])