Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame^] | 1 | SUMMARY = "An example kernel recipe that uses the linux-yocto and oe-core" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 2 | # linux-yocto-custom.bb: |
| 3 | # |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 4 | # kernel classes to apply a subset of yocto kernel management to git |
| 5 | # managed kernel repositories. |
| 6 | # |
| 7 | # To use linux-yocto-custom in your layer, copy this recipe (optionally |
| 8 | # rename it as well) and modify it appropriately for your machine. i.e.: |
| 9 | # |
| 10 | # COMPATIBLE_MACHINE_yourmachine = "yourmachine" |
| 11 | # |
| 12 | # You must also provide a Linux kernel configuration. The most direct |
| 13 | # method is to copy your .config to files/defconfig in your layer, |
| 14 | # in the same directory as the copy (and rename) of this recipe and |
| 15 | # add file://defconfig to your SRC_URI. |
| 16 | # |
| 17 | # To use the yocto kernel tooling to generate a BSP configuration |
| 18 | # using modular configuration fragments, see the yocto-bsp and |
| 19 | # yocto-kernel tools documentation. |
| 20 | # |
| 21 | # Warning: |
| 22 | # |
| 23 | # Building this example without providing a defconfig or BSP |
| 24 | # configuration will result in build or boot errors. This is not a |
| 25 | # bug. |
| 26 | # |
| 27 | # |
| 28 | # Notes: |
| 29 | # |
| 30 | # patches: patches can be merged into to the source git tree itself, |
| 31 | # added via the SRC_URI, or controlled via a BSP |
| 32 | # configuration. |
| 33 | # |
| 34 | # defconfig: When a defconfig is provided, the linux-yocto configuration |
| 35 | # uses the filename as a trigger to use a 'allnoconfig' baseline |
| 36 | # before merging the defconfig into the build. |
| 37 | # |
| 38 | # If the defconfig file was created with make_savedefconfig, |
| 39 | # not all options are specified, and should be restored with their |
| 40 | # defaults, not set to 'n'. To properly expand a defconfig like |
| 41 | # this, specify: KCONFIG_MODE="--alldefconfig" in the kernel |
| 42 | # recipe. |
| 43 | # |
| 44 | # example configuration addition: |
| 45 | # SRC_URI += "file://smp.cfg" |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 46 | # example patch addition (for kernel v4.x only): |
| 47 | # SRC_URI += "file://0001-linux-version-tweak.patch" |
| 48 | # example feature addition (for kernel v4.x only): |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | # SRC_URI += "file://feature.scc" |
| 50 | # |
| 51 | |
| 52 | inherit kernel |
| 53 | require recipes-kernel/linux/linux-yocto.inc |
| 54 | |
| 55 | # Override SRC_URI in a copy of this recipe to point at a different source |
| 56 | # tree if you do not want to build from Linus' tree. |
| 57 | SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;nocheckout=1;name=machine" |
| 58 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 59 | LINUX_VERSION ?= "4.2" |
| 60 | LINUX_VERSION_EXTENSION_append = "-custom" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 61 | |
| 62 | # Modify SRCREV to a different commit hash in a copy of this recipe to |
| 63 | # build a different release of the Linux kernel. |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 64 | # tag: v4.2 64291f7db5bd8150a74ad2036f1037e6a0428df2 |
| 65 | SRCREV_machine="64291f7db5bd8150a74ad2036f1037e6a0428df2" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 66 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 67 | PV = "${LINUX_VERSION}+git${SRCPV}" |
| 68 | |
| 69 | # Override COMPATIBLE_MACHINE to include your machine in a copy of this recipe |
| 70 | # file. Leaving it empty here ensures an early explicit build failure. |
| 71 | COMPATIBLE_MACHINE = "(^$)" |