summaryrefslogtreecommitdiffstats
path: root/scripts/envsetup.sh
blob: 6ca10de4d98dc78d800a639184379354cdce34ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash

if [ -z $1 ]; then
        echo -e "Usage: source envsetup.sh <board/device> [build dir]"
        return 1
fi

MACHINE="$1"


case "$MACHINE" in
        "porter")
                # setup proprietary gfx drivers and multimedia packages
                COPY_MM_SCRIPT=meta-renesas/meta-rcar-gen2/scripts/setup_mm_packages.sh
                if [ -f $COPY_MM_SCRIPT ]; then
                        . $COPY_MM_SCRIPT
                        copy_mm_packages $1
                        if [ $? -ne 0 ]; then
                                echo "Copying gfx drivers and multimedia packages for '$1' failed."
                                return 1
                        fi
                fi

                if [ ! -d "$TEMPLATECONF" ]; then
                    # set template conf for R-Car2 M2 Porter board
                    TEMPLATECONF="$PWD/meta-renesas/meta-rcar-gen2/conf"
                fi
                ;;
        "porter-nogfx")
                MACHINE="porter"
                if [ ! -d "$TEMPLATECONF" ]; then
                    # set template conf for R-Car2 M2 Porter board
                    TEMPLATECONF="$PWD/meta-renesas/meta-rcar-gen2/conf"
                fi
                ;;
        "intel-corei7-64")
                ;;
        "minnowboard")
                # alias for minnowboardmax
                MACHINE="intel-corei7-64"
                ;;
        "qemux86")
                ;;
        "qemux86-64")
                ;;
        "wandboard")
                ;;
        *)
                # nothing to do here
                echo "WARN: '$MACHINE' is not tested by AGL Distro"
                ;;
esac

# set template conf for each <board/device>
if [ -z "$TEMPLATECONF" ]; then
    if [ -d "$PWD/meta-agl-demo/templates/$MACHINE/conf" ]; then
        TEMPLATECONF="$PWD/meta-agl-demo/templates/$MACHINE/conf"
    fi
fi

echo "envsetup: Set '$1 as MACHINE."
export MACHINE

# fallback
if [ ! -d "$TEMPLATECONF" ]; then
   # Allow to use templates at meta-agl-demo/conf
   TEMPLATECONF="$PWD/meta-agl-demo/conf"
fi

echo "envsetup: Using templates for local.conf & bblayers.conf from :"
echo "          '$TEMPLATECONF'"
export TEMPLATECONF

if [ -n "$2" ]; then
  BUILD_DIR="$2"
else
  BUILD_DIR=build
fi

echo "envsetup: Setup build environment for poky/oe."
echo -e

source poky/oe-init-build-env $BUILD_DIR

if [ -n "$DL_DIR" ]; then
        BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE DL_DIR"
fi

if [ -n "$SSTATE_DIR" ]; then
        BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE SSTATE_DIR"
fi

export BB_ENV_EXTRAWHITE

unset TEMPLATECONF
class="p">(ns->binaries); for (i = 0; i < APCLASS_DIM; i++) pa_xfree((void *)ns->class_name[i]); free(ns); } } int agl_nodeset_add_role (struct userdata *u, const char *role, agl_node_type type, agl_nodeset_resdef *resdef) { agl_nodeset *ns; agl_nodeset_map *map; pa_assert (u); pa_assert_se (ns = u->nodeset); map = pa_xnew0 (agl_nodeset_map, 1); map->name = pa_xstrdup (role); map->type = type; map->role = pa_xstrdup (role); if (resdef) { map->resdef = pa_xnew (agl_nodeset_resdef, 1); memcpy (map->resdef, resdef, sizeof(agl_nodeset_resdef)); } return pa_hashmap_put (ns->roles, (void *)map->name, map); } agl_node *agl_node_create (struct userdata *u, agl_node *data) { agl_nodeset *ns; agl_node *node; pa_assert (u); pa_assert_se (ns = u->nodeset); node = pa_xnew0 (agl_node, 1); pa_idxset_put (ns->nodes, node, &node->index); if (data) { node->key = pa_xstrdup (data->key); node->direction = data->direction; node->implement = data->implement; node->channels = data->channels; node->location = data->location; node->privacy = data->privacy; node->type = data->type; node->zone = pa_xstrdup (data->zone); node->visible = data->visible; node->available = data->available; node->amname = pa_xstrdup (data->amname ? data->amname : data->paname); node->amdescr = pa_xstrdup(data->amdescr ? data->amdescr : ""); node->amid = data->amid; node->paname = pa_xstrdup (data->paname); node->stamp = data->stamp; node->rset.id = data->rset.id ? pa_xstrdup(data->rset.id) : NULL; node->rset.grant = data->rset.grant; if (node->implement == agl_device) { node->pacard.index = data->pacard.index; if (data->pacard.profile) node->pacard.profile = pa_xstrdup (data->pacard.profile); if (data->paport) node->paport = data->paport; } } /* TODO : register the node to the router */ /* agl_router_register_node (u, node); */ return node; } const char *agl_node_type_str (agl_node_type type) { switch (type) { case agl_node_type_unknown: return "Unknown"; case agl_radio: return "Radio"; case agl_player: return "Player"; case agl_navigator: return "Navigator"; case agl_game: return "Game"; case agl_browser: return "Browser"; case agl_camera: return "Camera"; case agl_phone: return "Phone"; case agl_alert: return "Alert"; case agl_event: return "Event"; case agl_system: return "System"; default: return "<user defined>"; } } const char *agl_node_direction_str (agl_direction direction) { switch (direction) { case agl_direction_unknown: return "unknown"; case agl_input: return "input"; case agl_output: return "output"; default: return "< ??? >"; } } agl_node *agl_node_get_from_data (struct userdata *u, agl_direction type, void *data) { pa_sink_input_new_data *sinp_data; pa_source_output_new_data *sout_data; agl_nodeset *nodeset; agl_node *node; uint32_t index; pa_assert (u); pa_assert (data); pa_assert (nodeset = u->nodeset); pa_assert (type == agl_input || type == agl_output); /* input (= sink_input) */ if (type == agl_input) { sinp_data = (pa_sink_input_new_data *) data; PA_IDXSET_FOREACH(node, nodeset->nodes, index) { if (node->client == sinp_data->client) return node; } /* output (= source_output) TODO */ /*} else {*/ } return NULL; } agl_node *agl_node_get_from_client (struct userdata *u, pa_client *client) { agl_nodeset *nodeset; agl_node *node; uint32_t index; pa_assert (u); pa_assert (client); pa_assert (nodeset = u->nodeset); PA_IDXSET_FOREACH(node, nodeset->nodes, index) { if (node->client == client) return node; } return NULL; }