]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
once the system is fully initialized, all modules are loaded,
authorRay Strode <rstrode@redhat.com>
Tue, 5 Jun 2007 20:51:40 +0000 (16:51 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 5 Jun 2007 20:51:40 +0000 (16:51 -0400)
and the filesystem is completely mounted, etc, mount the root
filesystem again from within the initrd so we can write the
boot log out

src/main.c

index e175fbf7bcb54b4704af75a49ecd7399554becb6..65f1e74590e2d149b686e40cb11414d7ff44f2df 100644 (file)
  */
 #include "config.h"
 
+#include <dirent.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/stat.h>
+#include <sys/mount.h>
 #include <sys/types.h>
 #include <sysexits.h>
+#include <unistd.h>
 
 #include "ply-boot-server.h"
 #include "ply-event-loop.h"
@@ -46,38 +49,30 @@ on_session_finished (state_t *state)
 {
   ply_log ("\nSession finished...exiting logger\n");
   ply_flush_log ();
-  //ply_event_loop_exit (state->loop, 0);
+  ply_event_loop_exit (state->loop, 1);
 } 
 
 static void 
 on_update (state_t     *state,
            const char  *status)
 {
-  ply_log ("\nSession now at boot status '%s'\n", status);
-  ply_flush_log ();
 }
 
 static void
 on_system_initialized (state_t *state)
 {
-  ply_log ("\nGot told system is initialized...\n");
-  ply_flush_log ();
-  pause ();
+  mknod ("/dev/root", 0600 | S_IFBLK, makedev (253, 0));
+  mount("/dev/root", "/sysroot", "ext3", 0, NULL);
+  ply_terminal_session_open_log (state->session, 
+                                 "/sysroot/var/log/bootmessages.log");
 }
 
 static void
 on_quit (state_t *state)
 {
-  ply_log ("\nGot quit request, quitting...\n");
-  ply_flush_log ();
-//  ply_event_loop_exit (state->loop, 0);
-}
-
-static void
-on_sigusr1 (state_t *state)
-{
-  ply_terminal_session_open_log (state->session, 
-                                 "/var/log/bootmessages.log");
+  ply_terminal_session_close_log (state->session);
+  umount ("/dev/root");
+  ply_event_loop_exit (state->loop, 0);
 }
 
 static ply_boot_server_t *
@@ -127,11 +122,6 @@ spawn_session (state_t  *state,
       return NULL;
     }
 
-  ply_event_loop_watch_signal (state->loop,
-                               SIGUSR1,
-                               (ply_event_handler_t) on_sigusr1,
-                               state);
-
   return session;
 }