#1142015 Please consider adding support for $DPKG_ROOT to support creating bootable Hurd systems on Linux

#1142015#5
Date:
2026-07-13 20:56:38 UTC
From:
To:
Hi,

to create a Debian GNU/Hurd chroot from Debian GNU/Linux, so called
"chrootless" or --force-script-chrootless (the dpkg option) has to be
used because Hurd binaries cannot be run on Linux. Since systemd cannot
work on GNU/Hurd, sysvinit is the default init system there. To use
sysvinit effectively, the package orphan-sysvinit-scripts is a desirable
installation candidate.

Installing orphan-sysvinit-scripts with --force-script-chrootless
currently fails because its postinst maintainer script does not respect
the $DPKG_ROOT environment variable. The patch at the end of this email
fixes this. I also opened a MR on salsa for your convenience:
https://salsa.debian.org/matthew/orphan-sysvinit-scripts/-/merge_requests/3/diffs

The changes have been verified to have the desired results in the salsa
CI pipeline of dpkg-root-demo:
https://salsa.debian.org/helmutg/dpkg-root-demo/-/pipelines

Thanks!

cheers, josch

From 7195e5ee15e77fd720bf176aca2205a2bd97e851 Mon Sep 17 00:00:00 2001
From: Johannes Schauer Marin Rodrigues <josch@debian.org>
Date: Mon, 29 Jun 2026 02:31:44 +0200
Subject: [PATCH] Add DPKG_ROOT support
---
 debian/postinst      |  2 +-
 lib/update_init_d.sh | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/debian/postinst b/debian/postinst
index 4c11f09..13a306f 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -4,7 +4,7 @@ set -e

 case "$1" in
     configure|triggered)
-	/usr/lib/orphan-sysvinit-scripts/update_init_d.sh
+	"$DPKG_ROOT/usr/lib/orphan-sysvinit-scripts/update_init_d.sh"

 	;;
 esac
diff --git a/lib/update_init_d.sh b/lib/update_init_d.sh
index b435808..11074e4 100755
--- a/lib/update_init_d.sh
+++ b/lib/update_init_d.sh
@@ -25,7 +25,7 @@ while read -r systemd sysv rcd rest ; do
 	echo "Unable to parse line: $systemd $sysv $rcd $rest"
 	exit 1
     fi
-    if [ -e "/lib/systemd/system/$systemd" ] && [ "$action" = "add" ]; then
+    if [ -e "$DPKG_ROOT/lib/systemd/system/$systemd" ] && [ "$action" = "add" ]; then
 	if dpkg-query -S "/etc/init.d/$sysv" >/dev/null 2>&1 ; then
 	    # This file still belongs to an installed package
 	    # so do nothing for now
@@ -34,19 +34,19 @@ while read -r systemd sysv rcd rest ; do
 	ucf "/usr/share/orphan-sysvinit-scripts/$sysv" "/etc/init.d/$sysv"
 	ucfr orphan-sysvinit-scripts "/etc/init.d/$sysv"
 	update-rc.d "$sysv" "${rcd:-defaults}" >/dev/null
-    elif [ -e "/etc/init.d/$sysv" ] && [ "$action" = "purge" ]; then
+    elif [ -e "$DPKG_ROOT/etc/init.d/$sysv" ] && [ "$action" = "purge" ]; then
 	#Only remove scripts if we are reasonably sure we have previously
 	#registered them with ucf (to minimise user surprise)
 	if which ucfq >/dev/null; then
 	    if ucfq "/etc/init.d/$sysv" | grep -q orphan-sysvinit-scripts ; then
 		for ext in '~' '%' .bak .ucf-new .ucf-old .ucf-dist; do
-		    rm -f "/etc/init.d/${sysv}.$ext"
+		    rm -f "$DPKG_ROOT/etc/init.d/${sysv}.$ext"
 		done
-		rm -f "/etc/init.d/$sysv"
+		rm -f "$DPKG_ROOT/etc/init.d/$sysv"
 		ucf --purge "/etc/init.d/$sysv"
 		ucfr --purge orphan-sysvinit-scripts "/etc/init.d/$sysv"
 		update-rc.d "$sysv" remove >/dev/null
 	    fi
 	fi
     fi
-done < /usr/lib/orphan-sysvinit-scripts/mapping
+done < "$DPKG_ROOT/usr/lib/orphan-sysvinit-scripts/mapping"
-- 
GitLab

#1142015#8
Date:
2026-07-27 05:36:45 UTC
From:
To:
Hello Debian sysvinit maintainers, hello Matthew,

I wanted to send a friendly ping about bug #1142015 which I submitted two weeks
ago for a MR I submitted a month ago on salsa.

According to the CI pipeline of [1] this is the last remaining issue before my
patch to debvm is able to output directly bootable Debian GNU/Hurd images built
on Linux with packages directly from the archive.

Since the default value of $DPKG_ROOT is the empty string, I believe that it is
fairly trivial to verify that my patch cannot result in any functional
behaviour difference when installing the package the normal way (without dpkg
--force-script-chrootless) and should thus be safe to apply.

My exams for this semester are over now and I'd like to spend my free time on
the GNU/Hurd topic again, so I wanted to send you a ping about it.  No
pressure! :) But if you are just short on time, I can also offer to NMU
orphan-sysvinit-scripts for you.

Thank you for maintaining orphan-sysvinit-scripts!

cheers, josch

[1] https://salsa.debian.org/helmutg/debvm/-/merge_requests/39


Quoting Johannes Schauer Marin Rodrigues (2026-07-13 22:56:38)

#1142015#11
Date:
2026-08-11 00:44:49 UTC
From:
To:
Hi,

Quoting Johannes Schauer Marin Rodrigues (2026-07-27 07:36:45)

the last reply by Matthew on this topic was 4 weeks ago in the salsa MR3. Since
I didn't receive any reply to my ping in this bug 2 weeks ago and since this is
the last bug blocking my other work in Debian on GNU/Hurd, and because I think
I am confident that this change cannot break user systems, I'm performing an
NMU of orphan-sysvinit-scripts with maximum delay of 15 days. Please cancel the
NMU if you think that this change is a bad idea (and please explain what I can
do better).

I have attached a debdiff and pushed the remaining changes to salsa MR3.

Thanks!

cheers, josch

#1142015#16
Date:
2026-08-17 20:49:56 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
orphan-sysvinit-scripts, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1142015@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthew Vernon <matthew@debian.org> (supplier of updated orphan-sysvinit-scripts package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Mon, 17 Aug 2026 21:25:03 +0100
Source: orphan-sysvinit-scripts
Architecture: source
Version: 0.24
Distribution: unstable
Urgency: medium
Maintainer: Debian sysvinit maintainers <debian-init-diversity@chiark.greenend.org.uk>
Changed-By: Matthew Vernon <matthew@debian.org>
Closes: 1142015
Changes:
 orphan-sysvinit-scripts (0.24) unstable; urgency=medium
 .
   * Patch from Johannes Schauer Marin Rodrigues to add DPKG_ROOT support
     (Closes: #1142015)
Checksums-Sha1:
 690d11eda477870419b80ba601ef44976caa84a6 1869 orphan-sysvinit-scripts_0.24.dsc
 215e0a35a3425ec2fb00ba053aeaed8f9e638d2a 19156 orphan-sysvinit-scripts_0.24.tar.xz
Checksums-Sha256:
 6050cf55662598b30218739e07257ccd80fb9f1de7da4c3081cec7080911125c 1869 orphan-sysvinit-scripts_0.24.dsc
 882e081100abb9a05917dddbd2f7cb3e192408ff912842c878919c613ef10cc9 19156 orphan-sysvinit-scripts_0.24.tar.xz
Files:
 0087c6d84185faaa3f0725bd4086ae9b 1869 admin optional orphan-sysvinit-scripts_0.24.dsc
 5b81aaa2db06c7bc7a2d79f142c880f4 19156 admin optional orphan-sysvinit-scripts_0.24.tar.xz
-----BEGIN PGP SIGNATURE-----

iQJHBAEBCgAxFiEEuk75yE35bTfYoeLUEvTSHI9qY8gFAmqDbvcTHG1hdHRoZXdA
ZGViaWFuLm9yZwAKCRAS9NIcj2pjyHBCD/4/Y2Q/0DZIV7F+aAnSizYoO0NSGtz3
WBBCb+Z7oU8LuHYJdv6cBoNzGDXktStXlotcSo1f6411sdZizMag8YcRlemVCzAU
ClqIKncNZd0SUe1fGocfxefC8ehTT1YAdZcc27/WgT++HqYJmAVkRwePFRnH4ypI
kADM/z2I+i9ouKUlr/za0w8tmjpuWbzL8B/N7eJ8V4l3epIFgFfN2yyj593/rnjk
u3FJ8w0dY7kEvGZJ0Fg72Yqh5zDfLGulXoTpik1nFgfyPyjf9/sK+ns4/eDj5d16
3ud5W+jZAu2bjRKdru7mCJDIGPgbZkq/Vr0Q2rIfsdzmlAXESX0CGo+nmDNCAkDh
m5cU38sEXmTYX33XMWTgDGuSM+ZkQ/Z1CN3efMzSy1if2LDGMCEu6AoPHVSYNgOm
+BIz73UoAEdE5YTHeo6DogSwtln8MCMLpcgOZ6RLU3NXMoZ3MgB0xWdrFcVkb9qH
CLOPIOv4yi4yOtRWOgDF3ys1Wp9sPPc/9enkN3YUd1DQiNWXUAq1NFIfBNDjgF8y
qprrZ5GbgZBVGPa9eFfYtcfSXqdhJRWqF1XTsnv/XLZb4rXJYuMnvcnjD1DQ/WDr
HNgC692EfALcYuBxrQ2/rJYWz3tSlVhLRnVU4YyLVkrJ0OJ9h4IoBWu4MGJoEeQn
L95+tWO5eNUaJw==
=d5Ym
-----END PGP SIGNATURE-----