openrc-init: add optional sysvinit compatibility
This commit is contained in:
parent
44bac3c379
commit
1564e155b7
@ -28,6 +28,7 @@ MKPREFIX=yes
|
||||
MKPKGCONFIG=no
|
||||
MKSELINUX=yes
|
||||
MKSTATICLIBS=no
|
||||
MKSYSVINIT=yes
|
||||
MKTERMCAP=ncurses
|
||||
MKTERMCAP=termcap
|
||||
PKG_PREFIX=/usr/pkg
|
||||
|
4
scripts/.gitignore
vendored
4
scripts/.gitignore
vendored
@ -1 +1,5 @@
|
||||
halt
|
||||
poweroff
|
||||
rc-sstat
|
||||
reboot
|
||||
shutdown
|
||||
|
@ -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
scripts/halt.in
Normal file
3
scripts/halt.in
Normal file
@ -0,0 +1,3 @@
|
||||
#!@SHELL@
|
||||
|
||||
exec @SBINDIR@/openrc-shutdown --halt "$@"
|
3
scripts/poweroff.in
Normal file
3
scripts/poweroff.in
Normal file
@ -0,0 +1,3 @@
|
||||
#!@SHELL@
|
||||
|
||||
exec @SBINDIR@/openrc-shutdown --poweroff "$@"
|
3
scripts/reboot.in
Normal file
3
scripts/reboot.in
Normal file
@ -0,0 +1,3 @@
|
||||
#!@SHELL@
|
||||
|
||||
exec @SBINDIR@/openrc-shutdown --reboot "$@"
|
3
scripts/shutdown.in
Normal file
3
scripts/shutdown.in
Normal file
@ -0,0 +1,3 @@
|
||||
#!@SHELL@
|
||||
|
||||
exec @SBINDIR@/openrc-shutdown "$@"
|
Loading…
Reference in New Issue
Block a user