]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt-auto-generator: make it easier to notice if boot loader support is missing
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 28 Nov 2019 17:21:22 +0000 (18:21 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 30 Nov 2019 16:42:00 +0000 (17:42 +0100)
The docs didn't talk about this, so let's add an explicit mention that the
boot loader must cooperate. And also make the message from the generator
notice level. This should help people who are trying to mix grub and the
gpt auto logic.

man/systemd-gpt-auto-generator.xml
src/gpt-auto-generator/gpt-auto-generator.c

index 22cd638f1f81fe9f8e4ab8198b8c276cec6d58b8..8d208f4cb96ae40bee8aa07af4fa8597581809bb 100644 (file)
@@ -35,7 +35,7 @@
     root, <filename>/home/</filename>, <filename>/srv/</filename>, the EFI System Partition, the Extended
     Boot Loader Partition and swap partitions and creates mount and swap units for them, based on the
     partition type GUIDs of GUID partition tables (GPT), see <ulink
-    url="https://uefi.org/specifications">UEFI Specification</ulink>, chapter 5.  It implements the <ulink
+    url="https://uefi.org/specifications">UEFI Specification</ulink>, chapter 5. It implements the <ulink
     url="https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/">Discoverable Partitions
     Specification</ulink>. Note that this generator has no effect on non-GPT systems, and on specific mount
     points that are directories already containing files. Also, on systems where the units are explicitly
     units this generator creates are overridden, but additional implicit dependencies might be
     created.</para>
 
-    <para>This generator will only look for root partitions on the
-    same physical disk the EFI System Partition (ESP) is located on.
-    It will only look for the other partitions on the same physical
-    disk the root file system is located on. These partitions will not
-    be searched for on systems where the root file system is distributed
-    on multiple disks, for example via btrfs RAID.</para>
+    <para>This generator will only look for the root partition on the same physical disk the EFI System
+    Partition (ESP) is located on. Note that support from the boot loader is required: EFI variable
+    <varname>LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f</varname> is used to determine from
+    which partition, and hence the disk from which the system was booted. If the boot loader does not set
+    this variable, this generator will not be able to autodetect the root partition.</para>
 
-    <para><filename>systemd-gpt-auto-generator</filename> is useful
-    for centralizing file system configuration in the partition table
-    and making configuration in <filename>/etc/fstab</filename> unnecessary.
+    <para>Similarly, this generator will only look for the other partitions on the same physical disk as the
+    root partition. In this case, boot loader support is not required. These partitions will not be searched
+    for on systems where the root file system is distributed on multiple disks, for example via btrfs RAID.
     </para>
 
+    <para><filename>systemd-gpt-auto-generator</filename> is useful for centralizing file system
+    configuration in the partition table and making configuration in <filename>/etc/fstab</filename> or on
+    the kernel command line unnecessary.</para>
+
     <para>This generator looks for the partitions based on their
     partition type GUID. The following partition type GUIDs are
     identified:</para>
index 99b5da17f5a2c52efaf6b3518e9a1730bd4c1690..bbfebbbe957c71b8d172e4eb900381e4b0a68336 100644 (file)
@@ -612,7 +612,8 @@ static int add_root_mount(void) {
 
         r = efi_loader_get_device_part_uuid(NULL);
         if (r == -ENOENT) {
-                log_debug("EFI loader partition unknown, exiting.");
+                log_notice("EFI loader partition unknown, exiting.\n"
+                           "(The boot loader did not set EFI variable LoaderDevicePartUUID.)");
                 return 0;
         } else if (r < 0)
                 return log_error_errno(r, "Failed to read ESP partition UUID: %m");