DESCRIPTION = "Linux Kernel" SECTION = "kernel" LICENSE = "GPL" inherit kernel # Add dependency on mkimage for kernels that build a uImage python __anonymous () { import bb kerneltype = bb.data.getVar('KERNEL_IMAGETYPE', d, 1) or '' if kerneltype == 'uImage': depends = bb.data.getVar("DEPENDS", d, 1) depends = "%s u-boot-mkimage-openmoko-native" % depends bb.data.setVar("DEPENDS", depends, d) } RPSRC = "http://www.rpsys.net/openzaurus/patches/archive" # Specify the commandline for your device # Boot from mmc CMDLINE_at91sam9263ek = "mem=64M console=ttyS0,115200 root=/dev/mmcblk0p1 rootfstype=ext2 rootdelay=5" # Boot from nfs #CMDLINE_at91sam9263ek = "mem=64M console=ttyS0,115200 root=301 root=/dev/nfs nfsroot=172.20.3.1:/data/at91 ip=172.20.0.5:::255.255.0.0" # Set the verbosity of kernel messages during runtime # You can define CMDLINE_DEBUG in your local.conf or distro.conf to override this behaviour CMDLINE_DEBUG ?= '${@base_conditional("DISTRO_TYPE", "release", "quiet", "debug",d)}' CMDLINE_append = " ${CMDLINE_DEBUG} " do_configure_prepend() { echo "" > ${S}/.config # # logo support, if you supply logo_linux_clut224.ppm in SRC_URI, then it's going to be used # if [ -e ${WORKDIR}/logo_linux_clut224.ppm ]; then install -m 0644 ${WORKDIR}/logo_linux_clut224.ppm drivers/video/logo/logo_linux_clut224.ppm echo "CONFIG_LOGO=y" >> ${S}/.config echo "CONFIG_LOGO_LINUX_CLUT224=y" >> ${S}/.config fi # # oabi / eabi support # if [ "${TARGET_OS}" = "linux-gnueabi" -o "${TARGET_OS}" = "linux-uclibcgnueabi" ]; then echo "CONFIG_AEABI=y" >> ${S}/.config echo "CONFIG_OABI_COMPAT=y" >> ${S}/.config else echo "# CONFIG_AEABI is not set" >> ${S}/.config echo "# CONFIG_OABI_COMPAT is not set" >> ${S}/.config fi # # endian support # if [ "${SITEINFO_ENDIANESS}" = "be" ]; then echo "CONFIG_CPU_BIG_ENDIAN=y" >> ${S}/.config fi echo "CONFIG_CMDLINE=\"${CMDLINE}\"" >> ${S}/.config sed -e '/CONFIG_AEABI/d' \ -e '/CONFIG_OABI_COMPAT=/d' \ -e '/CONFIG_CMDLINE=/d' \ -e '/CONFIG_CPU_BIG_ENDIAN/d' \ -e '/CONFIG_LOGO=/d' \ -e '/CONFIG_LOGO_LINUX_CLUT224=/d' \ < '${WORKDIR}/defconfig' >>'${S}/.config' # # root-over-nfs-over-usb-eth support. Limited, but should cover some cases. # Enable this by setting a proper CMDLINE_NFSROOT_USB. # if [ ! -z "${CMDLINE_NFSROOT_USB}" ]; then oenote "Configuring the kernel for root-over-nfs-over-usb-eth with CMDLINE ${CMDLINE_NFSROOT_USB}" sed -e '/CONFIG_INET/d' \ -e '/CONFIG_IP_PNP=/d' \ -e '/CONFIG_USB_GADGET=/d' \ -e '/CONFIG_USB_GADGET_SELECTED=/d' \ -e '/CONFIG_USB_ETH=/d' \ -e '/CONFIG_NFS_FS=/d' \ -e '/CONFIG_ROOT_NFS=/d' \ -e '/CONFIG_CMDLINE=/d' \ -i ${S}/.config echo "CONFIG_INET=y" >> ${S}/.config echo "CONFIG_IP_PNP=y" >> ${S}/.config echo "CONFIG_USB_GADGET=y" >> ${S}/.config echo "CONFIG_USB_GADGET_SELECTED=y" >> ${S}/.config echo "CONFIG_USB_ETH=y" >> ${S}/.config echo "CONFIG_NFS_FS=y" >> ${S}/.config echo "CONFIG_ROOT_NFS=y" >> ${S}/.config echo "CONFIG_CMDLINE=\"${CMDLINE_NFSROOT_USB}\"" >> ${S}/.config fi yes '' | oe_runmake oldconfig } do_configure_append_avr32() { sed -i -e s:-mno-pic::g arch/avr32/Makefile } UBOOT_ENTRYPOINT ?= "20008000" do_compile_append() { if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then if test -e arch/${ARCH}/boot/compressed/vmlinux ; then ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin uboot-mkimage -A ${ARCH} -O linux -T kernel -C none -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage rm -f linux.bin else ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin rm -f linux.bin.gz gzip -9 linux.bin 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 arch/${ARCH}/boot/uImage rm -f linux.bin.gz fi fi } KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}" KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-${MACHINE}" do_deploy() { install -d ${DEPLOY_DIR_IMAGE} install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin tar -cvzf ${DEPLOY_DIR_IMAGE}/modules-${PV}-${PR}-${MACHINE}.tgz -C ${D} lib cd ${DEPLOY_DIR_IMAGE} rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin } do_deploy[dirs] = "${S}" addtask sizecheck before do_install after do_compile addtask deploy before do_package after do_install