]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Extend grub binary search path
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 6 Jul 2024 20:03:07 +0000 (22:03 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 6 Jul 2024 20:12:27 +0000 (22:12 +0200)
Debian has a bespoke setup where if only grub-pc-bin is installed,
grub-bios-setup is installed in /usr/lib/i386-pc instead of in
/usr/bin. Let's take that into account and look for binaries in
/usr/lib/grub/i386-pc as well.

mkosi/__init__.py

index f68f8ea440d4a471cb8d501ef85b99056bb1653e..793fb434395ce42ad4101c35359040a96149c9b0 100644 (file)
@@ -1277,7 +1277,11 @@ def find_grub_directory(context: Context, *, target: str) -> Optional[Path]:
 
 def find_grub_binary(config: Config, binary: str) -> Optional[Path]:
     assert "grub" not in binary
-    return config.find_binary(f"grub-{binary}", f"grub2-{binary}")
+
+    # Debian has a bespoke setup where if only grub-pc-bin is installed, grub-bios-setup is installed in
+    # /usr/lib/i386-pc instead of in /usr/bin. Let's take that into account and look for binaries in
+    # /usr/lib/grub/i386-pc as well.
+    return config.find_binary(f"grub-{binary}", f"grub2-{binary}", f"/usr/lib/grub/i386-pc/grub-{binary}")
 
 
 def want_grub_efi(context: Context) -> bool: