summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2016-10-06 19:09:06 -0700
committerAndrei Gherzan <andrei@resin.io>2016-10-13 10:39:59 +0200
commit41689e8fe2ee0ff83fc94fbb3a12ebcab648106b (patch)
tree04bae1a5c3c3f4c101b2b064c807d7d654864087
parent5697e77ec4b53c2f4618d20bfe0af16cd3dee604 (diff)
downloadmeta-raspberrypi-41689e8fe2ee0ff83fc94fbb3a12ebcab648106b.tar.gz
sdcard_image-rpi.bbclass: Remove redundant RPI_KERNEL_VERSION
The value of the RPI_KERNEL_VERSION can change between None and the kernel version which can result in taskhash mismatch errors while building images. The taskhash mismatch errors can be reproduced using: bitbake -c cleansstate virtual/kernel core-image-minimal && bitbake core-image-minimal The get_dts() and split_overlays() functions are modified so that the kernel version argument is optional. If the version is not supplied to these functions, they will fallback to the Python equivalent of the expression used for RPI_KERNEL_VERSION. Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--classes/linux-raspberrypi-base.bbclass4
-rw-r--r--classes/sdcard_image-rpi.bbclass8
2 files changed, 5 insertions, 7 deletions
diff --git a/classes/linux-raspberrypi-base.bbclass b/classes/linux-raspberrypi-base.bbclass
index 930fc44..3a6e33d 100644
--- a/classes/linux-raspberrypi-base.bbclass
+++ b/classes/linux-raspberrypi-base.bbclass
@@ -1,6 +1,6 @@
1inherit linux-kernel-base 1inherit linux-kernel-base
2 2
3def get_dts(d, ver): 3def get_dts(d, ver=None):
4 import re 4 import re
5 5
6 staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True) 6 staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True)
@@ -32,7 +32,7 @@ def get_dts(d, ver):
32 return dts 32 return dts
33 33
34 34
35def split_overlays(d, ver, out): 35def split_overlays(d, out, ver=None):
36 dts = get_dts(d, ver) 36 dts = get_dts(d, ver)
37 if out: 37 if out:
38 overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d) 38 overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d)
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass
index 2f0daee..0487ef1 100644
--- a/classes/sdcard_image-rpi.bbclass
+++ b/classes/sdcard_image-rpi.bbclass
@@ -71,8 +71,6 @@ SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.rpi-sdimg"
71# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS. 71# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS.
72FATPAYLOAD ?= "" 72FATPAYLOAD ?= ""
73 73
74RPI_KERNEL_VERSION := "${@get_kernelversion_file('${STAGING_KERNEL_BUILDDIR}')}"
75
76IMAGE_CMD_rpi-sdimg () { 74IMAGE_CMD_rpi-sdimg () {
77 75
78 # Align partitions 76 # Align partitions
@@ -83,7 +81,7 @@ IMAGE_CMD_rpi-sdimg () {
83 echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB" 81 echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB"
84 82
85 # Check if we are building with device tree support 83 # Check if we are building with device tree support
86 DTS="${@get_dts(d, '${RPI_KERNEL_VERSION}')}" 84 DTS="${@get_dts(d)}"
87 85
88 # Initialize sdcard image file 86 # Initialize sdcard image file
89 dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE} 87 dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE}
@@ -104,8 +102,8 @@ IMAGE_CMD_rpi-sdimg () {
104 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/ 102 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/
105 if test -n "${DTS}"; then 103 if test -n "${DTS}"; then
106 # Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' (4.1.x) or by '.dtbo' (4.4.9+) string and will be put in a dedicated folder 104 # Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' (4.1.x) or by '.dtbo' (4.4.9+) string and will be put in a dedicated folder
107 DT_OVERLAYS="${@split_overlays(d, '${RPI_KERNEL_VERSION}', 0)}" 105 DT_OVERLAYS="${@split_overlays(d, 0)}"
108 DT_ROOT="${@split_overlays(d, '${RPI_KERNEL_VERSION}', 1)}" 106 DT_ROOT="${@split_overlays(d, 1)}"
109 107
110 # Copy board device trees to root folder 108 # Copy board device trees to root folder
111 for DTB in ${DT_ROOT}; do 109 for DTB in ${DT_ROOT}; do