1
'''Triaging Hibernate issues.
5
Andres Mujica <andres.mujica@seaq.com.co>
7
This program is free software; you can redistribute it and/or modify itunder the terms of the GNU General Public License as published by the
8
Free Software Foundation; either version 2 of the License, or (at your
9
option) any later version. See http://www.gnu.org/copyleft/gpl.html for
10
the full text of the license.
12
This apport-hook was made according to:
13
https://wiki.ubuntu.com/DebuggingKernelSuspendHibernateResume
18
def add_info(report, ui):
19
# validating which type of problem is if problem at all.
20
problem = ui.choice('Which type of hibernate/suspend/resume problem do you have?',
21
['Suspend (your computer saves everything in RAM consuming less power)',
22
'Hibernate (your computer saves everything in Disk)',
23
'Battery died while suspended',
24
'A repetition of a previous reported hibernate/suspend/resume failure',
33
# tagging as suspend bug
34
ProblemTag = 'suspend'
35
# invoking further questions
36
return problem_debug(report, ui, ProblemTag)
38
# tagging as hibernate bug
39
ProblemTag = 'hibernate'
40
# invoking further questions
41
return problem_debug(report, ui, ProblemTag)
43
# if the battery died while suspending, is not a Suspend/Resume bug... so test again fully charged
44
ui.information('Please reproduce your issue with the battery fully charged and report back if still happens')
47
# maybe this is redundant, anyway tagging as likely-dup and asking further questions to the reporter
48
ui.information('If you have reported this issue before, please mark this bug as a duplicate from the first one')
49
ProblemTag = 'likely-dup'
50
return problem_debug(report, ui, ProblemTag)
52
# a different problem... probably we can add further questions and expand this hook to g-p-m issues
53
ui.information('Please use "ubuntu-bug <packagename>" to report a bug against the particular package')
57
def problem_debug(report, ui, tag):
59
# we need to now if it was resuming or not. Normally all bugs are tagged resume also, but this is not necessary true.
60
when = ui.choice('Did the machine break while going to sleep or waking up?',
70
# it will be ideal if we can get some input box here and then attach that as a comment..
71
ui.information('Please explain in your report how did you verify this')
74
# we want to now if it was a one time thing or if it's common behaviour.
75
reproducible = ui.choice('From 10 sleep cycles, how often this ocurr?',
81
if reproducible is None:
83
reproducible = reproducible[0]
86
# it will be ideal if we can get some input box here and then attach that as a comment..
87
ui.information('Please be sure to explain in the report how did you reproduce this behaviour')
88
report['HowReproducible'] = str(reproducible)
90
# we want to now if this is a regression, i'm using tags from update manager, but maybe this give an idea when the regression occurred.
91
regression = ui.choice('Did it work before?',
98
if regression is None:
100
regression = regression[0]
103
RegressionTag = 'regression-potential jaunty2karmic'
105
RegressionTag = 'regression-potential intrepid2jaunty'
107
RegressionTag = 'regression-potential hardy2intrepid'
109
# is this a kernel panic error?
110
panic = ui.yesno('Do you end up with flashing caps-lock or similar?')
114
report['KernelPanic'] = str(panic)
115
FinalTags = 'apport-symptom' + " " + tag + " " + WhenTag + " " + RegressionTag
116
report['Tags'] = FinalTags
118
return 'linux-image-generic'