summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r--meta/recipes-kernel/linux/linux-dtb.inc36
1 files changed, 5 insertions, 31 deletions
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
index 0174c80d85..ca92822d25 100644
--- a/meta/recipes-kernel/linux/linux-dtb.inc
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -1,7 +1,5 @@
1# Support for device tree generation 1# Support for device tree generation
2FILES_kernel-devicetree = "/${KERNEL_IMAGEDEST}/devicetree*" 2FILES_kernel-devicetree = "/${KERNEL_IMAGEDEST}/*.dtb /${KERNEL_IMAGEDEST}/*.dtbo"
3
4PACKAGE_WRITE_DEPS += "virtual/update-alternatives-native"
5 3
6python __anonymous () { 4python __anonymous () {
7 d.appendVar("PACKAGES", " kernel-devicetree") 5 d.appendVar("PACKAGES", " kernel-devicetree")
@@ -36,12 +34,13 @@ do_install_append() {
36 for DTB in ${KERNEL_DEVICETREE}; do 34 for DTB in ${KERNEL_DEVICETREE}; do
37 DTB=`normalize_dtb "${DTB}"` 35 DTB=`normalize_dtb "${DTB}"`
38 DTB_EXT=${DTB##*.} 36 DTB_EXT=${DTB##*.}
37 DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
39 DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"` 38 DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
39 install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT}
40 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do 40 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
41 symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME} 41 symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
42 DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` 42 DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
43 DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"` 43 ln -sf ${DTB_BASE_NAME}.${DTB_EXT} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT}
44 install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT}
45 done 44 done
46 done 45 done
47} 46}
@@ -60,32 +59,7 @@ do_deploy_append() {
60 install -d ${DEPLOYDIR} 59 install -d ${DEPLOYDIR}
61 install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} 60 install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}
62 ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.${DTB_EXT} 61 ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.${DTB_EXT}
63 done 62 ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_BASE_NAME}.${DTB_EXT}
64 done
65}
66
67pkg_postinst_kernel-devicetree () {
68 cd /${KERNEL_IMAGEDEST}
69 for DTB in ${KERNEL_DEVICETREE}; do
70 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
71 symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
72 DTB_EXT=${DTB##*.}
73 DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
74 DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
75 update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} ${DTB_BASE_NAME}.${DTB_EXT} devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
76 done
77 done
78}
79
80pkg_postrm_kernel-devicetree () {
81 cd /${KERNEL_IMAGEDEST}
82 for DTB in ${KERNEL_DEVICETREE}; do
83 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
84 symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
85 DTB_EXT=${DTB##*.}
86 DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
87 DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
88 update-alternatives --remove ${DTB_BASE_NAME}.${DTB_EXT} devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
89 done 63 done
90 done 64 done
91} 65}