Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pHNsT-0002Ep-On for mharc-grub-devel@gnu.org; Mon, 16 Jan 2023 06:42:14 -0500 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 1pHNsR-0002EW-S4 for grub-devel@gnu.org; Mon, 16 Jan 2023 06:42:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHNsQ-0002CS-5f for grub-devel@gnu.org; Mon, 16 Jan 2023 06:42:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673869329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=siGrcUv5qHkmf/JYWduG6hBqedR/wGM0EAGgOJ50tNs=; b=bdjlEIf0BoyOpZN/rB0pC+OETjIDJwKTzOz/BZvsQ7up+MoBzw6ZMqGBZffNyX/8XfrgMO tDjKO/YtKnWUDTbqTdwLMB0BdCpyer0p0ZtR8tMNJdAPvCNPfLtWj7MVU0Z/NKCZNi7Qo8 LQm5HHjcaQnpQBjZ17BGYxtZW7NL0dI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-467-LBXGNWNKMtSPzKNeEsi-qQ-1; Mon, 16 Jan 2023 06:41:05 -0500 X-MC-Unique: LBXGNWNKMtSPzKNeEsi-qQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 24E18101A55E for ; Mon, 16 Jan 2023 11:41:05 +0000 (UTC) Received: from osteffen-laptop.redhat.com (unknown [10.39.194.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C4201415108; Mon, 16 Jan 2023 11:41:04 +0000 (UTC) From: Oliver Steffen To: grub-devel@gnu.org Cc: kraxel@redhat.com, Oliver Steffen Subject: [PATCH v1 0/2] Add basic Boot Loader Interface support Date: Mon, 16 Jan 2023 12:40:51 +0100 Message-Id: <20230116114053.3244249-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true Received-SPF: pass client-ip=170.10.133.124; envelope-from=osteffen@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: Mon, 16 Jan 2023 11:42:12 -0000 This is a step towards supporting unified kernel images (UKI) in Grub. Add a new module named boot_loader_interface, which provides a command with the same name. It implements a small but quite useful part of the Boot Loader Interface [0]. This interface uses EFI variables for communication between the boot loader and the operating system. This module sets two EFI variables under the vendor GUID 4a67b082-0a4c-41cf-b6c7-440b29bb8c4f: - LoaderInfo: contains GRUB + . This allows the running operating system to identify the boot loader used during boot. - LoaderDevicePartUUID: contains the partition UUID of the EFI System Partition (ESP). This is used by systemd-gpt-auto-genereator [1] to find the root partitions (and others too), via partition type IDs [2]. This is especially useful for UKIs, where the kernel command line is fixed and usually does not contain any information about the root partition. This module is only available on EFI platforms. [0] https://systemd.io/BOOT_LOADER_INTERFACE/ [1] https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html [2] https://uapi-group.org/specifications/specs/discoverable_partitions_specification/ Oliver Steffen (2): efi: add grub_variable_with_attributes Add a module for the Boot Loader Interface grub-core/Makefile.core.def | 6 + grub-core/commands/boot_loader_interface.c | 217 +++++++++++++++++++++ grub-core/kern/efi/efi.c | 19 +- include/grub/efi/efi.h | 6 + 4 files changed, 242 insertions(+), 6 deletions(-) create mode 100644 grub-core/commands/boot_loader_interface.c -- 2.39.0