summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
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>2015-12-28 09:25:16 +0000
commit4487e3a4205188cf53930147c7e88d98f0d8a8e0 (patch)
treed3a093a23b23dd0ea93a3997c64f022cb13af3a2 /meta/classes/kernel-yocto.bbclass
parent51619440e24f4e10102f0910b88532a951d8210f (diff)
downloadpoky-4487e3a4205188cf53930147c7e88d98f0d8a8e0.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: ccfa2ee5c4f509de4c18a7054b2a66fc874d5d69) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
-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