summary refs log tree commit diff
path: root/gnu/installer/dump.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2022-10-31 13:03:46 +0100
committerMathieu Othacehe <othacehe@gnu.org>2022-11-02 15:52:19 +0100
commit80387bc7c3966602800116f5be3893c3d3044a96 (patch)
treece2398404fea5837748fb58d6f1faa34de0e17ad /gnu/installer/dump.scm
parent868a1e7f320616e6a13aa23ea1ab86f7d40ddfdb (diff)
downloadguix-80387bc7c3966602800116f5be3893c3d3044a96.tar.gz
installer: Add core dump support.
Fixes: <https://issues.guix.gnu.org/58733>

* gnu/installer.scm (installer-program): Enable core dump generation.
* gnu/installer/dump.scm (%core-dump): New variable.
(prepare-dump): Copy the core dump file.
* gnu/installer/newt/welcome.scm (run-welcome-page): Propose to report an
installation that previously generated a core dump.
Diffstat (limited to 'gnu/installer/dump.scm')
-rw-r--r--gnu/installer/dump.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/gnu/installer/dump.scm b/gnu/installer/dump.scm
index daa02f205a..f91cbae021 100644
--- a/gnu/installer/dump.scm
+++ b/gnu/installer/dump.scm
@@ -28,13 +28,17 @@
   #:use-module (web http)
   #:use-module (web response)
   #:use-module (webutils multipart)
-  #:export (prepare-dump
+  #:export (%core-dump
+            prepare-dump
             make-dump
             send-dump-report))
 
 ;; The installer crash dump type.
 (define %dump-type "installer-dump")
 
+;; The core dump file.
+(define %core-dump "/tmp/installer-core-dump")
+
 (define (result->list result)
   "Return the alist for the given RESULT."
   (hash-map->list (lambda (k v)
@@ -66,6 +70,10 @@ RESULT is the installer result hash table.  Returns the created directory path."
     ;; syslog
     (copy-file "/var/log/messages" "syslog")
 
+    ;; core dump
+    (when (file-exists? %core-dump)
+      (copy-file %core-dump "core-dump"))
+
     ;; dmesg
     (let ((pipe (open-pipe* OPEN_READ "dmesg")))
       (call-with-output-file "dmesg"