summaryrefslogtreecommitdiffstats
path: root/scripts/poky-env-internal
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-11-24 16:25:28 -0600
committerRichard Purdie <rpurdie@linux.intel.com>2010-12-20 23:00:25 +0000
commit86b6b093374c37aeca87cdc36fc56440919d9458 (patch)
tree5380badad53264eaa2d4ff07f178bf92c3679cb9 /scripts/poky-env-internal
parent9975c00c1a6a9ae1c39678dec0986f4c62418c96 (diff)
downloadpoky-86b6b093374c37aeca87cdc36fc56440919d9458.tar.gz
poky-init-build-env: Breakup the environment script
Break up the scripts/poky-env-internal into two parts: 1) Chunk that is sourced and sets up the environment 2) Chunk that is executed and configures the build directory OEROOT configuration was moved into the initial poky-init-build-env script. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'scripts/poky-env-internal')
-rwxr-xr-xscripts/poky-env-internal102
1 files changed, 9 insertions, 93 deletions
diff --git a/scripts/poky-env-internal b/scripts/poky-env-internal
index 1557f9ddbd..2ec07ed061 100755
--- a/scripts/poky-env-internal
+++ b/scripts/poky-env-internal
@@ -18,9 +18,11 @@
18# along with this program; if not, write to the Free Software 18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 20
21# scripts/ is a sub-directory of OEROOT, we use readlink to get the full path 21# It is assumed OEROOT is already defined when this is called
22SCRIPTPATH=`readlink -f "$BASH_SOURCE"` 22if [ -z "$OEROOT" ]; then
23OEROOT="`dirname $SCRIPTPATH`/../" 23 echo >&2 "Error: OEROOT is not defined!"
24 return
25fi
24 26
25if [ "x$BDIR" = "x" ]; then 27if [ "x$BDIR" = "x" ]; then
26 if [ "x$1" = "x" ]; then 28 if [ "x$1" = "x" ]; then
@@ -36,109 +38,23 @@ else
36fi 38fi
37unset BDIR 39unset BDIR
38 40
39mkdir -p $BUILDDIR/conf
40if ! (test -w "$BUILDDIR"); then
41 echo >&2 "Error: Cannot write to $BUILDDIR, perhaps try sourcing with a writable path? i.e. . poky-init-build-env ~/my-build"
42 return
43fi
44
45BITBAKEDIR="$OEROOT/bitbake$BBEXTRA/" 41BITBAKEDIR="$OEROOT/bitbake$BBEXTRA/"
46 42
47PATH="${OEROOT}/scripts:$BITBAKEDIR/bin/:$PATH"
48
49# Remove any symlinks from paths
50BITBAKEDIR=`readlink -f "$BITBAKEDIR"` 43BITBAKEDIR=`readlink -f "$BITBAKEDIR"`
51BUILDDIR=`readlink -f "$BUILDDIR"` 44BUILDDIR=`readlink -f "$BUILDDIR"`
52OEROOT=`readlink -f "$OEROOT"`
53
54cd "$BUILDDIR"
55 45
56if ! (test -d "$BITBAKEDIR" && test -d "$BUILDDIR"); then 46if ! (test -d "$BITBAKEDIR"); then
57 echo >&2 "Error: Not all directories exist! Did you run this script in poky directory?" 47 echo >&2 "Error: The bitbake directory ($BITBAKEDIR) does not exist! Did you source the script in the poky directory?"
58 return 48 return
59fi 49fi
60 50
61# 51PATH="${OEROOT}/scripts:$BITBAKEDIR/bin/:$PATH"
62# $POKYCONF can point to a directory for the template local.conf & bblayers.conf
63#
64if [ "x" != "x$POKYCONF" ]; then
65 if ! (test -d "$POKYCONF"); then
66 # Allow POKYCONF=meta-xyz/conf as a shortcut
67 if [ -d "$OEROOT/$POKYCONF" ]; then
68 POKYCONF="$OEROOT/$POKYCONF"
69 fi
70 if ! (test -d "$POKYCONF"); then
71 echo >&2 "Error: '$POKYCONF' must be a directory containing local.conf & bblayers.conf"
72 return
73 fi
74 fi
75 POKYLAYERCONF="$POKYCONF/bblayers.conf"
76 POKYLOCALCONF="$POKYCONF/local.conf"
77fi
78
79if [ "x" = "x$POKYLOCALCONF" ]; then
80 POKYLOCALCONF="$OEROOT/meta/conf/local.conf.sample"
81fi
82if ! (test -r "$BUILDDIR/conf/local.conf"); then
83cat <<EOM
84You had no conf/local.conf file. Poky has created this configuration file for
85you with some default values. You may wish to edit it to use a different MACHINE
86(target hardware) or enable parallel build options to take advantage of multiple
87cores for example. See the file for more information as common configuration
88options are commented.
89
90Also, for more information see the Poky handbook:
91http://pokylinux.org/doc/poky-handbook.html
92
93EOM
94 cp -f $POKYLOCALCONF $BUILDDIR/conf/local.conf
95fi
96
97if [ "x" = "x$POKYLAYERCONF" ]; then
98 POKYLAYERCONF="$OEROOT/meta/conf/bblayers.conf.sample"
99fi
100if ! (test -r "$BUILDDIR/conf/bblayers.conf"); then
101cat <<EOM
102You had no conf/bblayers.conf file. Poky has created this configuration file for
103you with some default values. To add additional metadata layers into your
104configuration please add entries to this file.
105
106For more information see the Poky handbook:
107 http://pokylinux.org/doc/poky-handbook.html
108
109EOM
110
111 # Put the abosolute path to the layers in bblayers.conf so we can run
112 # bitbake without the init script after the first run
113 sed "s|##POKYBASE##|$OEROOT|g" $POKYLAYERCONF > $BUILDDIR/conf/bblayers.conf
114fi
115
116# Prevent disturbing a new GIT clone in same console
117unset POKYLOCALCONF
118unset POKYLAYERCONF
119unset BITBAKEDIR 52unset BITBAKEDIR
120unset OEROOT
121 53
122# Used by the poky-qemu script 54# Used by the poky-qemu script
123export BUILDDIR 55export BUILDDIR
124export PATH 56export PATH
57
125# Stop multi byte characters breaking the patcher stuff - This is for Redhat / Fedora people really 58# Stop multi byte characters breaking the patcher stuff - This is for Redhat / Fedora people really
126export LANG=C 59export LANG=C
127export BB_ENV_EXTRAWHITE="MACHINE DISTRO POKYMODE POKYLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS GIT_PROXY_COMMAND PSEUDO_DISABLED" 60export BB_ENV_EXTRAWHITE="MACHINE DISTRO POKYMODE POKYLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS GIT_PROXY_COMMAND PSEUDO_DISABLED"
128
129cat <<EOM
130
131### Shell environment set up for Poky builds. ###
132
133You can now run 'bitbake <target>'
134
135Common targets are:
136 poky-image-minimal
137 poky-image-sato
138 meta-toolchain
139 meta-toolchain-sdk
140
141You can also run generated qemu images with a command like 'poky-qemu qemux86'
142
143EOM
144