11/* Plymouth boot splash plugin for Finit
22 *
3- * Copyright (c) 2012-2026 Joachim Wiberg <troglobit@gmail.com>
3+ * Copyright (c) 2012-2026 Aaron Andersen <troglobit@gmail.com>
44 *
55 * Permission is hereby granted, free of charge, to any person obtaining a copy
66 * of this software and associated documentation files (the "Software"), to deal
3737 * splash during poweroff/reboot.
3838 *
3939 * The plugin is only activated when "splash" is present on the kernel
40- * command line. Plymouth requires devpts for VT takeover, which may
41- * not be mounted yet at HOOK_BANNER time (before fs_finalize), so the
42- * plugin mounts it if needed.
40+ * command line. Plymouth requires devpts for VT takeover; fs_init()
41+ * mounts it early enough for HOOK_BANNER.
4342 *
4443 * NOTE: The initramfs must include /etc/initrd-release. Plymouth
4544 * checks for this file and, when present, prefixes its argv[0] with
4645 * '@' so that the process is not killed during switch_root. Without
4746 * it, plymouthd will not survive the initramfs-to-rootfs transition.
4847 */
4948
50- #include <sys/mount.h>
51- #include <sys/stat.h>
52-
5349#include "config.h"
5450#include "finit.h"
5551#include "helpers.h"
@@ -99,13 +95,7 @@ static int plymouth_alive(void)
9995 return daemon_pid > 0 && pid_alive (daemon_pid );
10096}
10197
102- /*
103- * Start plymouthd in the given mode ("boot" or "shutdown").
104- *
105- * Mounts devpts if needed -- HOOK_BANNER fires before fs_finalize(),
106- * so /dev/pts may not exist yet. Plymouth needs it for --attach-to-session
107- * which gives it control of the VT for rendering.
108- */
98+ /* Start plymouthd in the given mode ("boot" or "shutdown"). */
10999static void plymouth_start (const char * mode )
110100{
111101 char cmd [256 ];
@@ -114,13 +104,6 @@ static void plymouth_start(const char *mode)
114104 if (plymouth_alive ())
115105 return ;
116106
117- /* Mount devpts if not already mounted (needed for --attach-to-session) */
118- if (!fismnt ("/dev/pts" )) {
119- mkdir ("/dev/pts" , 0755 );
120- mount ("devpts" , "/dev/pts" , "devpts" ,
121- MS_NOSUID | MS_NOEXEC , "ptmxmode=0666,mode=0620" );
122- }
123-
124107 snprintf (cmd , sizeof (cmd ),
125108 PLYMOUTHD_PATH " --attach-to-session --mode %s --pid-file %s" ,
126109 mode , PLYMOUTH_PIDFILE );
0 commit comments