diff options
-rw-r--r-- | meta/classes/kernel.bbclass | 16 | ||||
-rw-r--r-- | meta/recipes-kernel/linux/linux-dtb.inc | 36 |
2 files changed, 8 insertions, 44 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 3cc0432fcf..02a5e961cb 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -2,7 +2,7 @@ inherit linux-kernel-base kernel-module-split | |||
2 | 2 | ||
3 | PROVIDES += "virtual/kernel" | 3 | PROVIDES += "virtual/kernel" |
4 | DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native lzop-native" | 4 | DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native lzop-native" |
5 | PACKAGE_WRITE_DEPS += "depmodwrapper-cross virtual/update-alternatives-native" | 5 | PACKAGE_WRITE_DEPS += "depmodwrapper-cross" |
6 | 6 | ||
7 | do_deploy[depends] += "depmodwrapper-cross:do_populate_sysroot" | 7 | do_deploy[depends] += "depmodwrapper-cross:do_populate_sysroot" |
8 | 8 | ||
@@ -57,7 +57,7 @@ python __anonymous () { | |||
57 | 57 | ||
58 | d.appendVar('PACKAGES', ' ' + 'kernel-image-' + typelower) | 58 | d.appendVar('PACKAGES', ' ' + 'kernel-image-' + typelower) |
59 | 59 | ||
60 | d.setVar('FILES_kernel-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}') | 60 | d.setVar('FILES_kernel-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type) |
61 | 61 | ||
62 | d.appendVar('RDEPENDS_kernel-image', ' ' + 'kernel-image-' + typelower) | 62 | d.appendVar('RDEPENDS_kernel-image', ' ' + 'kernel-image-' + typelower) |
63 | 63 | ||
@@ -65,13 +65,6 @@ python __anonymous () { | |||
65 | 65 | ||
66 | d.setVar('ALLOW_EMPTY_kernel-image-' + typelower, '1') | 66 | d.setVar('ALLOW_EMPTY_kernel-image-' + typelower, '1') |
67 | 67 | ||
68 | priority = d.getVar('KERNEL_PRIORITY') | ||
69 | postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n' | ||
70 | d.setVar('pkg_postinst_kernel-image-' + typelower, postinst) | ||
71 | |||
72 | postrm = '#!/bin/sh\n' + 'update-alternatives --remove' + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} || true' + '\n' | ||
73 | d.setVar('pkg_postrm_kernel-image-' + typelower, postrm) | ||
74 | |||
75 | image = d.getVar('INITRAMFS_IMAGE') | 68 | image = d.getVar('INITRAMFS_IMAGE') |
76 | if image: | 69 | if image: |
77 | d.appendVarFlag('do_bundle_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') | 70 | d.appendVarFlag('do_bundle_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') |
@@ -137,10 +130,6 @@ export CROSS_COMPILE = "${TARGET_PREFIX}" | |||
137 | export KBUILD_BUILD_USER = "oe-user" | 130 | export KBUILD_BUILD_USER = "oe-user" |
138 | export KBUILD_BUILD_HOST = "oe-host" | 131 | export KBUILD_BUILD_HOST = "oe-host" |
139 | 132 | ||
140 | KERNEL_PRIORITY ?= "${@int(d.getVar('PV').split('-')[0].split('+')[0].split('.')[0]) * 10000 + \ | ||
141 | int(d.getVar('PV').split('-')[0].split('+')[0].split('.')[1]) * 100 + \ | ||
142 | int(d.getVar('PV').split('-')[0].split('+')[0].split('.')[-1])}" | ||
143 | |||
144 | KERNEL_RELEASE ?= "${KERNEL_VERSION}" | 133 | KERNEL_RELEASE ?= "${KERNEL_VERSION}" |
145 | 134 | ||
146 | # The directory where built kernel lies in the kernel tree | 135 | # The directory where built kernel lies in the kernel tree |
@@ -350,6 +339,7 @@ kernel_do_install() { | |||
350 | install -d ${D}/boot | 339 | install -d ${D}/boot |
351 | for type in ${KERNEL_IMAGETYPES} ; do | 340 | for type in ${KERNEL_IMAGETYPES} ; do |
352 | install -m 0644 ${KERNEL_OUTPUT_DIR}/${type} ${D}/${KERNEL_IMAGEDEST}/${type}-${KERNEL_VERSION} | 341 | install -m 0644 ${KERNEL_OUTPUT_DIR}/${type} ${D}/${KERNEL_IMAGEDEST}/${type}-${KERNEL_VERSION} |
342 | ln -sf ${type}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${type} | ||
353 | done | 343 | done |
354 | install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} | 344 | install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} |
355 | install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} | 345 | install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} |
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 |
2 | FILES_kernel-devicetree = "/${KERNEL_IMAGEDEST}/devicetree*" | 2 | FILES_kernel-devicetree = "/${KERNEL_IMAGEDEST}/*.dtb /${KERNEL_IMAGEDEST}/*.dtbo" |
3 | |||
4 | PACKAGE_WRITE_DEPS += "virtual/update-alternatives-native" | ||
5 | 3 | ||
6 | python __anonymous () { | 4 | python __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 | |||
67 | pkg_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 | |||
80 | pkg_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 | } |