def add_info(report, ui): problem_type = report.get("ProblemType", None) if problem_type == "Bug": response = ui.yesno("Is the issue you are reporting one you \ encountered when upgrading Ubuntu from one release to another?") else: response = None if response: os.execlp('apport-bug', 'apport-bug', 'ubuntu-release-upgrader') else: try: attach_gsettings_package(report, 'update-manager') except: pass attach_file_if_exists(report, '/var/log/apt/history.log', 'DpkgHistoryLog.txt') attach_file_if_exists(report, '/var/log/apt/term.log', 'DpkgTerminalLog.txt') attach_root_command_outputs( report, { 'CurrentDmesg.txt': 'dmesg | comm -13 --nocheck-order /var/log/dmesg -' }) report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
def add_info(report, ui): problem_type = report.get("ProblemType", None) if problem_type == "Bug": response = ui.yesno("Is the issue you are reporting one you \ encountered when upgrading Ubuntu from one release to another?") else: response = None if response: os.execlp('apport-bug', 'apport-bug', 'ubuntu-release-upgrader') else: attach_gsettings_package(report, 'update-manager') attach_file_if_exists(report, '/var/log/apt/history.log', 'DpkgHistoryLog.txt') attach_file_if_exists(report, '/var/log/apt/term.log', 'DpkgTerminalLog.txt') attach_root_command_outputs( report, { 'CurrentDmesg.txt': 'dmesg | comm -13 --nocheck-order /var/log/dmesg -' }) if command_available('hwe-support-status'): # not using apport's command_output because it doesn't expect a # return code of 10 unsupported = run_hwe_command('--show-all-unsupported') if unsupported: report['HWEunsupported'] = unsupported report['HWEreplacements'] = \ run_hwe_command('--show-replacements') report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
def add_info(report, ui): try: attach_gsettings_package(report, 'update-manager') except: pass attach_file_if_exists(report, '/var/log/apt/history.log', 'DpkgHistoryLog.txt') attach_file_if_exists(report, '/var/log/apt/term.log', 'DpkgTerminalLog.txt') attach_root_command_outputs( report, {'CurrentDmesg.txt': 'dmesg | comm -13 --nocheck-order /var/log/dmesg -'}) report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
def add_info(report, ui): try: attach_gsettings_package(report, 'update-manager') except: pass response = ui.yesno( "Is the issue you are reporting one you encountered when upgrading Ubuntu from one release to another?" ) if response: report.setdefault('Tags', 'dist-upgrade') report['Tags'] += ' dist-upgrade' attach_file_if_exists( report, '/var/log/dist-upgrade/apt-clone_system_state.tar.gz', 'VarLogDistupgradeAptclonesystemstate.tar.gz') attach_file_if_exists(report, '/var/log/dist-upgrade/apt.log', 'VarLogDistupgradeAptlog') attach_file_if_exists(report, '/var/log/dist-upgrade/apt-term.log', 'VarLogDistupgradeApttermlog') attach_file_if_exists(report, '/var/log/dist-upgrade/history.log', 'VarLogDistupgradeAptHistorylog') attach_file_if_exists(report, '/var/log/dist-upgrade/lspci.txt', 'VarLogDistupgradeLspcitxt') attach_file_if_exists(report, '/var/log/dist-upgrade/main.log', 'VarLogDistupgradeMainlog') attach_file_if_exists(report, '/var/log/dist-upgrade/term.log', 'VarLogDistupgradeTermlog') attach_file_if_exists(report, '/var/log/dist-upgrade/screenlog.0', 'VarLogDistupgradeScreenlog') elif response is None or response is False: attach_file_if_exists(report, '/var/log/apt/history.log', 'DpkgHistoryLog.txt') attach_file_if_exists(report, '/var/log/apt/term.log', 'DpkgTerminalLog.txt') attach_root_command_outputs( report, { 'CurrentDmesg.txt': 'dmesg | comm -13 --nocheck-order /var/log/dmesg -' }) report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
def add_info(report, ui): efiboot = '/boot/efi/EFI/ubuntu' if command_available('efibootmgr'): report['EFIBootMgr'] = command_output(['efibootmgr', '-v']) else: report['EFIBootMgr'] = 'efibootmgr not available' commands = {} try: directory = os.stat(efiboot) except OSError as e: if e.errno == errno.ENOENT: report['Missing'] = '/boot/efi/EFI/ubuntu directory is missing' return if e.errno == errno.EACCES: directory = True if directory: arch = report['Architecture'] commands['BootEFIContents'] = 'ls %s' % efiboot commands[ 'ShimDiff'] = 'diff %s/shim%s.efi /usr/lib/shim/shim%s.efi.signed' % ( efiboot, efiarch[arch], efiarch[arch]) commands[ 'GrubDiff'] = 'diff %s/grub%s.efi /usr/lib/grub/%s-efi-signed/grub%s.efi.signed' % ( efiboot, efiarch[arch], grubarch[arch], efiarch[arch]) efivars_dir = '/sys/firmware/efi/efivars' sb_var = os.path.join(efivars_dir, 'SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c') mok_var = os.path.join( efivars_dir, 'MokSBStateRT-605dab50-e046-4300-abb6-3dd810dd8b23') attach_file(report, '/proc/sys/kernel/moksbstate_disabled') commands['SecureBoot'] = 'od -An -t u1 %s' % sb_var commands['MokSBStateRT'] = 'od -An -t u1 %s' % mok_var attach_root_command_outputs(report, commands) report['EFITables'] = recent_syslog(re.compile(r'(efi|esrt):|Secure boot'))
def add_info(report, ui): try: attach_gsettings_package(report, 'update-manager') except: pass response = ui.yesno("Is the issue you are reporting one you encountered when upgrading Ubuntu from one release to another?") if response: report.setdefault('Tags', 'dist-upgrade') report['Tags'] += ' dist-upgrade' attach_file_if_exists(report, '/var/log/dist-upgrade/apt-clone_system_state.tar.gz', 'VarLogDistupgradeAptclonesystemstate.tar.gz') attach_file_if_exists(report, '/var/log/dist-upgrade/apt.log', 'VarLogDistupgradeAptlog') attach_file_if_exists(report, '/var/log/dist-upgrade/apt-term.log', 'VarLogDistupgradeApttermlog') attach_file_if_exists(report, '/var/log/dist-upgrade/history.log', 'VarLogDistupgradeAptHistorylog') attach_file_if_exists(report, '/var/log/dist-upgrade/lspci.txt', 'VarLogDistupgradeLspcitxt') attach_file_if_exists(report, '/var/log/dist-upgrade/main.log', 'VarLogDistupgradeMainlog') attach_file_if_exists(report, '/var/log/dist-upgrade/system_state.tar.gz', 'VarLogDistupgradeSystemstate.tar.gz') attach_file_if_exists(report, '/var/log/dist-upgrade/term.log', 'VarLogDistupgradeTermlog') attach_file_if_exists(report, '/var/log/dist-upgrade/screenlog.0', 'VarLogDistupgradeScreenlog') elif response is None or response is False: attach_file_if_exists(report, '/var/log/apt/history.log', 'DpkgHistoryLog.txt') attach_file_if_exists(report, '/var/log/apt/term.log', 'DpkgTerminalLog.txt') attach_root_command_outputs(report, {'CurrentDmesg.txt': 'dmesg | comm -13 --nocheck-order /var/log/dmesg -'}) report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
def add_info(report, ui): problem_type = report.get("ProblemType", None) if problem_type == "Bug": response = ui.yesno("Is the issue you are reporting one you \ encountered when upgrading Ubuntu from one release to another?") else: response = None if response: os.execlp('apport-bug', 'apport-bug', 'ubuntu-release-upgrader') else: try: attach_gsettings_package(report, 'update-manager') except: pass attach_file_if_exists(report, '/var/log/apt/history.log', 'DpkgHistoryLog.txt') attach_file_if_exists(report, '/var/log/apt/term.log', 'DpkgTerminalLog.txt') attach_root_command_outputs( report, {'CurrentDmesg.txt': 'dmesg | comm -13 --nocheck-order /var/log/dmesg -'}) report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
def add_info(report): hookutils.attach_dmesg(report) report['KernelSyslog'] = hookutils.recent_syslog(re.compile(r'kernel:'))