Skip to content

Commit

Permalink
Merge pull request #3059 from cgwalters/zipl-default-s390x
Browse files Browse the repository at this point in the history
  • Loading branch information
jlebon committed Sep 28, 2023
2 parents c4dcfba + e3d93a8 commit 2363de7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/libostree/ostree-bootloader-zipl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 7 additions & 0 deletions src/libostree/ostree-repo-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/libostree/ostree-repo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2363de7

Please sign in to comment.