1 |
commit: 1564e155b726308200ecd5df315c002bd8b16952 |
2 |
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed May 31 18:15:32 2017 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 31 23:07:02 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=1564e155 |
7 |
|
8 |
openrc-init: add optional sysvinit compatibility |
9 |
|
10 |
README.md | 1 + |
11 |
scripts/.gitignore | 4 ++++ |
12 |
scripts/Makefile | 13 ++++++++++++- |
13 |
scripts/halt.in | 3 +++ |
14 |
scripts/poweroff.in | 3 +++ |
15 |
scripts/reboot.in | 3 +++ |
16 |
scripts/shutdown.in | 3 +++ |
17 |
7 files changed, 29 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/README.md b/README.md |
20 |
index 80b28a9b..54f8f8f8 100644 |
21 |
--- a/README.md |
22 |
+++ b/README.md |
23 |
@@ -28,6 +28,7 @@ MKPREFIX=yes |
24 |
MKPKGCONFIG=no |
25 |
MKSELINUX=yes |
26 |
MKSTATICLIBS=no |
27 |
+MKSYSVINIT=yes |
28 |
MKTERMCAP=ncurses |
29 |
MKTERMCAP=termcap |
30 |
PKG_PREFIX=/usr/pkg |
31 |
|
32 |
diff --git a/scripts/.gitignore b/scripts/.gitignore |
33 |
index 8b9d7ba6..e26c51ae 100644 |
34 |
--- a/scripts/.gitignore |
35 |
+++ b/scripts/.gitignore |
36 |
@@ -1 +1,5 @@ |
37 |
+halt |
38 |
+poweroff |
39 |
rc-sstat |
40 |
+reboot |
41 |
+shutdown |
42 |
|
43 |
diff --git a/scripts/Makefile b/scripts/Makefile |
44 |
index 13b8024f..faa46b0e 100644 |
45 |
--- a/scripts/Makefile |
46 |
+++ b/scripts/Makefile |
47 |
@@ -8,12 +8,23 @@ INSTALLAFTER = _installafter |
48 |
ifeq (${OS},Linux) |
49 |
SRCS+= rc-sstat.in |
50 |
BIN+= rc-sstat |
51 |
+ifeq (${MKSYSVINIT},yes) |
52 |
+SRCS+= halt.in poweroff.in reboot.in shutdown.in |
53 |
+BIN+= halt poweroff reboot shutdown |
54 |
+ endif |
55 |
endif |
56 |
|
57 |
_installafter: |
58 |
ifeq (${OS},Linux) |
59 |
${INSTALL} -d ${DESTDIR}${SBINDIR} |
60 |
- ln -sf ${DIR}/rc-sstat ${DESTDIR}/${SBINDIR}/rc-sstat |
61 |
+ ln -sf ../${DIR}/rc-sstat ${DESTDIR}/${SBINDIR}/rc-sstat |
62 |
+ifeq (${MKSYSVINIT},yes) |
63 |
+ ln -sf ../${DIR}/halt ${DESTDIR}/sbin/halt |
64 |
+ ln -sf ../${DIR}/poweroff ${DESTDIR}/sbin/poweroff |
65 |
+ ln -sf ../${DIR}/reboot ${DESTDIR}/sbin/reboot |
66 |
+ ln -sf ../${DIR}/shutdown ${DESTDIR}/sbin/shutdown |
67 |
+ ln -sf openrc-init ${DESTDIR}/sbin/init |
68 |
+endif |
69 |
endif |
70 |
|
71 |
include ${MK}/scripts.mk |
72 |
|
73 |
diff --git a/scripts/halt.in b/scripts/halt.in |
74 |
new file mode 100644 |
75 |
index 00000000..68b13be1 |
76 |
--- /dev/null |
77 |
+++ b/scripts/halt.in |
78 |
@@ -0,0 +1,3 @@ |
79 |
+#!@SHELL@ |
80 |
+ |
81 |
+exec @SBINDIR@/openrc-shutdown --halt "$@" |
82 |
|
83 |
diff --git a/scripts/poweroff.in b/scripts/poweroff.in |
84 |
new file mode 100644 |
85 |
index 00000000..91736605 |
86 |
--- /dev/null |
87 |
+++ b/scripts/poweroff.in |
88 |
@@ -0,0 +1,3 @@ |
89 |
+#!@SHELL@ |
90 |
+ |
91 |
+exec @SBINDIR@/openrc-shutdown --poweroff "$@" |
92 |
|
93 |
diff --git a/scripts/reboot.in b/scripts/reboot.in |
94 |
new file mode 100644 |
95 |
index 00000000..4da78bb7 |
96 |
--- /dev/null |
97 |
+++ b/scripts/reboot.in |
98 |
@@ -0,0 +1,3 @@ |
99 |
+#!@SHELL@ |
100 |
+ |
101 |
+exec @SBINDIR@/openrc-shutdown --reboot "$@" |
102 |
|
103 |
diff --git a/scripts/shutdown.in b/scripts/shutdown.in |
104 |
new file mode 100644 |
105 |
index 00000000..6bb65260 |
106 |
--- /dev/null |
107 |
+++ b/scripts/shutdown.in |
108 |
@@ -0,0 +1,3 @@ |
109 |
+#!@SHELL@ |
110 |
+ |
111 |
+exec @SBINDIR@/openrc-shutdown "$@" |