summaryrefslogtreecommitdiff
path: root/media-gfx/splashutils/files/splashutils-openrc-0.4-fix.patch
blob: bc7b6ee05362784a5ecce988164286b6f3dd5a69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
commit a58099249acdce1fbdab19f5dfea0704c4c545f2
Author: Michał Januszewski <spock@gentoo.org>
Date:   Sun Dec 28 13:32:16 2008 +0100

    gentoo: make the splash plugin work with OpenRC 0.4.*

diff --git a/gentoo/splash.c b/gentoo/splash.c
index 26d0fa4..b6fa774 100644
--- a/gentoo/splash.c
+++ b/gentoo/splash.c
@@ -593,7 +593,7 @@ static int splash_start(const char *runlevel)
 
 	/* Get a list of services that we'll have to handle. */
 	/* We're rebooting/shutting down. */
-	if (!strcmp(runlevel, RC_LEVEL_SHUTDOWN) || !strcmp(runlevel, RC_LEVEL_REBOOT)) {
+	if (!strcmp(runlevel, RC_LEVEL_SHUTDOWN)) {
 		if ((err = fbsplash_cache_prep()))
 			return err;
 		splash_svcs_stop(runlevel);
@@ -690,10 +690,14 @@ int rc_plugin_hook(RC_HOOK hook, const char *name)
 	int retval = 0;
 
 	runlev = rc_runlevel_get();
-	if (!strcmp(runlev, RC_LEVEL_REBOOT))
-		type = fbspl_reboot;
-	else if (!strcmp(runlev, RC_LEVEL_SHUTDOWN))
-		type = fbspl_shutdown;
+	if (!strcmp(runlev, RC_LEVEL_SHUTDOWN)) {
+		char *t = getenv("RUNLEVEL");
+		if (t && !strcmp(t, "6")) {
+			type = fbspl_reboot;
+		} else {
+			type = fbspl_shutdown;
+		}
+	}
 
 	/* Get boot and default levels from env variables exported by RC.
 	 * If unavailable, use the default ones. */
@@ -716,7 +720,7 @@ int rc_plugin_hook(RC_HOOK hook, const char *name)
 			list = rc_stringlist_new();
 			get_list_fp(list, fp);
 			TAILQ_FOREACH(s, list, entries)
-				rc_service_mark(s->value, RC_SERVICE_COLDPLUGGED);
+				rc_service_mark(s->value, RC_SERVICE_HOTPLUGGED);
 			pclose(fp);
 			rc_stringlist_free(list);
 		}
@@ -739,7 +743,7 @@ int rc_plugin_hook(RC_HOOK hook, const char *name)
 			goto exit;
 
 		if (rc_runlevel_stopping() && strcmp(runlev, bootlevel) &&
-			strcmp(runlev, RC_LEVEL_REBOOT) && strcmp(runlev, RC_LEVEL_SHUTDOWN))
+			strcmp(runlev, RC_LEVEL_SHUTDOWN))
 			goto exit;
 	}
 
@@ -763,7 +767,7 @@ int rc_plugin_hook(RC_HOOK hook, const char *name)
 	case RC_HOOK_RUNLEVEL_STOP_IN:
 		/* Start the splash daemon on reboot. The theme hook is called
 		 * from splash_start(). */
-		if (strcmp(name, RC_LEVEL_REBOOT) == 0 || strcmp(name, RC_LEVEL_SHUTDOWN) == 0) {
+		if (strcmp(name, RC_LEVEL_SHUTDOWN) == 0) {
 			if ((i = splash_start(name))) {
 				fbsplash_set_verbose(0);
 				retval= i;
@@ -788,7 +792,7 @@ int rc_plugin_hook(RC_HOOK hook, const char *name)
 	case RC_HOOK_RUNLEVEL_STOP_OUT:
 		/* Make sure the progress indicator reaches 100%, even if
 		 * something went wrong along the way. */
-		if (strcmp(name, RC_LEVEL_REBOOT) == 0 || strcmp(name, RC_LEVEL_SHUTDOWN) == 0) {
+		if (strcmp(name, RC_LEVEL_SHUTDOWN) == 0) {
 			config->verbosity = FBSPL_VERB_QUIET;
 			i = fbsplash_check_daemon(&pid_daemon);
 			config->verbosity = FBSPL_VERB_NORMAL;