2 # Handle EULA , if needed. This is a generic method to handle BSPs
3 # that might (or not) come with a EULA. If a machine has a EULA, we
4 # assume that its corresponding layers has conf/EULA/$MACHINE file
5 # with the EULA text, which we will display to the user and request
6 # for acceptance. If accepted, the variable ACCEPT_EULA_$MACHINE is
7 # set to 1 in local.conf, which can later be used by the BSP.
8 # If the env variable EULA_$MACHINE is set it is used by default,
9 # without prompting the user.
10 # FIXME: there is a potential issue if the same $MACHINE is set in more than one layer.. but we should assert that earlier
11 # $1 is layer directory
12 # $2 is location of EULA file relative to layer directory
13 if test x"" == x"$2"; then
14 EULA=$(find $1 -print | grep "conf/eula/$MACHINE" | grep -v scripts | grep -v openembedded-core || true)
18 if [ -n "$EULA" ]; then
19 # remove '-' since we are constructing a bash variable name here
20 EULA_MACHINE="EULA_$(echo $MACHINE | sed 's/-//g')"
21 # NOTE: indirect reference / dynamic variable
22 if [ -n "${!EULA_MACHINE}" ]; then
23 # the EULA_$MACHINE variable is set in the environment, so we just configure
24 # ACCEPT_EULA_$MACHINE in local.conf
25 EULA_ACCEPT=${!EULA_MACHINE}
27 # so we need to ask user if he/she accepts the EULA:
29 The BSP for $MACHINE depends on packages and firmware which are covered by an
30 End User License Agreement (EULA). To have the right to use these binaries
31 in your images, you need to read and accept the following...
33 The firmware package can contains several types of firmware (depending on BSP):
35 * bootloaders: the first stage bootloaders are proprietary for this
36 board, they are included in this firmware package.
37 * firmware for the power management 'companion' core: on QCOM SoC some
38 power management features are implemented in a companion core , called
39 RPM, and not on the main CPU.
40 * firmware for GPU, WLAN, DSP/GPS and video codecs. These firmware are
41 used by their respective linux drivers (DRM, wlan, v4l2, .. ) and are
42 loaded on-demand by the main CPU onto the various cores on the SoC.
47 while [ -z "$REPLY" ]; do
48 echo -n "Do you want to read the EULA ? (y/n) "
63 if [ "$READ_EULA" == 1 ]; then
67 while [ -z "$REPLY" ]; do
68 echo -n "Do you accept the EULA you just read? (y/n) "
72 echo "EULA has been accepted."
76 echo "EULA has not been accepted."