]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Various fixes for grub packages in default tools trees
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 6 Jul 2024 19:02:31 +0000 (21:02 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 6 Jul 2024 21:10:13 +0000 (23:10 +0200)
- Install grub2-tools on all architectures on CentOS/Fedora instead
of just x86-64.
- Only install grub-pc-bin on x86-64 on Debian/Ubuntu as it is not
available on other architectures
- Install grub-common instead of grub2 as grub-common contains all
the binaries we need and grub2 configures the system to use grub
as the bootloader which we don't want when these packages might be
installed on user's systems via mkosi dependencies.
- Do not install grub2 on OpenSUSE due to the same problem, it
configures the system to use grub as the bootloader which we don't
want. Unfortunately there is no subpackage with only the grub binaries
on OpenSUSE. Reported as https://bugzilla.opensuse.org/show_bug.cgi?id=1227464.
The tests are changed to not try to build or boot opensuse images
with bios.

mkosi.conf.d/15-x86-64.conf
mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos-fedora/mkosi.conf
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/grub.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos-fedora/mkosi.conf.d/10-grub.conf with 82% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/10-opensuse.conf
mkosi/resources/mkosi.md
tests/test_boot.py

index 5603cb84a278f5c3ea0a0719a68325fc4530b441..1b0c4b30cfa4b8a477176674f9d2627d047165ed 100644 (file)
@@ -2,6 +2,10 @@
 
 [Match]
 Architecture=x86-64
+# We cannot install the grub tools in the OpenSUSE tools tree due to
+# https://bugzilla.opensuse.org/show_bug.cgi?id=1227464.
+# TODO: Remove this again when the above bug is resolved.
+ToolsTreeDistribution=!opensuse
 
 [Content]
 @BiosBootloader=grub
index d78c794852c800e188d73f5d66d412bc82834ab3..dc1e4913c2452248f5d6febd5291010a6c052d3a 100644 (file)
@@ -12,6 +12,7 @@ Packages=
         createrepo_c
         dnf-plugins-core
         git-core
+        grub2-tools
         openssh-clients
         policycoreutils
         python3-cryptography
index 1b0a8f9c37552d726405ee4a0f523586f809f37c..b72e86f4ec012c9211629749a71cd5a4d8d64817 100644 (file)
@@ -15,7 +15,7 @@ Packages=
         debian-archive-keyring
         erofs-utils
         git-core
-        grub2
+        grub-common
         libarchive-tools
         libcryptsetup12
         libtss2-dev
index c48f4424866658fcae92491fbac4050119d5212e..f0dc0e052cbb7687cf417592f776633962492138 100644 (file)
@@ -16,7 +16,6 @@ Packages=
         git-core
         glibc-gconv-modules-extra
         grep
-        grub2
         openssh-clients
         ovmf
         patterns-base-minimal_base
index be8a943ee6d52e977221d7199d5fd97e2005bd93..5521f46a9106351725300cb9c57aa8bf6484eee8 100644 (file)
@@ -1505,6 +1505,7 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
     | `findutils`             | ✓      | ✓      | ✓      | ✓      | ✓    | ✓        |
     | `git`                   | ✓      | ✓      | ✓      | ✓      | ✓    | ✓        |
     | `grep`                  | ✓      | ✓      | ✓      | ✓      | ✓    | ✓        |
+    | `grub-tools`            | ✓      | ✓      | ✓      | ✓      | ✓    |          |
     | `jq`                    | ✓      | ✓      | ✓      | ✓      | ✓    | ✓        |
     | `kmod`                  | ✓      | ✓      | ✓      | ✓      | ✓    | ✓        |
     | `less`                  | ✓      | ✓      | ✓      | ✓      | ✓    | ✓        |
index 478cf4920957a882ef249fe12ed50eea0795ff2c..491011d1674d5e3442b7624847d797b4b9b011a0 100644 (file)
@@ -68,7 +68,9 @@ def test_format(config: ImageConfig, format: OutputFormat) -> None:
         if have_vmspawn() and format in (OutputFormat.disk, OutputFormat.directory):
             image.vmspawn(options=options)
 
-        if format != OutputFormat.disk:
+        # TODO: Remove the opensuse check again when https://bugzilla.opensuse.org/show_bug.cgi?id=1227464 is resolved
+        # and we install the grub tools in the openSUSE tools tree again.
+        if format != OutputFormat.disk or config.tools_tree_distribution == Distribution.opensuse:
             return
 
         image.qemu(options=options + ["--qemu-firmware=bios"])
@@ -79,6 +81,11 @@ def test_bootloader(config: ImageConfig, bootloader: Bootloader) -> None:
     if config.distribution == Distribution.rhel_ubi:
         return
 
+    # TODO: Remove this again when https://bugzilla.opensuse.org/show_bug.cgi?id=1227464 is resolved and we install
+    # the grub tools in the openSUSE tools tree again.
+    if bootloader == Bootloader.grub and config.tools_tree_distribution == Distribution.opensuse:
+        return
+
     firmware = QemuFirmware.linux if bootloader == Bootloader.none else QemuFirmware.auto
 
     with Image(