install/partition: set esp flag for /boot when using GPT

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Reviewed-by: Caleb Connolly <kc@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230316192838.21431-4-clayton@craftyguy.net%3E
This commit is contained in:
Clayton Craft 2023-03-16 12:28:38 -07:00 committed by Oliver Smith
parent d957710b49
commit 2ec285aa1e
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 9 additions and 0 deletions

View File

@ -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)