grub2: Exit gracefully if there's no system ostree repository
authorColin Walters <walters@verbum.org>
Tue, 9 Jan 2018 15:22:50 +0000 (10:22 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 9 Jan 2018 18:30:59 +0000 (18:30 +0000)
Apparently there testing systems that literally install *all*
packages.  Having `ostree-grub2` currently causes grub2 to fail
on a non-ostree managed system.  Let's just gracefully exit
if there's no system repository.

https://bugzilla.redhat.com/show_bug.cgi?id=1532668

Closes: #1399
Approved by: jlebon

src/boot/grub2/grub2-15_ostree

index dfff6e89bf6b77aa4c4715f90c1edbe0f350b0be..0b9bf930ae085b7e0a224c4f419ae1cd6b2eac36 100644 (file)
 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 # Boston, MA 02111-1307, USA.
 
-# Gracefully exit if ostree is not installed
+# Gracefully exit if ostree is not installed, or there's
+# no system repository initialized.
 if ! which ostree >/dev/null 2>/dev/null; then
     exit 0
 fi
+if ! test -d /ostree/repo; then
+    exit 0
+fi
 
 # Make sure we're in the right environment
 if ! test -n "${GRUB_DEVICE}"; then