]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: don't load cache or treat root as mounted on shutdown
authorRay Strode <rstrode@redhat.com>
Thu, 26 Apr 2018 14:45:39 +0000 (10:45 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 26 Apr 2018 14:45:39 +0000 (10:45 -0400)
Right now, anytime we update the root fs in the daemon we treat
it like we switched from initramfs to the main root filesystem.

We shoudn't do that when shutting down since we're going to go
the other direction.

This commit changes on_newroot to look at the current mode to
decide what to do.

For the moment it doesn't do anything in the shutdown case, but
that will change shortly.

src/main.c

index f1e0fa7c6e84cda6f3bd0f0807cc290212b2c47e..70cacd7b6732b44d89afd8c12abfc9bc07e4edc2 100644 (file)
@@ -718,9 +718,17 @@ on_newroot (state_t    *state,
         chdir (root_dir);
         chroot (".");
         chdir ("/");
-        ply_progress_load_cache (state->progress, get_cache_file_for_mode (state->mode));
-        if (state->boot_splash != NULL)
-                ply_boot_splash_root_mounted (state->boot_splash);
+
+        switch ((int) state->mode) {
+        case PLY_MODE_BOOT:
+        case PLY_MODE_UPDATES:
+                ply_progress_load_cache (state->progress, get_cache_file_for_mode (state->mode));
+                if (state->boot_splash != NULL)
+                        ply_boot_splash_root_mounted (state->boot_splash);
+                break;
+        case PLY_MODE_SHUTDOWN:
+                break;
+        }
 }
 
 static const char *