openrc-init: add optional sysvinit compatibility

This commit is contained in:
William Hubbs
2017-05-31 13:15:32 -05:00
parent 44bac3c379
commit 1564e155b7
7 changed files with 29 additions and 1 deletions
+4
View File
@@ -1 +1,5 @@
halt
poweroff
rc-sstat
reboot
shutdown
+12 -1
View File
@@ -8,12 +8,23 @@ INSTALLAFTER = _installafter
ifeq (${OS},Linux)
SRCS+= rc-sstat.in
BIN+= rc-sstat
ifeq (${MKSYSVINIT},yes)
SRCS+= halt.in poweroff.in reboot.in shutdown.in
BIN+= halt poweroff reboot shutdown
endif
endif
_installafter:
ifeq (${OS},Linux)
${INSTALL} -d ${DESTDIR}${SBINDIR}
ln -sf ${DIR}/rc-sstat ${DESTDIR}/${SBINDIR}/rc-sstat
ln -sf ../${DIR}/rc-sstat ${DESTDIR}/${SBINDIR}/rc-sstat
ifeq (${MKSYSVINIT},yes)
ln -sf ../${DIR}/halt ${DESTDIR}/sbin/halt
ln -sf ../${DIR}/poweroff ${DESTDIR}/sbin/poweroff
ln -sf ../${DIR}/reboot ${DESTDIR}/sbin/reboot
ln -sf ../${DIR}/shutdown ${DESTDIR}/sbin/shutdown
ln -sf openrc-init ${DESTDIR}/sbin/init
endif
endif
include ${MK}/scripts.mk
+3
View File
@@ -0,0 +1,3 @@
#!@SHELL@
exec @SBINDIR@/openrc-shutdown --halt "$@"
+3
View File
@@ -0,0 +1,3 @@
#!@SHELL@
exec @SBINDIR@/openrc-shutdown --poweroff "$@"
+3
View File
@@ -0,0 +1,3 @@
#!@SHELL@
exec @SBINDIR@/openrc-shutdown --reboot "$@"
+3
View File
@@ -0,0 +1,3 @@
#!@SHELL@
exec @SBINDIR@/openrc-shutdown "$@"