From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#34276: =?UTF-8?Q?=E2=80=98guix?= system =?UTF-8?Q?disk-image=E2=80=99?= successfully builds a bad image Date: Sun, 17 Mar 2019 13:09:35 +0100 Message-ID: <878sxdzoqo.fsf@gnu.org> References: <877eejfqmb.fsf@nckx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:44192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5Uc9-0003Mc-DE for bug-guix@gnu.org; Sun, 17 Mar 2019 08:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5Uc8-0006Iq-4s for bug-guix@gnu.org; Sun, 17 Mar 2019 08:10:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33444) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h5Uc6-0006Ht-ME for bug-guix@gnu.org; Sun, 17 Mar 2019 08:10:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h5Uc6-0002Mc-8i for bug-guix@gnu.org; Sun, 17 Mar 2019 08:10:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <877eejfqmb.fsf@nckx> (Tobias Geerinckx-Rice's message of "Fri, 01 Feb 2019 16:57:48 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Tobias Geerinckx-Rice Cc: 34276@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Tobias Geerinckx-Rice skribis: > ERROR: In procedure copy-file: > In procedure copy-file: No space left on device > ^MESC[Kcopying 422 store items > boot program > '/gnu/store/lbvrvrlqab4qpw9f907na445kppmknab-linux-vm-loader' > terminated, rebooting > [ 1071.512054] Unregister pv shared memory for cpu 0 > [ 1071.522414] reboot: Restarting system > [ 1071.542285] reboot: machine restart > successfully built > /gnu/store/lbyq5790j5hfq3spbm76i1yw3sj41l8b-disk-image.drv I investigated a bit. I managed to get our code to cause a kernel panic upon failure (patch below). However I fail to turn that guest kernel panic into a different QEMU exit code. I tried to use the =E2=80=9Cpvpanic=E2=80=9D paravirtualized device (the = =E2=80=98pvpanic.ko=E2=80=99 module in the guest, and =E2=80=9C-device pvpanic=E2=80=9D on the QEMU comm= and line), but unfortunately that thing is almost undocumented and I can=E2=80=99t get= it to turn the panic into a non-zero exit code, nor do I know if it=E2=80=99s possible. Thoughts anyone? The other option would be to create a special file in the 9p mount that=E2=80=99s shared with the host upon success, but that seems a bit hack= y. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 983c6d81c8..cb29a656b9 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Court=C3= =A8s +;;; Copyright =C2=A9 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Cour= t=C3=A8s ;;; Copyright =C2=A9 2016 Mark H Weaver ;;; Copyright =C2=A9 2016 Jan Nieuwenhuizen ;;; Copyright =C2=A9 2017 Mathieu Othacehe @@ -279,6 +279,7 @@ FILE-SYSTEMS." "isci") ;for SAS controllers like Intel C= 602 '()) =20 + "pvpanic" ,@virtio-modules)) =20 (define-syntax %base-initrd-modules diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index e561285964..b671c74ab8 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -187,8 +187,9 @@ made available under the /xchg CIFS share." ;; When USER-BUILDER succeeds, reboot (indicating a ;; success), otherwise die, which causes a kernel panic ;; ("Attempted to kill init!"). - #~(when (zero? (system* #$user-builder)) - (reboot)))) + #~(if (zero? (system* #$user-builder)) + (reboot) + (exit 1)))) =20 (let ((initrd (or initrd (base-initrd file-systems --=-=-=--