summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJianxun Zhang <jianxun.zhang@linux.intel.com>2015-12-08 10:58:43 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-04 23:20:15 +0000
commitcc3a391bd96e04947bbdf2a093ec793ec78037f7 (patch)
tree7689dd664a008a244aa07484f2e158d6e3607107 /meta
parent049be17b533d7c592dae8e0f33ddbae54639a776 (diff)
downloadpoky-cc3a391bd96e04947bbdf2a093ec793ec78037f7.tar.gz
kernel-yocto: fix checkout bare-cloned kernel repositories
The existing code doesn't tell regular (with .git) and bare cases and just move the unpacked repo to the place of kernel source. But later steps will fail on a bare-cloned repo because we can not checkout directly in a bare cloned repo. This change performs another clone to fix the issue. Note: This change doesn't cover the case that S and WORKDIR are same and the repo is bare cloned. (From OE-Core rev: f3d0ae7b174f47170fef14a699aec22d02ea1745) Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> (cherry picked from commit ccfa2ee5c4f509de4c18a7054b2a66fc874d5d69) 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.bbclass13
1 files changed, 10 insertions, 3 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 00d9667fe0..c2d0d3076f 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -184,11 +184,18 @@ do_kernel_checkout() {
184 source_dir=`echo ${S} | sed 's%/$%%'` 184 source_dir=`echo ${S} | sed 's%/$%%'`
185 source_workdir="${WORKDIR}/git" 185 source_workdir="${WORKDIR}/git"
186 if [ -d "${WORKDIR}/git/" ]; then 186 if [ -d "${WORKDIR}/git/" ]; then
187 # case: git repository (bare or non-bare) 187 # case: git repository
188 # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree. 188 # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
189 if [ "${source_dir}" != "${source_workdir}" ]; then 189 if [ "${source_dir}" != "${source_workdir}" ]; then
190 rm -rf ${S} 190 if [ -d "${source_workdir}/.git" ]; then
191 mv ${WORKDIR}/git ${S} 191 # regular git repository with .git
192 rm -rf ${S}
193 mv ${WORKDIR}/git ${S}
194 else
195 # create source for bare cloned git repository
196 git clone ${WORKDIR}/git ${S}
197 rm -rf ${WORKDIR}/git
198 fi
192 fi 199 fi
193 cd ${S} 200 cd ${S}
194 else 201 else