summaryrefslogtreecommitdiffstats
path: root/scripts/poky-setup-builddir
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-setup-builddir
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-setup-builddir')
-rwxr-xr-xscripts/poky-setup-builddir113
1 files changed, 113 insertions, 0 deletions
diff --git a/scripts/poky-setup-builddir b/scripts/poky-setup-builddir
new file mode 100755
index 0000000000..7a1452f7ce
--- /dev/null
+++ b/scripts/poky-setup-builddir
@@ -0,0 +1,113 @@
1#!/bin/sh
2
3# Poky Build Enviroment Setup Script
4#
5# Copyright (C) 2006-2007 OpenedHand Ltd.
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
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
20
21if [ -z "$BUILDDIR" ]; then
22 echo >&2 "Error: The build directory (BUILDDIR) must be set!"
23 exit 1
24fi
25
26mkdir -p $BUILDDIR/conf
27
28if ! (test -d "$BUILDDIR"); then
29 echo >&2 "Error: The builddir ($BUILDDIR) does not exist!"
30 exit 1
31fi
32
33if ! (test -w "$BUILDDIR"); then
34 echo >&2 "Error: Cannot write to $BUILDDIR, perhaps try sourcing with a writable path? i.e. . poky-init-build-env ~/my-build"
35 exit 1
36fi
37
38cd "$BUILDDIR"
39
40#
41# $POKYCONF can point to a directory for the template local.conf & bblayers.conf
42#
43if [ "x" != "x$POKYCONF" ]; then
44 if ! (test -d "$POKYCONF"); then
45 # Allow POKYCONF=meta-xyz/conf as a shortcut
46 if [ -d "$OEROOT/$POKYCONF" ]; then
47 POKYCONF="$OEROOT/$POKYCONF"
48 fi
49 if ! (test -d "$POKYCONF"); then
50 echo >&2 "Error: '$POKYCONF' must be a directory containing local.conf & bblayers.conf"
51 return
52 fi
53 fi
54 POKYLAYERCONF="$POKYCONF/bblayers.conf"
55 POKYLOCALCONF="$POKYCONF/local.conf"
56fi
57
58if [ "x" = "x$POKYLOCALCONF" ]; then
59 POKYLOCALCONF="$OEROOT/meta/conf/local.conf.sample"
60fi
61if ! (test -r "$BUILDDIR/conf/local.conf"); then
62cat <<EOM
63You had no conf/local.conf file. Poky has created this configuration file for
64you with some default values. You may wish to edit it to use a different MACHINE
65(target hardware) or enable parallel build options to take advantage of multiple
66cores for example. See the file for more information as common configuration
67options are commented.
68
69Also, for more information see the Poky handbook:
70http://pokylinux.org/doc/poky-handbook.html
71
72EOM
73 cp -f $POKYLOCALCONF $BUILDDIR/conf/local.conf
74fi
75
76if [ "x" = "x$POKYLAYERCONF" ]; then
77 POKYLAYERCONF="$OEROOT/meta/conf/bblayers.conf.sample"
78fi
79if ! (test -r "$BUILDDIR/conf/bblayers.conf"); then
80cat <<EOM
81You had no conf/bblayers.conf file. Poky has created this configuration file for
82you with some default values. To add additional metadata layers into your
83configuration please add entries to this file.
84
85For more information see the Poky handbook:
86 http://pokylinux.org/doc/poky-handbook.html
87
88EOM
89
90 # Put the abosolute path to the layers in bblayers.conf so we can run
91 # bitbake without the init script after the first run
92 sed "s|##POKYBASE##|$OEROOT|g" $POKYLAYERCONF > $BUILDDIR/conf/bblayers.conf
93fi
94
95# Prevent disturbing a new GIT clone in same console
96unset POKYLOCALCONF
97unset POKYLAYERCONF
98
99cat <<EOM
100
101### Shell environment set up for Poky builds. ###
102
103You can now run 'bitbake <target>'
104
105Common targets are:
106 poky-image-minimal
107 poky-image-sato
108 meta-toolchain
109 meta-toolchain-sdk
110
111You can also run generated qemu images with a command like 'poky-qemu qemux86'
112
113EOM