4 # Handle EULA , if needed. This is a generic method to handle BSPs
5 # that might (or not) come with a EULA. If a machine has a EULA, we
6 # assume that its corresponding layers has conf/EULA/$MACHINE file
7 # with the EULA text, which we will display to the user and request
8 # for acceptance. If accepted, the variable ACCEPT_EULA_$MACHINE is
9 # set to 1 in local.conf, which can later be used by the BSP.
10 # If the env variable EULA_$MACHINE is set it is used by default,
11 # without prompting the user.
12 # FIXME: there is a potential issue if the same $MACHINE is set in more than one layer.. but we should assert that earlier
13 EULA=$(find $1 -print | grep "conf/eula/$MACHINE" | grep -v scripts | grep -v openembedded-core || true)
14 if [ -n "$EULA" ]; then
15 # remove '-' since we are constructing a bash variable name here
16 EULA_MACHINE="EULA_$(echo $MACHINE | sed 's/-//g')"
17 # NOTE: indirect reference / dynamic variable
18 if [ -n "${!EULA_MACHINE}" ]; then
19 # the EULA_$MACHINE variable is set in the environment, so we just configure
20 # ACCEPT_EULA_$MACHINE in local.conf
21 EULA_ACCEPT=${!EULA_MACHINE}
23 # so we need to ask user if he/she accepts the EULA:
25 The BSP for $MACHINE depends on packages and firmware which are covered by an
26 End User License Agreement (EULA). To have the right to use these binaries
27 in your images, you need to read and accept the following...
29 The firmware package can contains several types
30 of firmware (depending on BSP):
32 * bootloaders: the first stage bootloaders are proprietary for this
33 board, they are included in this firmware package.
34 * firmware for the power management 'companion' core: on QCOM SoC some
35 power management features are implemented in a companion core , called
36 RPM, and not on the main CPU.
37 * firmware for GPU, WLAN, DSP/GPS and video codecs. These firmware are
38 used by their respective linux drivers (DRM, wlan, v4l2, .. ) and are
39 loaded on-demand by the main CPU onto the various cores on the SoC.
44 while [ -z "$REPLY" ]; do
45 echo -n "Do you read the EULA ? (y/n) "
60 if [ "$READ_EULA" == 1 ]; then
64 while [ -z "$REPLY" ]; do
65 echo -n "Do you accept the EULA you just read? (y/n) "
69 echo "EULA has been accepted."
73 echo "EULA has not been accepted."
86 echo -e "Usage: source envsetup.sh <board/device> [build dir]"
91 echo "MACHINE=$MACHINE"
97 # setup proprietary gfx drivers and multimedia packages
98 COPY_MM_SCRIPT=meta-renesas/meta-rcar-gen2/scripts/setup_mm_packages.sh
99 if [ -f $COPY_MM_SCRIPT ]; then
102 if [ $? -ne 0 ]; then
103 echo "Copying gfx drivers and multimedia packages for '$1' failed."
108 if [ ! -d "$TEMPLATECONF" ]; then
109 # set template conf for R-Car2 M2 Porter board
110 TEMPLATECONF="$PWD/meta-renesas/meta-rcar-gen2/conf"
115 if [ ! -d "$TEMPLATECONF" ]; then
116 # set template conf for R-Car2 M2 Porter board
117 TEMPLATECONF="$PWD/meta-renesas/meta-rcar-gen2/conf"
127 # alias for minnowboardmax
128 MACHINE="intel-corei7-64"
137 # nickname for dra7xx-evm
143 find_and_ack_eula meta-qcom
147 echo "WARN: '$MACHINE' is not tested by AGL Distro"
151 echo "TEMPALTECONF=$TEMPLATECONF"
152 # set template conf for each <board/device>
153 if [ -z "$TEMPLATECONF" ]; then
154 # lookup meta-agl-demo first
155 if [ -d "$PWD/meta-agl-demo/templates/$MACHINE/conf" ]; then
156 TEMPLATECONF="$PWD/meta-agl-demo/templates/$MACHINE/conf"
157 # lookup meta-agl 2nd
158 elif [ -d "$PWD/meta-agl/templates/$MACHINE/conf" ]; then
159 TEMPLATECONF="$PWD/meta-agl/templates/$MACHINE/conf"
162 echo "TEMPLATECONF=$TEMPLATECONF"
164 echo "envsetup: Set '$1' as MACHINE."
168 if [ ! -d "$TEMPLATECONF" ]; then
169 # Allow to use templates at meta-agl-demo/conf
170 TEMPLATECONF="$PWD/meta-agl-demo/conf"
173 echo "envsetup: Using templates for local.conf & bblayers.conf from :"
174 echo " '$TEMPLATECONF'"
183 echo "envsetup: Setup build environment for poky/oe."
186 source poky/oe-init-build-env $BUILD_DIR
188 if [ -n "$DL_DIR" ]; then
189 BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE DL_DIR"
192 if [ -n "$SSTATE_DIR" ]; then
193 BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE SSTATE_DIR"
196 export BB_ENV_EXTRAWHITE
200 case "$EULA_ACCEPT" in
202 echo "" >> conf/local.conf
203 echo "# EULA" >> conf/local.conf
204 echo "ACCEPT_EULA_$MACHINE = \"1\"" >> conf/local.conf