Skip to content

Commit

Permalink
grub2: Disable use of grub-mkconfig on Endless
Browse files Browse the repository at this point in the history
OSTree recently gained support[1] for recognizing the Debian-style
/boot/grub/grub.cfg path in addition to the existing support for the Red
Hat-style /boot/grub2/grub.cfg. With this, it decides to run
grub-mkconfig in ostree_sysroot_write_deployment_with_options() by
calling ostree_bootloader_write_config(). However grub-mkconfig is
disabled on Endless OS since the grub.cfg is hand-written and doesn't
need updates[2] and therefore returns a non-zero exit status. This
causes operations such as "ostree admin unlock --hotfix" and "ostree
admin upgrade" to fail.

So this commit effectively reverts the Debian grub support, by making
_ostree_bootloader_grub2_query() always return TRUE with out_is_active
set to FALSE, so that grub-mkconfig is not called and the operations
above succeed. In the longer term, Endless should migrate to letting
OSTree manage the grub config and drop this patch[3][4].

https://phabricator.endlessm.com/T25195

[1] ostreedev/ostree@74bdf7e17
[2] https://phabricator.endlessm.com/T19614
[3] https://phabricator.endlessm.com/T14870
[4] https://phabricator.endlessm.com/T18848
  • Loading branch information
mwleeds authored and dbnicholson committed Feb 4, 2022
1 parent bd4ce64 commit 344474a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libostree/ostree-bootloader-grub2.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ _ostree_bootloader_grub2_query (OstreeBootloader *bootloader,
{
OstreeBootloaderGrub2 *self = OSTREE_BOOTLOADER_GRUB2 (bootloader);

/* FIXME: Endless specific patch: don't let libostree find our
* /boot/grub/grub.cfg because we manage that separately and disable
* grub-mkconfig. See:
* - https://phabricator.endlessm.com/T19614
* - https://phabricator.endlessm.com/T18848 */
{
*out_is_active = FALSE;
return TRUE;
}

/* Look for the BIOS path first */
if (g_file_query_exists (self->config_path_bios_1, NULL) ||
g_file_query_exists (self->config_path_bios_2, NULL))
Expand Down

0 comments on commit 344474a

Please sign in to comment.