init-system-helpers updates for native openrc
Johannes Schauer Marin Rodrigues
josch at debian.org
Sun Nov 22 22:32:22 GMT 2026
Hi Mark,
Quoting Mark Hindley (2026-11-22 14:30:44)
> Josch, I have tried to continue your existing DPKG_ROOT work and support.
> Please could you check I have incorporated that correctly? Thanks.
yay thank you so much for adding that feature to your workload! I read your
patch and I only found an issue which is fixed by the following change:
--- a/script/update-rc.d
+++ b/script/update-rc.d
@@ -75,10 +75,10 @@ sub script_runlevels {
# Return full path to first RC_PATH directory containing suitable script.
sub openrc_script {
my ($scriptname) = @_;
- my @rc_path= ("$dpkg_root/etc/rc/init.d",
- "$dpkg_root/usr/lib/rc/init.d",
- "$dpkg_root/etc/init.d");
- (my $scriptpath) = grep { -x "$_/$scriptname" } @rc_path;
+ my @rc_path= ("/etc/rc/init.d",
+ "/usr/lib/rc/init.d",
+ "/etc/init.d");
+ (my $scriptpath) = grep { -x "$dpkg_root/$_/$scriptname" } @rc_path;
warning("No suitable openrc $scriptname found") unless $scriptpath;
return "$scriptpath/$scriptname" if $scriptpath;
}
The $dpkg_root prefix must be added when you check -x but must *not* be part of
$scriptpath or otherwise the symlink target will reference a path containing
the $dpkg_root prefix.
I threw your patch in our dpkg-root-demo CI pipeline to verify that a chroot
built the normal way is bit-by-bit identical to one built with DPKG_ROOT. This
works with my above patch (otherwise the symlink targets are wrong). Here is
the pipeline:
https://salsa.debian.org/helmutg/dpkg-root-demo/-/pipelines/1220634
I'm already testing systemd-sysv as well as sysvinit-core (on linux as well as
on hurd). I would like to add openrc as another init system to the
dpkg-root-demo CI job. Should it be as simple as simple as creating a job
containing openrc-init in the chroot on top of the Essential:yes packages? Any
other package I should install together with it? I see that debvm has an
--initsystem=openrc switch but that one adds the openrc package and not the
openrc-init package which probably explains why I get this when booting:
run-init: /sbin/init: No such file or directory
Target filesystem doesn't have requested /sbin/init.
Thanks!
cheers, josch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <http://www.chiark.greenend.org.uk/pipermail/debian-init-diversity/attachments/20261122/fa8d5f13/attachment.sig>
More information about the Debian-init-diversity
mailing list