From 4b3f4913e50510eed5fbd3bc4cf94a49dec939ab Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Wed, 27 Feb 2019 10:08:50 +0100
Subject: [PATCH] offline update: Use new plymouth "system-upgrade" and
 "reboot" modes

These landed in plymouth git yesterday to implement
https://wiki.gnome.org/Design/OS/BootProgress

Using the new API conditionally is tricky as it's command line API;
enterprise distros that don't have new enough plymouth should probably
just revert this commit.
---
 client/pk-offline-update.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/client/pk-offline-update.c b/client/pk-offline-update.c
index 90ecacd06..6f6591427 100644
--- a/client/pk-offline-update.c
+++ b/client/pk-offline-update.c
@@ -188,7 +188,7 @@ pk_offline_update_reboot (void)
 
 	/* reboot using systemd */
 	sd_journal_print (LOG_INFO, "rebooting");
-	pk_offline_update_set_plymouth_mode ("shutdown");
+	pk_offline_update_set_plymouth_mode ("reboot");
 	/* TRANSLATORS: we've finished doing offline updates */
 	pk_offline_update_set_plymouth_msg (_("Rebooting after installing updates…"));
 	connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
@@ -371,6 +371,7 @@ pk_offline_update_do_update (PkTask *task, PkProgressBar *progressbar, GError **
 		return FALSE;
 	}
 
+	pk_offline_update_set_plymouth_mode ("updates");
 	/* TRANSLATORS: we've started doing offline updates */
 	pk_offline_update_set_plymouth_msg (_("Installing updates; this could take a while..."));
 	pk_offline_update_write_dummy_results ();
@@ -403,6 +404,7 @@ pk_offline_update_do_upgrade (PkTask *task, PkProgressBar *progressbar, GError *
 	        return FALSE;
 	}
 
+	pk_offline_update_set_plymouth_mode ("system-upgrade");
 	/* TRANSLATORS: we've started doing offline system upgrade */
 	pk_offline_update_set_plymouth_msg (_("Installing system upgrade; this could take a while..."));
 	pk_offline_update_write_dummy_results ();
@@ -485,7 +487,6 @@ main (int argc, char *argv[])
 
 	task = pk_task_new ();
 	pk_client_set_interactive (PK_CLIENT (task), FALSE);
-	pk_offline_update_set_plymouth_mode ("updates");
 
 	if (g_strcmp0 (link, PK_OFFLINE_PREPARED_UPGRADE_FILENAME) == 0 &&
 	    g_file_test (PK_OFFLINE_PREPARED_UPGRADE_FILENAME, G_FILE_TEST_EXISTS)) {
-- 
2.21.0

