diff options
| -rw-r--r-- | meta/recipes-kernel/linux/linux-dtb.inc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc index 22801b72b8..772adcbced 100644 --- a/meta/recipes-kernel/linux/linux-dtb.inc +++ b/meta/recipes-kernel/linux/linux-dtb.inc | |||
| @@ -14,6 +14,15 @@ normalize_dtb () { | |||
| 14 | echo "${DTB}" | 14 | echo "${DTB}" |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | get_real_dtb_path_in_kernel () { | ||
| 18 | DTB="$1" | ||
| 19 | DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}" | ||
| 20 | if [ ! -e "${DTB_PATH}" ]; then | ||
| 21 | DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}" | ||
| 22 | fi | ||
| 23 | echo "${DTB_PATH}" | ||
| 24 | } | ||
| 25 | |||
| 17 | do_compile_append() { | 26 | do_compile_append() { |
| 18 | for DTB in ${KERNEL_DEVICETREE}; do | 27 | for DTB in ${KERNEL_DEVICETREE}; do |
| 19 | DTB=`normalize_dtb "${DTB}"` | 28 | DTB=`normalize_dtb "${DTB}"` |
| @@ -26,10 +35,7 @@ do_install_append() { | |||
| 26 | DTB=`normalize_dtb "${DTB}"` | 35 | DTB=`normalize_dtb "${DTB}"` |
| 27 | DTB_BASE_NAME=`basename ${DTB} .dtb` | 36 | DTB_BASE_NAME=`basename ${DTB} .dtb` |
| 28 | DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` | 37 | DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` |
| 29 | DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}" | 38 | DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"` |
| 30 | if [ ! -e "${DTB_PATH}" ]; then | ||
| 31 | DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}" | ||
| 32 | fi | ||
| 33 | install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb | 39 | install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb |
| 34 | done | 40 | done |
| 35 | } | 41 | } |
| @@ -40,10 +46,7 @@ do_deploy_append() { | |||
| 40 | DTB_BASE_NAME=`basename ${DTB} .dtb` | 46 | DTB_BASE_NAME=`basename ${DTB} .dtb` |
| 41 | DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` | 47 | DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` |
| 42 | DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` | 48 | DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` |
| 43 | DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}" | 49 | DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"` |
| 44 | if [ ! -e "${DTB_PATH}" ]; then | ||
| 45 | DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}" | ||
| 46 | fi | ||
| 47 | install -d ${DEPLOYDIR} | 50 | install -d ${DEPLOYDIR} |
| 48 | install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb | 51 | install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb |
| 49 | ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb | 52 | ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb |
