Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nLrne-0007DK-CP for mharc-grub-devel@gnu.org; Sun, 20 Feb 2022 14:23:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLrnd-0007CE-8F; Sun, 20 Feb 2022 14:23:13 -0500 Received: from [2a0c:e300::1] (port=40440 helo=hera.aquilenet.fr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLrna-0005io-5T; Sun, 20 Feb 2022 14:23:12 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C04612AC; Sun, 20 Feb 2022 20:23:05 +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 D4GzMJohQala; Sun, 20 Feb 2022 20:23:05 +0100 (CET) Received: from begin (unknown [IPv6:2a01:cb19:956:1b00:de41:a9ff:fe47:ec49]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 2620D416; Sun, 20 Feb 2022 20:23:05 +0100 (CET) Received: from samy by begin with local (Exim 4.95) (envelope-from ) id 1nLrnT-00H77d-9m; Sun, 20 Feb 2022 20:23:03 +0100 Date: Sun, 20 Feb 2022 20:23:03 +0100 From: Samuel Thibault To: grub-devel@gnu.org Cc: bug-hurd@gnu.org Subject: [PATCH] hurd: Add support for pci-arbiter and rumpdisk Message-ID: <20220220192303.irc52kqryt76txjf@begin> Mail-Followup-To: grub-devel@gnu.org, bug-hurd@gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: C04612AC X-Spamd-Result: default: False [0.40 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; MID_RHS_NOT_FQDN(0.50)[] X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a0c:e300::1 (failed) Received-SPF: neutral client-ip=2a0c:e300::1; envelope-from=samuel.thibault@ens-lyon.org; helo=hera.aquilenet.fr X-Spam_score_int: -2 X-Spam_score: -0.3 X-Spam_bar: / X-Spam_report: (-0.3 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Feb 2022 19:23:13 -0000 This adds pci-arbiter and rumpdisk as bootstrap modules whenever they are available. This opens the path for fully-userland disk support. diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index 3663d360e..2ab3a97e6 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -68,6 +68,18 @@ for i in /hurd/${hurd_fs}.static /hurd/exec ; do fi done +if test -e '/hurd/pci-arbiter.static' ; then + pci_arbiter=true +else + pci_arbiter=false +fi + +if test -e '/hurd/rumpdisk.static' ; then + rumpdisk=true +else + rumpdisk=false +fi + if ${at_least_one} ; then : ; else # no hurd here, aborting silently exit 0 @@ -132,14 +144,46 @@ EOF opts="--readonly" fi + host_ports="--host-priv-port='\${host-port}' --device-master-port='\${device-port}'" + resume_task="'\$(task-resume)'" + sed "s/^/$submenu_indentation/" << EOF echo '$(echo "$message" | grub_quote)' +EOF + + if [ "$pci_arbiter" = true ] ; then + if [ "$rumpdisk" = true ] ; then + next_task='${disk-task}' + else + next_task='${fs-task}' + fi + sed "s/^/$submenu_indentation/" << EOF + module /hurd/pci-arbiter.static pci-arbiter \\ + $host_ports \\ + --next-task='$next_task' \\ + '\$(pci-task=task-create)' $resume_task +EOF + host_ports="" + resume_task="" + fi + + if [ "$rumpdisk" = true ] ; then + sed "s/^/$submenu_indentation/" << EOF + module /hurd/rumpdisk.static rumpdisk \\ + $host_ports \\ + --next-task='\${fs-task}' \\ + '\$(disk-task=task-create)' $resume_task +EOF + host_ports="" + resume_task="" + fi + + sed "s/^/$submenu_indentation/" << EOF module /hurd/${hurd_fs}.static ${hurd_fs} $opts \\ --multiboot-command-line='\${kernel-command-line}' \\ - --host-priv-port='\${host-port}' \\ - --device-master-port='\${device-port}' \\ + $host_ports \\ --exec-server-task='\${exec-task}' -T typed '\${root}' \\ - '\$(task-create)' '\$(task-resume)' + '\$(fs-task=task-create)' $resume_task module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)' } EOF