3 # Copyright (C) 2003,2004,2005,2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 declare -r _VS_NEWLINE=${_VS_NEWLINE:0-1}
24 declare -r VS_ALLVSERVERS_ARGS=all,marked,unmarked,stopped,running
35 test -n "$_fo_i" || continue
36 test ! $_fo_mod "$_fo_i" || { _fo_file=$_fo_i; break; }
39 test -z "$_fo_i" -o -n "$_fo_file" || {
40 echo "Can not find file for '$_fo_var'; aborting"
44 eval "$_fo_var=\"$_fo_file\""
60 test ! -s "$dst" || return 0
66 test -n "$tmp" -a -s "$tmp" || return 0
67 $_CP -af "$tmp" "$dst"
70 ## Usage: isRegularFile <filename> [<mod>]
71 function isRegularFile
73 test ${2:--f} "$1" || return 1
76 (*.rpmsave|*.rpmnew|*.rpmorig|*.cfsaved*|*.~*~) return 1;;
82 function getPhysicalDir
84 ( set -P && cd "$1" && pwd )
87 ## Usage:: isDirectoryEmpty <dir> [<ignore-lost+found>]
88 function isDirectoryEmpty
92 shopt -s nullglob || *
95 test -z "$2" -o "$2" = 0 || ignore_lostfound=
100 test "$ignore_lostfound" || exit 1
102 (*) echo "$i"; exit 1
110 ## Usage: logging <message>
113 if test -n "$_VS_LOGFILE"; then
114 echo "$@" >>"$_VS_LOGFILE"
120 ## Usage: warning <message>
123 if test -n "$_VS_ERRFILE"; then
124 echo "$@" >>"$_VS_ERRFILE"
130 ## Usage: panic <message>
133 if test -n "$_VS_ERRFILE"; then
134 echo "$@" >>"$_VS_ERRFILE"
142 ## Usage: execute <message>
145 test -z "${DEBUG_EXEC:-}" || echo "$@"
146 test "${DEBUG_EXEC:-}" = noexec || exec "$@"
151 ## Usage: spawn <message>
154 test -z "${DEBUG_EXEC:-}" || echo "$@"
155 test "${DEBUG_EXEC:-}" = noexec || "$@"
158 ## Usage: isNumber <arg>
162 let tmp=$1+0 2>/dev/null || test -z "${1//0/}" -a -n "$1" || return 1
166 ## Usage: hasSubstring <haystack> <needle>+
167 function hasSubstring
175 test x"${pat/*$i*/$i}" = x"$i" || continue
182 ## Usage: colorize <style> <command>
192 findFile cfile "$__CONFDIR"/.defaults/styles/"$style" ''
193 if test -n "$cfile"; then
197 (bold) echo -ne "\e[1m";;
198 (emph) echo -ne "\e[34m";;
199 (info) echo -ne "\e[0;34m";;
200 (warn*) echo -ne "\e[1;31m";;
201 (error) echo -ne "\e[1;33;41m";;
213 if test -n "$_VS_ERRFILE"; then
214 echo "$@" >>"$_VS_ERRFILE"
216 colorize error echo -n "$@" >&2
225 colorize warning warning "$@"
230 colorize info echo "$@"
234 ## Usage: xtermTitle <title>
238 echo -ne "\e]0;$@\007"
242 ## Usage: lock <lockfile> [<timeout>]
245 local tmp=$($_MKTEMP vserver-lock.XXXXXX)
249 $_LOCKFILE "$1" $tmp $2 &
250 $_GREP -q true $tmp 2>/dev/null || return 1
252 _VS_LOCKS="$! $_VS_LOCKS"
255 ## Usage: unlock [<num>]
262 while test "$#" -gt 0; do
263 kill -HUP "$1" >/dev/null || :
265 test "$num" != 1 || break
266 test -z "$num" || let --num
271 function _pkgMountBindDir()
273 test "$1" != "$2" || return 0
275 $_MOUNT -n --bind "$1" "$2"
278 function _pkgSetVarsBase
282 if test -d "$vserver/vdir"; then
284 VDIR=$(getPhysicalDir "$vserver/vdir")
286 PKGDIR=$BASEDIR/apps/pkgmgmt
287 test -d "$PKGDIR" || {
288 echo "Can not find configuration-directory for package-managment tools"
291 findDir EXECDIR $PKGDIR/execdir /
293 VDIR=$(getPhysicalDir "$vserver")
298 BASEDIR=$__CONFDIR/$vserver
299 test -d "$BASEDIR" || {
300 echo "Can not find configuration-directory"
305 test -d "$VDIR" || VDIR=$__DEFAULT_VSERVERDIR/$vserver
306 VDIR=$(getPhysicalDir "$VDIR")
308 PKGDIR=$BASEDIR/apps/pkgmgmt
309 test -d "$PKGDIR" || {
310 echo "Can not find configuration-directory for package-managment tools"
314 findDir EXECDIR $PKGDIR/execdir /
319 if test -z "$WORKAROUND_106057"; then
322 _rpmdb_mntpoint=/.rpmdb
326 function _pkgSetVarsRPM
328 if test -n "$PKGDIR"; then
329 findDir RPMETCDIR $PKGDIR/rpmetc $PKGDIR/base/rpm/etc /etc/rpm
330 findDir RPMSTATEDIR $PKGDIR/rpmstate $PKGDIR/base/rpm/state
332 findDir RPMLIBDIR $PKGDIR/rpmlib /
335 findDir RPMETCDIR "$VDIR"/etc/rpm /etc/rpm
336 findDir RPMSTATEDIR "$VDIR"/var/lib/rpm
340 RPMSTATEDIR=$(getPhysicalDir "$RPMSTATEDIR")
341 RPMETCDIR=$(getPhysicalDir "$RPMETCDIR")
344 function _pkgSetVarsApt
346 if test -n "$PKGDIR"; then
347 findDir APTETCDIR $PKGDIR/aptetc $PKGDIR/base/apt/etc /etc/apt
348 findDir APTSTATEDIR $PKGDIR/aptstate $PKGDIR/base/apt/state
349 findDir APTCACHEDIR $PKGDIR/aptcache $PKGDIR/base/apt/cache
350 findDir APTARCHIVDIR $PKGDIR/aptarchives $PKGDIR/base/apt/archives /var/cache/apt/archives
352 findDir APTETCDIR "$VDIR"/etc/apt /etc/apt
353 findDir APTSTATEDIR "$VDIR"/var/state/apt
354 findDir APTCACHEDIR "$VDIR"/var/cache/apt
355 findDir APTARCHIVDIR "$VDIR"/var/cache/apt/archives /var/cache/apt/archives
358 findFile APT_CONFIG "$APTETCDIR"/apt.conf ""
359 test -z "$APT_CONFIG" || export APT_CONFIG
362 function _pkgSetVarsYum
364 if test -n "$PKGDIR"; then
365 findDir YUMETCDIR $PKGDIR/yumetc $PKGDIR/base/yum/etc /etc
366 findDir YUMCACHEDIR $PKGDIR/yumcache $PKGDIR/base/yum/cache
368 findDir YUMETCDIR "$VDIR"/etc /etc
369 findDir YUMCACHEDIR "$VDIR"/var/cache/yum
374 function _pkgMountBase
379 function _pkgMountApt
384 function _pkgMountYum
389 function _pkgMountRPM
391 _pkgMountBindDir "$RPMETCDIR" /etc/rpm
392 test "$RPMLIBDIR" = "/" || _pkgMountBindDir "$RPMLIBDIR" /usr/lib/rpm
394 pushd "$VDIR" >/dev/null
396 $_SECURE_MOUNT --chroot -n --bind "$RPMSTATEDIR" "$_rpmdb_mntpoint"
397 test -z "$WORKAROUND_106057" || mount -n --bind "$RPMSTATEDIR" "$_rpmdb_mntpoint"
399 test -e "$VDIR"/proc/self/status || \
400 $_SECURE_MOUNT --chroot -n -t proc none /proc
405 function _pkgSetEnvBase
407 test "$EXECDIR" = "/" || {
409 LD_LIBRARY_PATH=$EXECDIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
412 export PATH LD_LIBRARY_PATH
415 function _pkgSetEnvApt
420 function _pkgSetEnvYum
425 function _pkgSetEnvRPM
428 RPM_FAKE_NAMESPACE_MOUNTS=$_rpmdb_mntpoint
429 RPM_BINARY=$_VRPM_PRELOAD
431 export CUR_VSERVER RPM_FAKE_NAMESPACE_MOUNTS RPM_BINARY
443 rpm) _pkgSetVarsRPM;;
444 apt) _pkgSetVarsApt;;
445 yum) _pkgSetVarsYum;;
446 *) echo "Unknown packaging flavor" >&2; exit 1;;
469 _PKG_VSERVER=$vserver
472 function isAvoidNamespace
476 $_VSERVER_INFO - FEATURE namespace || return 0
477 cfgdir=$($_VSERVER_INFO "$1" CFGDIR) || return 0
478 test ! -e "$cfgdir"/namespace || return 1
479 test -e "$__CONFDIR"/.defaults/nonamespace -o \
480 -e "$cfgdir"/nonamespace
483 function isNamespaceCleanup
487 $_VSERVER_INFO - FEATURE namespace || return 1
488 cfgdir=$($_VSERVER_INFO "$1" CFGDIR) || return 1
489 test -e "$cfgdir"/nonamespace-cleanup && return 1
490 test -e "$__CONFDIR"/.defaults/namespace-cleanup -o \
491 -e "$cfgdir"/namespace-cleanup && return 0
495 ## Usage: getAllVservers <var> [<KIND>*]
496 function getAllVservers
499 declare -a _ga_tmp=()
501 for _ga_i in $__CONFDIR/*; do
502 isRegularFile "$_ga_i" -d || continue
504 test ! -e "$_ga_i"/disabled || continue
505 test -d "$_ga_i"/vdir || continue
508 local _ga_markfile=$_ga_i/apps/init/mark
511 (MARKED) test -s "$_ga_markfile" || _ga_doadd=;;
512 (UNMARKED) test ! -s "$_ga_markfile" || _ga_doadd=;;
513 (STOPPED) ! $_VSERVER "$_ga_i" running &>/dev/null || _ga_doadd=;;
514 (RUNNING) $_VSERVER "$_ga_i" running &>/dev/null || _ga_doadd=;;
516 (*) panic $"Unknown vserver tagging '$2'";;
519 test -z "$_ga_doadd" || _ga_tmp=( "${_ga_tmp[@]}" "${_ga_i##$__CONFDIR/}")
522 eval $1='( "${_ga_tmp[@]}" )'
525 ## Usage: getAllVserversByArg <var> <arg>
526 function getAllVserversByArg
531 (--all) _gav_mark=ALL;;
532 (--marked) _gav_mark=MARKED;;
533 (--unmarked) _gav_mark=UNMARKED;;
534 (--stopped) _gav_mark=STOPPED;;
535 (--running) _gav_mark=RUNNING;;
539 getAllVservers "$1" "$_gav_mark"
542 ## Usage: _getProcNumberCount <ctx> <var>
543 function _getProcNumberCount
546 local _gp_procnr_cnt=0
548 # Use /proc/virtual from kernel 2.6 when possible
549 if test -d "/proc/virtual"; then
550 set -- $($_GREP '^PROC:' "/proc/virtual/$1/limit" 2>/dev/null)
553 _gp_procnr_cnt=$($_VPS ax | $_AWK '{print $2}' | $_GREP -x "$1" | $_WC -l )
556 let _gp_procnr_cnt=_gp_procnr_cnt+0
557 eval $_gp_var=\$_gp_procnr_cnt
560 ## Usage: getVserverCtx <vdir> <result-varname> [<procnumber-varname> [<do-cleanup>]]
561 ## Returns: 0 iff vserver is running
562 function getVserverStatus
564 test -r "$1"/run || return 1
567 read _gvs_ctx <"$1"/run
570 test -n "$3" || return 0
572 _getProcNumberCount "$_gvs_ctx" _gvs_tmp
575 if test "$_gvs_tmp" = 0; then
576 local runfile=$($_READLINK "$1/run")
577 test -z "$4" || $_RM -f "$runfile"
584 ## Usage: isCtxRunning <ctx>
585 function isCtxRunning
588 _getProcNumberCount "$1" _tmp
592 ## Usage: isVserverRunning <vdir> [<ctx-varname>]
593 function isVserverRunning
595 local _ivr_ctx _ivr_procnum
597 getVserverStatus "$1" _ivr_ctx _ivr_procnum 1 || return 1
598 test "$_ivr_procnum" != 0 || return 1
599 test -z "$2" || eval "$2"=\$_ivr_ctx
603 ## Called as 'getFileValue <varname> <filename>+'
604 function getFileValue
610 findFile _gfv_file "$@" ''
611 test -n "$_gfv_file" -a -r "$_gfv_file" || return 0
612 eval read "$_gfv_var" <"$_gfv_file"
615 ## Called as 'getFileArray <varname> <filename>'
616 function getFileArray
618 test -r "$2" || return 1
620 local IFS=$_VS_NEWLINE
621 eval "$1"='( $(< "$2") )'
624 function checkComponents
635 (core) test -x "$_CHBIND" || failed=1;;
636 (build) test -x "$_VSERVER_BUILD" || failed=1;;
637 (sysv) test -x "$__INITRDDIR/vserver" || failed=1;;
638 (devel) test -d "$__INCLUDEDIR/vserver.h" || failed=1;;
639 (*) echo "Unknown component '$i'" >&2
644 test -z "$failed" || {
653 ## Usage: isKernelAPI <ver> [<cmp-modifier>]
657 api=$($_VSERVER_INFO - APIVER) || api=0
658 test $[ $api ] -${2:-ge} $[ $1 ]
661 ## Usage: callInNamespace <vserver> <command> <args>*
662 function callInNamespace
666 isAvoidNamespace "$1" || \
667 ctx=$( $_VSERVER_INFO "$1" CONTEXT f ) || ctx=
670 if test -n "$ctx"; then
671 $_VNAMESPACE --enter "$ctx" -- "$@"
677 ## Usage: setDefaultTTY <vdir> [<fallback-tty>]
678 function setDefaultTTY
682 cfgdir=$($_VSERVER_INFO "$1" APPDIR init) || cfgdir=
683 findObject -e ttyname \
684 ${cfgdir:+"$cfgdir"/tty} \
685 "$__CONFDIR/.defaults/apps/init/tty" \
692 ## Usage: killContext <XID> [<SIG>]
697 #$_VKILL -s STOP --xid "$1" 1 &>/dev/null || :
698 $_VKILL -s "$sig" --xid "$1" 1 &>/dev/null || :
699 $_VKILL -s "$sig" --xid "$1" &>/dev/null || :
700 #$_VKILL -s "$sig" --xid "$1" 1 &>/dev/null || :
701 #$_VKILL -s CONT --xid "$1" 1 &>/dev/null || :
704 ## Usage: pkgmgmt.guessStyle <vserver> <resultvar>
705 function pkgmgmt.guessStyle()
708 _pgs_vdir=$($_VSERVER_INFO "$1" VDIR) || {
709 echo $"Can not determine vserver-root" >&2
712 local _pgs_cfgdir=$($_VSERVER_INFO "$1" APPDIR pkgmgmt) || :
714 if test -n "$_pgs_cfgdir" -a -e "$_pgs_cfgdir"/style; then
715 read style <"$_pgs_cfgdir"/style
716 elif test -e "$_pgs_vdir"/etc/redhat-release -o -e "$_pgs_vdir"/etc/fedora-release; then
718 elif test -e "$_pgs_vdir"/etc/mandrake-release; then
720 elif test -e "$_pgs_vdir"/etc/debian_version; then
722 elif test -e "$_pgs_vdir"/etc/SuSE-release; then
725 echo $"Can not determine packagemanagement style" >&2
733 ## Usage: pkgmgmt.isInternal <vserver>
734 ## returns true iff <vserver> is configured for internal packagemanagement
735 ## A typical application is
737 ## | pkgmgmt.isInternal "$vserver" || is_external=1
738 function pkgmgmt.isInternal
740 local cfgdir=$($_VSERVER_INFO "$1" APPDIR pkgmgmt) || :
742 test -z "$cfgdir" -o ! -d "$cfgdir" -o -e "$cfgdir"/internal
745 ## Usage: pkgmgmt.isAptAvailable <cfgdir> <vdir> [<is-internal>]
746 function pkgmgmt.isAptAvailable
750 local is_internal="$3"
753 if test -n "$is_internal"; then
755 test -d "$cfgdir"/base/apt -o -d "$cfgdir"/aptetc || have_apt=
758 for i in /bin /usr/bin /usr/local/bin; do
759 test ! -x "$vdir$i"/apt-get || { have_apt=1; break; }
763 test -n "$have_apt" && return 0 || return 1
766 ## Usage: pkgmgmt.isYumAvailable <cfgdir> <vdir> [<is-internal>]
767 function pkgmgmt.isYumAvailable
771 local is_internal="$3"
774 if test -n "$is_internal"; then
776 test -d "$cfgdir"/base/yum -o -d "$cfgdir"/yumetc || have_yum=
779 for i in /bin /usr/bin /usr/local/bin; do
780 test ! -x "$vdir$i"/yum || { have_yum=1; break; }
784 test -n "$have_yum" && return 0 || return 1
788 function vshelper.doSanityCheck
790 local vshelper this_xid i
791 declare -a warnings=()
792 local solution_disable=
793 local solution_sysctl=
795 vshelper.isEnabled && vshelper.isEnabled warning || return 0
797 this_xid=$($_VSERVER_INFO - XID) ||
798 panic $"Failed to determine current context; aborting..."
800 ## Do nothing in other xid's; the helper will be executed in xid 0 only
801 test "$this_xid" = 0 || return 0
803 local proc_file=/proc/sys/kernel/vshelper
805 if ! test -r "$proc_file"; then
807 warnings=( "${warnings[@]}"
808 $"File '$proc_file' does not exist but is required for vshelper setup" )
811 vshelper=$(cat "$proc_file")
813 $_CMP -s "$vshelper" "$_VSHELPER" || {
814 warnings=( "${warnings[@]}"
815 $"The configured vshelper '$vshelper' does not match the 'vshelper'
816 script of the util-vserver package"
823 test -d "$__VSHELPERSTATEDIR" || {
824 warnings=( "${warnings[@]}"
826 The vshelper state-directory '$__VSHELPERSTATEDIR' does not exist; since
827 it is created by 'make install', this indicates a serious problem with
828 your util-vserver installation" )
832 test "${#warnings[@]}" -eq 0 || {
834 The following problem(s) were encountered while verifying vshelper
837 for i in "${warnings[@]}"; do
843 To fix this, you can:"
845 test -z "$solution_disable" || warning $"\
846 * disable vshelper entirely by executing
847 | touch \"$__CONFDIR/.defaults/apps/vshelper/disabled\"
848 * disable only this message by executing
849 | touch \"$__CONFDIR/.defaults/apps/vshelper/warning-disabled\""
851 test -x "$solution_sysctl" || warning $"\
852 * configure the util-vserver vshelper script, e.g. by adding
853 | kernel.vshelper = $_VSHELPER
854 to /etc/sysctl.conf and rebooting the machine, or by executing
855 | echo \"$_VSHELPER\" >$proc_file"
865 ## Usage: vshelper.isEnabled [<style>] [<vserver>]
866 function vshelper.isEnabled
868 local f=${1:+$1-}disabled
869 test ! -e "$__CONFDIR"/.defaults/apps/vshelper/"$f" || return 1
870 $_VSERVER_INFO - FEATURE vshelper || return 1
871 if test -n "$2"; then
873 appdir=$($_VSERVER_INFO "$2" APPDIR vshelper) || return 0
874 test -z "$2" -o ! -e "$appdir/$f" || return 1
880 ## Usage: vshelper.isDebug [<vserver>]
881 function vshelper.isDebug
883 test ! -e "$__CONFDIR"/.defaults/apps/vshelper/debug || return 0
884 $_VSERVER_INFO - FEATURE vshelper || return 1
885 if test -n "$1"; then
887 appdir=$($_VSERVER_INFO "$1" APPDIR vshelper) || return 1
888 test ! -e "$appdir/debug" || return 0
894 function vshelper._getHandlerInternal
899 shift ## HACK: see below the note about the 'set -u' mode
901 while test "$#" -ge 2; do
906 test "$_vghi_mod" "$_vghi_obj" || continue
909 eval $_vghi_var=\$_vghi_obj
912 read _vghi_tmp <"$_vghi_obj"
913 eval $_vghi_var=:\$_vghi_tmp
915 (*) panic $"Internal error, unexpected modifier '$_vghi_mod'"
923 ## Usage: vshelper.getHandler <result-var> <vserver> <action>
924 function vshelper.getHandler
927 _vgh_appdir=$($_VSERVER_INFO "$2" APPDIR vshelper) || _vgh_appdir=
929 declare -a _vgh_search_list=( X )
930 ## HACK: when we are in 'set -u' mode, empty lists are causing errors
932 test -z "$_vgh_appdir" || _vgh_search_list=( "${_vgh_search_list[@]}" -x "$_vgh_appdir/$3" )
933 test -z "$_vgh_appdir" || _vgh_search_list=( "${_vgh_search_list[@]}" -e "$_vgh_appdir/action" )
934 _vgh_search_list=( "${_vgh_search_list[@]}" -x "$__CONFDIR"/.defaults/apps/vshelper/"$3" )
935 _vgh_search_list=( "${_vgh_search_list[@]}" -e "$__CONFDIR"/.defaults/apps/vshelper/action )
937 ! vshelper._getHandlerInternal "$1" "${_vgh_search_list[@]}" || return 0
941 ## Usage: vshelper.init <vserver> [<method> <args>*]
942 function vshelper.doInit
944 vshelper.isEnabled || return 0
947 xid=$($_VSERVER_INFO "$1" CONTEXT false) && test -n "$xid" || {
948 warning $"vshelper.init: can not determine xid of vserver '$vserver'; returned value was '$xid'"
952 local f="$__VSHELPERSTATEDIR/$xid"
959 if test -n "$2"; then
972 ## Usage: vshelper.doDestroy <vserver> <xid>
973 function vshelper.doDestroy
975 vshelper.isEnabled || return 0
977 $_RM -f "$__VSHELPERSTATEDIR/$2"
980 ## Usage: vshelper.initSync <vserver> <pipe-varname> [<method>]
981 function vshelper.initSync
984 _vis_tmpdir=$($_MKTEMPDIR vserver-stop.XXXXXX) || {
985 warning $"Failed to generate temporary directory for vshelper sync"
989 local _vis_fifo="$_vis_tmpdir"/pipe
990 $_MKFIFO -m700 "$_vis_fifo"
991 vshelper.doInit "$1" "${3:-sync}" "$_vis_fifo"
995 ## Usage: vshelper.getSyncTimeout <vserver> <varname>
996 function vshelper.getSyncTimeout
998 local _vgst_appdir _vgst_file _vgst_tmp
999 _vgst_appdir=$($_VSERVER_INFO "$1" APPDIR vshelper) || _vgst_appdir=
1001 findFile _vgst_file ${_vgst_appdir:+"$_vgst_appdir"/sync-timeout} "$__CONFDIR"/.defaults/apps/vshelper/sync-timeout ''
1002 test -n "$_vgst_file" || return 1
1003 read _vgst_tmp <"$_vgst_file"
1008 function _rpmFake.getCapFlags
1012 if test -n "$ctx" && ! $_VSERVER_INFO - FEATURE migrate; then
1013 set -- $($_CHCONTEXT_COMPAT --xid 1 \
1014 $_SH -c "$_CAT /proc/[0-9]*/status | $_EGREP '^(CapBset|s_context|ctxflags)'" | \
1015 $_GREP -B 1 -A 1 "^s_context: $ctx " | \
1016 $_SED -e '1,3p;d' | $_AWK '{ print $2 }')
1021 if test -n "$3"; then
1022 RPM_FAKE_CAP=$[ ~0x$1 ]
1025 RPM_FAKE_CAP=$[ ~0xd40c04ff ]
1030 function rpmFake.init
1034 vdir=$($_VSERVER_INFO "$1" VDIR) || vdir="$1"
1035 ctx=$($_VSERVER_INFO "$1" CONTEXT) || ctx=
1038 panic $"Can not find chroot environment at '$vdir' for '$1'"
1040 _rpmFake.getCapFlags "$ctx"
1042 RPM_FAKE_CHROOT=$vdir
1046 function rpmFake.exec
1048 export RPM_FAKE_CHROOT RPM_FAKE_CTX RPM_FAKE_CAP RPM_FAKE_FLAGS
1050 LD_PRELOAD=$_RPM_FAKE_SO${LD_PRELOAD:+:$LD_PRELOAD} \