summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2013-01-24 00:30:31 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-04 13:18:28 +0000
commitaa653b9354e4a414f7a00aa69ec957c47cbb0dcc (patch)
tree64bec2fedb7d9a638b8a52ac6c369bd9e65f05f2 /meta/classes/kernel-yocto.bbclass
parentde2211133f157c3ca8086f318c842e985185f624 (diff)
downloadpoky-aa653b9354e4a414f7a00aa69ec957c47cbb0dcc.tar.gz
kernel-yocto/linux-yocto-custom: support low bandwidth options
To support configurations where active development is not being done within the oe/bitbake build environment and restricted bandwidth situations, this commit allows the SRC_URI to point to a kernel tgz instead of a full git repository. Outside of the upstream tgz instead of a kernel git repository, the restrictions, config and patch process is the same as any linux-yocto-custom recipe. An example linux-yocto-custom based recipe would have a configuration like this to build the 3.7 kernel, using an externally supplied config, from the 3.7 tgz: SRC_URI = "http://kernel.org/pub/linux/kernel/v3.0/linux-3.7.tar.bz2" PV = "3.7" S = "${WORKDIR}/linux-3.7" SRC_URI[md5sum] = "5323f3faadd051e83af605a63be5ea2e" SRC_URI[sha256sum] = "dc08d87a579fe2918362e6666e503a95a76296419195cb499aa9dd4dbe171a9e" [YOCTO #2686] (From OE-Core rev: 08b3a282ce75a9972694f0c4379179505b9ec91f) 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/classes/kernel-yocto.bbclass')
-rw-r--r--meta/classes/kernel-yocto.bbclass34
1 files changed, 21 insertions, 13 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 92ede6a3aa..8494c16787 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -158,22 +158,10 @@ do_kernel_checkout() {
158 mkdir -p ${S} 158 mkdir -p ${S}
159 159
160 # We can fix up the kernel repository even if it wasn't a bare clone. 160 # We can fix up the kernel repository even if it wasn't a bare clone.
161 # If KMETA is defined, the branch must exist, but a machine branch
162 # can be missing since it may be created later by the tools.
163 mv ${WORKDIR}/git/.git ${S} 161 mv ${WORKDIR}/git/.git ${S}
164 rm -rf ${WORKDIR}/git/ 162 rm -rf ${WORKDIR}/git/
165 cd ${S} 163 cd ${S}
166 if [ -n "${KMETA}" ]; then 164 elif [ -d "${WORKDIR}/git/" ] && [ ! -d "${WORKDIR}/git/.git" ]; then
167 git branch -a | grep -q ${KMETA}
168 if [ $? -ne 0 ]; then
169 echo "ERROR. The branch '${KMETA}' is required and was not"
170 echo "found. Ensure that the SRC_URI points to a valid linux-yocto"
171 echo "kernel repository"
172 exit 1
173 fi
174 fi
175 fi
176 if [ -d "${WORKDIR}/git/" ] && [ ! -d "${WORKDIR}/git/.git" ]; then
177 # we build out of {S}, so ensure that ${S} is clean and present 165 # we build out of {S}, so ensure that ${S} is clean and present
178 rm -rf ${S} 166 rm -rf ${S}
179 mkdir -p ${S}/.git 167 mkdir -p ${S}/.git
@@ -182,9 +170,29 @@ do_kernel_checkout() {
182 rm -rf ${WORKDIR}/git/ 170 rm -rf ${WORKDIR}/git/
183 cd ${S} 171 cd ${S}
184 git config core.bare false 172 git config core.bare false
173 else
174 # We have no git repository at all. To support low bandwidth options
175 # for building the kernel, we'll just convert the tree to a git repo
176 # and let the rest of the process work unchanged
177 cd ${S}
178 git init
179 git add .
180 git commit -q -m "baseline commit: creating repo for ${PN}-${PV}"
185 fi 181 fi
186 # end debare 182 # end debare
187 183
184 # If KMETA is defined, the branch must exist, but a machine branch
185 # can be missing since it may be created later by the tools.
186 if [ -n "${KMETA}" ]; then
187 git branch -a | grep -q ${KMETA}
188 if [ $? -ne 0 ]; then
189 echo "ERROR. The branch '${KMETA}' is required and was not"
190 echo "found. Ensure that the SRC_URI points to a valid linux-yocto"
191 echo "kernel repository"
192 exit 1
193 fi
194 fi
195
188 # convert any remote branches to local tracking ones 196 # convert any remote branches to local tracking ones
189 for i in `git branch -a | grep remotes | grep -v HEAD`; do 197 for i in `git branch -a | grep remotes | grep -v HEAD`; do
190 b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`; 198 b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;