Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pmYxa-00069n-6K for mharc-grub-devel@gnu.org; Wed, 12 Apr 2023 07:48:23 -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 1pmYxJ-0005hy-Lv for grub-devel@gnu.org; Wed, 12 Apr 2023 07:48:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmYxI-0003Xd-3B for grub-devel@gnu.org; Wed, 12 Apr 2023 07:48:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681300082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Z5Y0f3A5Fw2LT1gftTZ4zrO7ypAQiE0K67Bm1B/Zz4=; b=Mcx8gc2MfVK330N6pWpPh1Ze01DY+XenlPHwO4Y3NvWtu2wOp05COhgzKCFKwc6U4elyJB 79KQ5Lnr95fhpEzSDqkwxncfQkGO6+qmiEL+Lhu4FFSW1hIYmSFqylZRv5HDD9welNGGrg xBX/TZAMd8rLr0JSKh/9eT5St9dDNSo= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-367-ajT19Cx5P-66K0_5YxA7xw-1; Wed, 12 Apr 2023 07:48:01 -0400 X-MC-Unique: ajT19Cx5P-66K0_5YxA7xw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DADAD3C10C6F for ; Wed, 12 Apr 2023 11:48:00 +0000 (UTC) Received: from [10.39.194.253] (unknown [10.39.194.253]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7748C2027044 for ; Wed, 12 Apr 2023 11:47:59 +0000 (UTC) Message-ID: <0f4f6cfa-cdcf-a937-5757-36e73dc44d07@redhat.com> Date: Wed, 12 Apr 2023 13:47:56 +0200 MIME-Version: 1.0 To: grub-devel From: Laszlo Ersek Subject: reading grub.cfg X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=lersek@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: Wed, 12 Apr 2023 11:48:10 -0000 Hi, sorry for the beginner questions in advance. How does grub2 locate and read "grub.cfg"? My (very superficial) understanding is this: - grub2 relies on its own filesystem drivers; for example, it does not attempt to consume EFI_SIMPLE_FILE_SYSTEM_PROTOCOL directly on a UEFI system -- it presumably consumes the BlockIo and/or DiskIo protocols, as a dependency of its own filesystem drivers - in one of those detected filesystems, it locates "grub.cfg", and reads it. Is this more or less correct? What about the following dependency problem: - some filesystem driver is built as a grub2 module, - grub.cfg contains a matching "insmod" grub2 command, loading said module, - but "grub.cfg" is placed on a filesystem of that particular type. Is this a realistic problem? If so, how is it solved? Is there something obvious I'm missing? Another question: assuming an EFI_SIMPLE_FILE_SYSTEM_PROTOCOL-based fs driver existed in grub2, a particular filesystem might then appear *twice* to grub2, once via its own "native" driver, and another time via the UEFI SimpleFs-backed driver. Would this be a problem? Thanks for your patience! Laszlo