repo: Default bootloader to zipl on s390x
authorColin Walters <walters@verbum.org>
Wed, 27 Sep 2023 15:41:55 +0000 (11:41 -0400)
committerColin Walters <walters@verbum.org>
Wed, 27 Sep 2023 22:10:15 +0000 (18:10 -0400)
This will allow us to drop code like
https://github.com/coreos/coreos-assembler/blob/87fc693c115eae1e7ff0e1621ce26c9167af6e84/src/create_disk.sh#L503
which is really just unnecessary since there aren't any other
bootloaders we care about on this architecture.

src/libostree/ostree-bootloader-zipl.c
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo.c

index 4ff093ffc49355da1dc3aa77fc43a71cc5fc0a0a..c0a2a1450726b92843affa261e6434da1700d4e9 100644 (file)
@@ -63,10 +63,11 @@ static gboolean
 _ostree_bootloader_zipl_query (OstreeBootloader *bootloader, gboolean *out_is_active,
                                GCancellable *cancellable, GError **error)
 {
-  /* We don't auto-detect this one; should be explicitly chosen right now.
-   * see also https://github.com/coreos/coreos-assembler/pull/849
-   */
+#if defined(__s390x__)
+  *out_is_active = TRUE;
+#else
   *out_is_active = FALSE;
+#endif
   return TRUE;
 }
 
index d8ca057ddb0ac26340db1b7679f9a35368514605..0156a541a226b7b1abd8c752d9d4f48a9901b344 100644 (file)
@@ -143,6 +143,13 @@ typedef enum
   /* Non-exhaustive */
 } OstreeCfgSysrootBootloaderOpt;
 
+#if !defined(__s390x__)
+#define CFG_SYSROOT_BOOTLOADER_DEFAULT_STR "auto"
+#else
+// There's nothing else on s390x.
+#define CFG_SYSROOT_BOOTLOADER_DEFAULT_STR "zipl"
+#endif
+
 static const char *const CFG_SYSROOT_BOOTLOADER_OPTS_STR[] = {
   /* This must be kept in the same order as the enum */
   "auto", "none", "grub2", "syslinux", "uboot", "zipl", "aboot", NULL,
index 23b6dd25312072d8c6a0db2f2c25f3512ed923f4..04a540296d210b2b8643799e222e61598f8a77f2 100644 (file)
@@ -3300,7 +3300,8 @@ reload_sysroot_config (OstreeRepo *self, GCancellable *cancellable, GError **err
   g_autofree char *bootloader = NULL;
 
   if (!ot_keyfile_get_value_with_default_group_optional (self->config, "sysroot", "bootloader",
-                                                         "auto", &bootloader, error))
+                                                         CFG_SYSROOT_BOOTLOADER_DEFAULT_STR,
+                                                         &bootloader, error))
     return FALSE;
 
   /* TODO: possibly later add support for specifying a generic bootloader