source: live-build/trunk/fuentes/functions/chroot.sh @ 900

Last change on this file since 900 was 900, checked in by kbut, 3 years ago

add original source

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/sh
2
3## live-build(7) - System Build Scripts
4## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
5##
6## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7## This is free software, and you are welcome to redistribute it
8## under certain conditions; see COPYING for details.
9
10
11Chroot ()
12{
13        CHROOT="${1}"; shift
14        COMMANDS="${@}"
15
16        # Executing commands in chroot
17        Echo_debug "Executing: %s" "${COMMANDS}"
18
19        ENV=""
20
21        for _FILE in config/environment config/environment.chroot
22        do
23                if [ -e "${_FILE}" ]
24                then
25                        ENV="${ENV} $(grep -v '^#' ${_FILE})"
26                fi
27        done
28
29        if [ "${LB_USE_FAKEROOT}" != "true" ]
30        then
31                ${LB_ROOT_COMMAND} ${_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_NOWARNINGS="${LB_DEBCONF_NOWARNINGS}" ${ENV} ${COMMANDS}
32        else
33                # Building with fakeroot/fakechroot
34                ${LB_ROOT_COMMAND} ${_LINUX32} chroot "${CHROOT}" ${ENV} ${COMMANDS}
35        fi
36
37        return "${?}"
38}
Note: See TracBrowser for help on using the repository browser.