diff --git a/templates/OpenRC/files/shutdown.in b/templates/OpenRC/files/shutdown.in new file mode 100644 index 0000000000..8eace71bd5 --- /dev/null +++ b/templates/OpenRC/files/shutdown.in @@ -0,0 +1,18 @@ +#!${PREFIX}/sbin/runscript + +description="Shutdown or reboot the system" + +depend() +{ + keyword noprefix + after * +} + +start() +{ + if [ "${RC_RUNLEVEL}" = "shutdown" ]; then + yesno "$RC_REBOOT" && reboot -d -f -i + poweroff -d -f -h -i + fi + +} diff --git a/templates/OpenRC/template b/templates/OpenRC/template index eb832e9cf0..d1042bff45 100644 --- a/templates/OpenRC/template +++ b/templates/OpenRC/template @@ -2,6 +2,7 @@ pkgname=OpenRC version=20090430 wrksrc=openrc +patch_files="xbps-changes.diff" distfiles="http://ftp.gnu.org/gnu/openrc/openrc-$version.tar.bz2" build_style=gnu_makefile short_desc="Universal init system" @@ -22,3 +23,8 @@ conf_files="/etc/rc.conf /etc/conf.d/bootmisc /etc/conf.d/consolefont Add_dependency full glibc Add_dependency full psmisc + +pre_configure() +{ + cp ${FILESDIR}/shutdown.in ${wrksrc}/init.d +} diff --git a/templates/OpenRC/xbps-changes.diff b/templates/OpenRC/xbps-changes.diff new file mode 100644 index 0000000000..fc7ed4aa85 --- /dev/null +++ b/templates/OpenRC/xbps-changes.diff @@ -0,0 +1,20 @@ +Adds the shutdown service. + +--- init.d/Makefile.Linux.orig 2009-05-02 23:22:58.456719613 +0200 ++++ init.d/Makefile.Linux 2009-05-02 23:23:11.172882585 +0200 +@@ -2,7 +2,7 @@ NET_LO= net.lo + + SRCS+= devfs.in dmesg.in hwclock.in consolefont.in keymaps.in killprocs.in \ + modules.in mount-ro.in mtab.in numlock.in procfs.in sysfs.in \ +- termencoding.in ++ termencoding.in shutdown.in + + .SUFFIXES: .Linux.in + .Linux.in: +--- runlevels/Makefile.Linux.orig 2009-05-02 23:27:32.089940526 +0200 ++++ runlevels/Makefile.Linux 2009-05-02 23:27:42.565715104 +0200 +@@ -1,3 +1,3 @@ + SYSINIT+= devfs dmesg + BOOT+= hwclock keymaps modules mtab procfs termencoding +-SHUTDOWN+= killprocs mount-ro ++SHUTDOWN+= killprocs mount-ro shutdown