From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sAA3IiAI2F5aHgAA0tVLHw (envelope-from ) for ; Wed, 03 Jun 2020 20:29:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id Jrv4HSAI2F4eCAAAbx9fmQ (envelope-from ) for ; Wed, 03 Jun 2020 20:29:20 +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 01CDE9404CF for ; Wed, 3 Jun 2020 20:29:20 +0000 (UTC) Received: from localhost ([::1]:57614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jga0l-0001Lt-0w for larch@yhetil.org; Wed, 03 Jun 2020 16:29:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgZzX-00084c-2y for bug-guix@gnu.org; Wed, 03 Jun 2020 16:28:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgZzW-00019u-PE for bug-guix@gnu.org; Wed, 03 Jun 2020 16:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jgZzW-0001UC-EX for bug-guix@gnu.org; Wed, 03 Jun 2020 16:28:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41541: merge wip-hurd-vm Resent-From: Jan Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 03 Jun 2020 20:28:02 +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: Mathieu Othacehe Received: via spool by 41541-submit@debbugs.gnu.org id=B41541.15912160495666 (code B ref 41541); Wed, 03 Jun 2020 20:28:02 +0000 Received: (at 41541) by debbugs.gnu.org; 3 Jun 2020 20:27:29 +0000 Received: from localhost ([127.0.0.1]:44633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgZyo-0001T9-3z for submit@debbugs.gnu.org; Wed, 03 Jun 2020 16:27:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgZym-0001Sx-9V for 41541@debbugs.gnu.org; Wed, 03 Jun 2020 16:27:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48013) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgZyg-00012N-CH; Wed, 03 Jun 2020 16:27:10 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=41112 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jgZyd-0002Qo-5M; Wed, 03 Jun 2020 16:27:08 -0400 From: Jan Nieuwenhuizen Organization: AvatarAcademy.nl 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> <87mu5lsksn.fsf@gnu.org> <87y2p5vb7v.fsf@gnu.org> <87wo4oqzgu.fsf@gnu.org> <87k10otbr1.fsf@gnu.org> <87v9k85fdc.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Wed, 03 Jun 2020 22:27:03 +0200 In-Reply-To: <87v9k85fdc.fsf@gnu.org> (Mathieu Othacehe's message of "Wed, 03 Jun 2020 17:38:23 +0200") Message-ID: <874krrrj3c.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: -1.0 (-) 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 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: nsZOCTd1ff2Z Mathieu Othacehe writes: Hi! >> Legend (in order of merge'ability / is there a convention for this?): >> >> [M] Mathieu >> [L] Ludo >> g good to go LGTM'd >> t trivial (self-LGTM :-) >> . direct dependency of/partially superseded by a LGTM >> >> ack or review needed >> ! troublesome > > Hehe, nice one :) > >> ! ee81319934 image: Support extra-directives, add hurd-directives. > > This one now only contains the hurd symlink, that you could be done at > activation I guess. I never believed that could work, but to my own eh, ..., I found a way to make it work. We "only" need to make sure that /hurd/startup etc. are found by substitute*'ing some more, and create the symlink. Reverting that patch and using this diff --8<---------------cut here---------------start------------->8--- diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm index 20d012fbfa..31260b52a1 100644 --- a/gnu/build/hurd-boot.scm +++ b/gnu/build/hurd-boot.scm @@ -45,6 +45,35 @@ Return the value associated with OPTION, or #f on failur= e." (lambda (arg) (substring arg (+ 1 (string-index arg #\=3D))))))) =20 +;; XXX FIXME c&p from guix/utils.scm +(define (readlink* file) + "Call 'readlink' until the result is not a symlink." + (define %max-symlink-depth 50) + + (let loop ((file file) + (depth 0)) + (define (absolute target) + (if (absolute-file-name? target) + target + (string-append (dirname file) "/" target))) + + (if (>=3D depth %max-symlink-depth) + file + (call-with-values + (lambda () + (catch 'system-error + (lambda () + (values #t (readlink file))) + (lambda args + (let ((errno (system-error-errno args))) + (if (or (=3D errno EINVAL)) + (values #f file) + (apply throw args)))))) + (lambda (success? target) + (if success? + (loop (absolute target) (+ depth 1)) + file)))))) + (define* (make-hurd-device-nodes #:optional (root "/")) "Make some of the nodes needed on GNU/Hurd." (define (scope dir) @@ -199,18 +228,25 @@ XXX TODO: use Linux xattr/setxattr to remove (settran= s in) /libexec/RUNSYSTEM (format #t "Setting-up essential translators...\n") (set-hurd-device-translators) =20 - (format #t "Starting pager...\n") - (unless (zero? (system* "/hurd/mach-defpager")) - (format #t "FAILED...Good luck!\n")) - (let* ((args (command-line)) (system (find-long-option "--system" args)) (to-load (find-long-option "--load" args))) + (false-if-exception (delete-file "/run/current-system")) (format #t "Setting current system...~a\n" system) (mkdir-p "/run") (symlink system "/run/current-system") + + (false-if-exception (delete-file "/hurd")) + (let ((hurd/hurd (readlink* (string-append system "/profile/hurd"))= )) + (symlink hurd/hurd "/hurd")) + + (format #t "Starting pager...\n") + (unless (zero? (system* "/hurd/mach-defpager")) + (format #t "FAILED...Good luck!\n")) + (cond ((member "--repl" args) + (format #t "Starting repl...\n") (start-repl)) (to-load (format #t "loading '~a'...\n" to-load) diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index 9dc03c6c9c..087574cd61 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -390,6 +390,8 @@ PATH=3D@PATH@ =20 fsck --yes --force / fsysopts / --writable + +# Note: this /hurd/ gets substituted settrans -c /servers/socket/1 /hurd/pflocal =20 # parse multiboot arguments @@ -421,9 +423,18 @@ exec ${system}/rc \"$@\" (substitute* '("utils/uptime.sh") (("/bin/w") (string-append out "/bin/w"))) - (substitute* "daemons/console-run.c" + (substitute* '("boot/boot.c" + "daemons/console-run.c" + "startup/startup.c") (("/hurd/") (string-append out "/hurd/"))) + (substitute* "hurd/paths.h" + (("_HURD_STARTUP\t") + (string-append "_HURD_STARTUP\t\"" out "\" ")) + (("_HURD_PROC\t") + (string-append "_HURD_PROC\t\"" out "\" ")) + (("_HURD_AUTH\t") + (string-append "_HURD_AUTH\t\"" out "\" "))) (substitute* '("daemons/runsystem.sh" "sutils/MAKEDEV.sh") (("^PATH=3D.*") --8<---------------cut here---------------end--------------->8--- produces a bootable VM. So...this could be great or maybe...well, what do you think? >> t 4479c1c1e3 linux-boot: Update 'make-hurd-device-nodes'. >> [M] a17f91bd50 image: Add Hurd support. >> t 7359403993 gnu: hurd: Update to upstream Hurd-reserved xattr index. >> [L] 68a8a26a57 gnu: guile-static: Disable JIT on ARMv7. >> [L] 220243a2c6 vm: Shared-store script runs that native QEMU and Bash. >> [L] e3b6c5dce2 vm: compiler honors system and target. >> [L] d43423f074 vm: 'qemu-image' preserves the cross-compilation target= of the OS. >> [L] c6ee3a059b vm: 'qemu-image' uses the native partitioning tools and= bootloader. >> [L] ab06638f57 vm: 'expression->derivation-in-linux-vm' always returns= a native build. >> [L] 113ba9d7a9 system: 'system-linux-image-file-name' takes an optiona= l parameter. > > For the rest, maybe you could send a patch serie by email with all the > patch that are tagged ' ' or '!'. This way we could proceed to a last > review round? Sure, that makes sense. I'll need some time to move this diff down the tree and do some testing. Greetings, Janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com