[From nobody Mon Aug 17 21:51:10 2026
Received: (at submit) by bugs.debian.org; 13 Jul 2026 20:56:41 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
 (2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-112.2 required=4.0 tests=ALL_TRUSTED,BAYES_00,
 DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,
 FROMDEVELOPER,MD5_SHA1_SUM,SPF_HELO_NONE,SPF_PASS,
 USER_IN_DKIM_WELCOMELIST,XMAILER_REPORTBUG autolearn=ham
 autolearn_force=no version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 21; hammy, 150; neutral, 150; spammy,
 0. spammytokens:
 hammytokens:0.000-+--Hx-spam-relays-external:sk:stravin,
 0.000-+--H*RT:sk:stravin, 0.000-+--Hx-spam-relays-external:311,
 0.000-+--H*RT:311, 0.000-+--H*RT:108
Return-path: &lt;josch@debian.org&gt;
Received: from stravinsky.debian.org ([2001:41b8:202:deb::311:108]:54318)
 by buxtehude.debian.org with utf8esmtps
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;josch@debian.org&gt;) id 1wjNhh-00745C-33
 for submit@bugs.debian.org; Mon, 13 Jul 2026 20:56:41 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; 
 s=smtpauto.stravinsky;
 h=X-Debian-User:Date:Message-ID:Subject:To:From:
 Content-Transfer-Encoding:MIME-Version:Content-Type:Reply-To:Cc:Content-ID:
 Content-Description:In-Reply-To:References;
 bh=VgnB0VXay2+CwWViFtKZ6AP5kKZCDo3PM8r7LT44dTM=; b=OvWyfAK/wiyKnOqR5njUAM2H9A
 u+B0CyUvENPBLt/XV+SZxNjqApjuGvDzSeA3n45d6oTHUQSFxohu1zovMMC6MLNKfi1T0RHfLdoZH
 ugTV5MjcoJYlPkuT01pU2cpkzaHfs8QttPnq75sRqy93TknibhwbPsieY34N6V469eE98IE/YOEyz
 09P3suz8wxqahH/CNRC/jmT/an+bO2xnNvff1EWd6Qztdniiy+Z+7IwmJvJqW1So0RcUZEc9SySqo
 1dPkFZd4b9U2gGvIglRn+35fqedhBbYRqea8WH//HmhrOs+BatBiBUIDS6IeO+ykrnHuxxqoSmg5W
 Km90Umlw==;
Received: from authenticated-user by stravinsky.debian.org with utf8esmtpsa
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;josch@debian.org&gt;) id 1wjNhg-001m0X-0A;
 Mon, 13 Jul 2026 20:56:40 +0000
Content-Type: text/plain; charset=&quot;us-ascii&quot;
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Johannes Schauer Marin Rodrigues &lt;josch@debian.org&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: Please consider adding support for $DPKG_ROOT to support creating
 bootable Hurd systems on Linux
Message-ID: &lt;178397619887.1626326.7130540315448766293.reportbug@localhost&gt;
X-Mailer: reportbug 13.2.0
Date: Mon, 13 Jul 2026 22:56:38 +0200
X-Debian-User: josch
Delivered-To: submit@bugs.debian.org

Source: orphan-sysvinit-scripts
Version: 0.23
Severity: wishlist
Tags: patch

Hi,

to create a Debian GNU/Hurd chroot from Debian GNU/Linux, so called
&quot;chrootless&quot; 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

&gt;From 7195e5ee15e77fd720bf176aca2205a2bd97e851 Mon Sep 17 00:00:00 2001
From: Johannes Schauer Marin Rodrigues &lt;josch@debian.org&gt;
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 &quot;$1&quot; in
     configure|triggered)
-	/usr/lib/orphan-sysvinit-scripts/update_init_d.sh
+	&quot;$DPKG_ROOT/usr/lib/orphan-sysvinit-scripts/update_init_d.sh&quot;
 
 	;;
 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 &quot;Unable to parse line: $systemd $sysv $rcd $rest&quot;
 	exit 1
     fi
-    if [ -e &quot;/lib/systemd/system/$systemd&quot; ] &amp;&amp; [ &quot;$action&quot; = &quot;add&quot; ]; then
+    if [ -e &quot;$DPKG_ROOT/lib/systemd/system/$systemd&quot; ] &amp;&amp; [ &quot;$action&quot; = &quot;add&quot; ]; then
 	if dpkg-query -S &quot;/etc/init.d/$sysv&quot; &gt;/dev/null 2&gt;&amp;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 &quot;/usr/share/orphan-sysvinit-scripts/$sysv&quot; &quot;/etc/init.d/$sysv&quot;
 	ucfr orphan-sysvinit-scripts &quot;/etc/init.d/$sysv&quot;
 	update-rc.d &quot;$sysv&quot; &quot;${rcd:-defaults}&quot; &gt;/dev/null
-    elif [ -e &quot;/etc/init.d/$sysv&quot; ] &amp;&amp; [ &quot;$action&quot; = &quot;purge&quot; ]; then
+    elif [ -e &quot;$DPKG_ROOT/etc/init.d/$sysv&quot; ] &amp;&amp; [ &quot;$action&quot; = &quot;purge&quot; ]; then
 	#Only remove scripts if we are reasonably sure we have previously
 	#registered them with ucf (to minimise user surprise)
 	if which ucfq &gt;/dev/null; then
 	    if ucfq &quot;/etc/init.d/$sysv&quot; | grep -q orphan-sysvinit-scripts ; then
 		for ext in '~' '%' .bak .ucf-new .ucf-old .ucf-dist; do
-		    rm -f &quot;/etc/init.d/${sysv}.$ext&quot;
+		    rm -f &quot;$DPKG_ROOT/etc/init.d/${sysv}.$ext&quot;
 		done
-		rm -f &quot;/etc/init.d/$sysv&quot;
+		rm -f &quot;$DPKG_ROOT/etc/init.d/$sysv&quot;
 		ucf --purge &quot;/etc/init.d/$sysv&quot;
 		ucfr --purge orphan-sysvinit-scripts &quot;/etc/init.d/$sysv&quot;
 		update-rc.d &quot;$sysv&quot; remove &gt;/dev/null
 	    fi
 	fi
     fi
-done &lt; /usr/lib/orphan-sysvinit-scripts/mapping
+done &lt; &quot;$DPKG_ROOT/usr/lib/orphan-sysvinit-scripts/mapping&quot;
-- 
GitLab
]