Submit
Path:
~
/
/
usr
/
share
/
apport
/
package-hooks
/
File Content:
source_mdadm.py
'''apport package hook for mdadm (c) 2009-2016 Canonical Ltd. Author: Steve Beattie <sbeattie@ubuntu.com> Based on the ideas in debian's /usr/share/bug/mdadm/script ''' from apport.hookutils import attach_file, attach_file_if_exists, attach_hardware, path_to_key, command_output import os import re import glob import gzip import subprocess import sys def get_initrd_files(pattern): '''Extract listing of files from the current initrd which match a regex. pattern should be a "re" object. ''' (_, _, release, _, _) = os.uname() try: fd = gzip.GzipFile('/boot/initrd.img-' + release, 'rb') # universal_newlines needs to be False here as we're passing # binary data from gzip into cpio, which means we'll need to # decode the bytes into strings later when reading the output cpio = subprocess.Popen(['cpio', '-t'], close_fds=True, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=False) except OSError as e: return 'Error: ' + str(e) out = cpio.communicate(fd.read())[0].decode(sys.stdout.encoding, errors='replace') if cpio.returncode != 0: return 'Error: command %s failed with exit code %i %' % ( 'cpio', cpio.returncode, out) lines = ''.join([l for l in out.splitlines(True) if pattern.search(l)]) return lines def add_info(report): attach_hardware(report) attach_file(report, '/proc/mounts', 'ProcMounts') attach_file_if_exists(report, '/etc/mdadm/mdadm.conf', 'mdadm.conf') attach_file(report, '/proc/mdstat', 'ProcMDstat') attach_file(report, '/proc/partitions', 'ProcPartitions') attach_file(report, '/etc/blkid.tab', 'etc.blkid.tab') attach_file_if_exists(report, '/boot/grub/menu.lst', 'GrubMenu.lst') attach_file_if_exists(report, '/boot/grub/grub.cfg', 'Grub.cfg') attach_file_if_exists(report, '/etc/lilo.conf', 'lilo.conf') devices = glob.glob("/dev/[hs]d*") for dev in devices: report['MDadmExamine' + path_to_key(dev)] = command_output(['/sbin/mdadm', '-E', dev]) initrd_re = re.compile('md[a/]') report['initrd.files'] = get_initrd_files(initrd_re)
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
apache2.py
1816 bytes
0644
bind9.py
738 bytes
0644
cloud-init.py
176 bytes
0644
cryptsetup.py
1082 bytes
0644
isc-dhcp-client.py
1796 bytes
0644
libatasmart4.py
943 bytes
0644
openssh-client.py
1213 bytes
0644
openssh-server.py
1004 bytes
0644
postfix.py
2743 bytes
0644
source_apparmor.py
2790 bytes
0644
source_apport.py
569 bytes
0644
source_byobu.py
339 bytes
0644
source_console-setup.py
374 bytes
0644
source_debian-installer.py
1906 bytes
0644
source_fontconfig.py
162 bytes
0644
source_grub2.py
3879 bytes
0644
source_linux-aws-6.8.py
6302 bytes
0644
source_linux-aws.py
6302 bytes
0644
source_linux-azure-6.8.py
6302 bytes
0644
source_linux-azure-fde.py
6302 bytes
0644
source_linux-azure.py
6302 bytes
0644
source_linux-firmware.py
6302 bytes
0644
source_linux-gcp-6.8.py
6302 bytes
0644
source_linux-gcp.py
6302 bytes
0644
source_linux-gke.py
6302 bytes
0644
source_linux-gkeop.py
6302 bytes
0644
source_linux-hwe-6.8.py
6302 bytes
0644
source_linux-ibm-6.8.py
6302 bytes
0644
source_linux-ibm.py
6302 bytes
0644
source_linux-intel-iotg.py
6302 bytes
0644
source_linux-kvm.py
6302 bytes
0644
source_linux-lowlatency-hwe-6.8.py
6302 bytes
0644
source_linux-lowlatency.py
6302 bytes
0644
source_linux-meta-aws-6.8.py
6302 bytes
0644
source_linux-meta-aws.py
6302 bytes
0644
source_linux-meta-azure-6.8.py
6302 bytes
0644
source_linux-meta-azure-fde.py
6302 bytes
0644
source_linux-meta-azure.py
6302 bytes
0644
source_linux-meta-gcp-6.8.py
6302 bytes
0644
source_linux-meta-gcp.py
6302 bytes
0644
source_linux-meta-gke.py
6302 bytes
0644
source_linux-meta-gkeop.py
6302 bytes
0644
source_linux-meta-hwe-6.8.py
6302 bytes
0644
source_linux-meta-ibm-6.8.py
6302 bytes
0644
source_linux-meta-ibm.py
6302 bytes
0644
source_linux-meta-intel-iotg.py
6302 bytes
0644
source_linux-meta-kvm.py
6302 bytes
0644
source_linux-meta-lowlatency-hwe-6.8.py
6302 bytes
0644
source_linux-meta-lowlatency.py
6302 bytes
0644
source_linux-meta-nvidia-6.8.py
6302 bytes
0644
source_linux-meta-nvidia-tegra-igx.py
6302 bytes
0644
source_linux-meta-nvidia-tegra.py
6302 bytes
0644
source_linux-meta-nvidia.py
6302 bytes
0644
source_linux-meta-oem-osp1.py
6302 bytes
0644
source_linux-meta-oem.py
6302 bytes
0644
source_linux-meta-oracle-6.8.py
6302 bytes
0644
source_linux-meta-oracle.py
6302 bytes
0644
source_linux-meta-raspi.py
6302 bytes
0644
source_linux-meta-realtime.py
6302 bytes
0644
source_linux-meta-riscv-6.8.py
6302 bytes
0644
source_linux-meta-xilinx-zynqmp.py
6302 bytes
0644
source_linux-meta.py
6302 bytes
0644
source_linux-nvidia-6.8.py
6302 bytes
0644
source_linux-nvidia-tegra-igx.py
6302 bytes
0644
source_linux-nvidia-tegra.py
6302 bytes
0644
source_linux-nvidia.py
6302 bytes
0644
source_linux-oem-osp1.py
6302 bytes
0644
source_linux-oem.py
6302 bytes
0644
source_linux-oracle-6.8.py
6302 bytes
0644
source_linux-oracle.py
6302 bytes
0644
source_linux-raspi.py
6302 bytes
0644
source_linux-realtime.py
6302 bytes
0644
source_linux-restricted-modules-aws-6.8.py
6302 bytes
0644
source_linux-restricted-modules-aws.py
6302 bytes
0644
source_linux-restricted-modules-azure-6.8.py
6302 bytes
0644
source_linux-restricted-modules-azure.py
6302 bytes
0644
source_linux-restricted-modules-gcp-6.8.py
6302 bytes
0644
source_linux-restricted-modules-gcp.py
6302 bytes
0644
source_linux-restricted-modules-hwe-6.8.py
6302 bytes
0644
source_linux-restricted-modules-ibm-6.8.py
6302 bytes
0644
source_linux-restricted-modules-intel-iotg.py
6302 bytes
0644
source_linux-restricted-modules-lowlatency-hwe-6.8.py
6302 bytes
0644
source_linux-restricted-modules-lowlatency.py
6302 bytes
0644
source_linux-restricted-modules-nvidia-6.8.py
6302 bytes
0644
source_linux-restricted-modules-nvidia-tegra-igx.py
6302 bytes
0644
source_linux-restricted-modules-nvidia.py
6302 bytes
0644
source_linux-restricted-modules-oracle-6.8.py
6302 bytes
0644
source_linux-restricted-modules-oracle.py
6302 bytes
0644
source_linux-restricted-modules.py
6302 bytes
0644
source_linux-riscv-6.8.py
6302 bytes
0644
source_linux-signed-aws-6.8.py
6302 bytes
0644
source_linux-signed-aws.py
6302 bytes
0644
source_linux-signed-azure-6.8.py
6302 bytes
0644
source_linux-signed-azure-fde.py
6302 bytes
0644
source_linux-signed-azure.py
6302 bytes
0644
source_linux-signed-gcp-6.8.py
6302 bytes
0644
source_linux-signed-gcp.py
6302 bytes
0644
source_linux-signed-gke.py
6302 bytes
0644
source_linux-signed-gkeop.py
6302 bytes
0644
source_linux-signed-hwe-6.8.py
6302 bytes
0644
source_linux-signed-ibm-6.8.py
6302 bytes
0644
source_linux-signed-ibm.py
6302 bytes
0644
source_linux-signed-intel-iotg.py
6302 bytes
0644
source_linux-signed-kvm.py
6302 bytes
0644
source_linux-signed-lowlatency-hwe-6.8.py
6302 bytes
0644
source_linux-signed-lowlatency.py
6302 bytes
0644
source_linux-signed-nvidia-6.8.py
6302 bytes
0644
source_linux-signed-nvidia-tegra-igx.py
6302 bytes
0644
source_linux-signed-nvidia-tegra.py
6302 bytes
0644
source_linux-signed-nvidia.py
6302 bytes
0644
source_linux-signed-oem-osp1.py
6302 bytes
0644
source_linux-signed-oem.py
6302 bytes
0644
source_linux-signed-oracle-6.8.py
6302 bytes
0644
source_linux-signed-oracle.py
6302 bytes
0644
source_linux-signed-realtime.py
6302 bytes
0644
source_linux-signed.py
6302 bytes
0644
source_linux-xilinx-zynqmp.py
6302 bytes
0644
source_linux.py
6302 bytes
0644
source_mariadb-10.6.py
1964 bytes
0644
source_mdadm.py
2252 bytes
0644
source_plymouth.py
1474 bytes
0644
source_shadow.py
720 bytes
0644
source_shim-signed.py
2000 bytes
0644
source_shim.py
2000 bytes
0644
source_sudo.py
1160 bytes
0644
source_ubiquity.py
7768 bytes
0644
source_ubuntu-advantage-tools.py
1246 bytes
0644
source_ubuntu-release-upgrader.py
2684 bytes
0644
source_unattended-upgrades.py
705 bytes
0644
source_update-manager.py
2444 bytes
0644
subiquity.py
5230 bytes
0644
systemd.py
871 bytes
0644
ubuntu-desktop-installer.py
1276 bytes
0644
udev.py
455 bytes
0644
N4ST4R_ID | Naxtarrr