From 2ec285aa1e1eda6ef4b8cb93845b1e1e39c85347 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Thu, 16 Mar 2023 12:28:38 -0700 Subject: [PATCH] install/partition: set esp flag for /boot when using GPT Reviewed-by: Oliver Smith Reviewed-by: Caleb Connolly Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230316192838.21431-4-clayton@craftyguy.net%3E --- pmb/install/partition.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pmb/install/partition.py b/pmb/install/partition.py index 01d21cb9..49c73a36 100644 --- a/pmb/install/partition.py +++ b/pmb/install/partition.py @@ -97,6 +97,15 @@ def partition(args, layout, size_boot, size_reserve): ["set", str(layout["boot"]), "boot", "on"] ] + # Not strictly necessary if the device doesn't use EFI boot, but marking + # it as an ESP will cover all situations where the device does use EFI + # boot. Marking it as ESP is helpful for EFI fw when it's looking for EFI + # system partitions. It's assumed that setting this bit is unlikely to + # cause problems for other situations, like when using Legacy BIOS boot + # or u-boot. + if partition_type.lower() == "gpt": + commands += [["set", str(layout["boot"]), "esp", "on"]] + for command in commands: pmb.chroot.root(args, ["parted", "-s", "/dev/install"] + command, check=False)