diff options
Diffstat (limited to 'meta/classes/kernel.bbclass')
| -rw-r--r-- | meta/classes/kernel.bbclass | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index b2f8132abf..59de148cc8 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
| @@ -40,8 +40,8 @@ HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}" | |||
| 40 | TARGET_LD_KERNEL_ARCH ?= "" | 40 | TARGET_LD_KERNEL_ARCH ?= "" |
| 41 | HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" | 41 | HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" |
| 42 | 42 | ||
| 43 | KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}" | 43 | KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}" |
| 44 | KERNEL_LD = "${LD}${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}" | 44 | KERNEL_LD = "${LD}${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}" |
| 45 | 45 | ||
| 46 | # Where built kernel lies in the kernel tree | 46 | # Where built kernel lies in the kernel tree |
| 47 | KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}" | 47 | KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}" |
| @@ -173,7 +173,7 @@ kernel_do_install() { | |||
| 173 | scripts/ihex2fw scripts/kallsyms scripts/pnmtologo scripts/basic/docproc \ | 173 | scripts/ihex2fw scripts/kallsyms scripts/pnmtologo scripts/basic/docproc \ |
| 174 | scripts/basic/fixdep scripts/basic/hash scripts/dtc/dtc \ | 174 | scripts/basic/fixdep scripts/basic/hash scripts/dtc/dtc \ |
| 175 | scripts/genksyms/genksyms scripts/kconfig/conf scripts/mod/mk_elfconfig \ | 175 | scripts/genksyms/genksyms scripts/kconfig/conf scripts/mod/mk_elfconfig \ |
| 176 | scripts/mod/modpost" | 176 | scripts/mod/modpost scripts/recordmcount" |
| 177 | rm -rf $kerneldir/scripts/*.o | 177 | rm -rf $kerneldir/scripts/*.o |
| 178 | rm -rf $kerneldir/scripts/basic/*.o | 178 | rm -rf $kerneldir/scripts/basic/*.o |
| 179 | rm -rf $kerneldir/scripts/kconfig/*.o | 179 | rm -rf $kerneldir/scripts/kconfig/*.o |
| @@ -185,7 +185,7 @@ kernel_do_install() { | |||
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | sysroot_stage_all_append() { | 187 | sysroot_stage_all_append() { |
| 188 | sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}${STAGING_KERNEL_DIR} | 188 | sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | 191 | ||
| @@ -292,13 +292,16 @@ module_conf_rfcomm = "alias bt-proto-3 rfcomm" | |||
| 292 | 292 | ||
| 293 | python populate_packages_prepend () { | 293 | python populate_packages_prepend () { |
| 294 | def extract_modinfo(file): | 294 | def extract_modinfo(file): |
| 295 | import re | 295 | import tempfile, re |
| 296 | tmpfile = os.tmpnam() | 296 | tempfile.tempdir = bb.data.getVar("WORKDIR", d, 1) |
| 297 | tf = tempfile.mkstemp() | ||
| 298 | tmpfile = tf[1] | ||
| 297 | cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (bb.data.getVar("PATH", d, 1), bb.data.getVar("HOST_PREFIX", d, 1) or "", file, tmpfile) | 299 | cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (bb.data.getVar("PATH", d, 1), bb.data.getVar("HOST_PREFIX", d, 1) or "", file, tmpfile) |
| 298 | os.system(cmd) | 300 | os.system(cmd) |
| 299 | f = open(tmpfile) | 301 | f = open(tmpfile) |
| 300 | l = f.read().split("\000") | 302 | l = f.read().split("\000") |
| 301 | f.close() | 303 | f.close() |
| 304 | os.close(tf[0]) | ||
| 302 | os.unlink(tmpfile) | 305 | os.unlink(tmpfile) |
| 303 | exp = re.compile("([^=]+)=(.*)") | 306 | exp = re.compile("([^=]+)=(.*)") |
| 304 | vals = {} | 307 | vals = {} |
| @@ -441,7 +444,7 @@ python populate_packages_prepend () { | |||
| 441 | metapkg = "kernel-modules" | 444 | metapkg = "kernel-modules" |
| 442 | bb.data.setVar('ALLOW_EMPTY_' + metapkg, "1", d) | 445 | bb.data.setVar('ALLOW_EMPTY_' + metapkg, "1", d) |
| 443 | bb.data.setVar('FILES_' + metapkg, "", d) | 446 | bb.data.setVar('FILES_' + metapkg, "", d) |
| 444 | blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux' ] | 447 | blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'perf' ] |
| 445 | for l in module_deps.values(): | 448 | for l in module_deps.values(): |
| 446 | for i in l: | 449 | for i in l: |
| 447 | pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1)) | 450 | pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1)) |
| @@ -484,16 +487,16 @@ kernel_do_deploy() { | |||
| 484 | 487 | ||
| 485 | if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then | 488 | if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then |
| 486 | if test -e arch/${ARCH}/boot/uImage ; then | 489 | if test -e arch/${ARCH}/boot/uImage ; then |
| 487 | cp arch/${ARCH}/boot/uImage ${DEPLOYDIR}/uImage-${PV}-${PR}-${MACHINE}-${DATETIME}.bin | 490 | cp arch/${ARCH}/boot/uImage ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin |
| 488 | elif test -e arch/${ARCH}/boot/compressed/vmlinux ; then | 491 | elif test -e arch/${ARCH}/boot/compressed/vmlinux ; then |
| 489 | ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin | 492 | ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin |
| 490 | uboot-mkimage -A ${ARCH} -O linux -T kernel -C none -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${DEPLOYDIR}/uImage-${PV}-${PR}-${MACHINE}-${DATETIME}.bin | 493 | uboot-mkimage -A ${ARCH} -O linux -T kernel -C none -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin |
| 491 | rm -f linux.bin | 494 | rm -f linux.bin |
| 492 | else | 495 | else |
| 493 | ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin | 496 | ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin |
| 494 | rm -f linux.bin.gz | 497 | rm -f linux.bin.gz |
| 495 | gzip -9 linux.bin | 498 | gzip -9 linux.bin |
| 496 | uboot-mkimage -A ${ARCH} -O linux -T kernel -C gzip -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz ${DEPLOYDIR}/uImage-${PV}-${PR}-${MACHINE}-${DATETIME}.bin | 499 | uboot-mkimage -A ${ARCH} -O linux -T kernel -C gzip -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin |
| 497 | rm -f linux.bin.gz | 500 | rm -f linux.bin.gz |
| 498 | fi | 501 | fi |
| 499 | fi | 502 | fi |
