diff options
-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 . |