# Packages that need to be installed
packages = []
+ # Requires a BIOS boot partition?
+ requires_bootldr_partition = False
+
+ # Requires an EFI partition?
+ requires_efi_partition = False
+
def __init__(self, bricklayer):
self.bricklayer = bricklayer
"grub",
]
+ requires_bootldr_partition = True
+
def install(self):
# Initialize Pakfire
pakfire = self.bricklayer.setup_pakfire()
class GrubEFI(Grub):
name = N_("GRUB EFI")
+ requires_efi_partition = True
+
@property
def grub_arch(self):
if self.bricklayer.arch == "aarch64":
log.debug("Creating partition layout on %s" % self.path)
# Create a bootloader partition of exactly 1 MiB
- self._add_partition("BOOTLDR", DEFAULT_FILESYSTEM, length=1024**2,
- flags=[parted.PARTITION_BIOS_GRUB])
+ if any((bl.requires_bootldr_partition for bl in self.bricklayer.bootloaders)):
+ self._add_partition("BOOTLDR", DEFAULT_FILESYSTEM, length=1024**2,
+ flags=[parted.PARTITION_BIOS_GRUB])
# Create an EFI-partition of exactly 32 MiB
- self._add_partition("ESP", "fat32", length=32 * 1024**2,
- flags=[parted.PARTITION_ESP])
+ if any((bl.requires_efi_partition for bl in self.bricklayer.bootloaders)):
+ self._add_partition("ESP", "fat32", length=32 * 1024**2,
+ flags=[parted.PARTITION_ESP])
# Create a swap partition
swap_size = self.bricklayer.settings.get("swap-size", 0)