diff options
author | Paul Barker <pbarker@toganlabs.com> | 2017-09-08 09:29:31 +0000 |
---|---|---|
committer | Andrei Gherzan <andrei@gherzan.com> | 2017-09-24 20:39:35 +0100 |
commit | 8311d16e5999566d01e6931003f858d979a6e46c (patch) | |
tree | af7e4c0bf486bb790e75d9afdd7232a1e2f3221c | |
parent | b00d914e78c8f4abfaff29deda5a72689230fa5f (diff) | |
download | meta-raspberrypi-8311d16e5999566d01e6931003f858d979a6e46c.tar.gz |
linux-raspberrypi: Drop unnecessary code
* The kerneltype variable is not used anywhere after being set.
* The manipulation of KERNEL_DEVICETREE is effectively a no-op, we read the
current value in get_dts() and store this back into the same variable.
Signed-off-by: Paul Barker <pbarker@toganlabs.com>
-rw-r--r-- | classes/linux-raspberrypi-base.bbclass | 19 | ||||
-rw-r--r-- | classes/sdcard_image-rpi.bbclass | 2 | ||||
-rw-r--r-- | recipes-kernel/linux/linux-raspberrypi.inc | 8 |
3 files changed, 2 insertions, 27 deletions
diff --git a/classes/linux-raspberrypi-base.bbclass b/classes/linux-raspberrypi-base.bbclass index e925d4e..0a21cc9 100644 --- a/classes/linux-raspberrypi-base.bbclass +++ b/classes/linux-raspberrypi-base.bbclass | |||
@@ -1,24 +1,7 @@ | |||
1 | inherit linux-kernel-base | 1 | inherit linux-kernel-base |
2 | 2 | ||
3 | def get_dts(d, ver=None): | ||
4 | import re | ||
5 | |||
6 | staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR") | ||
7 | dts = d.getVar("KERNEL_DEVICETREE") | ||
8 | |||
9 | # d.getVar() might return 'None' as a normal string | ||
10 | # leading to 'is None' check isn't enough. | ||
11 | # TODO: Investigate if this is a bug in bitbake | ||
12 | if ver is None or ver == "None": | ||
13 | ''' if 'ver' isn't set try to grab the kernel version | ||
14 | from the kernel staging ''' | ||
15 | ver = get_kernelversion_file(staging_dir) | ||
16 | |||
17 | return dts | ||
18 | |||
19 | |||
20 | def split_overlays(d, out, ver=None): | 3 | def split_overlays(d, out, ver=None): |
21 | dts = get_dts(d, ver) | 4 | dts = d.getVar("KERNEL_DEVICETREE") |
22 | if out: | 5 | if out: |
23 | overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d) | 6 | overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d) |
24 | overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d) | 7 | overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d) |
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass index 42753d6..8099f77 100644 --- a/classes/sdcard_image-rpi.bbclass +++ b/classes/sdcard_image-rpi.bbclass | |||
@@ -86,7 +86,7 @@ IMAGE_CMD_rpi-sdimg () { | |||
86 | echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB" | 86 | echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB" |
87 | 87 | ||
88 | # Check if we are building with device tree support | 88 | # Check if we are building with device tree support |
89 | DTS="${@get_dts(d)}" | 89 | DTS="${KERNEL_DEVICETREE}" |
90 | 90 | ||
91 | # Initialize sdcard image file | 91 | # Initialize sdcard image file |
92 | dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE} | 92 | dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE} |
diff --git a/recipes-kernel/linux/linux-raspberrypi.inc b/recipes-kernel/linux/linux-raspberrypi.inc index b348a9d..8aa9577 100644 --- a/recipes-kernel/linux/linux-raspberrypi.inc +++ b/recipes-kernel/linux/linux-raspberrypi.inc | |||
@@ -30,14 +30,6 @@ UDEV_GE_141 ?= "1" | |||
30 | 30 | ||
31 | KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}" | 31 | KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}" |
32 | 32 | ||
33 | # Set programmatically some variables during recipe parsing | ||
34 | # See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions | ||
35 | python __anonymous () { | ||
36 | kerneltype = d.getVar('KERNEL_IMAGETYPE') | ||
37 | kerneldt = get_dts(d, d.getVar('LINUX_VERSION')) | ||
38 | d.setVar("KERNEL_DEVICETREE", kerneldt) | ||
39 | } | ||
40 | |||
41 | do_compile_append_raspberrypi3-64() { | 33 | do_compile_append_raspberrypi3-64() { |
42 | cc_extra=$(get_cc_option) | 34 | cc_extra=$(get_cc_option) |
43 | oe_runmake dtbs CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} | 35 | oe_runmake dtbs CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} |