blob: f02c964c70bf1190829e52c943d04abe34abdf6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# use the kernel class (poky/meta/kernel.bbclass)
inherit kernel
KERNEL_IMAGETYPE = "zImage"
# license information/checksum
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
# specify kernel source (named as "upstream" for later reference)
# SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;name=upstream"
# provide git reference for the exact commit
# - references must be used with git if no network available
# - reference for "v4.4" tag discovered with: git show-ref v4.4
#SRCREV_upstream = "b5be40b90dbaa6bd337f3b77de361bfc0723468b"
# by default for the git protocol, the repository is checked out into
# ${WORKDIR}/git, so bitbake must look there for the source code
# (the "destsuffix" SRC_URI option defaults to "git/" for git)
#S = "${WORKDIR}/git"
SRC_URI = "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${PV}.tar.xz"
# checksums for the downloaded file
SRC_URI[md5sum] = "9a75a70346aff3be6147e2478a581c18"
SRC_URI[sha256sum] = "7e46f9e216907942b0b07f2bb59708dc33501d4e2a0938164396386ebd21e608"
# the https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.11.1.tar.xz extracts
# into a directory called linux-4.11.1 set this as source directory
S = "${WORKDIR}/linux-4.11.1"
# specify kernel config (automatically searched in ./files/${MACHINE}/)
SRC_URI += "file://defconfig"
# set a weak default for our DTB variable
# (this ensures that DTB definitely has a value and because of
# how we named the dummy value, will generate a useful message
# if DTB is not specified in some .conf somehwere)
DTB ??= "no-devicetree-specified.dtb"
# create a compile function for the device tree
# - DTB is a variable we created
build_dtb () {
oe_runmake -f ${B}/Makefile ${DTB}
}
# ...and have it called after the compile task is finished
do_compile[postfuncs] += "build_dtb"
# create a deploy function for the device tree
# - ${B} is set to the kernel build directory (set in kernel.bbclass)
# - ${ARCH} is set to the kernel architecture (set in kernel-arch.bbclass)
# - anything copied to ${DEPLOYDIR} will also appear as a deployed file
# (for example: tmp/deploy/images/vexpress/myfile)
deploy_dtb () {
install -D -m 0644 ${B}/arch/${ARCH}/boot/dts/${DTB} \
${DEPLOYDIR}/devicetree-${DTB}
}
# ...and have it called after the deploy task is finished
do_deploy[postfuncs] += "deploy_dtb"
|