diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 14:36:22 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 15:32:53 +0200 |
commit | f4cf9fe05bb3f32fabea4e54dd92d368967a80da (patch) | |
tree | 487180fa9866985ea7b28e625651765d86f515c3 /scripts/oe-setup-builddir | |
download | poky-f4cf9fe05bb3f32fabea4e54dd92d368967a80da.tar.gz |
initial commit for Enea Linux 4.0
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'scripts/oe-setup-builddir')
-rwxr-xr-x | scripts/oe-setup-builddir | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir new file mode 100755 index 0000000000..c91e079512 --- /dev/null +++ b/scripts/oe-setup-builddir | |||
@@ -0,0 +1,134 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # OE Build Environment Setup Script | ||
4 | # | ||
5 | # Copyright (C) 2006-2011 Linux Foundation | ||
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 | |||
21 | if [ -z "$BUILDDIR" ]; then | ||
22 | echo >&2 "Error: The build directory (BUILDDIR) must be set!" | ||
23 | exit 1 | ||
24 | fi | ||
25 | |||
26 | mkdir -p $BUILDDIR/conf | ||
27 | |||
28 | if [ ! -d "$BUILDDIR" ]; then | ||
29 | echo >&2 "Error: The builddir ($BUILDDIR) does not exist!" | ||
30 | exit 1 | ||
31 | fi | ||
32 | |||
33 | if [ ! -w "$BUILDDIR" ]; then | ||
34 | echo >&2 "Error: Cannot write to $BUILDDIR, perhaps try sourcing with a writable path? i.e. . oe-init-build-env ~/my-build" | ||
35 | exit 1 | ||
36 | fi | ||
37 | |||
38 | cd "$BUILDDIR" | ||
39 | |||
40 | if [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then | ||
41 | TEMPLATECONF=$(cat $BUILDDIR/conf/templateconf.cfg) | ||
42 | fi | ||
43 | |||
44 | . $OEROOT/.templateconf | ||
45 | |||
46 | if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then | ||
47 | echo "$TEMPLATECONF" >$BUILDDIR/conf/templateconf.cfg | ||
48 | fi | ||
49 | |||
50 | # | ||
51 | # $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf | ||
52 | # | ||
53 | if [ -n "$TEMPLATECONF" ]; then | ||
54 | if [ ! -d "$TEMPLATECONF" ]; then | ||
55 | # Allow TEMPLATECONF=meta-xyz/conf as a shortcut | ||
56 | if [ -d "$OEROOT/$TEMPLATECONF" ]; then | ||
57 | TEMPLATECONF="$OEROOT/$TEMPLATECONF" | ||
58 | fi | ||
59 | if [ ! -d "$TEMPLATECONF" ]; then | ||
60 | echo >&2 "Error: '$TEMPLATECONF' must be a directory containing local.conf & bblayers.conf" | ||
61 | exit 1 | ||
62 | fi | ||
63 | fi | ||
64 | OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample" | ||
65 | OECORELOCALCONF="$TEMPLATECONF/local.conf.sample" | ||
66 | OECORENOTESCONF="$TEMPLATECONF/conf-notes.txt" | ||
67 | fi | ||
68 | |||
69 | if [ -z "$OECORELOCALCONF" ]; then | ||
70 | OECORELOCALCONF="$OEROOT/meta/conf/local.conf.sample" | ||
71 | fi | ||
72 | if [ ! -r "$BUILDDIR/conf/local.conf" ]; then | ||
73 | cat <<EOM | ||
74 | You had no conf/local.conf file. This configuration file has therefore been | ||
75 | created for you with some default values. You may wish to edit it to use a | ||
76 | different MACHINE (target hardware) or enable parallel build options to take | ||
77 | advantage of multiple cores for example. See the file for more information as | ||
78 | common configuration options are commented. | ||
79 | |||
80 | The Yocto Project has extensive documentation about OE including a reference manual | ||
81 | which can be found at: | ||
82 | http://yoctoproject.org/documentation | ||
83 | |||
84 | For more information about OpenEmbedded see their website: | ||
85 | http://www.openembedded.org/ | ||
86 | |||
87 | EOM | ||
88 | cp -f $OECORELOCALCONF $BUILDDIR/conf/local.conf | ||
89 | fi | ||
90 | |||
91 | if [ -z "$OECORELAYERCONF" ]; then | ||
92 | OECORELAYERCONF="$OEROOT/meta/conf/bblayers.conf.sample" | ||
93 | fi | ||
94 | if [ ! -r "$BUILDDIR/conf/bblayers.conf" ]; then | ||
95 | cat <<EOM | ||
96 | You had no conf/bblayers.conf file. The configuration file has been created for | ||
97 | you with some default values. To add additional metadata layers into your | ||
98 | configuration please add entries to this file. | ||
99 | |||
100 | The Yocto Project has extensive documentation about OE including a reference manual | ||
101 | which can be found at: | ||
102 | http://yoctoproject.org/documentation | ||
103 | |||
104 | For more information about OpenEmbedded see their website: | ||
105 | http://www.openembedded.org/ | ||
106 | |||
107 | |||
108 | EOM | ||
109 | |||
110 | # Put the abosolute path to the layers in bblayers.conf so we can run | ||
111 | # bitbake without the init script after the first run | ||
112 | # ##COREBASE## is deprecated as it's meaning was inconsistent, but continue | ||
113 | # to replace it for compatibility. | ||
114 | sed -e "s|##OEROOT##|$OEROOT|g" \ | ||
115 | -e "s|##COREBASE##|$OEROOT|g" \ | ||
116 | $OECORELAYERCONF > $BUILDDIR/conf/bblayers.conf | ||
117 | fi | ||
118 | |||
119 | # Prevent disturbing a new GIT clone in same console | ||
120 | unset OECORELOCALCONF | ||
121 | unset OECORELAYERCONF | ||
122 | |||
123 | cat <<EOM | ||
124 | |||
125 | ### Shell environment set up for builds. ### | ||
126 | |||
127 | You can now run 'bitbake <target>' | ||
128 | |||
129 | EOM | ||
130 | if [ -z "$OECORENOTESCONF" ]; then | ||
131 | OECORENOTESCONF="$OEROOT/meta/conf/conf-notes.txt" | ||
132 | fi | ||
133 | [ ! -r "$OECORENOTESCONF" ] || cat $OECORENOTESCONF | ||
134 | unset OECORENOTESCONF | ||