Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] runit-void: split package into main package and init controls
@ 2021-02-28  7:23 heliocat
  2021-02-28  7:26 ` heliocat
                   ` (47 more replies)
  0 siblings, 48 replies; 49+ messages in thread
From: heliocat @ 2021-02-28  7:23 UTC (permalink / raw)
  To: ml

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

There is a new 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 better allow 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: 5198 bytes --]

From c442d0a1b20c3055bdf001050fdf3de6d8da07d0 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: 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.
---
 etc/defaults.virtual                       |  1 +
 srcpkgs/runit-void-init                    |  1 +
 srcpkgs/runit-void/INSTALL                 |  6 ------
 srcpkgs/runit-void/runit-void-init.INSTALL | 10 ++++++++++
 srcpkgs/runit-void/template                | 23 +++++++++++++++++++---
 5 files changed, 32 insertions(+), 9 deletions(-)
 create mode 120000 srcpkgs/runit-void-init
 create mode 100644 srcpkgs/runit-void/runit-void-init.INSTALL

diff --git a/etc/defaults.virtual b/etc/defaults.virtual
index 083ab6349ea..3e517fa25ba 100644
--- a/etc/defaults.virtual
+++ b/etc/defaults.virtual
@@ -36,3 +36,4 @@ xserver-abi-video xorg-server
 libGL libglvnd
 libEGL libglvnd
 libGLES libglvnd
+void-init runit-void-init
diff --git a/srcpkgs/runit-void-init b/srcpkgs/runit-void-init
new file mode 120000
index 00000000000..56af4340f73
--- /dev/null
+++ b/srcpkgs/runit-void-init
@@ -0,0 +1 @@
+runit-void
\ No newline at end of file
diff --git a/srcpkgs/runit-void/INSTALL b/srcpkgs/runit-void/INSTALL
index 5a998f22549..276bf80d350 100644
--- a/srcpkgs/runit-void/INSTALL
+++ b/srcpkgs/runit-void/INSTALL
@@ -15,11 +15,5 @@ post)
 		[ -e /etc/sv/agetty-tty${f}/down ] || ln -sf /etc/sv/agetty-tty$f etc/runit/runsvdir/default
 	done
 	[ -e etc/sv/udevd/run ] && ln -sf /etc/sv/udevd etc/runit/runsvdir/default
-
-	if [ -d usr/sbin -a ! -L usr/sbin ]; then
-		for f in init shutdown halt reboot poweroff; do
-			ln -sr ../bin/$f usr/sbin/$f
-		done
-	fi
 	;;
 esac
diff --git a/srcpkgs/runit-void/runit-void-init.INSTALL b/srcpkgs/runit-void/runit-void-init.INSTALL
new file mode 100644
index 00000000000..c4c383805fa
--- /dev/null
+++ b/srcpkgs/runit-void/runit-void-init.INSTALL
@@ -0,0 +1,10 @@
+case "${ACTION}" in
+post)
+    # install init and shutdown files
+    if [ -d usr/sbin -a ! -L usr/sbin ]; then
+        for f in init shutdown halt reboot poweroff; do
+            ln -sr ../bin/$f usr/sbin/$f
+        done
+    fi
+    ;;
+esac
diff --git a/srcpkgs/runit-void/template b/srcpkgs/runit-void/template
index c495a45a3de..9c566821773 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"
@@ -11,7 +11,7 @@ homepage="https://github.com/void-linux/void-runit"
 distfiles="https://github.com/void-linux/void-runit/archive/${version}.tar.gz"
 checksum=706ed491315bd75b4b4ca07bc04af97369f8ef8820e9fa1931dae6939ea2e2db
 
-depends="virtual?awk procps-ng runit"
+depends="virtual?awk procps-ng runit virtual?void-init"
 conf_files="
  /etc/hostname
  /etc/locale.conf
@@ -40,7 +40,6 @@ 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
 }
 
 runit-void-apparmor_package() {
@@ -52,3 +51,21 @@ runit-void-apparmor_package() {
 		vmove etc/runit/core-services/09-apparmor.sh
 	}
 }
+
+runit-void-init_package() {
+	short_desc+=" - init interface"
+	depends="runit runit-void"
+	provides="void-init-0_1"
+	replaces="void-init>=0"
+	pkg_install() {
+		vmove usr/bin/halt
+		vmove usr/bin/poweroff
+		vmove usr/bin/reboot
+		vmove usr/bin/shutdown
+		vmove usr/share/man/man8/halt.8
+		vmove usr/share/man/man8/poweroff.8
+		vmove usr/share/man/man8/reboot.8
+		vmove usr/share/man/man8/shutdown.8
+		ln -s runit-init ${PKGDESTDIR}/usr/bin/init
+	}
+}

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2022-05-19  2:15 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-28  7:23 [PR PATCH] runit-void: split package into main package and init controls 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 ` [PR PATCH] [Updated] " heliocat
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

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).