Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nMIQI-0004si-K9 for mharc-grub-devel@gnu.org; Mon, 21 Feb 2022 18:48:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMIQH-0004py-9R; Mon, 21 Feb 2022 18:48:53 -0500 Received: from [2a0c:e300::1] (port=46274 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 1nMIQF-0002WN-AI; Mon, 21 Feb 2022 18:48:52 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 448704FD; Tue, 22 Feb 2022 00:48:46 +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 o_Fo-j3_regv; Tue, 22 Feb 2022 00:48:45 +0100 (CET) Received: from begin.home (unknown [IPv6:2a01:cb19:956:1b00:de41:a9ff:fe47:ec49]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 9146D237; Tue, 22 Feb 2022 00:48:45 +0100 (CET) Received: from samy by begin.home with local (Exim 4.95) (envelope-from ) id 1nMIQ9-00GQa9-3u; Tue, 22 Feb 2022 00:48:45 +0100 Date: Tue, 22 Feb 2022 00:48:45 +0100 From: Samuel Thibault To: grub-devel@gnu.org Cc: bug-hurd@gnu.org Subject: [PATCH] hurd: Add support for rumpdisk device names Message-ID: <20220221234845.hj2gzwukdty4wqqi@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 Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 448704FD 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)[]; HAS_ORG_HEADER(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: Mon, 21 Feb 2022 23:48:53 -0000 On GNU/Hurd grub2 currently only looks at /dev/hd* and /dev/sd*. With rumpdisk we now also need to look at /dev/wd* Signed-off-by: Samuel Thibault Index: grub2-2.06/util/deviceiter.c =================================================================== --- grub2-2.06.orig/util/deviceiter.c +++ grub2-2.06/util/deviceiter.c @@ -392,6 +392,14 @@ get_fio_disk_name (char *name, int unit) } #endif +#ifdef __GNU__ +static void +get_rump_disk_name (char *name, int unit) +{ + sprintf (name, "/dev/wd%d", unit); +} +#endif + static struct seen_device { struct seen_device *next; @@ -1041,6 +1049,21 @@ dmraid_end: # endif /* HAVE_DEVICE_MAPPER */ #endif /* __linux__ */ +#ifdef __GNU__ + /* The rest is SCSI disks. */ + for (i = 0; i < 96; i++) + { + char name[16]; + + get_rump_disk_name (name, i); + if (check_device_readable_unique (name)) + { + if (hook (name, 0, hook_data)) + goto out; + } + } +#endif /* __GNU__ */ + out: clear_seen_devices (); }