fedora-iot / greenboot

Generic Health Checking Framework for systemd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rethink the package and subpackage structure

jnogol opened this issue · comments

Basically:

  • address optionality of subpackages like grub2, status, etc.
  • pack together the default health checks

The reasoning behind having all the subpackages has always been to avoid distro-lock in. However, I'm not aware of any distros outside of the larger Fedora ecosystem that use greenboot. If you feel like this is getting unwieldy and/or hard to manage, I'm not going to oppose changing that approach.

The reasoning behind having all the subpackages has always been to avoid distro-lock in. However, I'm not aware of any distros outside of the larger Fedora ecosystem that use greenboot. If you feel like this is getting unwieldy and/or hard to manage, I'm not going to oppose changing that approach.

Ultimately if we get other distros and they don't like it we can evolve it with discussions over PR. I think keeping it simple for our current usecases rather than over complicating it for a possible future use case that may never arrive is pragmatic.

Fixed in 0.13

@nullr0ute @eric-ch @LorbusChris @jnogol @runcom ... I need to install greenboot on a system that does not have grub health checking (and we will add our own health checks):

      - greenboot
      - mpp-if: not use_aboot
        then: greenboot-grub2
      - greenboot-reboot
      - greenboot-status
      - mpp-if: not use_aboot
        then: greenboot-rpm-ostree-grub2

if I do something like this:

I still get grub stuff installed in the image:

[  OK  ] Reached target Boot Completion Check.
         Starting Mark boot as successful in grubenv...
         Starting greenboot Success Scripts Runner...
[FAILED] Failed to start Mark boot as successful in grubenv.
See 'systemctl status greenboot-grub2-set-success.service' for details.
[  OK  ] Started Hostname Service.

What is the recommended way to install greenboot on non-grub systems?

Nevermind, I think I have a solution:

diff --git a/osbuild-manifests/include/image-ostree.ipp.yml b/osbuild-manifests/include/image-ostree.ipp.yml
index e608e1e..b4c6f93 100644
--- a/osbuild-manifests/include/image-ostree.ipp.yml
+++ b/osbuild-manifests/include/image-ostree.ipp.yml
@@ -13,10 +13,12 @@ mpp-vars:
     - mpp-eval: locals().get('extra_boot_rpms', [])
     - - nss-altfiles
       - greenboot
-      - greenboot-grub2
+      - mpp-if: not use_aboot
+        then: greenboot-grub2
       - greenboot-reboot
       - greenboot-status
-      - greenboot-rpm-ostree-grub2
+      - mpp-if: not use_aboot
+        then: greenboot-rpm-ostree-grub2
       - mpp-if: name == 'developer'
         then: ostree-compliance-mode
       - polkit # Needed by rpm-ostree upgrade (until fix for https://github.com/coreos/rpm-ostree/issues/3554 is in)
@@ -46,10 +48,13 @@ pipelines:
       - type: org.osbuild.systemd
         options:
           enabled_services:
-          - greenboot-grub2-set-counter.service
-          - greenboot-grub2-set-success.service
+          - mpp-if: not use_aboot
+            then: greenboot-grub2-set-counter.service
+          - mpp-if: not use_aboot
+            then: greenboot-grub2-set-success.service
           - greenboot-healthcheck.service
-          - greenboot-rpm-ostree-grub2-check-fallback.service
+          - mpp-if: not use_aboot
+            then: greenboot-rpm-ostree-grub2-check-fallback.service
           - greenboot-status.service
           - greenboot-task-runner.service
     - mpp-eval: image_extra_stages

@ericcurtin awesome, going forward abstracting (even in the code) the dependency on grub would be awesome - maybe after/while the rust rewrite

@ericcurtin what version of greenboot are you running?

All the subpackages were were merged in 82cad31, so right now the upstream packaging does not facilitate what you're trying to do (I think).

I'd say it'd be easiest to more or less revert that change. Also note that none of the bootcounting and auto-rollback stuff will work without grub as-is.

greenboot-0.15.4-1.el9.aarch64

I think it's ok now though, thanks @LorbusChris