GNU bug report logs - #29932
[PATCH 0/2] Clean up operating-system-kernel-arguments.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Danny Milosavljevic <dannym@HIDDEN>; Keywords: patch; dated Mon, 1 Jan 2018 13:23:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 29932 <at> debbugs.gnu.org:


Received: (at 29932) by debbugs.gnu.org; 9 Jan 2018 18:59:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 13:59:48 2018
Received: from localhost ([127.0.0.1]:49887 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYz7j-0004VF-UY
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2018 13:59:48 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:57566)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eYz7h-0004Uq-VB
 for 29932 <at> debbugs.gnu.org; Tue, 09 Jan 2018 13:59:46 -0500
Received: from localhost (178.113.224.152.wireless.dyn.drei.com
 [178.113.224.152])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id C2956336059A;
 Tue,  9 Jan 2018 19:59:43 +0100 (CET)
Date: Tue, 9 Jan 2018 19:59:41 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: ludo@HIDDEN (Ludovic =?ISO-8859-1?Q?Court=E8s?=)
Subject: Re: [bug#29932] [PATCH 0/2] Clean up
 operating-system-kernel-arguments.
Message-ID: <20180109195941.10076cb4@HIDDEN>
In-Reply-To: <20180109113954.530505c0@HIDDEN>
References: <20180101132200.26157-1-dannym@HIDDEN>
 <878td8k8f5.fsf@HIDDEN> <20180109113954.530505c0@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29932
Cc: 29932 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Newest attempt:

diff --git a/gnu/system.scm b/gnu/system.scm
index 40e259f43..37f0e76ec 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -73,7 +73,8 @@
             operating-system-hosts-file
             operating-system-kernel
             operating-system-kernel-file
-            operating-system-kernel-arguments
+            operating-system-boot-kernel-arguments
+            operating-system-user-kernel-arguments
             operating-system-initrd
             operating-system-users
             operating-system-groups
@@ -90,7 +91,6 @@
             operating-system-activation-script
             operating-system-user-accounts
             operating-system-shepherd-service-names
-            operating-system-user-kernel-arguments
 
             operating-system-derivation
             operating-system-profile
@@ -126,10 +126,9 @@
 ;;;
 ;;; Code:
 
-(define (bootable-kernel-arguments kernel-arguments system.drv root-device)
-  "Prepend extra arguments to KERNEL-ARGUMENTS that allow SYSTEM.DRV to be
-booted from ROOT-DEVICE"
-  (cons* (string-append "--root="
+(define (boot-kernel-arguments system.drv root-device)
+  "Kernel-arguments that allow SYSTEM.DRV to be booted from ROOT-DEVICE"
+  (list (string-append "--root="
                         (if (uuid? root-device)
 
                             ;; Note: Always use the DCE format because that's
@@ -138,8 +137,7 @@ booted from ROOT-DEVICE"
                             (uuid->string (uuid-bytevector root-device) 'dce)
                             root-device))
          #~(string-append "--system=" #$system.drv)
-         #~(string-append "--load=" #$system.drv "/boot")
-         kernel-arguments))
+         #~(string-append "--load=" #$system.drv "/boot")))
 
 ;; System-wide configuration.
 ;; TODO: Add per-field docstrings/stexi.
@@ -201,12 +199,11 @@ booted from ROOT-DEVICE"
   (sudoers-file operating-system-sudoers-file     ; file-like
                 (default %sudoers-specification)))
 
-(define (operating-system-kernel-arguments os system.drv root-device)
-  "Return all the kernel arguments, including the ones not specified
-directly by the user."
-  (bootable-kernel-arguments (operating-system-user-kernel-arguments os)
-                             system.drv
-                             root-device))
+(define* (operating-system-boot-kernel-arguments os)
+  "Kernel arguments that allow OS (only) to be booted."
+  (let* ((root-file-system (operating-system-root-file-system os))
+         (root-device (file-system-device root-file-system)))
+    #~(boot-kernel-arguments #$os root-device)))
 
 ^L
 ;;;
@@ -319,8 +316,7 @@ The object has its kernel-arguments extended in order to make it bootable."
     (if params
       (boot-parameters
         (inherit params)
-        (kernel-arguments (bootable-kernel-arguments kernel-arguments
-                                                     system root)))
+        (kernel-arguments (append (boot-kernel-arguments system root) kernel-arguments)))
       #f)))
 
 (define (boot-parameters->menu-entry conf)
@@ -940,9 +936,10 @@ kernel arguments for that derivation to <boot-parameters>."
              (root-device root-device)
              (kernel (operating-system-kernel-file os))
              (kernel-arguments
-              (if system.drv
-                (operating-system-kernel-arguments os system.drv root-device)
-                (operating-system-user-kernel-arguments os)))
+              (append (if system.drv
+                        (operating-system-boot-kernel-arguments os)
+                        '())
+                      (operating-system-user-kernel-arguments os)))
              (initrd initrd)
              (bootloader-name bootloader-name)
              (store-device (ensure-not-/dev (fs->boot-device store)))
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 496f2ac4e..6ba76142b 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -716,7 +716,8 @@ it is mostly useful when FULL-BOOT?  is true."
                                 #:disk-image-size disk-image-size)))
     (define kernel-arguments
       #~(list #$@(if graphic? #~() #~("console=ttyS0"))
-              #+@(operating-system-kernel-arguments os os-drv "/dev/vda1")))
+              #+@(append (operating-system-boot-kernel-arguments os)
+                         (operating-system-user-kernel-arguments os))))
 
     (define qemu-exec
       #~(list (string-append #$qemu "/bin/" #$(qemu-command (%current-system)))


I get this error message:

In gnu/system.scm:
    905:2  2 (_ _)
   939:14  1 (_ _)
In unknown file:
           0 (append #<gexp (boot-kernel-arguments #<gexp-input #<<?> ?)
ERROR: In procedure append: Wrong type argument in position 1 (expecting empty list): #<gexp (boot-kernel-arguments #<gexp-input #<<operating-system> kern...

gnu/system.scm:939 is the "append" in the middle of "operating-system-boot-parameters".

What now?




Information forwarded to guix-patches@HIDDEN:
bug#29932; Package guix-patches. Full text available.

Message received at 29932 <at> debbugs.gnu.org:


Received: (at 29932) by debbugs.gnu.org; 9 Jan 2018 11:53:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 06:53:20 2018
Received: from localhost ([127.0.0.1]:42160 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYsT2-0004NO-2S
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2018 06:53:20 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:42618)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1eYsT0-0004NF-99
 for 29932 <at> debbugs.gnu.org; Tue, 09 Jan 2018 06:53:18 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id B922710659;
 Tue,  9 Jan 2018 12:53:17 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id UI57y5l9KMfs; Tue,  9 Jan 2018 12:53:17 +0100 (CET)
Received: from ribbon (unknown [193.50.110.243])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id DADF910474;
 Tue,  9 Jan 2018 12:53:16 +0100 (CET)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: [bug#29932] [PATCH 0/2] Clean up
 operating-system-kernel-arguments.
References: <20180101132200.26157-1-dannym@HIDDEN>
 <878td8k8f5.fsf@HIDDEN> <20180109092133.3f740ba3@HIDDEN>
 <87incbxvlq.fsf@HIDDEN> <20180109113438.38341a07@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 20 =?utf-8?Q?Niv=C3=B4se?= an 226 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 09 Jan 2018 12:53:16 +0100
In-Reply-To: <20180109113438.38341a07@HIDDEN> (Danny Milosavljevic's
 message of "Tue, 9 Jan 2018 11:34:38 +0100")
Message-ID: <87608bw8nn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 29932
Cc: 29932 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

Danny Milosavljevic <dannym@HIDDEN> skribis:

> Hi Ludo,
>
>>   #~(string-append "--system=3D" #$os)
>>=20
>> where =E2=80=98os=E2=80=99 is an <operating-system>.  It automatically c=
omputes its
>> derivation.  Thus, no need to explicitly call
>> =E2=80=98operating-system-derivation=E2=80=99 and pass =E2=80=9Csystem.d=
rv=E2=80=9D arguments around.
>
> Ah!  Good to know.
>
>> So we=E2=80=99d just need a slight adjustment to =E2=80=98bootable-kerne=
l-arguments=E2=80=99 (so
>> that it takes the root device from the given OS object) and then rename
>> it to =E2=80=98operating-system-kernel-arguments=E2=80=99.
>
> bootable-kernel-arguments is also used by the "parameters" file serialize=
r.

Good point, so probably we need to keep it as-is internally.  For user
consumption though, we can expose =E2=80=98operating-system-kernel-argument=
s=E2=80=99
(or whatever we call it.)

> Also, the user that is modifying a <operating-system> instance (for examp=
le marionette-operating-system adding "panic=3D1") would erronously use ope=
rating-system-kernel-arguments in order to get the previous instance's argu=
ments, resulting in the "--root", "--load" etc being prepended twice, no?
>
> The user might want to pass some kernel arguments which have nothing to d=
o with Guix (which <operating-system>'s "kernel-arguments" is for) and then=
 GuixSD needs some extra arguments to be able to boot the actual system (wh=
ich can be found entirely automatically - nice!).

Oh wait, now I realize that =E2=80=98operating-system-kernel-arguments=E2=
=80=99 is
already taken.  :-)

So another name suggestion would be:
=E2=80=98operating-system-essential-kernel-arguments=E2=80=99.  Thoughts?

Sorry for the confusion!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#29932; Package guix-patches. Full text available.

Message received at 29932 <at> debbugs.gnu.org:


Received: (at 29932) by debbugs.gnu.org; 9 Jan 2018 10:40:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 05:40:00 2018
Received: from localhost ([127.0.0.1]:42135 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYrK4-0002XD-Ej
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2018 05:40:00 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:46290)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eYrK2-0002X5-HU
 for 29932 <at> debbugs.gnu.org; Tue, 09 Jan 2018 05:39:58 -0500
Received: from localhost (178.113.224.152.wireless.dyn.drei.com
 [178.113.224.152])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 34BE533600C4;
 Tue,  9 Jan 2018 11:39:57 +0100 (CET)
Date: Tue, 9 Jan 2018 11:39:54 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: ludo@HIDDEN (Ludovic =?ISO-8859-1?Q?Court=E8s?=)
Subject: Re: [bug#29932] [PATCH 0/2] Clean up
 operating-system-kernel-arguments.
Message-ID: <20180109113954.530505c0@HIDDEN>
In-Reply-To: <878td8k8f5.fsf@HIDDEN>
References: <20180101132200.26157-1-dannym@HIDDEN>
 <878td8k8f5.fsf@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29932
Cc: 29932 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

> It=E2=80=99d feel more idiomatic to me if, instead, we had an
> =E2=80=98operating-system-boot-kernel-arguments=E2=80=99 procedure that t=
akes an OS and
> returns (list --root --system =E2=80=A6).  Then it=E2=80=99d be up to the=
 caller to
> append that to what =E2=80=98operating-system-kernel-arguments=E2=80=99 r=
eturns.

We could also do that...

Note that bootable-kernel-arguments is also used by this:

(define (read-boot-parameters-file system)
  "Read boot parameters from SYSTEM's (system or generation) \"parameters\"
file and returns the corresponding <boot-parameters> object or #f if the
format is unrecognized.
The object has its kernel-arguments extended in order to make it bootable."
  (let* ((file (string-append system "/parameters"))
         (params (call-with-input-file file read-boot-parameters))
         (root (boot-parameters-root-device params))
         (kernel-arguments (boot-parameters-kernel-arguments params)))
    (if params
      (boot-parameters
        (inherit params)
        (kernel-arguments (bootable-kernel-arguments kernel-arguments
                                                     system root)))
      #f)))

Which is used by the ./guix/scripts/system.scm generation lister etc (that =
is, they have the derivations already).




Information forwarded to guix-patches@HIDDEN:
bug#29932; Package guix-patches. Full text available.

Message received at 29932 <at> debbugs.gnu.org:


Received: (at 29932) by debbugs.gnu.org; 9 Jan 2018 10:34:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 05:34:45 2018
Received: from localhost ([127.0.0.1]:42126 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYrEz-0002Py-6L
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2018 05:34:45 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:45676)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eYrEw-0002Pn-Dq
 for 29932 <at> debbugs.gnu.org; Tue, 09 Jan 2018 05:34:43 -0500
Received: from localhost (178.113.224.152.wireless.dyn.drei.com
 [178.113.224.152])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id A6BE53360350;
 Tue,  9 Jan 2018 11:34:40 +0100 (CET)
Date: Tue, 9 Jan 2018 11:34:38 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: ludo@HIDDEN (Ludovic =?ISO-8859-1?Q?Court=E8s?=)
Subject: Re: [bug#29932] [PATCH 0/2] Clean up
 operating-system-kernel-arguments.
Message-ID: <20180109113438.38341a07@HIDDEN>
In-Reply-To: <87incbxvlq.fsf@HIDDEN>
References: <20180101132200.26157-1-dannym@HIDDEN>
 <878td8k8f5.fsf@HIDDEN> <20180109092133.3f740ba3@HIDDEN>
 <87incbxvlq.fsf@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29932
Cc: 29932 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Hi Ludo,

>   #~(string-append "--system=3D" #$os)
>=20
> where =E2=80=98os=E2=80=99 is an <operating-system>.  It automatically co=
mputes its
> derivation.  Thus, no need to explicitly call
> =E2=80=98operating-system-derivation=E2=80=99 and pass =E2=80=9Csystem.dr=
v=E2=80=9D arguments around.

Ah!  Good to know.

> So we=E2=80=99d just need a slight adjustment to =E2=80=98bootable-kernel=
-arguments=E2=80=99 (so
> that it takes the root device from the given OS object) and then rename
> it to =E2=80=98operating-system-kernel-arguments=E2=80=99.

bootable-kernel-arguments is also used by the "parameters" file serializer.

Also, the user that is modifying a <operating-system> instance (for example=
 marionette-operating-system adding "panic=3D1") would erronously use opera=
ting-system-kernel-arguments in order to get the previous instance's argume=
nts, resulting in the "--root", "--load" etc being prepended twice, no?

The user might want to pass some kernel arguments which have nothing to do =
with Guix (which <operating-system>'s "kernel-arguments" is for) and then G=
uixSD needs some extra arguments to be able to boot the actual system (whic=
h can be found entirely automatically - nice!).

Example:

diff --git a/gnu/tests.scm b/gnu/tests.scm
index 0caa922fd..3e4c3d4e3 100644
--- a/gnu/tests.scm
+++ b/gnu/tests.scm
@@ -172,6 +172,14 @@ marionette service in the guest is started after the S=
hepherd services listed
 in REQUIREMENTS."
   (operating-system
     (inherit os)
+    ;; Make sure the guest dies on error.
+    (kernel-arguments (cons "panic=3D1"
+                            (operating-system-user-kernel-arguments os)))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    ;; Make sure the guest doesn't hang in the REPL on error.
+    (initrd (lambda (fs . rest)
+              (apply (operating-system-initrd os) fs
+                     #:on-error 'backtrace
+                     rest)))
     (services (cons (service marionette-service-type
                              (marionette-configuration
                               (requirements requirements)

I'd suggest this:

diff --git a/gnu/system.scm b/gnu/system.scm
index df89ca06d..6466c7c48 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -73,7 +73,8 @@
             operating-system-hosts-file
             operating-system-kernel
             operating-system-kernel-file
-            operating-system-kernel-arguments
+            operating-system-bootable-kernel-arguments
+            operating-system-user-kernel-arguments
             operating-system-initrd
             operating-system-users
             operating-system-groups
@@ -200,12 +201,13 @@ booted from ROOT-DEVICE"
   (sudoers-file operating-system-sudoers-file     ; file-like
                 (default %sudoers-specification)))
=20
-(define (operating-system-kernel-arguments os system.drv root-device)
-  "Return all the kernel arguments, including the ones not specified
-directly by the user."
-  (bootable-kernel-arguments (operating-system-user-kernel-arguments os)
-                             system.drv
-                             root-device))
+(define* (operating-system-bootable-kernel-arguments os)
+  "Prepend extra arguments to OS's kernel-arguments that allow OS to be bo=
oted."
+  (let* ((root-file-system (operating-system-root-file-system os))
+         (root-device (file-system-device root-file-system)))
+    #~(bootable-kernel-arguments (operating-system-user-kernel-arguments o=
s)
+                                 #$os
+                                 root-device)))
=20
 ^L
 ;;;
@@ -940,7 +942,7 @@ kernel arguments for that derivation to <boot-parameter=
s>."
              (kernel (operating-system-kernel-file os))
              (kernel-arguments
               (if system.drv
-                (operating-system-kernel-arguments os system.drv root-devi=
ce)
+                (operating-system-bootable-kernel-arguments os)
                 (operating-system-user-kernel-arguments os)))
              (initrd initrd)
              (bootloader-name bootloader-name)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 496f2ac4e..117e333a7 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -716,7 +716,7 @@ it is mostly useful when FULL-BOOT?  is true."
                                 #:disk-image-size disk-image-size)))
     (define kernel-arguments
       #~(list #$@(if graphic? #~() #~("console=3DttyS0"))
-              #+@(operating-system-kernel-arguments os os-drv "/dev/vda1")=
))
+              #+@(operating-system-bootable-kernel-arguments os)))
=20
     (define qemu-exec
       #~(list (string-append #$qemu "/bin/" #$(qemu-command (%current-syst=
em)))




Information forwarded to guix-patches@HIDDEN:
bug#29932; Package guix-patches. Full text available.

Message received at 29932 <at> debbugs.gnu.org:


Received: (at 29932) by debbugs.gnu.org; 9 Jan 2018 08:52:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 03:52:23 2018
Received: from localhost ([127.0.0.1]:42085 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYpdv-0008Uc-FE
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2018 03:52:23 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:41546)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1eYpdt-0008UU-7d
 for 29932 <at> debbugs.gnu.org; Tue, 09 Jan 2018 03:52:21 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id CE02010904;
 Tue,  9 Jan 2018 09:52:19 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id pp3b8KnnGJcY; Tue,  9 Jan 2018 09:52:19 +0100 (CET)
Received: from ribbon (unknown [193.50.110.243])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id D54831034E;
 Tue,  9 Jan 2018 09:52:18 +0100 (CET)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: [bug#29932] [PATCH 0/2] Clean up
 operating-system-kernel-arguments.
References: <20180101132200.26157-1-dannym@HIDDEN>
 <878td8k8f5.fsf@HIDDEN> <20180109092133.3f740ba3@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 20 =?utf-8?Q?Niv=C3=B4se?= an 226 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 09 Jan 2018 09:52:17 +0100
In-Reply-To: <20180109092133.3f740ba3@HIDDEN> (Danny Milosavljevic's
 message of "Tue, 9 Jan 2018 09:21:33 +0100")
Message-ID: <87incbxvlq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 29932
Cc: 29932 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

Hi Danny,

Danny Milosavljevic <dannym@HIDDEN> skribis:

> On Mon, 08 Jan 2018 10:26:54 +0100
> ludo@HIDDEN (Ludovic Court=C3=A8s) wrote:

[...]

>> It=E2=80=99d feel more idiomatic to me if, instead, we had an
>> =E2=80=98operating-system-boot-kernel-arguments=E2=80=99 procedure that =
takes an OS and
>> returns (list --root --system =E2=80=A6).  Then it=E2=80=99d be up to th=
e caller to
>> append that to what =E2=80=98operating-system-kernel-arguments=E2=80=99 =
returns.
>
> Yeah, but looking at it some more, it doesn't really need an OS.  It need=
s the system derivation (and root device).

Since <operating-system> has a =E2=80=9Cgexp compiler=E2=80=9D, you can wri=
te:

  #~(string-append "--system=3D" #$os)

where =E2=80=98os=E2=80=99 is an <operating-system>.  It automatically comp=
utes its
derivation.  Thus, no need to explicitly call
=E2=80=98operating-system-derivation=E2=80=99 and pass =E2=80=9Csystem.drv=
=E2=80=9D arguments around.

So we=E2=80=99d just need a slight adjustment to =E2=80=98bootable-kernel-a=
rguments=E2=80=99 (so
that it takes the root device from the given OS object) and then rename
it to =E2=80=98operating-system-kernel-arguments=E2=80=99.

How does that sound?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#29932; Package guix-patches. Full text available.

Message received at 29932 <at> debbugs.gnu.org:


Received: (at 29932) by debbugs.gnu.org; 9 Jan 2018 08:21:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 03:21:44 2018
Received: from localhost ([127.0.0.1]:42068 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYpAG-0007jX-6l
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2018 03:21:44 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:34790)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eYpAD-0007jL-Ko
 for 29932 <at> debbugs.gnu.org; Tue, 09 Jan 2018 03:21:42 -0500
Received: from localhost (178.113.224.152.wireless.dyn.drei.com
 [178.113.224.152])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id C321733605DD;
 Tue,  9 Jan 2018 09:21:39 +0100 (CET)
Date: Tue, 9 Jan 2018 09:21:33 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: ludo@HIDDEN (Ludovic =?ISO-8859-1?Q?Court=E8s?=)
Subject: Re: [bug#29932] [PATCH 0/2] Clean up
 operating-system-kernel-arguments.
Message-ID: <20180109092133.3f740ba3@HIDDEN>
In-Reply-To: <878td8k8f5.fsf@HIDDEN>
References: <20180101132200.26157-1-dannym@HIDDEN>
 <878td8k8f5.fsf@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29932
Cc: 29932 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Hi Ludo,

On Mon, 08 Jan 2018 10:26:54 +0100
ludo@HIDDEN (Ludovic Court=C3=A8s) wrote:

> Danny Milosavljevic <dannym@HIDDEN> skribis:
>=20
> > Previously, the accessor for the field "kernel-arguments" in the struct=
ure
> > <operating-system> was called "operating-system-user-kernel-arguments".
> >
> > The procedure "operating-system-kernel-arguments" made sure to add argu=
ments
> > that made the system boot from a given device.
> >
> > After some reflection I think I was mistaken in that.
> >
> > It's nicer if the accessor is called "operating-system-kernel-argmuents"
> > and if the users just use "bootable-kernel-arguments" on their own in o=
rder to
> > amend them.
> >
> > That's what this patch does. =20
>=20
> I find =E2=80=98bootable-kernel-arguments=E2=80=99 to be quite unusual fo=
r a public
> interface.
>=20
> It=E2=80=99d feel more idiomatic to me if, instead, we had an
> =E2=80=98operating-system-boot-kernel-arguments=E2=80=99 procedure that t=
akes an OS and
> returns (list --root --system =E2=80=A6).  Then it=E2=80=99d be up to the=
 caller to
> append that to what =E2=80=98operating-system-kernel-arguments=E2=80=99 r=
eturns.

Yeah, but looking at it some more, it doesn't really need an OS.  It needs =
the system derivation (and root device).

Do we still call it "operating-system-..." when it won't get an OS (or anyt=
hing from it) as parameter?

What it does now is

(define (bootable-kernel-arguments kernel-arguments system.drv root-device)
  "Prepend extra arguments to KERNEL-ARGUMENTS that allow SYSTEM.DRV to be
booted from ROOT-DEVICE"
  (cons* (string-append "--root=3D"
                        (if (uuid? root-device)

                            ;; Note: Always use the DCE format because that=
's
                            ;; what (gnu build linux-boot) expects for the
                            ;; '--root' kernel command-line option.
                            (uuid->string (uuid-bytevector root-device) 'dc=
e)
                            root-device))
         #~(string-append "--system=3D" #$system.drv)
         #~(string-append "--load=3D" #$system.drv "/boot")
         kernel-arguments))

We could make it do

(define (bootable-kernel-arguments* system.drv root-device)
  "Return extra boot arguments that allow SYSTEM.DRV to be
booted from ROOT-DEVICE"
  (list (string-append "--root=3D"
                        (if (uuid? root-device)

                            ;; Note: Always use the DCE format because that=
's
                            ;; what (gnu build linux-boot) expects for the
                            ;; '--root' kernel command-line option.
                            (uuid->string (uuid-bytevector root-device) 'dc=
e)
                            root-device))
        #~(string-append "--system=3D" #$system.drv)
        #~(string-append "--load=3D" #$system.drv "/boot")))

But then it doesn't take anything from <operating-system>.

The current users are:

(define (operating-system-kernel-arguments os system.drv root-device)
  "Return all the kernel arguments, including the ones not specified
directly by the user."
  (bootable-kernel-arguments (operating-system-user-kernel-arguments os)
                             system.drv
                             root-device))

Of that, the current users are:

(define (operating-system-boot-parameters os system.drv root-device)
  "Return a monadic <boot-parameters> record that describes the boot parame=
ters
of OS.  SYSTEM.DRV is either a derivation or #f.  If it's a derivation, adds
kernel arguments for that derivation to <boot-parameters>."
  (mlet* %store-monad
      ((initrd (operating-system-initrd-file os))
       (store -> (operating-system-store-file-system os))
       (bootloader  -> (bootloader-configuration-bootloader
                        (operating-system-bootloader os)))
       (bootloader-name -> (bootloader-name bootloader))
       (label -> (kernel->boot-label (operating-system-kernel os))))
    (return (boot-parameters
             (label label)
             (root-device root-device)
             (kernel (operating-system-kernel-file os))
             (kernel-arguments
              (if system.drv
                (operating-system-kernel-arguments os system.drv root-devic=
e)
                (operating-system-user-kernel-arguments os)))
             (initrd initrd)
             (bootloader-name bootloader-name)
             (store-device (ensure-not-/dev (fs->boot-device store)))
             (store-mount-point (file-system-mount-point store))))))


(define* (system-qemu-image/shared-store-script os
                                                #:key
                                                (qemu qemu)
                                                (graphic? #t)
                                                (memory-size 256)
                                                (mappings '())
                                                full-boot?
                                                (disk-image-size
                                                 (* (if full-boot? 500 70)
                                                    (expt 2 20)))
                                                (options '()))
...
    (define kernel-arguments
      #~(list #$@(if graphic? #~() #~("console=3DttyS0"))
              #+@(operating-system-kernel-arguments os os-drv "/dev/vda1")))
...




Information forwarded to guix-patches@HIDDEN:
bug#29932; Package guix-patches. Full text available.

Message received at 29932 <at> debbugs.gnu.org:


Received: (at 29932) by debbugs.gnu.org; 8 Jan 2018 09:26:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 08 04:26:58 2018
Received: from localhost ([127.0.0.1]:40200 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYThq-0007C9-Ex
	for submit <at> debbugs.gnu.org; Mon, 08 Jan 2018 04:26:58 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:33932)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1eYTho-0007C1-J2
 for 29932 <at> debbugs.gnu.org; Mon, 08 Jan 2018 04:26:56 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 0B682108C7;
 Mon,  8 Jan 2018 10:26:56 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id uAYx7O7c755R; Mon,  8 Jan 2018 10:26:54 +0100 (CET)
Received: from ribbon (unknown [193.50.110.243])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 9FB9D10872;
 Mon,  8 Jan 2018 10:26:54 +0100 (CET)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: [bug#29932] [PATCH 0/2] Clean up
 operating-system-kernel-arguments.
References: <20180101132200.26157-1-dannym@HIDDEN>
Date: Mon, 08 Jan 2018 10:26:54 +0100
In-Reply-To: <20180101132200.26157-1-dannym@HIDDEN> (Danny
 Milosavljevic's message of "Mon, 1 Jan 2018 14:22:00 +0100")
Message-ID: <878td8k8f5.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 29932
Cc: 29932 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

Hello,

Danny Milosavljevic <dannym@HIDDEN> skribis:

> Previously, the accessor for the field "kernel-arguments" in the structure
> <operating-system> was called "operating-system-user-kernel-arguments".
>
> The procedure "operating-system-kernel-arguments" made sure to add argume=
nts
> that made the system boot from a given device.
>
> After some reflection I think I was mistaken in that.
>
> It's nicer if the accessor is called "operating-system-kernel-argmuents"
> and if the users just use "bootable-kernel-arguments" on their own in ord=
er to
> amend them.
>
> That's what this patch does.

I find =E2=80=98bootable-kernel-arguments=E2=80=99 to be quite unusual for =
a public
interface.

It=E2=80=99d feel more idiomatic to me if, instead, we had an
=E2=80=98operating-system-boot-kernel-arguments=E2=80=99 procedure that tak=
es an OS and
returns (list --root --system =E2=80=A6).  Then it=E2=80=99d be up to the c=
aller to
append that to what =E2=80=98operating-system-kernel-arguments=E2=80=99 ret=
urns.

WDYT?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#29932; Package guix-patches. Full text available.

Message received at 29932 <at> debbugs.gnu.org:


Received: (at 29932) by debbugs.gnu.org; 1 Jan 2018 13:27:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 01 08:27:14 2018
Received: from localhost ([127.0.0.1]:59327 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eW07W-0007AL-NY
	for submit <at> debbugs.gnu.org; Mon, 01 Jan 2018 08:27:14 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:43522)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eW07U-0007A6-U1
 for 29932 <at> debbugs.gnu.org; Mon, 01 Jan 2018 08:27:13 -0500
Received: from dayas.3.home (178.113.223.176.wireless.dyn.drei.com
 [178.113.223.176])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 877B93361A28;
 Mon,  1 Jan 2018 14:27:11 +0100 (CET)
From: Danny Milosavljevic <dannym@HIDDEN>
To: 29932 <at> debbugs.gnu.org
Subject: [PATCH 2/2] system: Rename operating-system-user-kernel-arguments to
 operating-system-kernel-arguments.
Date: Mon,  1 Jan 2018 14:27:03 +0100
Message-Id: <20180101132703.26309-2-dannym@HIDDEN>
X-Mailer: git-send-email 2.15.1
In-Reply-To: <20180101132703.26309-1-dannym@HIDDEN>
References: <20180101132200.26157-1-dannym@HIDDEN>
 <20180101132703.26309-1-dannym@HIDDEN>
Tags: patch
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29932
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

* gnu/system.scm (operating-system-user-kernel-arguments): Rename to ...
(operating-system-kernel-arguments): ... this.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Use
operating-system-kernel-arguments.
---
 gnu/system.scm    | 6 +++---
 gnu/system/vm.scm | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 42e0c37c1..79e3facee 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -149,7 +149,7 @@ booted from ROOT-DEVICE"
   operating-system?
   (kernel operating-system-kernel                 ; package
           (default linux-libre))
-  (kernel-arguments operating-system-user-kernel-arguments
+  (kernel-arguments operating-system-kernel-arguments
                     (default '()))                ; list of gexps/strings
   (bootloader operating-system-bootloader)        ; <bootloader-configuration>
 
@@ -936,9 +936,9 @@ kernel arguments for that derivation to <boot-parameters>."
              (kernel-arguments
               (if system.drv
                 (bootable-kernel-arguments
-                 (operating-system-user-kernel-arguments os)
+                 (operating-system-kernel-arguments os)
                  system.drv root-device)
-                (operating-system-user-kernel-arguments os)))
+                (operating-system-kernel-arguments os)))
              (initrd initrd)
              (bootloader-name bootloader-name)
              (store-device (ensure-not-/dev (fs->boot-device store)))
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 323eceac5..13c1557df 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -705,7 +705,7 @@ it is mostly useful when FULL-BOOT?  is true."
     (define kernel-arguments
       #~(list #$@(if graphic? #~() #~("console=ttyS0"))
               #+@(bootable-kernel-arguments
-                  (operating-system-user-kernel-arguments os)
+                  (operating-system-kernel-arguments os)
                   os-drv "/dev/vda1")))
 
     (define qemu-exec




Information forwarded to guix-patches@HIDDEN:
bug#29932; Package guix-patches. Full text available.

Message received at 29932 <at> debbugs.gnu.org:


Received: (at 29932) by debbugs.gnu.org; 1 Jan 2018 13:27:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 01 08:27:13 2018
Received: from localhost ([127.0.0.1]:59325 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eW07V-0007AD-Gc
	for submit <at> debbugs.gnu.org; Mon, 01 Jan 2018 08:27:13 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:43516)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eW07T-00079y-Tc
 for 29932 <at> debbugs.gnu.org; Mon, 01 Jan 2018 08:27:12 -0500
Received: from dayas.3.home (178.113.223.176.wireless.dyn.drei.com
 [178.113.223.176])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 9192F3360BED;
 Mon,  1 Jan 2018 14:27:09 +0100 (CET)
From: Danny Milosavljevic <dannym@HIDDEN>
To: 29932 <at> debbugs.gnu.org
Subject: [PATCH 1/2] system: Inline operating-system-kernel-arguments.
Date: Mon,  1 Jan 2018 14:27:02 +0100
Message-Id: <20180101132703.26309-1-dannym@HIDDEN>
X-Mailer: git-send-email 2.15.1
In-Reply-To: <20180101132200.26157-1-dannym@HIDDEN>
References: <20180101132200.26157-1-dannym@HIDDEN>
Tags: patch
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29932
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

* gnu/system.scm (operating-system-kernel-arguments): Remove.
(bootable-kernel-arguments): Export.
(read-boot-parameters-file): Use bootable-kernel-arguments.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Use
bootable-kernel-arguments.
---
 gnu/system.scm    | 15 ++++++---------
 gnu/system/vm.scm |  4 +++-
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index df89ca06d..42e0c37c1 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -117,7 +117,9 @@
             local-host-aliases
             %setuid-programs
             %base-packages
-            %base-firmware))
+            %base-firmware
+
+            bootable-kernel-arguments))
 
 ;;; Commentary:
 ;;;
@@ -200,13 +202,6 @@ booted from ROOT-DEVICE"
   (sudoers-file operating-system-sudoers-file     ; file-like
                 (default %sudoers-specification)))
 
-(define (operating-system-kernel-arguments os system.drv root-device)
-  "Return all the kernel arguments, including the ones not specified
-directly by the user."
-  (bootable-kernel-arguments (operating-system-user-kernel-arguments os)
-                             system.drv
-                             root-device))
-
 
 ;;;
 ;;; Boot parameters
@@ -940,7 +935,9 @@ kernel arguments for that derivation to <boot-parameters>."
              (kernel (operating-system-kernel-file os))
              (kernel-arguments
               (if system.drv
-                (operating-system-kernel-arguments os system.drv root-device)
+                (bootable-kernel-arguments
+                 (operating-system-user-kernel-arguments os)
+                 system.drv root-device)
                 (operating-system-user-kernel-arguments os)))
              (initrd initrd)
              (bootloader-name bootloader-name)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 53629daa9..323eceac5 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -704,7 +704,9 @@ it is mostly useful when FULL-BOOT?  is true."
                                 #:disk-image-size disk-image-size)))
     (define kernel-arguments
       #~(list #$@(if graphic? #~() #~("console=ttyS0"))
-              #+@(operating-system-kernel-arguments os os-drv "/dev/vda1")))
+              #+@(bootable-kernel-arguments
+                  (operating-system-user-kernel-arguments os)
+                  os-drv "/dev/vda1")))
 
     (define qemu-exec
       #~(list (string-append #$qemu "/bin/" #$(qemu-command (%current-system)))




Information forwarded to guix-patches@HIDDEN:
bug#29932; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Jan 2018 13:22:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 01 08:22:22 2018
Received: from localhost ([127.0.0.1]:59319 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eW02n-00072G-U2
	for submit <at> debbugs.gnu.org; Mon, 01 Jan 2018 08:22:22 -0500
Received: from eggs.gnu.org ([208.118.235.92]:45989)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eW02m-000722-EF
 for submit <at> debbugs.gnu.org; Mon, 01 Jan 2018 08:22:20 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1eW02g-0004zi-FJ
 for submit <at> debbugs.gnu.org; Mon, 01 Jan 2018 08:22:15 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:55876)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dannym@HIDDEN>)
 id 1eW02g-0004zR-BY
 for submit <at> debbugs.gnu.org; Mon, 01 Jan 2018 08:22:14 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36938)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1eW02f-0001hN-ER
 for guix-patches@HIDDEN; Mon, 01 Jan 2018 08:22:14 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1eW02a-0004rU-HR
 for guix-patches@HIDDEN; Mon, 01 Jan 2018 08:22:13 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:39300)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dannym@HIDDEN>)
 id 1eW02a-0004mI-AM
 for guix-patches@HIDDEN; Mon, 01 Jan 2018 08:22:08 -0500
Received: from dayas.3.home (178.113.223.176.wireless.dyn.drei.com
 [178.113.223.176])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 52904336029B;
 Mon,  1 Jan 2018 14:22:04 +0100 (CET)
From: Danny Milosavljevic <dannym@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/2] Clean up operating-system-kernel-arguments.
Date: Mon,  1 Jan 2018 14:22:00 +0100
Message-Id: <20180101132200.26157-1-dannym@HIDDEN>
X-Mailer: git-send-email 2.15.1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Previously, the accessor for the field "kernel-arguments" in the structure
<operating-system> was called "operating-system-user-kernel-arguments".

The procedure "operating-system-kernel-arguments" made sure to add arguments
that made the system boot from a given device.

After some reflection I think I was mistaken in that.

It's nicer if the accessor is called "operating-system-kernel-argmuents"
and if the users just use "bootable-kernel-arguments" on their own in order to
amend them.

That's what this patch does.

Danny Milosavljevic (2):
  system: Inline operating-system-kernel-arguments.
  system: Rename operating-system-user-kernel-arguments to
    operating-system-kernel-arguments.

 gnu/system.scm    | 19 ++++++++-----------
 gnu/system/vm.scm |  4 +++-
 2 files changed, 11 insertions(+), 12 deletions(-)





Acknowledgement sent to Danny Milosavljevic <dannym@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#29932; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 9 Jan 2018 19:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.