2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2014-02-08 15:47:02 -01:00
|
|
|
## Copyright (C) 2006-2014 Daniel Baumann <mail@daniel-baumann.ch>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
2012-07-29 23:59:00 +00:00
|
|
|
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
2010-09-02 11:12:37 +00:00
|
|
|
## 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 ()
|
|
|
|
{
|
2008-10-28 14:44:06 -01:00
|
|
|
CHROOT="${1}"; shift
|
2008-02-24 13:19:41 -01:00
|
|
|
COMMANDS="${@}"
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Executing commands in chroot
|
2008-08-11 20:28:54 +00:00
|
|
|
Echo_debug "Executing: %s" "${COMMANDS}"
|
2007-11-10 16:39:49 -01:00
|
|
|
|
2012-06-06 19:32:08 +00:00
|
|
|
ENV=""
|
|
|
|
|
|
|
|
for _FILE in config/environment config/environment.chroot
|
|
|
|
do
|
|
|
|
if [ -e "${_FILE}" ]
|
|
|
|
then
|
|
|
|
ENV="${ENV} $(grep -v '^#' ${_FILE})"
|
|
|
|
fi
|
|
|
|
done
|
2012-05-24 07:41:27 +00:00
|
|
|
|
2013-02-18 11:56:07 -01:00
|
|
|
${_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}
|
2007-09-23 08:05:09 +00:00
|
|
|
|
|
|
|
return "${?}"
|
2007-09-23 08:04:46 +00:00
|
|
|
}
|