diff options
Diffstat (limited to 'meta/classes-recipe/kernel-yocto.bbclass')
-rw-r--r-- | meta/classes-recipe/kernel-yocto.bbclass | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass index 9a86616dad..6d5c3b6327 100644 --- a/meta/classes-recipe/kernel-yocto.bbclass +++ b/meta/classes-recipe/kernel-yocto.bbclass | |||
@@ -63,7 +63,7 @@ def find_sccs(d): | |||
63 | return sources_list | 63 | return sources_list |
64 | 64 | ||
65 | # check the SRC_URI for "kmeta" type'd git repositories. Return the name of | 65 | # check the SRC_URI for "kmeta" type'd git repositories. Return the name of |
66 | # the repository as it will be found in WORKDIR | 66 | # the repository as it will be found in UNPACKDIR |
67 | def find_kernel_feature_dirs(d): | 67 | def find_kernel_feature_dirs(d): |
68 | feature_dirs=[] | 68 | feature_dirs=[] |
69 | fetch = bb.fetch2.Fetch([], d) | 69 | fetch = bb.fetch2.Fetch([], d) |
@@ -147,24 +147,24 @@ do_kernel_metadata() { | |||
147 | # from the source tree, into a common location and normalized "defconfig" name, | 147 | # from the source tree, into a common location and normalized "defconfig" name, |
148 | # where the rest of the process will include and incoroporate it into the build | 148 | # where the rest of the process will include and incoroporate it into the build |
149 | # | 149 | # |
150 | # If the fetcher has already placed a defconfig in WORKDIR (from the SRC_URI), | 150 | # If the fetcher has already placed a defconfig in UNPACKDIR (from the SRC_URI), |
151 | # we don't overwrite it, but instead warn the user that SRC_URI defconfigs take | 151 | # we don't overwrite it, but instead warn the user that SRC_URI defconfigs take |
152 | # precendence. | 152 | # precendence. |
153 | # | 153 | # |
154 | if [ -n "${KBUILD_DEFCONFIG}" ]; then | 154 | if [ -n "${KBUILD_DEFCONFIG}" ]; then |
155 | if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then | 155 | if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then |
156 | if [ -f "${WORKDIR}/defconfig" ]; then | 156 | if [ -f "${UNPACKDIR}/defconfig" ]; then |
157 | # If the two defconfig's are different, warn that we overwrote the | 157 | # If the two defconfig's are different, warn that we overwrote the |
158 | # one already placed in WORKDIR | 158 | # one already placed in UNPACKDIR |
159 | cmp "${WORKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" | 159 | cmp "${UNPACKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" |
160 | if [ $? -ne 0 ]; then | 160 | if [ $? -ne 0 ]; then |
161 | bbdebug 1 "detected SRC_URI or unpatched defconfig in WORKDIR. ${KBUILD_DEFCONFIG} copied over it" | 161 | bbdebug 1 "detected SRC_URI or patched defconfig in UNPACKDIR. ${KBUILD_DEFCONFIG} copied over it" |
162 | fi | 162 | fi |
163 | cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig | 163 | cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig |
164 | else | 164 | else |
165 | cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig | 165 | cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig |
166 | fi | 166 | fi |
167 | in_tree_defconfig="${WORKDIR}/defconfig" | 167 | in_tree_defconfig="${UNPACKDIR}/defconfig" |
168 | else | 168 | else |
169 | bbfatal "A KBUILD_DEFCONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree (${S}/arch/${ARCH}/configs/)" | 169 | bbfatal "A KBUILD_DEFCONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree (${S}/arch/${ARCH}/configs/)" |
170 | fi | 170 | fi |
@@ -178,7 +178,7 @@ do_kernel_metadata() { | |||
178 | patches="${@" ".join(find_patches(d,'kernel-meta'))}" | 178 | patches="${@" ".join(find_patches(d,'kernel-meta'))}" |
179 | if [ -n "$patches" ]; then | 179 | if [ -n "$patches" ]; then |
180 | ( | 180 | ( |
181 | cd ${WORKDIR}/kernel-meta | 181 | cd ${UNPACKDIR}/kernel-meta |
182 | 182 | ||
183 | # take the SRC_URI patches, and create a series file | 183 | # take the SRC_URI patches, and create a series file |
184 | # this is required to support some better processing | 184 | # this is required to support some better processing |
@@ -193,11 +193,11 @@ do_kernel_metadata() { | |||
193 | # handling the rest of the kernel. This allows us | 193 | # handling the rest of the kernel. This allows us |
194 | # more flexibility for handling failures or advanced | 194 | # more flexibility for handling failures or advanced |
195 | # mergeing functinoality | 195 | # mergeing functinoality |
196 | message=$(kgit-s2q --gen -v --patches ${WORKDIR}/kernel-meta 2>&1) | 196 | message=$(kgit-s2q --gen -v --patches ${UNPACKDIR}/kernel-meta 2>&1) |
197 | if [ $? -ne 0 ]; then | 197 | if [ $? -ne 0 ]; then |
198 | # setup to try the patch again | 198 | # setup to try the patch again |
199 | kgit-s2q --prev | 199 | kgit-s2q --prev |
200 | bberror "Problem applying patches to: ${WORKDIR}/kernel-meta" | 200 | bberror "Problem applying patches to: ${UNPACKDIR}/kernel-meta" |
201 | bbfatal_log "\n($message)" | 201 | bbfatal_log "\n($message)" |
202 | fi | 202 | fi |
203 | ) | 203 | ) |
@@ -232,12 +232,10 @@ do_kernel_metadata() { | |||
232 | # SRC_URI. If they were supplied, we convert them into include directives | 232 | # SRC_URI. If they were supplied, we convert them into include directives |
233 | # for the update part of the process | 233 | # for the update part of the process |
234 | for f in ${feat_dirs}; do | 234 | for f in ${feat_dirs}; do |
235 | if [ -d "${WORKDIR}/$f/kernel-meta" ]; then | 235 | if [ -d "${UNPACKDIR}/$f/kernel-meta" ]; then |
236 | includes="$includes -I${WORKDIR}/$f/kernel-meta" | 236 | includes="$includes -I${UNPACKDIR}/$f/kernel-meta" |
237 | elif [ -d "${WORKDIR}/../oe-local-files/$f" ]; then | 237 | elif [ -d "${UNPACKDIR}/$f" ]; then |
238 | includes="$includes -I${WORKDIR}/../oe-local-files/$f" | 238 | includes="$includes -I${UNPACKDIR}/$f" |
239 | elif [ -d "${WORKDIR}/$f" ]; then | ||
240 | includes="$includes -I${WORKDIR}/$f" | ||
241 | fi | 239 | fi |
242 | done | 240 | done |
243 | for s in ${sccs} ${patches}; do | 241 | for s in ${sccs} ${patches}; do |
@@ -379,19 +377,19 @@ do_kernel_checkout() { | |||
379 | set +e | 377 | set +e |
380 | 378 | ||
381 | source_dir=`echo ${S} | sed 's%/$%%'` | 379 | source_dir=`echo ${S} | sed 's%/$%%'` |
382 | source_workdir="${WORKDIR}/git" | 380 | source_workdir="${UNPACKDIR}/git" |
383 | if [ -d "${WORKDIR}/git/" ]; then | 381 | if [ -d "${UNPACKDIR}/git/" ]; then |
384 | # case: git repository | 382 | # case: git repository |
385 | # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree. | 383 | # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree. |
386 | if [ "${source_dir}" != "${source_workdir}" ]; then | 384 | if [ "${source_dir}" != "${source_workdir}" ]; then |
387 | if [ -d "${source_workdir}/.git" ]; then | 385 | if [ -d "${source_workdir}/.git" ]; then |
388 | # regular git repository with .git | 386 | # regular git repository with .git |
389 | rm -rf ${S} | 387 | rm -rf ${S} |
390 | mv ${WORKDIR}/git ${S} | 388 | mv ${UNPACKDIR}/git ${S} |
391 | else | 389 | else |
392 | # create source for bare cloned git repository | 390 | # create source for bare cloned git repository |
393 | git clone ${WORKDIR}/git ${S} | 391 | git clone ${WORKDIR}/git ${S} |
394 | rm -rf ${WORKDIR}/git | 392 | rm -rf ${UNPACKDIR}/git |
395 | fi | 393 | fi |
396 | fi | 394 | fi |
397 | cd ${S} | 395 | cd ${S} |
@@ -434,7 +432,7 @@ do_kernel_checkout() { | |||
434 | 432 | ||
435 | set -e | 433 | set -e |
436 | } | 434 | } |
437 | do_kernel_checkout[dirs] = "${S} ${WORKDIR}" | 435 | do_kernel_checkout[dirs] = "${S} ${UNPACKDIR}" |
438 | 436 | ||
439 | addtask kernel_checkout before do_kernel_metadata after do_symlink_kernsrc | 437 | addtask kernel_checkout before do_kernel_metadata after do_symlink_kernsrc |
440 | addtask kernel_metadata after do_validate_branches do_unpack before do_patch | 438 | addtask kernel_metadata after do_validate_branches do_unpack before do_patch |
@@ -442,6 +440,11 @@ do_kernel_metadata[depends] = "kern-tools-native:do_populate_sysroot" | |||
442 | do_kernel_metadata[file-checksums] = " ${@get_dirs_with_fragments(d)}" | 440 | do_kernel_metadata[file-checksums] = " ${@get_dirs_with_fragments(d)}" |
443 | do_validate_branches[depends] = "kern-tools-native:do_populate_sysroot" | 441 | do_validate_branches[depends] = "kern-tools-native:do_populate_sysroot" |
444 | 442 | ||
443 | # ${S} doesn't exist for us at unpack | ||
444 | do_qa_unpack() { | ||
445 | return | ||
446 | } | ||
447 | |||
445 | do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}binutils:do_populate_sysroot" | 448 | do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}binutils:do_populate_sysroot" |
446 | do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}gcc:do_populate_sysroot" | 449 | do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}gcc:do_populate_sysroot" |
447 | do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot" | 450 | do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot" |
@@ -460,7 +463,7 @@ do_kernel_configme() { | |||
460 | config_flags="" | 463 | config_flags="" |
461 | ;; | 464 | ;; |
462 | *) | 465 | *) |
463 | if [ -f ${WORKDIR}/defconfig ]; then | 466 | if [ -f ${UNPACKDIR}/defconfig ]; then |
464 | config_flags="-n" | 467 | config_flags="-n" |
465 | fi | 468 | fi |
466 | ;; | 469 | ;; |