Github messages for voidlinux
 help / color / mirror / Atom feed
From: heliocat <heliocat@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] runit-void: split package into main package and init controls
Date: Tue, 09 Mar 2021 07:34:34 +0100	[thread overview]
Message-ID: <20210309063434.LTJ9T53GcKbq8bXb9l7c6zZ2j07p2SVoQLFUlxWGCIo@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-29115@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 3204 bytes --]

There is an updated pull request by heliocat against master on the void-packages repository

https://github.com/heliocat/void-packages runit-void-init
https://github.com/void-linux/void-packages/pull/29115

runit-void: split package into main package and init controls
The runit-void package handles multiple duties. Th first is being the
base system configuration for all mainline void linux installs. The
second is handling the population of ownership of the init and power
controls (/usr/bin/halt, /usr/bin/shutdown, and the init, poweroff, and
reboot symlinks). Since those commands are required to manage a system,
anybody who wants to experiment with an alternate init scheme needs to
either put their init control elsewhere or clean up after any reloads of
runit-void.

The structure here is to split the commands required to start or stop a
system away from the configuration and services that make up the core of
Void. Core functionality continues to be provided by runit-void but it
is adjusted to depend on a virutal package called "void-init" for the
init and power commands.  In mainline Void systems "void-init" is
provided by runit-void-init, a subpackage built alongside runit-void,
however this change allows any package to provide that functionality
without breaking the core distribution configuration.

From a package management perspective runit-void-init provides void-init
and replaces void-init. This allows for a single-pass replacement of any
other void-init providers simply by installing runit-void-init.
Similarly, an alternative init package can be installed in a single pass
via the same mechanisms without explicitly defining all packages that it
needs to override.

<!-- Mark items with [x] where applicable -->

#### General
- [X] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [X] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->
It's technically a new package but mostly a rearrangement of functionality to allow for better experimentation.

A patch file from https://github.com/void-linux/void-packages/pull/29115.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-runit-void-init-29115.patch --]
[-- Type: text/x-diff, Size: 3015 bytes --]

From d65904b6454ecbe07efc636df9760ba04a466d79 Mon Sep 17 00:00:00 2001
From: Colin Booth <colin@heliocat.net>
Date: Sun, 14 Feb 2021 16:47:01 -0800
Subject: [PATCH] runit-void: use alternatives for init and power commands

The runit-void package handles multiple duties. Th first is being the
base system configuration for all mainline void linux installs. The
second is handling the population of ownership of the init and power
controls (/usr/bin/halt, /usr/bin/shutdown, and the init, poweroff, and
reboot symlinks). Since those commands are required to manage a system,
anybody who wants to experiment with an alternate init scheme needs to
do one of: put their init control elsewhere, hold runit-void,  or clean
up after any reloads of runit-void.

This change adds the suffix `-runit` to shutdown, halt, poweroff, and
reboot and then registers shutdown, halt, poweroff, reboot, and init
names with alternatives under the void-init group. This will allow other
inits to take over for runit-void in a non-destructive fashion and
allows for easy rollbacks even in the face of disaster.

Thanks to st3r4g for pointing me towards xbps-alternatives instead of
using a virtual package to handle the ownership flip-flop. It is a much
cleaner method with significantly more straightforward semantics, though
not without its pitfalls.
---
 srcpkgs/runit-void/template | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/runit-void/template b/srcpkgs/runit-void/template
index c495a45a3de..6d93bb70ba4 100644
--- a/srcpkgs/runit-void/template
+++ b/srcpkgs/runit-void/template
@@ -1,7 +1,7 @@
 # Template file for 'runit-void'
 pkgname=runit-void
 version=20200720
-revision=1
+revision=2
 wrksrc="void-runit-${version}"
 build_style=gnu-makefile
 short_desc="Void Linux runit scripts"
@@ -24,6 +24,13 @@ conf_files="
  /etc/sv/agetty-hvc0/conf
  /etc/sv/agetty-hvsi0/conf"
 
+alternatives="
+ void-init:init:/usr/bin/runit-init
+ void-init:halt:/usr/bin/halt-runit
+ void-init:poweroff:/usr/bin/poweroff-runit
+ void-init:reboot:/usr/bin/reboot-runit
+ void-init:shutdown:/usr/bin/shutdown-runit"
+
 make_dirs="
  /etc/zzz.d/suspend 0755 root root
  /etc/zzz.d/resume 0755 root root"
@@ -31,6 +38,10 @@ make_dirs="
 post_install() {
 	vmkdir usr/bin
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
+	mv ${DESTDIR}/usr/bin/halt ${DESTDIR}/usr/bin/halt-runit
+	mv ${DESTDIR}/usr/bin/shutdown ${DESTDIR}/usr/bin/shutdown-runit
+	ln -sf halt-runit ${DESTDIR}/usr/bin/poweroff-runit
+	ln -sf halt-runit ${DESTDIR}/usr/bin/reboot-runit
 	vconf ${FILESDIR}/hostname
 	vconf ${FILESDIR}/os-release
 	vconf ${FILESDIR}/locale.conf
@@ -40,7 +51,9 @@ post_install() {
 	rm -f ${DESTDIR}/etc/runit/runsvdir/current
 	rm -rf ${DESTDIR}/etc/runit/runsvdir/default
 	rm -rf ${DESTDIR}/etc/runit/runsvdir/single
-	ln -s runit-init ${DESTDIR}/usr/bin/init
+	# Remove extraneous power symlinks
+	rm ${DESTDIR}/usr/bin/poweroff
+	rm ${DESTDIR}/usr/bin/reboot
 }
 
 runit-void-apparmor_package() {

  parent reply	other threads:[~2021-03-09  6:34 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-28  7:23 [PR PATCH] " heliocat
2021-02-28  7:26 ` heliocat
2021-02-28  9:14 ` st3r4g
2021-02-28 10:23 ` st3r4g
2021-02-28 11:13 ` st3r4g
2021-02-28 11:16 ` st3r4g
2021-02-28 12:52 ` teldra
2021-02-28 13:30 ` mobinmob
2021-02-28 15:53 ` ahesford
2021-02-28 19:50 ` heliocat
2021-02-28 22:07 ` st3r4g
2021-02-28 22:07 ` st3r4g
2021-02-28 23:05 ` st3r4g
2021-03-01  2:02 ` heliocat
2021-03-01 17:04 ` st3r4g
2021-03-02  1:00 ` heliocat
2021-03-02 23:17 ` [PR PATCH] [Updated] " heliocat
2021-03-03  8:54 ` heliocat
2021-03-03 15:01 ` leahneukirchen
2021-03-07 13:32 ` st3r4g
2021-03-07 20:06 ` heliocat
2021-03-08  1:08 ` st3r4g
2021-03-08  1:31 ` heliocat
2021-03-08 17:57 ` st3r4g
2021-03-08 18:02 ` st3r4g
2021-03-08 18:03 ` st3r4g
2021-03-09  1:12 ` heliocat
2021-03-09  6:34 ` heliocat [this message]
2021-03-09  6:34 ` heliocat
2021-03-09  6:35 ` heliocat
2021-03-09  6:35 ` heliocat
2021-03-12 17:41 ` st3r4g
2021-03-12 17:45 ` st3r4g
2021-03-12 22:36 ` heliocat
2021-03-14  0:41 ` [PR PATCH] [Updated] " heliocat
2021-03-14  0:44 ` heliocat
2021-03-14  0:45 ` heliocat
2021-03-14  4:14 ` [PR PATCH] [Updated] " heliocat
2021-03-14 18:49 ` heliocat
2021-03-14 18:54 ` heliocat
2021-03-17 17:08 ` [PR PATCH] [Updated] runit-void: add alternatives to runit-void to facilitate fast init switching heliocat
2021-03-17 18:04 ` heliocat
2021-03-20  7:28 ` heliocat
2021-04-03 22:09 ` [PR PATCH] [Updated] " heliocat
2021-04-10 17:11 ` Gottox
2021-04-13  7:11 ` heliocat
2021-06-23 18:09 ` [PR PATCH] [Updated] " heliocat
2022-05-05  2:09 ` github-actions
2022-05-19  2:15 ` [PR PATCH] [Closed]: " github-actions

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210309063434.LTJ9T53GcKbq8bXb9l7c6zZ2j07p2SVoQLFUlxWGCIo@z \
    --to=heliocat@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).