Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1qLAND-0005Lo-M7 for mharc-grub-devel@gnu.org; Sun, 16 Jul 2023 18:37:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qLANC-0005LV-AJ; Sun, 16 Jul 2023 18:37:50 -0400 Received: from domu-toccata.ens-lyon.fr ([140.77.166.138] helo=sonata.ens-lyon.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qLANA-0003bd-LV; Sun, 16 Jul 2023 18:37:50 -0400 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 52C6220101; Mon, 17 Jul 2023 00:37:44 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u5_QMaugz7hX; Mon, 17 Jul 2023 00:37:43 +0200 (CEST) Received: from begin (lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr [92.158.138.184]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 55BB3200FD; Mon, 17 Jul 2023 00:37:43 +0200 (CEST) Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1qLAN4-00B8dZ-2l; Mon, 17 Jul 2023 00:37:42 +0200 Date: Mon, 17 Jul 2023 00:37:42 +0200 From: Samuel Thibault To: Damien Zammit Cc: grub-devel@gnu.org, bug-hurd@gnu.org Subject: Re: [PATCH v2 grub] hurdhelper: Add helper for loading GNU/Hurd multiboot modules Message-ID: <20230716223742.rs5tkfrczvqycphc@begin> Mail-Followup-To: Damien Zammit , grub-devel@gnu.org, bug-hurd@gnu.org References: <20230716104020.1416219-1-damien@zamaudio.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230716104020.1416219-1-damien@zamaudio.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) Received-SPF: pass client-ip=140.77.166.138; envelope-from=SRS0=csId=DC=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org; helo=sonata.ens-lyon.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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, 16 Jul 2023 22:37:50 -0000 Hello, Damien Zammit, le dim. 16 juil. 2023 10:40:29 +0000, a ecrit: > This adds a new grub module called hurdhelper. That's both simple to implement and interesting for use, thanks! > This module simplifies the loading of hurd multiboot modules > by allowing them to be loaded in one line (in order of loading). > > A typical use case would be: > > grub> insmod hurdhelper > grub> multiboot /boot/gnumach-1.8-486-dbg.gz root=part:2:device:wd0 noide > grub> hurdmodules pci-arbiter acpi rumpdisk ext2fs exec I'd rather see that as separate commands, so as to be able to pass options to them as desired. > +#define HURD_FS_PARAMS1 "--multiboot-command-line=${kernel-command-line}" > +#define HURD_FS_PARAMS2 "--store-type=typed" > +#define HURD_FS_PARAMS3 "${root}" I'd rather make the user explicitly tell the module that they're loading a FS server. > +#define LIB_PREFIX "/lib/" > +#define EXEC_TASK "exec" > +#define LD_SO_1 "ld.so.1" We don't want to hardcode that. The user may want to use a static exec, etc. I.e. I'd rather see something like this: hurdmodule /hurd/pci-arbiter.static hurdmodule /hurd/acpi.static hurdmodule /hurd/rumpdisk.static hurdrootmodule /hurd/ext2fs.static hurdexecmodule /lib/ld.so /hurd/exec Or possibly, by hardcoding only "/hurd/" and ".static" and using lookups to automatically discover what's available: hurdmodule pci-arbiter hurdmodule acpi hurdmodule rumpdisk hurdrootmodule ext2fs hurdexecmodule /lib/ld.so /hurd/exec The user can also just use hurdexecmodule exec if they want something simpler to type. That'll just not share libc etc. with the rest of the system, but that's fine for booting something. For grub-generated configurations, we can keep loading ld.so explicitly to load the dynamically-linked version. > +static int > +is_fs_task (char *arg) > +{ > + if (!grub_strncmp(arg, FS_TASK, 6)) It's not that simple, we can have many different filesystems. Better just make the user explicitly tell which module is the root FS module. > +static int > +is_exec_task (char *arg) > +{ > + if (!grub_strncmp(arg, EXEC_TASK, 4)) I'd also rather make this explicit. Also because (see my mail on the hurd mailing list) the exec server is special to the root FS. Samuel