From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IFUxCehI1l4xFwAA0tVLHw (envelope-from ) for ; Tue, 02 Jun 2020 12:41:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id ELMeBehI1l5QHwAAB5/wlQ (envelope-from ) for ; Tue, 02 Jun 2020 12:41:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8518494030A for ; Tue, 2 Jun 2020 12:41:11 +0000 (UTC) Received: from localhost ([::1]:46480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg6E9-0004zw-8S for larch@yhetil.org; Tue, 02 Jun 2020 08:41:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg6E2-0004zp-2c for bug-guix@gnu.org; Tue, 02 Jun 2020 08:41:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg6E1-0001Eq-PX for bug-guix@gnu.org; Tue, 02 Jun 2020 08:41:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jg6E1-0003Kd-Mi for bug-guix@gnu.org; Tue, 02 Jun 2020 08:41:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41541: merge wip-hurd-vm Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 02 Jun 2020 12:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41541 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Jan Nieuwenhuizen Received: via spool by 41541-submit@debbugs.gnu.org id=B41541.159110163412766 (code B ref 41541); Tue, 02 Jun 2020 12:41:01 +0000 Received: (at 41541) by debbugs.gnu.org; 2 Jun 2020 12:40:34 +0000 Received: from localhost ([127.0.0.1]:38156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jg6DZ-0003Jp-La for submit@debbugs.gnu.org; Tue, 02 Jun 2020 08:40:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jg6DY-0003Jc-3V for 41541@debbugs.gnu.org; Tue, 02 Jun 2020 08:40:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43441) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg6DS-0000wW-Qn; Tue, 02 Jun 2020 08:40:26 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=34040 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jg6DS-0005mM-3x; Tue, 02 Jun 2020 08:40:26 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87o8qavktf.fsf@gnu.org> <87tv01vgqy.fsf@gnu.org> <87blm54hae.fsf@gnu.org> <874krtyhtg.fsf@gnu.org> <87h7vtzupa.fsf@gnu.org> <87r1uxwz5q.fsf@gnu.org> <87mu5ly7tx.fsf@gnu.org> Date: Tue, 02 Jun 2020 14:40:24 +0200 In-Reply-To: <87mu5ly7tx.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Tue, 02 Jun 2020 14:23:54 +0200") Message-ID: <87mu5lsksn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 41541@debbugs.gnu.org, Mathieu Othacehe Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: lg8WwgHkt73L Hi, Jan Nieuwenhuizen skribis: >> Having an RC argument passed directly by the bootloader seems like a >> good way to proceed for me. This is somehow remotely similar to what we >> are doing with the "initrd" on Linux (pointing to some piece of code >> that needs to be loaded before starting the init process). >> >> You would also need to store this RC argument in the >> record, by adding a new field or stuffing it in the "initrd" >> field. Then, we wouldn't need an extra service I guess. > > Hmm...I don't understand...probably I'm missing something. > > I was thinking to just extend boot-parameters with > --rc-file=3D%hurd-rc-script, and then add %hurd-rc-script to the SYSTEM > service...How would I get the RC script into SYSTEM without a service? Normally, if you have the system (as returned by =E2=80=98guix system build= =E2=80=99), that=E2=80=99s enough to derive any other kind of thing you might want. So for example, you could have a =E2=80=9Cstartup=E2=80=9D (or =E2=80=9Crc= =E2=80=9D) entry in the =E2=80=98system=E2=80=99 directory by extending =E2=80=98system-service-typ= e=E2=80=99. And since the system is known from the boot command line, bingo. The guideline IMO should be to remain as close as possible to Guix System on GNU/Linux. It=E2=80=99s OK to depart a bit from upstream Hurd th= ough because those bits are not actually used (Debian does its own thing). >> If we are going that way, the procedures in (gnu build hurd-boot) could >> be passed the "hurd" package to install, and we could maybe get rig of >> the "/hurd" symlink? > > Hehe, that would be nice...but IME /hurd isn't easy to get rid of. Some of the /hurd names are embedded in libc, via the Hurd=E2=80=99s paths.= h. Some names are compared by string (!); for instance, symlink.c in libc has: /* A symlink is a file whose translator is "/hurd/symlink\0target\0". */ memcpy (buf, _HURD_SYMLINK, sizeof (_HURD_SYMLINK)); memcpy (&buf[sizeof (_HURD_SYMLINK)], from, len); That makes it next to impossible to remove /hurd. I think it should be treated like /bin/sh and /run/current-system: set up at activation time. >>>From e11e59cbcd9165e3b885c1019e19aaab471f5498 Mon Sep 17 00:00:00 2001 > From: "Jan (janneke) Nieuwenhuizen" > Date: Thu, 30 Apr 2020 15:40:07 +0200 > Subject: [PATCH] gnu: services: Add %hurd-startup-service. > > This decouples startup of the Hurd from the "hurd" package, moving the RC > script into SYSTEM. > > * gnu/packages/hurd.scm (hurd)[inputs]: Remove hurd-rc-script. > [arguments]: Do not substitute it. Update "runsystem.sh" to parse > kernel arguments and exec into --rc-file=3DRC-FILE. > (hurd-rc-script): Move to... > * gnu/services.scm (%hurd-rc-file): ...this new variable. > (bootable-kernel-arguments): Use it. > (%hurd-bare-metal-service): New variable. > * gnu/system.scm (hurd-default-essential-services): Use it. [=E2=80=A6] > +;; XXX this won't go into SYSTEM (as system-service); the result is fine > +;; though and it gets picked-up well by --rc-file=3D%hurd-rc-script > +(define %hurd-rc-script > + ;; The RC script to be started upon boot. > + (program-file "rc" > + (with-imported-modules '((guix build utils) > + (gnu build hurd-boot) > + (guix build syscalls)) Probably use =E2=80=98source-module-closure=E2=80=99 to be on the safe side. > +(define (hurd-rc-entry mrc) > + "Return, as a monadic value, an entry for the RC script in the system > +directory." > + (mlet %store-monad ((rc mrc)) > + (return `(("rc" ,rc))))) > + > +(define hurd-startup-service-type > + ;; The service that creates the initial RC startup file. > + (service-type (name 'startup) > + (extensions > + (list (service-extension system-service-type hurd-rc-en= try))) > + (compose identity) > + (extend (const (lower-object %hurd-rc-script))) > + (description > + "Produce the operating system's RC script, which is exe= cuted > +by RUNSYSTEM."))) Is this service really meant to be extensible? If not, we could just do: (service-type (name 'startup) (extensions (list (service-extension system-service-type hurd-rc-entry= ))) (default-value %hurd-rc-script)) where: (define (hurd-rc-entry rc) (mlet %store-monad ((rc (lower-object rc))) (return `(("rc" ,rc))))) > + (append > + (if (hurd-target?) > + (list #~(string-append "--rc-file=3D" #$%hurd-rc-script)) > + '()) > + (list (string-append "--root=3D" > + ;; Note: Always use the DCE format because that'= s what > + ;; (gnu build linux-boot) expects for the '--roo= t' > + ;; kernel command-line option. > + (file-system-device->string root-device > + #:uuid-type 'dce)) > + #~(string-append "--system=3D" #$system) > + #~(string-append "--load=3D" #$system "/boot")))) So my suggestion is to avoid --rc-file since you know that SYSTEM/rc exists. Ludo=E2=80=99, who jumps in the middle of the discussion. :-)