From: Daan De Meyer Date: Sun, 10 Dec 2023 18:40:41 +0000 (+0100) Subject: Write grub BIOS partition definition after ESP definition X-Git-Tag: v20~84^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2155%2Fhead;p=thirdparty%2Fmkosi.git Write grub BIOS partition definition after ESP definition The BIOS partition is ordered after the ESP so let's write their config file in the same order for clarity. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 74e2ff4c5..8993db3ec 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2266,25 +2266,11 @@ def make_disk( else: bootloader = None - # If grub for BIOS is installed, let's add a BIOS boot partition onto which we can install grub. - bios = (state.config.bootable != ConfigFeature.disabled and want_grub_bios(state)) - - if bios: - (defaults / "05-bios.conf").write_text( - textwrap.dedent( - f"""\ - [Partition] - Type={Partition.GRUB_BOOT_PARTITION_UUID} - SizeMinBytes=1M - SizeMaxBytes=1M - """ - ) - ) - esp = ( state.config.bootable == ConfigFeature.enabled or (state.config.bootable == ConfigFeature.auto and bootloader and bootloader.exists()) ) + bios = (state.config.bootable != ConfigFeature.disabled and want_grub_bios(state)) if esp or bios: # Even if we're doing BIOS, let's still use the ESP to store the kernels, initrds and grub @@ -2303,6 +2289,19 @@ def make_disk( ) ) + # If grub for BIOS is installed, let's add a BIOS boot partition onto which we can install grub. + if bios: + (defaults / "05-bios.conf").write_text( + textwrap.dedent( + f"""\ + [Partition] + Type={Partition.GRUB_BOOT_PARTITION_UUID} + SizeMinBytes=1M + SizeMaxBytes=1M + """ + ) + ) + (defaults / "10-root.conf").write_text( textwrap.dedent( f"""\