bootloader/grub2: Handle empty static configs
authorTimothée Ravier <tim@siosm.fr>
Fri, 13 Sep 2024 17:14:43 +0000 (19:14 +0200)
committerTimothée Ravier <tim@siosm.fr>
Fri, 13 Sep 2024 22:34:24 +0000 (00:34 +0200)
commit508a8b61aca5b1cee9a15f13a14bfa512b7252d0
treeeb2770a86a2502c3d1b87d8d27e69ac6acc99fd0
parentb18e78bfb8508e76a91ba0737d6fa248e1a1d56a
bootloader/grub2: Handle empty static configs

In #3205, we introduced a check to skip re-generating the GRUB config if
we detect that static configs are in used by looking at bootupd's state.

Unfortunately this check is incomplete and does not account for present
but null entries in the JSON state file.

A proper fix would be to parse the JSON but this requires a larger code
change.

Fixes: https://github.com/ostreedev/ostree/issues/3295
Fixes: https://github.com/ostreedev/ostree/pull/3205
src/libostree/ostree-bootloader-grub2.c
tests/kolainst/destructive/bootupd-static.sh