summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/kernel-devicetree.bbclass80
1 files changed, 40 insertions, 40 deletions
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 4f80cc62eb..10441475e8 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -10,21 +10,21 @@ FILES_${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-
10KERNEL_DEVICETREE_BUNDLE ?= "0" 10KERNEL_DEVICETREE_BUNDLE ?= "0"
11 11
12normalize_dtb () { 12normalize_dtb () {
13 DTB="$1" 13 dtb="$1"
14 if echo ${DTB} | grep -q '/dts/'; then 14 if echo $dtb | grep -q '/dts/'; then
15 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used." 15 bbwarn "$dtb contains the full path to the the dts file, but only the dtb name should be used."
16 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'` 16 dtb=`basename $dtb | sed 's,\.dts$,.dtb,g'`
17 fi 17 fi
18 echo "${DTB}" 18 echo "$dtb"
19} 19}
20 20
21get_real_dtb_path_in_kernel () { 21get_real_dtb_path_in_kernel () {
22 DTB="$1" 22 dtb="$1"
23 DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}" 23 dtb_path="${B}/arch/${ARCH}/boot/dts/$dtb"
24 if [ ! -e "${DTB_PATH}" ]; then 24 if [ ! -e "$dtb_path" ]; then
25 DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}" 25 dtb_path="${B}/arch/${ARCH}/boot/$dtb"
26 fi 26 fi
27 echo "${DTB_PATH}" 27 echo "$dtb_path"
28} 28}
29 29
30do_configure_append() { 30do_configure_append() {
@@ -50,61 +50,61 @@ do_configure_append() {
50} 50}
51 51
52do_compile_append() { 52do_compile_append() {
53 for DTB in ${KERNEL_DEVICETREE}; do 53 for dtbf in ${KERNEL_DEVICETREE}; do
54 DTB=`normalize_dtb "${DTB}"` 54 dtb=`normalize_dtb "$dtbf"`
55 oe_runmake ${DTB} 55 oe_runmake $dtb
56 done 56 done
57} 57}
58 58
59do_install_append() { 59do_install_append() {
60 for DTB in ${KERNEL_DEVICETREE}; do 60 for dtbf in ${KERNEL_DEVICETREE}; do
61 DTB=`normalize_dtb "${DTB}"` 61 dtb=`normalize_dtb "$dtbf"`
62 DTB_EXT=${DTB##*.} 62 dtb_ext=${dtb##*.}
63 DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"` 63 dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
64 DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"` 64 dtb_base_name=`basename $dtb ."$dtb_ext"`
65 install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} 65 install -m 0644 $dtb_path ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext
66 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do 66 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
67 symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME} 67 symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
68 DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` 68 dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
69 ln -sf ${DTB_BASE_NAME}.${DTB_EXT} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} 69 ln -sf $dtb_base_name.$dtb_ext ${D}/${KERNEL_IMAGEDEST}/devicetree-$dtb_symlink_name.$dtb_ext
70 70
71 if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then 71 if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
72 cat ${D}/${KERNEL_IMAGEDEST}/$type \ 72 cat ${D}/${KERNEL_IMAGEDEST}/$type \
73 ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} \ 73 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext \
74 > ${D}/${KERNEL_IMAGEDEST}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin 74 > ${D}/${KERNEL_IMAGEDEST}/$type-$dtb_base_name.$dtb_ext.bin
75 fi 75 fi
76 done 76 done
77 done 77 done
78} 78}
79 79
80do_deploy_append() { 80do_deploy_append() {
81 for DTB in ${KERNEL_DEVICETREE}; do 81 for dtbf in ${KERNEL_DEVICETREE}; do
82 DTB=`normalize_dtb "${DTB}"` 82 dtb=`normalize_dtb "$dtbf"`
83 DTB_EXT=${DTB##*.} 83 dtb_ext=${dtb##*.}
84 DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"` 84 dtb_base_name=`basename $dtb ."$dtb_ext"`
85 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do 85 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
86 base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME} 86 base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
87 symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME} 87 symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
88 DTB_NAME=`echo ${base_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` 88 dtb_name=`echo ${base_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
89 DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` 89 dtb_symlink_name=`echo ${symlink_name} | sed "s/${MACHINE}/$dtb_base_name/g"`
90 DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"` 90 dtb_path=`get_real_dtb_path_in_kernel "$dtb"`
91 install -d ${DEPLOYDIR} 91 install -d ${DEPLOYDIR}
92 install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} 92 install -m 0644 $dtb_path ${DEPLOYDIR}/$dtb_name.$dtb_ext
93 ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.${DTB_EXT} 93 ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_symlink_name.$dtb_ext
94 ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_BASE_NAME}.${DTB_EXT} 94 ln -sf $dtb_name.$dtb_ext ${DEPLOYDIR}/$dtb_base_name.$dtb_ext
95 95
96 if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then 96 if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
97 cat ${DEPLOYDIR}/$type \ 97 cat ${DEPLOYDIR}/$type \
98 ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \ 98 ${DEPLOYDIR}/$dtb_name.$dtb_ext \
99 > ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}.bin 99 > ${DEPLOYDIR}/$dtb_name.$dtb_ext.bin
100 ln -sf ${DTB_NAME}.${DTB_EXT}.bin ${DEPLOYDIR}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin 100 ln -sf $dtb_name.$dtb_ext.bin ${DEPLOYDIR}/$type-$dtb_base_name.$dtb_ext.bin
101 101
102 if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then 102 if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
103 cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \ 103 cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
104 ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \ 104 ${DEPLOYDIR}/$dtb_name.$dtb_ext \
105 > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin 105 > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin
106 ln -sf ${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin \ 106 ln -sf ${type}-${INITRAMFS_BASE_NAME}-$dtb_base_name.$dtb_ext.bin \
107 ${DEPLOYDIR}/${type}-initramfs-${DTB_BASE_NAME}.${DTB_EXT}-${MACHINE}.bin 107 ${DEPLOYDIR}/${type}-initramfs-$dtb_base_name.$dtb_ext-${MACHINE}.bin
108 fi 108 fi
109 fi 109 fi
110 done 110 done