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

View File

@ -28,6 +28,7 @@ MKPREFIX=yes
MKPKGCONFIG=no MKPKGCONFIG=no
MKSELINUX=yes MKSELINUX=yes
MKSTATICLIBS=no MKSTATICLIBS=no
MKSYSVINIT=yes
MKTERMCAP=ncurses MKTERMCAP=ncurses
MKTERMCAP=termcap MKTERMCAP=termcap
PKG_PREFIX=/usr/pkg PKG_PREFIX=/usr/pkg

4
scripts/.gitignore vendored
View File

@ -1 +1,5 @@
halt
poweroff
rc-sstat rc-sstat
reboot
shutdown

View File

@ -8,12 +8,23 @@ INSTALLAFTER = _installafter
ifeq (${OS},Linux) ifeq (${OS},Linux)
SRCS+= rc-sstat.in SRCS+= rc-sstat.in
BIN+= rc-sstat BIN+= rc-sstat
ifeq (${MKSYSVINIT},yes)
SRCS+= halt.in poweroff.in reboot.in shutdown.in
BIN+= halt poweroff reboot shutdown
endif
endif endif
_installafter: _installafter:
ifeq (${OS},Linux) ifeq (${OS},Linux)
${INSTALL} -d ${DESTDIR}${SBINDIR} ${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 endif
include ${MK}/scripts.mk include ${MK}/scripts.mk

3
scripts/halt.in Normal file
View File

@ -0,0 +1,3 @@
#!@SHELL@
exec @SBINDIR@/openrc-shutdown --halt "$@"

3
scripts/poweroff.in Normal file
View File

@ -0,0 +1,3 @@
#!@SHELL@
exec @SBINDIR@/openrc-shutdown --poweroff "$@"

3
scripts/reboot.in Normal file
View File

@ -0,0 +1,3 @@
#!@SHELL@
exec @SBINDIR@/openrc-shutdown --reboot "$@"

3
scripts/shutdown.in Normal file
View File

@ -0,0 +1,3 @@
#!@SHELL@
exec @SBINDIR@/openrc-shutdown "$@"