]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[client] add new update-root-fs command
authorRay Strode <rstrode@redhat.com>
Wed, 24 Mar 2010 20:38:40 +0000 (16:38 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 24 Mar 2010 20:38:40 +0000 (16:38 -0400)
This supercedes --newroot and --sysinit into one
command following the newer subcommand method of
using the plymouth client.

src/client/plymouth.c

index d3920070b0d4dbbee99456dc8246b88f2b140e27..69c9277e98785f17cb15796c00bf353effd84e24 100644 (file)
@@ -735,6 +735,42 @@ get_kernel_command_line (state_t *state)
   return true;
 }
 
+static void
+on_update_root_fs_request (state_t    *state,
+                           const char *command)
+{
+
+  char *root_dir;
+  bool is_read_write;
+
+  root_dir = NULL;
+  is_read_write = false;
+  ply_command_parser_get_command_options (state->command_parser,
+                                          command,
+                                          "new-root-dir", &root_dir,
+                                          "read-write", &is_read_write,
+                                          NULL);
+
+  if (root_dir != NULL)
+    {
+      ply_boot_client_tell_daemon_to_change_root (state->client, root_dir,
+                                                  (ply_boot_client_response_handler_t)
+                                                  on_success,
+                                                  (ply_boot_client_response_handler_t)
+                                                  on_failure, state);
+
+    }
+
+  if (is_read_write)
+    {
+      ply_boot_client_tell_daemon_system_is_initialized (state->client,
+                                                         (ply_boot_client_response_handler_t)
+                                                         on_success,
+                                                         (ply_boot_client_response_handler_t)
+                                                         on_failure, state);
+    }
+}
+
 int
 main (int    argc,
       char **argv)
@@ -771,6 +807,16 @@ main (int    argc,
                                   "wait", "Wait for boot daemon to quit", PLY_COMMAND_OPTION_TYPE_FLAG,
                                   NULL);
 
+  ply_command_parser_add_command (state.command_parser,
+                                  "update-root-fs", "Tell daemon about root filesystem changes",
+                                  (ply_command_handler_t)
+                                  on_update_root_fs_request, &state,
+                                  "new-root-dir", "Root filesystem is about to change",
+                                  PLY_COMMAND_OPTION_TYPE_STRING,
+                                  "read-write", "Root filesystem is no longer read-only",
+                                  PLY_COMMAND_OPTION_TYPE_FLAG,
+                                  NULL);
+
   ply_command_parser_add_command (state.command_parser,
                                   "ask-for-password", "Ask user for password",
                                   (ply_command_handler_t)