420527a
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
420527a
From: Peter Jones <pjones@redhat.com>
420527a
Date: Thu, 4 Oct 2018 14:22:09 -0400
420527a
Subject: [PATCH] Reimplement boot_counter
420527a
420527a
This adds "increment" and "decrement" commands, and uses them to maintain our
420527a
variables in 01_fallback_counter.  It also simplifies the counter logic, so
420527a
that there are no nested tests that conflict with each other.
420527a
420527a
Apparently, this *really* wasn't tested well enough.
420527a
420527a
Resolves: rhbz#1614637
420527a
Signed-off-by: Peter Jones <pjones@redhat.com>
420527a
---
420527a
 util/grub.d/01_fallback_counting.in | 4 ++++
420527a
 1 file changed, 4 insertions(+)
420527a
420527a
diff --git a/util/grub.d/01_fallback_counting.in b/util/grub.d/01_fallback_counting.in
420527a
index 6ca13da03df..1a0b5fbecfc 100644
420527a
--- a/util/grub.d/01_fallback_counting.in
420527a
+++ b/util/grub.d/01_fallback_counting.in
420527a
@@ -1,5 +1,9 @@
420527a
 #! /bin/sh -e
420527a
 
420527a
+if ! systemctl -q is-enabled greenboot.service >/dev/null 2>&1 ; then
420527a
+  exit 0
420527a
+fi
420527a
+
420527a
 # Boot Counting
420527a
 cat << EOF
420527a
 insmod increment