2
# -*- coding: utf-8 -*-
3
'''apport package hook for bluez
5
(c) 2010 Free Software Foundation
7
Baptiste Mille-Mathias <baptistem@src.gnome.org>
10
from apport.hookutils import *
13
def add_info(report, ui):
14
report['syslog'] = recent_syslog(re.compile(r'bluetooth', re.IGNORECASE))
15
attach_hardware(report)
16
if command_available('hciconfig'):
17
report['hciconfig'] = command_output('hciconfig')
18
if command_available('rfkill'):
19
report['rfkill'] = command_output(['rfkill','list'])
20
if command_available('getfacl'):
21
report['getfacl'] = command_output(['getfacl','/dev/rfkill'])
23
interesting_modules = ('btusb', 'rfcomm', 'sco', 'bnep', 'l2cap', 'bluetooth')
24
interesting_modules_loaded = []
26
for line in open('/proc/modules'):
27
module = line.split()[0]
28
if module in interesting_modules:
29
interesting_modules_loaded.append(module)
31
if interesting_modules_loaded:
32
report['InterestingModules'] = ' '.join(interesting_modules_loaded)
34
ui.information("""Your bug report will be processed in few seconds.
35
If you can reproduce it, please follow the next steps:
36
- Install the package 'bluez-hcidump'
38
- Run the command "sudo hcidump -XYt > $HOME/hci.log"
39
- Reproduce the actions until the error happens
40
- On the terminal, press Ctrl+C to stop hcidump.
41
- Attach the file hci.log to the bug report.""")