2015-03-27 09:39:40 +01:00
|
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
|
|
Date: Fri, 12 Apr 2013 16:56:26 +0200
|
|
|
|
Subject: Revert "service: drop support for SysV scripts for the early boot"
|
|
|
|
|
|
|
|
This reverts commit 3cdebc217c42c8529086f2965319b6a48eaaeabe.
|
|
|
|
|
|
|
|
[Implementation note: currently, the unit is generated, but not
|
|
|
|
activated even if symlinks exist in boot.d. Hmmm... -jengelh@inai.de]
|
|
|
|
---
|
2016-02-03 10:19:12 +01:00
|
|
|
src/sysv-generator/sysv-generator.c | 20 +++++++++++++++-----
|
|
|
|
1 file changed, 15 insertions(+), 5 deletions(-)
|
2015-03-27 09:39:40 +01:00
|
|
|
|
2016-02-03 10:19:12 +01:00
|
|
|
Index: systemd-228/src/sysv-generator/sysv-generator.c
|
|
|
|
===================================================================
|
|
|
|
--- systemd-228.orig/src/sysv-generator/sysv-generator.c
|
|
|
|
+++ systemd-228/src/sysv-generator/sysv-generator.c
|
|
|
|
@@ -46,7 +46,8 @@
|
2015-03-27 09:39:40 +01:00
|
|
|
|
|
|
|
typedef enum RunlevelType {
|
|
|
|
RUNLEVEL_UP,
|
|
|
|
- RUNLEVEL_DOWN
|
|
|
|
+ RUNLEVEL_DOWN,
|
|
|
|
+ RUNLEVEL_SYSINIT,
|
|
|
|
} RunlevelType;
|
|
|
|
|
|
|
|
static const struct {
|
2016-02-03 10:19:12 +01:00
|
|
|
@@ -54,6 +55,9 @@ static const struct {
|
2015-03-27 09:39:40 +01:00
|
|
|
const char *target;
|
|
|
|
const RunlevelType type;
|
|
|
|
} rcnd_table[] = {
|
|
|
|
+ /* SUSE style boot.d */
|
|
|
|
+ { "boot.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT },
|
|
|
|
+
|
|
|
|
/* Standard SysV runlevels for start-up */
|
2015-09-27 14:32:31 +02:00
|
|
|
{ "rc1.d", SPECIAL_RESCUE_TARGET, RUNLEVEL_UP },
|
|
|
|
{ "rc2.d", SPECIAL_MULTI_USER_TARGET, RUNLEVEL_UP },
|
2016-02-03 10:19:12 +01:00
|
|
|
@@ -69,10 +73,10 @@ static const struct {
|
2015-03-27 09:39:40 +01:00
|
|
|
directories in this order, and we want to make sure that
|
|
|
|
sysv_start_priority is known when we first load the
|
|
|
|
unit. And that value we only know from S links. Hence
|
|
|
|
- UP must be read before DOWN */
|
|
|
|
+ UP/SYSINIT must be read before DOWN */
|
|
|
|
};
|
|
|
|
|
|
|
|
-const char *arg_dest = "/tmp";
|
|
|
|
+static const char *arg_dest = "/tmp";
|
|
|
|
|
2015-09-27 14:32:31 +02:00
|
|
|
typedef struct SysvStub {
|
|
|
|
char *name;
|
2016-02-03 10:19:12 +01:00
|
|
|
@@ -261,6 +265,10 @@ static char *sysv_translate_name(const c
|
2015-09-27 14:32:31 +02:00
|
|
|
_cleanup_free_ char *c = NULL;
|
|
|
|
char *res;
|
2015-03-27 09:39:40 +01:00
|
|
|
|
|
|
|
+ if (startswith(name, "boot."))
|
|
|
|
+ /* Drop SuSE-style boot. prefix */
|
|
|
|
+ name += 5;
|
|
|
|
+
|
2015-09-27 14:32:31 +02:00
|
|
|
c = strdup(name);
|
|
|
|
if (!c)
|
2015-03-27 09:39:40 +01:00
|
|
|
return NULL;
|
2016-02-03 10:19:12 +01:00
|
|
|
@@ -882,7 +890,8 @@ static int set_dependencies_from_rcnd(co
|
2015-03-27 09:39:40 +01:00
|
|
|
|
|
|
|
if (de->d_name[0] == 'S') {
|
|
|
|
|
2016-02-03 10:19:12 +01:00
|
|
|
- if (rcnd_table[i].type == RUNLEVEL_UP)
|
2015-03-27 09:39:40 +01:00
|
|
|
+ if (rcnd_table[i].type == RUNLEVEL_UP ||
|
|
|
|
+ rcnd_table[i].type == RUNLEVEL_SYSINIT)
|
2016-02-03 10:19:12 +01:00
|
|
|
service->sysv_start_priority = MAX(a*10 + b, service->sysv_start_priority);
|
2015-03-27 09:39:40 +01:00
|
|
|
|
|
|
|
r = set_ensure_allocated(&runlevel_services[i], NULL);
|
2016-02-03 10:19:12 +01:00
|
|
|
@@ -898,7 +907,8 @@ static int set_dependencies_from_rcnd(co
|
|
|
|
}
|
2015-03-27 09:39:40 +01:00
|
|
|
|
|
|
|
} else if (de->d_name[0] == 'K' &&
|
|
|
|
- (rcnd_table[i].type == RUNLEVEL_DOWN)) {
|
|
|
|
+ (rcnd_table[i].type == RUNLEVEL_DOWN ||
|
|
|
|
+ rcnd_table[i].type == RUNLEVEL_SYSINIT)) {
|
|
|
|
|
|
|
|
r = set_ensure_allocated(&shutdown_services, NULL);
|
2016-02-03 10:19:12 +01:00
|
|
|
if (r < 0) {
|