[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#910685: marked as done (glibc: please support DPKG_ROOT)



Your message dated Mon, 04 May 2020 21:48:37 +0000
with message-id <E1jVix3-000BjD-Ag@fasolo.debian.org>
and subject line Bug#910685: fixed in glibc 2.30-5
has caused the Debian Bug report #910685,
regarding glibc: please support DPKG_ROOT
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
910685: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=910685
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: glibc
Version: 2.27-6
Severity: wishlist
Tags: patch
Control: user debian-dpkg@lists.debian.org
Control: usertag -1 + dpkg-root-support

Hi,

In version 1.18.5, dpkg gained a new way for installing binary packages.
It now supports executing maintainer scripts outside the system it is
operating on. The feature is tracked at
https://wiki.debian.org/Teams/Dpkg/Spec/InstallBootstrap. This is
relevant in two ways:
 * When running debootstrap, ordering postinsts is tricky due to the
   number of dependency loops. By executing them outside the chroot,
   some loops can be broken as utilities of the outer system can be
   used.
 * When creating chroots for foreign architectures, the utilities
   inside such chroots usually cannot be executed at all.

To support this, dpkg now unconditionally exports an environment
variable called DPKG_ROOT. It will point to the installation root with
the trailing slash stripped. That means under normal conditions, it is
empty. Since scripts are normally run under chroot(2) even when passing
--root to dpkg, it is empty in that case as well. Only when explicitly
activating the new mode, the chroot call is skipped and DPKG_ROOT can be
non-empty. It is yet unclear under what conditions this mode should be
enabled, so for the time being the only way to do so is to use
--force-script-chrootless and I stress that this is only meant for
testing.

Currently in Debian sid, there are 57 packages that need to be installed
for the whole Essential:yes set. Most of them Depend (directly or
indirectly) on libc6. Attached patch adds $DPKG_ROOT to a couple of
places of the preinst and postinst of libc6 and that will make 37 of
these 57 install without problems. The patch adds $DPKG_ROOT in more
places than strictly necessary for just installing packages. For example
I didn't test the upgrade scenario. If you like, I can prepare a smaller
patch with only the code paths that I tested.

It would be nice if you could consider applying attached patch because
it is required for the majority of packages in the Essential:yes set to
be successfully installed with the --force-script-chrootless mode.

To test you can run:

dpkg --root "$target" --log "$target/var/log/dpkg.log" --force-script-chrootless -i libc6_2.27-6.1_amd64.deb

Thanks!

cheers, josch
diff -Nru glibc-2.27/debian/changelog glibc-2.27/debian/changelog
--- glibc-2.27/debian/changelog	2018-09-04 21:13:02.000000000 +0200
+++ glibc-2.27/debian/changelog	2018-10-09 06:02:02.000000000 +0200
@@ -1,3 +1,10 @@
+glibc (2.27-6.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * support DPKG_ROOT
+
+ -- Johannes 'josch' Schauer <josch@debian.org>  Tue, 09 Oct 2018 06:02:02 +0200
+
 glibc (2.27-6) unstable; urgency=medium
 
   [ Samuel Thibault ]
diff -Nru glibc-2.27/debian/debhelper.in/libc.postinst glibc-2.27/debian/debhelper.in/libc.postinst
--- glibc-2.27/debian/debhelper.in/libc.postinst	2018-01-06 01:49:53.000000000 +0100
+++ glibc-2.27/debian/debhelper.in/libc.postinst	2018-10-09 06:02:02.000000000 +0200
@@ -17,14 +17,14 @@
 if [ "$type" = "configure" ]
 then
     # We don't use a registry anymore, remove the old file
-    rm -f /etc/ld.so.hwcappkgs
+    rm -f "$DPKG_ROOT/etc/ld.so.hwcappkgs"
  
     # /etc/ld.so.nohwcap code:
     __NOHWCAP__
 
     # Load debconf module if available
-    if [ -f /usr/share/debconf/confmodule ] ; then
-	. /usr/share/debconf/confmodule
+    if [ -f "$DPKG_ROOT/usr/share/debconf/confmodule" ] ; then
+	. "$DPKG_ROOT/usr/share/debconf/confmodule"
     fi
 
     if [ -n "$preversion" ] && [ -x "$(which ischroot)" ] && ! ischroot; then
@@ -41,7 +41,7 @@
 	    __NSS_CHECK__
 	    if [ -n "$services" ]; then
 
-	        if [ -f /usr/share/debconf/confmodule ] ; then
+	        if [ -f "$DPKG_ROOT/usr/share/debconf/confmodule" ] ; then
 		    db_version 2.0
 		    db_input critical libraries/restart-without-asking || true
 		    db_go || true
@@ -116,7 +116,7 @@
 		    done
 		    echo
 		    if [ -n "$failed" ]; then
-	        	if [ -f /usr/share/debconf/confmodule ] ; then
+	        	if [ -f "$DPKG_ROOT/usr/share/debconf/confmodule" ] ; then
 		    	    db_fset glibc/restart-failed seen false
 			    db_subst glibc/restart-failed services "$failed"
 			    db_input critical glibc/restart-failed || true
@@ -140,7 +140,7 @@
 		fi
                 # Shut down the frontend, to make sure none of the
 		# restarted services keep a connection open to it
-	        if [ -f /usr/share/debconf/confmodule ] ; then
+	        if [ -f "$DPKG_ROOT/usr/share/debconf/confmodule" ] ; then
 		    db_stop
 		fi
 	    else
@@ -156,7 +156,7 @@
     if ischroot 2>/dev/null; then
         # Don't bother trying to re-exec init from a chroot:
         TELINIT=no
-    elif [ -d /run/systemd/system ]; then
+    elif [ -d "$DPKG_ROOT/run/systemd/system" ]; then
         # Skip if systemd is the active PID 1, since systemd doesn't
         # need a reexec for a clean shutdown
         TELINIT=no
@@ -165,7 +165,7 @@
         if dpkg --compare-versions "$UPSTART" lt-nl 1.6.1; then
             # This is an old upstart that can't re-exec statefully:
             TELINIT=no
-            touch /var/run/init.upgraded
+            touch "$DPKG_ROOT/var/run/init.upgraded"
         fi
     fi
     if [ "$TELINIT" = "yes" ]; then
diff -Nru glibc-2.27/debian/debhelper.in/libc.preinst glibc-2.27/debian/debhelper.in/libc.preinst
--- glibc-2.27/debian/debhelper.in/libc.preinst	2018-01-06 01:49:53.000000000 +0100
+++ glibc-2.27/debian/debhelper.in/libc.preinst	2018-10-09 06:02:02.000000000 +0200
@@ -93,8 +93,8 @@
 if [ "$type" != abort-upgrade ]
 then
     # Load debconf module if available
-    if [ -f /usr/share/debconf/confmodule ] ; then
-        . /usr/share/debconf/confmodule
+    if [ -f "$DPKG_ROOT/usr/share/debconf/confmodule" ] ; then
+        . "$DPKG_ROOT/usr/share/debconf/confmodule"
     fi
 
     # See if LD_LIBRARY_PATH contains the traditional /lib, but not the
@@ -153,7 +153,7 @@
 
         if linux_compare_versions "$kernel_ver" lt $kernel_ver_min
         then
-            if [ -f /usr/share/debconf/confmodule ]
+            if [ -f "$DPKG_ROOT/usr/share/debconf/confmodule" ]
             then
                 db_version 2.0
                 db_fset glibc/kernel-too-old seen false
@@ -173,7 +173,7 @@
 
         if linux_compare_versions "$kernel_ver" lt $kernel_ver_rec
         then
-            if [ -f /usr/share/debconf/confmodule ]
+            if [ -f "$DPKG_ROOT/usr/share/debconf/confmodule" ]
             then
                 db_version 2.0
                 db_fset glibc/kernel-not-supported seen false
@@ -196,7 +196,7 @@
         kernel_ver_min=8.3
         if kfreebsd_compare_versions "$kernel_ver" lt $kernel_ver_min
         then
-            if [ -f /usr/share/debconf/confmodule ]
+            if [ -f "$DPKG_ROOT/usr/share/debconf/confmodule" ]
             then
                 db_version 2.0
                 db_version 2.0
@@ -234,7 +234,7 @@
 
     dirs="SLIBDIR /lib /lib/tls /lib32 /lib64 /usr/local/lib /usr/local/lib32 /usr/local/lib64"
     for dir in $dirs ; do
-        check_dir "in an unexpected directory" $dir
+        check_dir "in an unexpected directory" "$DPKG_ROOT/$dir"
     done
 
     if test -n "$LD_LIBRARY_PATH"; then
@@ -244,16 +244,16 @@
         done
     fi
 
-    if test -e /etc/ld.so.conf; then
-        dirs=$(echo $(cat /etc/ld.so.conf))
+    if test -e "$DPKG_ROOT/etc/ld.so.conf"; then
+        dirs=$(echo $(cat "$DPKG_ROOT/etc/ld.so.conf"))
         if test -n "$dirs" ; then
             for dir in $dirs ; do
-                check_dir "via /etc/ld.so.conf" $dir
+                check_dir "via /etc/ld.so.conf" "$DPKG_ROOT/$dir"
             done
         fi
     fi
 
-    if [ -e /lib/tls/i686/cmov/libc.so.6 ] || [ -e /lib/i686/cmov/libc.so.6 ] ; then
+    if [ -e "$DPKG_ROOT/lib/tls/i686/cmov/libc.so.6" ] || [ -e "$DPKG_ROOT/lib/i686/cmov/libc.so.6" ] ; then
         status_i686=$(dpkg -s libc6-i686 2>/dev/null | grep ^Status: | sed -e 's/^Status: \(.*\) \(.*\) \(.*\)/\3/g')
         status_xen=$(dpkg -s libc6-xen 2>/dev/null | grep ^Status: | sed -e 's/^Status: \(.*\) \(.*\) \(.*\)/\3/g')
         if ([ -z "$status_i686" ] || [ "$status_i686" = "not-installed" ] || [ "$status_i686" = "config-files" ]) && \
@@ -271,7 +271,7 @@
 	# NSS authentication trouble guard
 	if dpkg --compare-versions "$preversion" lt GLIBC_VERSION; then
 	    if pidof xscreensaver xlockmore >/dev/null; then
-		if [ -f /usr/share/debconf/confmodule ] ; then
+		if [ -f "$DPKG_ROOT/usr/share/debconf/confmodule" ] ; then
 		    db_version 2.0
 		    db_reset glibc/disable-screensaver
 		    db_input critical glibc/disable-screensaver || true
@@ -301,7 +301,7 @@
 	    # NSS services check:
 	    __NSS_CHECK__
 	    if [ -n "$services" ]; then 
-		if [ -f /usr/share/debconf/confmodule ] ; then
+		if [ -f "$DPKG_ROOT/usr/share/debconf/confmodule" ] ; then
 	            db_version 2.0
 		    db_reset glibc/upgrade
 		    db_subst glibc/upgrade services $services
@@ -353,7 +353,7 @@
 
     # This will keep us from using hwcap libs (optimized) during an
     # upgrade.
-    touch /etc/ld.so.nohwcap
+    touch "$DPKG_ROOT/etc/ld.so.nohwcap"
 fi
 
 #DEBHELPER#
@@ -363,8 +363,8 @@
        # unconditionally wipe ld.so.cache on major version upgrades; this
        # makes those upgrades a bit slower, but is less error-prone than
        # hoping we notice every time the cache format is changed upstream
-       rm -f /etc/ld.so.cache
-       rm -f /var/cache/ldconfig/aux-cache
+       rm -f "$DPKG_ROOT/etc/ld.so.cache"
+       rm -f "$DPKG_ROOT/var/cache/ldconfig/aux-cache"
     fi
 fi
 

--- End Message ---
--- Begin Message ---
Source: glibc
Source-Version: 2.30-5
Done: Aurelien Jarno <aurel32@debian.org>

We believe that the bug you reported is fixed in the latest version of
glibc, 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 910685@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Aurelien Jarno <aurel32@debian.org> (supplier of updated glibc 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)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 04 May 2020 23:39:18 +0200
Source: glibc
Architecture: source
Version: 2.30-5
Distribution: unstable
Urgency: medium
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Changed-By: Aurelien Jarno <aurel32@debian.org>
Closes: 910685 941174 953654 955270 958674
Changes:
 glibc (2.30-5) unstable; urgency=medium
 .
   [ Samuel Thibault ]
   * debian/patches/hurd-i386/git-trunc-times.diff: New patch to fix updating
     mtime/ctime on O_TRUNC.  Closes: #955270.
   * debian/control: Drop dependency on libihash-dev, not used any more by htl.
   * debian/sysdeps/hurd.mk: Try to symlink mach/hurd headers from multiarch
     directory when they are there.
 .
   [ Aurelien Jarno ]
   * debian/rules: Add -fdebug-prefix-map= to CFLAGS to improve
     reproducibility.
   * debian/control.in/libc: Make libcX-dev declare a Breaks against python3.7
     (<< 3.7.7-1+b1) and python3.8 (<< 3.8.2-1+b1) due to #955474.
   * debian/rules.d/debhelper.mk: install the dynamic loader symlink in the
     udeb package.
   * debian/control: conflict against libgcc-X-dev versions that might need the
     __glibc_has_include macro.
   * debian/patches/any/local-revert-glibc_has_include.diff: drop patch,
     obsolete.
   * debian/control.in/libc: add a Provides: libc6-dbgsym to the libc6-dbg
     package.  Closes: #953654.
   * debian/control.in/libc: qualify the libselinux-dev build-depends with
     <!stage2>.
   * debian/debhelper.in/libc.postinst: drop the code removing
     /etc/ld.so.hwcappkgs, it's not needed anymore since Squeeze.
   * debian/patches/git-updates.diff: update from upstream stable branch:
     - Fixes data race in setting function descriptor during lazy binding on
       hppa. Closes: #941174.
     - debian/patches/any/local-tst-system-disable-shell-tests.diff: obsolete.
 .
   [ Helmut Grohne ]
   * Refactor generation of multilib include symlinks. (Closes: #958674).
   * Initial, minimal support for DPKG_ROOT. (Closes: #910685).
Checksums-Sha1:
 3b3c6a4261a3798cc8a98041eba6998cc5765155 8649 glibc_2.30-5.dsc
 b0a42a939acd662ca2991e725644c4cd1d03ab76 847904 glibc_2.30-5.debian.tar.xz
 878760868cee957900b0b17fe9b7003e9f8c40dc 7622 glibc_2.30-5_source.buildinfo
Checksums-Sha256:
 4b078d541ec8066688d3705d7c967850d3f3fb50dda75ba9ea0e3de9e3c73d25 8649 glibc_2.30-5.dsc
 ec4d7fc611721314fa3f26a16a2f59a740f6fa27d2c5a2d06229ad33d306f7b5 847904 glibc_2.30-5.debian.tar.xz
 c9253a39b35cf4ec0ad497f6f1b3840f1eb3af0e7232335985513d08b58db01e 7622 glibc_2.30-5_source.buildinfo
Files:
 c514204efe096f2b1aac6bbd2776e22f 8649 libs required glibc_2.30-5.dsc
 7ac32873dcaa8d1ecd4ab1acbb032267 847904 libs required glibc_2.30-5.debian.tar.xz
 2ebc279f84f54591a5750a03301b99eb 7622 libs required glibc_2.30-5_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEUryGlb40+QrX1Ay4E4jA+JnoM2sFAl6wjRUACgkQE4jA+Jno
M2tYIg/9F927PpOvyErZuHLVr4kOv4zVwEaAgPjX1+JOUNb94lu5wq/mj8Hgxtrq
J6bEg/uBBkim23JnkR7Y5ZJSCW/W/qLg0U7vVJvE+i+OMGU+5h3j2Fpug+KcI9C9
LtkUqx1EXPJlkAact9zfa9p0rG7t//ACXCMYqQ428IXkN2BjINuEcuaxYZ+kd7uY
bhzpmLqwfMWdFWb5oSHXz8zDGv23EwptRy53wM362MoEDTr5e98wd6Wp3UUEEwVR
irKQXsqHH63O3asbJEulxrnHj85yd2iBbqblF68Y7H0gWdfxfBHQDuARgn3K4JEh
6EuTNwRmdyI3A+Og6w5EJJsvvr7vmqCapSXKEXopgR6qjcFgfj8pOyvYB0/N4+bE
0mleciAYjkUQF+97BsjaSTH1yd+gpVU0YrGIl7FhMoChKb2F1gi7hjaEnb9IFE6F
HFUkSngIfIO8QhB2fbds/S1xlJgVQ2t0Obu77N5v3WEzabUNwaQfr0UzeEJRQlGo
PzyWjSySb0l6OiGFntrEMXW8kelJe2oq/DUuB4Bv/faNHGCXEB1VKwTJZJAQN6R0
4BWUj8sHPBTCCHAO3Zko4+3NwdPtcIw3iVy8j/cyAd/h3uGtjt9ZItjrA4OxkJ43
7e7O1bmC1IulFrVmYWnrcrhCTRSWXGBfF1YT0oaWt50PxXGbLOE=
=fpGc
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: