live-build/functions/chroot.sh

28 lines
981 B
Bash
Raw Normal View History

2007-09-23 08:04:46 +00:00
#!/bin/sh
2007-09-23 08:04:48 +00:00
# chroot.sh - /usr/sbin/chroot wrapper script
# Copyright (C) 2006-2009 Daniel Baumann <daniel@debian.org>
2007-09-23 08:04:48 +00:00
#
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
# This is free software, and you are welcome to redistribute it
# under certain conditions; see COPYING for details.
2007-09-23 08:04:46 +00:00
Chroot ()
{
CHROOT="${1}"; shift
COMMANDS="${@}"
2007-09-23 08:04:46 +00:00
# Executing commands in chroot
Echo_debug "Executing: %s" "${COMMANDS}"
if [ "${LH_USE_FAKEROOT}" != "true" ]
then
${LH_ROOT_COMMAND} chroot "${CHROOT}" /usr/bin/env -i HOME="/root" PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" TERM="${TERM}" ftp_proxy="${LH_APT_FTP_PROXY}" http_proxy="${LH_APT_HTTP_PROXY}" DEBIAN_FRONTEND="${LH_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LH_DEBCONF_PRIORITY}" DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" XORG_CONFIG="custom" ${COMMANDS}
else
# Building with fakeroot/fakechroot
${LH_ROOT_COMMAND} chroot "${CHROOT}" ${COMMANDS}
fi
2007-09-23 08:05:09 +00:00
return "${?}"
2007-09-23 08:04:46 +00:00
}