]> git.proxmox.com Git - systemd.git/commitdiff
Add Apport hooks for udev and systemd when building on Ubuntu
authorMartin Pitt <martin.pitt@ubuntu.com>
Sun, 14 Dec 2014 12:46:45 +0000 (13:46 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Sun, 14 Dec 2014 12:47:32 +0000 (13:47 +0100)
debian/changelog
debian/extra/systemd.py [new file with mode: 0644]
debian/extra/udev.py [new file with mode: 0644]
debian/rules

index e588a0d605b339a52352f4de056d6732e47aecf7..e016b480cdbd793971050546b0cc881954b6dd90 100644 (file)
@@ -9,6 +9,7 @@ systemd (218-1) UNRELEASED; urgency=medium
     - Don't symlink udev doc directories.
     - Add epoch to gudev packages; Ubuntu packaged the standalone gudev before
       it got merged into udev.
+    - Add Apport hooks for udev and systemd.
 
  -- Martin Pitt <mpitt@debian.org>  Fri, 12 Dec 2014 20:32:32 +0200
 
diff --git a/debian/extra/systemd.py b/debian/extra/systemd.py
new file mode 100644 (file)
index 0000000..b36238a
--- /dev/null
@@ -0,0 +1,29 @@
+'''apport package hook for systemd
+
+(c) 2014 Canonical Ltd.
+Author: Martin Pitt <martin.pitt@ubuntu.com>
+'''
+
+import os.path
+import apport.hookutils
+
+def add_info(report):
+    apport.hookutils.attach_hardware(report)
+
+    report['SystemdDelta'] = apport.hookutils.command_output(['systemd-delta'])
+
+    if not os.path.exists('/run/systemd/system'):
+        return
+
+    # Add details about all failed units, if any
+    out = apport.hookutils.command_output(['systemctl', '--failed', '--full',
+                                           '--no-legend']).strip()
+    if out:
+        failed = ''
+        for line in out.splitlines():
+            unit = line.split()[0]
+            if failed:
+                failed += '------\n'
+            failed += apport.hookutils.command_output(['systemctl', 'status', '--full', unit])
+        report['SystemdFailedUnits'] = failed
+
diff --git a/debian/extra/udev.py b/debian/extra/udev.py
new file mode 100644 (file)
index 0000000..d8bc76f
--- /dev/null
@@ -0,0 +1,19 @@
+'''apport package hook for udev
+
+(c) 2009 Canonical Ltd.
+Author: Martin Pitt <martin.pitt@ubuntu.com>
+'''
+
+import os
+import apport.hookutils
+
+def add_info(report):
+    apport.hookutils.attach_hardware(report)
+
+    user_rules = []
+    for f in os.listdir('/etc/udev/rules.d'):
+        if not f.startswith('70-persistent-') and f != 'README':
+            user_rules.append(f)
+
+    if user_rules:
+        report['CustomUdevRuleFiles'] = ' '.join(user_rules)
index 2ebbf1bec80cbb0675df50327f1bc6f411b13c5e..3879cdf81dc318f05a6f4710241a53e591b27b4b 100755 (executable)
@@ -243,6 +243,11 @@ endif
        rm debian/udev/lib/udev/rules.d/73-seat-late.rules
        rm debian/udev/lib/udev/rules.d/71-seat.rules
        rm debian/udev/lib/udev/rules.d/99-systemd.rules
+       # Ubuntu specific files
+       if dpkg-vendor --is ubuntu; then \
+               install -D --mode=644 debian/extra/udev.py debian/udev/usr/share/apport/package-hooks/udev.py; \
+               install -D --mode=644 debian/extra/systemd.py debian/systemd/usr/share/apport/package-hooks/systemd.py; \
+       fi
 
 # use symlinked doc directories on Debian as the old udev package did
 override_dh_installdocs: