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

Ralph Ronnquist ralph at selfhost.au
Tue Jul 14 00:10:23 BST 2026


On Mon, Jul 13, 2026 at 10:56:38PM +0200, Johannes Schauer Marin Rodrigues wrote:
> 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
> "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
> 

In relation to this, I'd like to note that the packaged script
"crosshurd-image" does create a directly bootable Debian-hurd image on
GNU/Linux, employing "crossurd". The image preparation includes the
first crosshurd phase to populate the filesystem and the second phase
is then to be performed on the first bootup in a VM.

I haven't investigated it all in detail, but I suppose the issue you
raise does not come up as then the installation is confined to the VM
rather than being done on the main host.

regards

Ralph.

> Thanks!
> 
> cheers, josch
> 
> >From 7195e5ee15e77fd720bf176aca2205a2bd97e851 Mon Sep 17 00:00:00 2001
> From: Johannes Schauer Marin Rodrigues <josch at 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
> 



More information about the Debian-init-diversity mailing list