From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1f1D4b-0003CS-Iw for mharc-grub-devel@gnu.org; Wed, 28 Mar 2018 11:33:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1D4Y-0003Ad-Rm for grub-devel@gnu.org; Wed, 28 Mar 2018 11:33:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1D4S-0007YX-NK for grub-devel@gnu.org; Wed, 28 Mar 2018 11:33:10 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:46370) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f1D4S-0007Xc-HN for grub-devel@gnu.org; Wed, 28 Mar 2018 11:33:04 -0400 Received: by mail-pg0-x244.google.com with SMTP id t12so1055809pgp.13 for ; Wed, 28 Mar 2018 08:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=Ud1BQVf/UXumLVz06u/NK2LWAxbXzw/E37ZXwnO0+3Y=; b=kIBnfpZOo6PiD4xQjb+t8QjXdNXLUl5gn+QDKRG2ab4clCzhERbbfDCMzj+70mwxtL S6dc0OYbrr7AExsPORG40EaSJpWez+1RctM2drGt7sEupj071JDahMKfJCtDzP048MUc gWAusTvm3Bj1yf9g302LxE2U+bHburiR4Ps/9E+qExzOkvYJF2amNLah+p536+tHqGtW e7AT3J19R1cC1w93oJMnwU1CIrmXkVCWu0a7hAjSsDpt91XJRGlrhKwB0PxzgIeEG1Kk YmJELX0P6Vq27/6Spnidtpjd/Ri6ad6m+XRiaUNpunCL9zOsboMhT3d2bb2+nBkkuclv u7NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Ud1BQVf/UXumLVz06u/NK2LWAxbXzw/E37ZXwnO0+3Y=; b=VKFWbcQXxqNJTGtStYudwKpaJ/3S1A/eylPAwSYf0PMqLTpZiTRxcWZv330mB4/JSW Nkk4iy/5u6hi6hcWmPMYv+H5DKg4/GKHvP2j5Bw0PNM3RYPOj1zpdfNQWWyHa/1CX8vZ jGfOHBUR0EGdIRytn98haxPOqTlsd9El9HXvmR1BUPhiuo3fbw6cdzly9B6t5I7GEWNr b9uky0+oP9eO9csCgGFxxQpnA02nto1b6n6fUlWFHkLH9jC6HFb3xys9xklz31afetuE Ol3U9yVig6elAuKIfuJQNnOyId9USN0BPdB5o9lLRLr9Y2qfdmdohzOuYsrasgxq8g46 QnOA== X-Gm-Message-State: AElRT7GBskH8nyx1EzDSgPvS0pvz/vhUw6l2DG1rHy9R3kKVRqMU96wY PzccEYnZtPYC+kXxnTGhAlepgA== X-Google-Smtp-Source: AIpwx49houVmjH2ewnZhck2/lR5cthTi3CfCAkyy7pMrTAyw2JuPHnF1rYXuXqSbRCK+rJcX3PhkUQ== X-Received: by 10.99.60.89 with SMTP id i25mr2957401pgn.208.1522251182709; Wed, 28 Mar 2018 08:33:02 -0700 (PDT) Received: from localhost.localdomain ([2601:602:9c01:e86a:2ec2:3a19:cd81:76ab]) by smtp.googlemail.com with ESMTPSA id m185sm3887624pfc.88.2018.03.28.08.33.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 08:33:01 -0700 (PDT) From: Nicholas Vinson To: grub-devel@gnu.org Subject: [GRUB PARTUUID PATCH V8 0/4] Add PARTUUID detection support Date: Wed, 28 Mar 2018 08:32:50 -0700 Message-Id: X-Mailer: git-send-email 2.16.3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::244 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Mar 2018 15:33:12 -0000 Changes from Patch v7: - Changed checks in probe_partuuid() to use the variable 'p' instead of disk->partition - Moved 'disk->partition = p;' assignment to inside the 'p & p->parent == NULL' statement - Moved 'disk->partition = p->parent;' assignment to before partmap name checks. - Fixed formatting issues. - Copied Daniel Kiper's reviewed-by line to unaltered patches. Changes from Patch v6: - Corrected spelling and grammatical errors in description text for GRUB_ENABLE_LINUX_PARTUUID - Moved disk->partition save & restore logic to beginning and end of probe_partuuid() - Fixed formatting errors in probe_partuuid Changes from Patch v5: - Added sign-off by lines - Fixed formatting errors found by Daniel Kiper Changes from Patch v4: - Updated grub.texi to reflect new behavior for GRUB_ENABLE_LINUX_PARTUUID - Updated 10_linux.in logic to favor the PARTUUID when GRUB_ENABLE_LINUX_PARTUUID is enabled and GRUB_DISABLE_LINUX_UUID is disabled. Changes from Patch v3: - Removed flex-2.6.3 compatibility patch - Removed Steve Kenton's patch Changes from Patch v2: - Added flex-2.6.3 compatibility patch - Fixed a GPT partition read error - Added Steve Kenton's patch - Changed struct grub_part_gpt_type name to struct grub_part_gpt_part_guid - Changed grub_part_gpt_type_t typedef name to grub_part_gpt_guid_t - Added sprint_gpt_guid to Steve Kenton's patch - Updated v1 and Steve Kenton's patch to use similar methods when reading partition GUIDs. Changes from Patch v1: - Added GRUB_ENABLE_LINUX_PARTUUID variable description to grub.texi - Removed added gpt_part_guid copy logic from grub_gpt_partition_map_iterate() - Removed added NT disk signature copy logic from grub_partition_msdos_iterate() - Removed modifications to partition number increment logic - Removed added guid union definition. - Added GRUB_ENABLE_LINUX_PARTUUID to grub-mkconfig.in export list - Moved PRINT_GPT_PARTTYPE printing logic to print_gpt_guid() function in grub-probe.c - Updated PRINT_GPT_PARTTYPE case to call print_gpt_guid() function in grub-probe.c. - Created probe_partuuid() function in grub-probe.c - Updated print == PRINT_PARTUUID check logic in probe() to call probe_partuuid(). - Updated UUID logic in 10_linux.in to enable root=PARTUUID feature only if GRUB_DISABLE_LINUX_UUID is not set to true, and GRUB_DEVICE_PARTUUID is not empty, GRUB_ENABLE_LINUX_PARTUUID is set to true. Hello, This is a request to add PARTUUID detection support grub-probe for MBR and GPT partition schemes. The Linux kernel supports mounting the root filesystem by Linux device name or by the Partition [GU]UID. GRUB's mkconfig, however, currently only supports specifying the rootfs in the kernel command-line by Linux device name unless an initramfs is also present. When an initramfs is present GRUB's mkconfig will set the kernel's root parameter value to either the Linux device name or to the filesystem [GU]UID. Therefore, the only way to protect a Linux system from failing to boot when its Linux storage device names change is to either manually edit grub.cfg or /etc/default/grub and append root=PARTUUID=xxx to the command-line or create an initramfs that understands how to mount devices by filesystem [G]UID and let grub-mkconfig pass the filesystem [GU]UID to the initramfs. The goal of this patch set is to enable root=PARTUUID=xxx support in grub-mkconfig, so that users don't have to manually edit /etc/default/grub or grub.cfg, or create an initramfs for the sole purpose of having a robust bootloader configuration for Linux. Thanks, Nicholas Vinson Nicholas Vinson (4): Centralize guid prints Update grub_gpt_partentry Add PARTUUID detection support to grub-probe Update grub script template files docs/grub.texi | 9 ++++++ grub-core/disk/ldm.c | 2 +- grub-core/partmap/gpt.c | 4 +-- include/grub/gpt_partition.h | 8 ++--- util/grub-install.c | 2 +- util/grub-mkconfig.in | 3 ++ util/grub-probe.c | 76 +++++++++++++++++++++++++++++++++++--------- util/grub.d/10_linux.in | 12 +++++-- 8 files changed, 90 insertions(+), 26 deletions(-) -- 2.16.3