bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41668: Failing test: gui-installed-desktop-os-encrypted


From: Ludovic Courtès
Subject: bug#41668: Failing test: gui-installed-desktop-os-encrypted
Date: Tue, 09 Jun 2020 16:22:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

> From 18754c8c62eabb341e0f710d83ff435ef950ca8e Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <othacehe@gnu.org>
> Date: Mon, 8 Jun 2020 15:14:49 +0200
> Subject: [PATCH] installer: utils: Dump command output to syslog when testing.
>
> When debugging the installation tests, it can be very handy to be able to read
> "run-command" output, for instance when executing "guix system init".
>
> Introduce a new "invoke-with-log" procedure that is able to log a command
> standard and error outputs to the syslog. Use it, only when running the
> installation tests, to dump "run-command" output.
>
> * gnu/installer/utils.scm (open-pipe-with-stderr, invoke-with-log): New
> procedures,
> (invoke-log-port): new variable,
> (run-command): move to the end of the file and use invoke-with-log when
> running the installation tests.
> ---
>  gnu/installer/utils.scm | 164 +++++++++++++++++++++++++++++-----------
>  1 file changed, 120 insertions(+), 44 deletions(-)

It’s nice, but also a bit complicated just to print stuff on the
screen.  :-)

I found a stash with my debugging hack:

diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm
index 869be8814b..c084123064 100644
--- a/gnu/installer/final.scm
+++ b/gnu/installer/final.scm
@@ -137,7 +137,13 @@ or #f.  Return #t on success and #f on failure."
       (lambda ()
         (start-service 'cow-store (list (%installer-target-dir))))
       (lambda ()
-        (run-command install-command #:locale locale))
+        (with-output-to-file "/dev/console"
+          (lambda ()
+            (with-error-to-file "/dev/console"
+              (lambda ()
+                (setvbuf (current-output-port) 'none)
+                (setvbuf (current-error-port) 'none)
+                (run-command install-command #:locale locale))))))
       (lambda ()
         (stop-service 'cow-store)
         ;; Remove the store overlay created at cow-store service start.
That’s enough to send the ‘guix system init’ output to the console,
since we use “console=ttyS0”.

It’s a gross hack of course, but maybe we can do something along these
lines instead of setting up a pipe?

Thanks,
Ludo’.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]