diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-02-06 00:17:46 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-01 13:03:28 +0000 |
commit | d9149a0ce0e21e9d22905d1ae29196bd938cfef2 (patch) | |
tree | 7151d551ed2b57e6bbd36836e82fbbca1d0f2f1d /meta | |
parent | 61001aa702441c17cab444c281953b2945c34216 (diff) | |
download | poky-d9149a0ce0e21e9d22905d1ae29196bd938cfef2.tar.gz |
kernel-yocto: allow building from fetcher source dir
The linux-yocto recipes themselves always set S="${WORKDIR}/linux" and
arrange for the fetcher default of ${WORKDIR}/git to be renamed before
building.
Part of this rename involves an assumption that the directory used by
the fetcher can be removed as part of the renaming process, or in fact
that renaming is required.
If a derived recipe uses S="${WORKDIR}/git", the checkout phase fails
since the kernel source is removed as part of the processing.
To fix this the code now detects this situation and does not clean the
source directory before renaming the fetcher default (and in fact does
not rename it at all).
(From OE-Core rev: e4ab5efea1a41297f63c96de97270136535b5f0b)
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/kernel-yocto.bbclass | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index 368f91e43e..7b8e6075f2 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass | |||
@@ -148,29 +148,34 @@ do_kernel_checkout() { | |||
148 | 148 | ||
149 | # A linux yocto SRC_URI should use the bareclone option. That | 149 | # A linux yocto SRC_URI should use the bareclone option. That |
150 | # ensures that all the branches are available in the WORKDIR version | 150 | # ensures that all the branches are available in the WORKDIR version |
151 | # of the repository. | 151 | # of the repository. |
152 | source_dir=`echo ${S} | sed 's%/$%%'` | ||
153 | source_workdir="${WORKDIR}/git" | ||
152 | if [ -d "${WORKDIR}/git/" ] && [ -d "${WORKDIR}/git/.git" ]; then | 154 | if [ -d "${WORKDIR}/git/" ] && [ -d "${WORKDIR}/git/.git" ]; then |
153 | # we build out of {S}, so ensure that ${S} is clean and present | 155 | # case2: the repository is a non-bare clone |
154 | rm -rf ${S} | 156 | |
155 | mkdir -p ${S} | 157 | # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree. |
156 | 158 | if [ "${source_dir}" != "${source_workdir}" ]; then | |
157 | # We can fix up the kernel repository even if it wasn't a bare clone. | 159 | rm -rf ${S} |
158 | mv ${WORKDIR}/git/.git ${S} | 160 | mv ${WORKDIR}/git ${S} |
159 | rm -rf ${WORKDIR}/git/ | 161 | fi |
160 | cd ${S} | 162 | cd ${S} |
161 | elif [ -d "${WORKDIR}/git/" ] && [ ! -d "${WORKDIR}/git/.git" ]; then | 163 | elif [ -d "${WORKDIR}/git/" ] && [ ! -d "${WORKDIR}/git/.git" ]; then |
162 | # we build out of {S}, so ensure that ${S} is clean and present | 164 | # case2: the repository is a bare clone |
163 | rm -rf ${S} | 165 | |
164 | mkdir -p ${S}/.git | 166 | # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree. |
165 | 167 | if [ "${source_dir}" != "${source_workdir}" ]; then | |
166 | mv ${WORKDIR}/git/* ${S}/.git | 168 | rm -rf ${S} |
167 | rm -rf ${WORKDIR}/git/ | 169 | mkdir -p ${S}/.git |
170 | mv ${WORKDIR}/git/* ${S}/.git | ||
171 | rm -rf ${WORKDIR}/git/ | ||
172 | fi | ||
168 | cd ${S} | 173 | cd ${S} |
169 | git config core.bare false | 174 | git config core.bare false |
170 | else | 175 | else |
171 | # We have no git repository at all. To support low bandwidth options | 176 | # case 3: we have no git repository at all. |
172 | # for building the kernel, we'll just convert the tree to a git repo | 177 | # To support low bandwidth options for building the kernel, we'll just |
173 | # and let the rest of the process work unchanged | 178 | # convert the tree to a git repo and let the rest of the process work unchanged |
174 | cd ${S} | 179 | cd ${S} |
175 | git init | 180 | git init |
176 | git add . | 181 | git add . |