1 # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
2 # vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
4 getconf CHROOT "`which chroot`"
6 function backend_chroot_init () {
7 # Is the changeroot command available?
11 function backend_chroot_host_available () {
13 # The root exists and is a directory, everything ok
16 if [ ! -e "$1" ]; then
17 # The root does not exist?
18 eval "$2=\"No such file or directory: '\$1'\""
20 # The root exists, so is not a directory
21 eval "$2=\"Not a directory: '\$1'\""
27 function backend_chroot_host_root () {
28 # The host part is the root, but strip any trailing slashes
29 echo "$1" | sed 's/\/*$//'
32 function backend_chroot_run () {
33 # Run the command using the chroot command
34 "$CHROOT" "$root" "$@"
37 function backend_chroot_interpolate_vars () {
41 function backend_chroot_interpolate_value () {