summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/kernel-yocto.bbclass33
1 files changed, 20 insertions, 13 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 5f3cb63fb4..187e3cc07c 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -139,17 +139,17 @@ do_patch() {
139} 139}
140 140
141do_kernel_checkout() { 141do_kernel_checkout() {
142 # we build out of {S}, so ensure that ${S} is clean and present
143 rm -rf ${S}
144 mkdir -p ${S}/.git
145
146 set +e 142 set +e
147 143
148 # A linux yocto SRC_URI should use the bareclone option. That 144 # A linux yocto SRC_URI should use the bareclone option. That
149 # ensures that all the branches are available in the WORKDIR version 145 # ensures that all the branches are available in the WORKDIR version
150 # of the repository. If it wasn't passed, we should detect it, and put 146 # of the repository. If it wasn't passed, we should detect it, and put
151 # out a useful error message 147 # out a useful error message
152 if [ -d "${WORKDIR}/git/.git" ]; then 148 if [ -d "${WORKDIR}/git/" ] && [ -d "${WORKDIR}/git/.git" ]; then
149 # we build out of {S}, so ensure that ${S} is clean and present
150 rm -rf ${S}
151 mkdir -p ${S}/.git
152
153 echo "WARNING. ${WORKDIR}/git is not a bare clone." 153 echo "WARNING. ${WORKDIR}/git is not a bare clone."
154 echo "Ensure that the SRC_URI includes the 'bareclone=1' option." 154 echo "Ensure that the SRC_URI includes the 'bareclone=1' option."
155 155
@@ -158,12 +158,14 @@ do_kernel_checkout() {
158 mv ${WORKDIR}/git/.git ${S} 158 mv ${WORKDIR}/git/.git ${S}
159 rm -rf ${WORKDIR}/git/ 159 rm -rf ${WORKDIR}/git/
160 cd ${S} 160 cd ${S}
161 git branch -a | grep -q ${KMETA} 161 if [ -n "${YOCTO_KERNEL_META_DATA}" ] && [ -n "${KMETA}" ]; then
162 if [ $? -ne 0 ]; then 162 git branch -a | grep -q ${KMETA}
163 echo "ERROR. The branch '${KMETA}' is required and was not" 163 if [ $? -ne 0 ]; then
164 echo "found. Ensure that the SRC_URI points to a valid linux-yocto" 164 echo "ERROR. The branch '${KMETA}' is required and was not"
165 echo "kernel repository" 165 echo "found. Ensure that the SRC_URI points to a valid linux-yocto"
166 exit 1 166 echo "kernel repository"
167 exit 1
168 fi
167 fi 169 fi
168 if [ -z "${YOCTO_KERNEL_EXTERNAL_BRANCH}" ] && [ -n "${KBRANCH}" ] ; then 170 if [ -z "${YOCTO_KERNEL_EXTERNAL_BRANCH}" ] && [ -n "${KBRANCH}" ] ; then
169 git branch -a | grep -q ${KBRANCH} 171 git branch -a | grep -q ${KBRANCH}
@@ -174,10 +176,15 @@ do_kernel_checkout() {
174 exit 1 176 exit 1
175 fi 177 fi
176 fi 178 fi
177 else 179 fi
180 if [ -d "${WORKDIR}/git/" ] && [ ! -d "${WORKDIR}/git/.git" ]; then
181 # we build out of {S}, so ensure that ${S} is clean and present
182 rm -rf ${S}
183 mkdir -p ${S}/.git
184
178 mv ${WORKDIR}/git/* ${S}/.git 185 mv ${WORKDIR}/git/* ${S}/.git
179 rm -rf ${WORKDIR}/git/ 186 rm -rf ${WORKDIR}/git/
180 cd ${S} 187 cd ${S}
181 git config core.bare false 188 git config core.bare false
182 fi 189 fi
183 # end debare 190 # end debare