diff options
Diffstat (limited to 'scripts/oe-setup-builddir')
-rw-r--r-- | scripts/oe-setup-builddir | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir new file mode 100644 index 0000000000..0e616a7805 --- /dev/null +++ b/scripts/oe-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 | |||
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 ! (test -d "$BUILDDIR"); then | ||
29 | echo >&2 "Error: The builddir ($BUILDDIR) does not exist!" | ||
30 | exit 1 | ||
31 | fi | ||
32 | |||
33 | if ! (test -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 | # | ||
41 | # $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf | ||
42 | # | ||
43 | if [ "x" != "x$TEMPLATECONF" ]; then | ||
44 | if ! (test -d "$TEMPLATECONF"); then | ||
45 | # Allow TEMPLATECONF=meta-xyz/conf as a shortcut | ||
46 | if [ -d "$OEROOT/$TEMPLATECONF" ]; then | ||
47 | TEMPLATECONF="$OEROOT/$POKYCONF" | ||
48 | fi | ||
49 | if ! (test -d "$TEMPLATECONF"); then | ||
50 | echo >&2 "Error: '$TEMPLATECONF' must be a directory containing local.conf & bblayers.conf" | ||
51 | return | ||
52 | fi | ||
53 | fi | ||
54 | OECORELAYERCONF="$TEMPLATECONF/bblayers.conf" | ||
55 | OECORELOCALCONF="$TEMPLATECONF/local.conf" | ||
56 | fi | ||
57 | |||
58 | if [ "x" = "x$OECORELOCALCONF" ]; then | ||
59 | OECORELOCALCONF="$OEROOT/meta/conf/local.conf.sample" | ||
60 | fi | ||
61 | if ! (test -r "$BUILDDIR/conf/local.conf"); then | ||
62 | cat <<EOM | ||
63 | You had no conf/local.conf file. Poky has created this configuration file for | ||
64 | you 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 | ||
66 | cores for example. See the file for more information as common configuration | ||
67 | options are commented. | ||
68 | |||
69 | Also, for more information see the Poky Reference Manual: | ||
70 | http://yoctoproject.org/community/documentation | ||
71 | |||
72 | EOM | ||
73 | cp -f $OECORELOCALCONF $BUILDDIR/conf/local.conf | ||
74 | fi | ||
75 | |||
76 | if [ "x" = "x$OECORELAYERCONF" ]; then | ||
77 | OECORELAYERCONF="$OEROOT/meta/conf/bblayers.conf.sample" | ||
78 | fi | ||
79 | if ! (test -r "$BUILDDIR/conf/bblayers.conf"); then | ||
80 | cat <<EOM | ||
81 | You had no conf/bblayers.conf file. Poky has created this configuration file for | ||
82 | you with some default values. To add additional metadata layers into your | ||
83 | configuration please add entries to this file. | ||
84 | |||
85 | For more information see the Poky Reference Manual: | ||
86 | http://yoctoproject.org/community/documentation | ||
87 | |||
88 | EOM | ||
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|##COREBASE##|$OEROOT|g" $OECORELAYERCONF > $BUILDDIR/conf/bblayers.conf | ||
93 | fi | ||
94 | |||
95 | # Prevent disturbing a new GIT clone in same console | ||
96 | unset OECORELOCALCONF | ||
97 | unset OECORELAYERCONF | ||
98 | |||
99 | cat <<EOM | ||
100 | |||
101 | ### Shell environment set up for Poky builds. ### | ||
102 | |||
103 | You can now run 'bitbake <target>' | ||
104 | |||
105 | Common targets are: | ||
106 | core-image-minimal | ||
107 | core-image-sato | ||
108 | meta-toolchain | ||
109 | meta-toolchain-sdk | ||
110 | |||
111 | You can also run generated qemu images with a command like 'runqemu qemux86' | ||
112 | |||
113 | EOM | ||