kernel.bbclass: resync with oe-core version

* 4 spaces for anonymous python
* don't recreate uImage if it already exists

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Martin Jansa
2012-03-30 00:43:05 +02:00
parent 1c2e52a30e
commit 56a34a9e60
+33 -31
View File
@@ -11,20 +11,20 @@ INITRAMFS_IMAGE ?= ""
INITRAMFS_TASK ?= "" INITRAMFS_TASK ?= ""
python __anonymous () { python __anonymous () {
kerneltype = d.getVar('KERNEL_IMAGETYPE', True) or '' kerneltype = d.getVar('KERNEL_IMAGETYPE', True) or ''
if kerneltype == 'uImage': if kerneltype == 'uImage':
depends = d.getVar("DEPENDS", True) depends = d.getVar("DEPENDS", True)
depends = "%s u-boot-mkimage-native" % depends depends = "%s u-boot-mkimage-native" % depends
d.setVar("DEPENDS", depends) d.setVar("DEPENDS", depends)
image = d.getVar('INITRAMFS_IMAGE', True) image = d.getVar('INITRAMFS_IMAGE', True)
if image: if image:
d.setVar('INITRAMFS_TASK', '${INITRAMFS_IMAGE}:do_rootfs') d.setVar('INITRAMFS_TASK', '${INITRAMFS_IMAGE}:do_rootfs')
machine_kernel_pr = d.getVar('MACHINE_KERNEL_PR', True) machine_kernel_pr = d.getVar('MACHINE_KERNEL_PR', True)
if machine_kernel_pr: if machine_kernel_pr:
d.setVar('PR', machine_kernel_pr) d.setVar('PR', machine_kernel_pr)
} }
inherit kernel-arch deploy inherit kernel-arch deploy
@@ -507,34 +507,36 @@ do_sizecheck() {
addtask sizecheck before do_install after do_compile addtask sizecheck before do_install after do_compile
KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
# Don't include the DATETIME variable in the sstate package signatures
KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
do_uboot_mkimage() { do_uboot_mkimage() {
if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
ENTRYPOINT=${UBOOT_ENTRYPOINT} if test ! -e arch/${ARCH}/boot/uImage ; then
if test -n "${UBOOT_ENTRYSYMBOL}"; then ENTRYPOINT=${UBOOT_ENTRYPOINT}
ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \ if test -n "${UBOOT_ENTRYSYMBOL}"; then
awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'` ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
fi awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
if test -e arch/${ARCH}/boot/compressed/vmlinux ; then fi
${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C none -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
rm -f linux.bin uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C none -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage
else rm -f linux.bin
${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin else
rm -f linux.bin.gz ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
gzip -9 linux.bin rm -f linux.bin.gz
uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C gzip -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz arch/${ARCH}/boot/uImage gzip -9 linux.bin
rm -f linux.bin.gz uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C gzip -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz arch/${ARCH}/boot/uImage
rm -f linux.bin.gz
fi
fi fi
fi fi
} }
addtask uboot_mkimage before do_install after do_compile addtask uboot_mkimage before do_install after do_compile
KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
# Don't include the DATETIME variable in the sstate package signatures
KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
kernel_do_deploy() { kernel_do_deploy() {
install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then