Create a basic chroot environment.

    Note that this environment is not functional. The caller needs to
    install the minimal required binaries, including Python if
    chroot.call is called.

    name
        Path to the chroot environment

    CLI Example:

    .. code-block:: bash

        salt myminion chroot.create /chroot

def create(name):
    '''
    Create a basic chroot environment.

    Note that this environment is not functional. The caller needs to
    install the minimal required binaries, including Python if
    chroot.call is called.

    name
        Path to the chroot environment

    CLI Example:

    .. code-block:: bash

        salt myminion chroot.create /chroot

    '''
    if not exist(name):
        dev = os.path.join(name, 'dev')
        proc = os.path.join(name, 'proc')
        try:
            os.makedirs(dev, mode=0o755)
            os.makedirs(proc, mode=0o555)
        except OSError as e:
            log.error('Error when trying to create chroot directories: %s', e)
            return False
    return True