Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 1 | require linux-rpi.inc |
| 2 | inherit linux-raspberrypi-base |
| 3 | |
| 4 | DESCRIPTION = "Linux Kernel for Raspberry Pi" |
| 5 | SECTION = "kernel" |
| 6 | LICENSE = "GPLv2" |
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" |
| 8 | |
| 9 | SRC_URI += " \ |
| 10 | file://defconfig \ |
| 11 | " |
| 12 | |
| 13 | COMPATIBLE_MACHINE = "raspberrypi" |
| 14 | |
| 15 | PE = "1" |
| 16 | PV = "${LINUX_VERSION}+git${SRCPV}" |
| 17 | |
| 18 | # NOTE: For now we pull in the default config from the RPi kernel GIT tree. |
| 19 | KERNEL_DEFCONFIG_raspberrypi ?= "bcmrpi_defconfig" |
| 20 | KERNEL_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig" |
| 21 | |
| 22 | # CMDLINE for raspberrypi |
| 23 | CMDLINE = "dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" |
| 24 | |
| 25 | # Add the kernel debugger over console kernel command line option if enabled |
| 26 | CMDLINE_append = ' ${@base_conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}' |
| 27 | |
| 28 | UDEV_GE_141 ?= "1" |
| 29 | |
| 30 | KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}" |
| 31 | |
| 32 | # Set programmatically some variables during recipe parsing |
| 33 | # See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions |
| 34 | python __anonymous () { |
| 35 | kerneltype = d.getVar('KERNEL_IMAGETYPE', True) |
| 36 | kerneldt = get_dts(d, d.getVar('LINUX_VERSION', True)) |
| 37 | d.setVar("KERNEL_DEVICETREE", kerneldt) |
| 38 | } |
| 39 | |
| 40 | do_kernel_configme_prepend() { |
| 41 | install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available." |
| 42 | } |
| 43 | |
| 44 | do_install_prepend() { |
| 45 | install -d ${D}/lib/firmware |
| 46 | } |
| 47 | |
| 48 | do_deploy_append() { |
| 49 | # Deploy cmdline.txt |
| 50 | install -d ${DEPLOYDIR}/bcm2835-bootfiles |
| 51 | PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" |
| 52 | if [ ${PITFT} = "1" ]; then |
| 53 | PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8" |
| 54 | fi |
| 55 | echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt |
| 56 | } |