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

Bug#854660: marked as done ([live-build] pass LD_PRELOAD to the chroot stage (to enable e.g. libeatmydata))



Your message dated Sat, 24 Feb 2018 17:41:29 +0100
with message-id <20180224164129.GA31341@home.ouaza.com>
and subject line Re: Bug#854660: [live-build] pass LD_PRELOAD to the chroot stage (to enable e.g. libeatmydata)
has caused the Debian Bug report #854660,
regarding [live-build] pass LD_PRELOAD to the chroot stage (to enable e.g. libeatmydata)
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.)


-- 
854660: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854660
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: live-build
Version: 1:20161216
Severity: normal
Tags: patch

--- Please enter the report below this line. ---

The script functions/chroot.sh in live-build cleans the environment before entering the chroot and so also removes LD_PRELOAD from the environment. This prevents the use of eatmydata to speed up the build process.

This can either be fixed by giving a value for LD_PRELOAD in config/environment.chroot or by changing chroot.sh to pass LD_PRELOAD along. I suggest doing the latter since this is a quite common request.

Patch is attached.

--- chroot.sh.orig    2017-02-09 08:24:52.995385684 +0100
+++ chroot.sh    2017-02-09 08:25:48.623280273 +0100
@@ -26,7 +26,7 @@
         fi
     done

- ${_LINUX32} chroot "${CHROOT}" /usr/bin/env -i HOME="/root" PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" TERM="${TERM}" DEBIAN_FRONTEND="${LB_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LB_DEBCONF_PRIORITY}" DEBCONF_NONINTERACTIVE_SEEN="true" DEBCONF_NOWARNINGS="true" ${ENV} ${COMMANDS} + ${_LINUX32} chroot "${CHROOT}" /usr/bin/env -i LD_PRELOAD=${LD_PRELOAD} HOME="/root" PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" TERM="${TERM}" DEBIAN_FRONTEND="${LB_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LB_DEBCONF_PRIORITY}" DEBCONF_NONINTERACTIVE_SEEN="true" DEBCONF_NOWARNINGS="true" ${ENV} ${COMMANDS}

     return "${?}"
 }


--- System information. ---
Architecture: amd64
Kernel: Linux 4.8.0-0.bpo.2-amd64

Debian Release: 8.7
500 stable-updates ftp.de.debian.org
500 stable security.debian.org
500 stable ftp.gruen.hm.mlpd.de
500 stable ftp.de.debian.org
500 jessie-local ftp.gruen.hm.mlpd.de
200 jessie-backports mozilla.debian.net
200 jessie-backports ftp.de.debian.org

--- Package information. ---
Depends (Version) | Installed
==========================-+-===========
debootstrap | 1.0.86~bpo8+1


Recommends (Version) | Installed
===============================-+-===========
apt-utils | 1.0.9.8.4
cpio | 2.11+dfsg-4.1+deb8u1
live-boot-doc | 1:20160511~bpo8+1
live-config-doc | 4.0.4-1
live-manual-html | 1:4.0.1-1
OR live-manual |
wget | 1.16-1+deb8u1


Suggests (Version) | Installed
=============================-+-===========
debian-keyring | 2015.04.10
gpgv | 1.4.18-7+deb8u3

--- End Message ---
--- Begin Message ---
Hello,

On Thu, 09 Feb 2017, Andreas Heinlein wrote:
> The script functions/chroot.sh in live-build cleans the environment before
> entering the chroot and so also removes LD_PRELOAD from the environment.
> This prevents the use of eatmydata to speed up the build process.
> 
> This can either be fixed by giving a value for LD_PRELOAD in
> config/environment.chroot or by changing chroot.sh to pass LD_PRELOAD along.
> I suggest doing the latter since this is a quite common request.

Thanks for the patch and the suggestion but I find that passing
LD_PRELOAD across a chroot is more of a risk than a benefit.

And this obviously doesn't have the desired result if you don't have
eatmydata installed in the chroot.

As you noted, there are already ways to achieve the same result if you
really care about it. Manually setting the correct environment variable
in config/environment.chroot as you noted. Or you could also tweak APT's
configuration to run /usr/local/bin/dpkg which would be a symlink to
eatmydata.

echo 'Dir::Bin::dpkg "/usr/local/bin/dpkg"' >/etc/apt/apt.conf.d/eatmydata

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/

--- End Message ---

Reply to: