diff options
author | He Zhe <zhe.he@windriver.com> | 2016-05-25 04:47:16 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-30 15:58:11 +0100 |
commit | 0437a59e3c298d40aaa96af09b80bff8fcbe292d (patch) | |
tree | 0f97feda6f977e4e4c837897313413347ee36273 /meta/classes/kernel.bbclass | |
parent | 077377e912ce3eabd4978b4246272665f8304b66 (diff) | |
download | poky-0437a59e3c298d40aaa96af09b80bff8fcbe292d.tar.gz |
kernel: Add KERNEL_IMAGETYPES to build multi types kernel at one time
Add KERNEL_IMAGETYPES to support building packaging and installing
multi types of kernel images, such as zImage uImage, at one time.
KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE work as before.
(From OE-Core rev: 849b67b2e4820564b5e5c9bd4bb293c44351c5f3)
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r-- | meta/classes/kernel.bbclass | 174 |
1 files changed, 125 insertions, 49 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index c5355cf37e..e7e2cb3963 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -16,12 +16,53 @@ INITRAMFS_IMAGE ?= "" | |||
16 | INITRAMFS_TASK ?= "" | 16 | INITRAMFS_TASK ?= "" |
17 | INITRAMFS_IMAGE_BUNDLE ?= "" | 17 | INITRAMFS_IMAGE_BUNDLE ?= "" |
18 | 18 | ||
19 | # KERNEL_VERSION is extracted from source code. It is evaluated as | ||
20 | # None for the first parsing, since the code has not been fetched. | ||
21 | # After the code is fetched, it will be evaluated as real version | ||
22 | # number and cause kernel to be rebuilt. To avoid this, make | ||
23 | # KERNEL_VERSION_NAME and KERNEL_VERSION_PKG_NAME depend on | ||
24 | # LINUX_VERSION which is a constant. | ||
25 | KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION', True) or ""}" | ||
26 | KERNEL_VERSION_NAME[vardepvalue] = "${LINUX_VERSION}" | ||
27 | KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION', True))}" | ||
28 | KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}" | ||
29 | |||
19 | python __anonymous () { | 30 | python __anonymous () { |
20 | import re | 31 | import re |
21 | 32 | ||
22 | kerneltype = d.getVar('KERNEL_IMAGETYPE', True) | 33 | # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES |
34 | type = d.getVar('KERNEL_IMAGETYPE', True) or "" | ||
35 | alttype = d.getVar('KERNEL_ALT_IMAGETYPE', True) or "" | ||
36 | types = d.getVar('KERNEL_IMAGETYPES', True) or "" | ||
37 | if type not in types.split(): | ||
38 | types = (type + ' ' + types).strip() | ||
39 | if alttype not in types.split(): | ||
40 | types = (alttype + ' ' + types).strip() | ||
41 | d.setVar('KERNEL_IMAGETYPES', types) | ||
42 | |||
43 | typeformake = re.sub(r'\.gz', '', types) | ||
44 | d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake) | ||
45 | |||
46 | for type in typeformake.split(): | ||
47 | typelower = type.lower() | ||
48 | |||
49 | d.appendVar('PACKAGES', ' ' + 'kernel-image-' + typelower) | ||
50 | |||
51 | d.setVar('FILES_kernel-image-' + typelower, '/boot/' + type + '*') | ||
52 | |||
53 | d.appendVar('RDEPENDS_kernel-image', ' ' + 'kernel-image-' + typelower) | ||
54 | |||
55 | d.setVar('PKG_kernel-image-' + typelower, 'kernel-image-' + typelower + '-${KERNEL_VERSION_PKG_NAME}') | ||
23 | 56 | ||
24 | d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", re.sub(r'\.gz$', '', kerneltype)) | 57 | d.setVar('ALLOW_EMPTY_kernel-image-' + typelower, '1') |
58 | |||
59 | imagedest = d.getVar('KERNEL_IMAGEDEST', True) | ||
60 | priority = d.getVar('KERNEL_PRIORITY', True) | ||
61 | postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n' | ||
62 | d.setVar('pkg_postinst_kernel-image-' + typelower, postinst) | ||
63 | |||
64 | postrm = '#!/bin/sh\n' + 'update-alternatives --remove' + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} || true' + '\n' | ||
65 | d.setVar('pkg_postrm_kernel-image-' + typelower, postrm) | ||
25 | 66 | ||
26 | image = d.getVar('INITRAMFS_IMAGE', True) | 67 | image = d.getVar('INITRAMFS_IMAGE', True) |
27 | if image: | 68 | if image: |
@@ -92,8 +133,8 @@ KERNEL_PRIORITY ?= "${@int(d.getVar('PV',1).split('-')[0].split('+')[0].split('. | |||
92 | 133 | ||
93 | KERNEL_RELEASE ?= "${KERNEL_VERSION}" | 134 | KERNEL_RELEASE ?= "${KERNEL_VERSION}" |
94 | 135 | ||
95 | # Where built kernel lies in the kernel tree | 136 | # The directory where built kernel lies in the kernel tree |
96 | KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}" | 137 | KERNEL_OUTPUT_DIR ?= "arch/${ARCH}/boot" |
97 | KERNEL_IMAGEDEST = "boot" | 138 | KERNEL_IMAGEDEST = "boot" |
98 | 139 | ||
99 | # | 140 | # |
@@ -162,23 +203,48 @@ copy_initramfs() { | |||
162 | echo "Finished copy of initramfs into ./usr" | 203 | echo "Finished copy of initramfs into ./usr" |
163 | } | 204 | } |
164 | 205 | ||
165 | INITRAMFS_BASE_NAME = "${KERNEL_IMAGETYPE}-initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}" | 206 | INITRAMFS_BASE_NAME = "initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}" |
166 | INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME" | 207 | INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME" |
167 | do_bundle_initramfs () { | 208 | do_bundle_initramfs () { |
168 | if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then | 209 | if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then |
169 | echo "Creating a kernel image with a bundled initramfs..." | 210 | echo "Creating a kernel image with a bundled initramfs..." |
170 | copy_initramfs | 211 | copy_initramfs |
171 | if [ -e ${KERNEL_OUTPUT} ] ; then | 212 | # Backing up kernel image relies on its type(regular file or symbolic link) |
172 | mv -f ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}.bak | 213 | tmp_path="" |
173 | fi | 214 | for type in ${KERNEL_IMAGETYPES} ; do |
215 | if [ -h ${KERNEL_OUTPUT_DIR}/$type ] ; then | ||
216 | linkpath=`readlink -n ${KERNEL_OUTPUT_DIR}/$type` | ||
217 | realpath=`readlink -fn ${KERNEL_OUTPUT_DIR}/$type` | ||
218 | mv -f $realpath $realpath.bak | ||
219 | tmp_path=$tmp_path" "$type"#"$linkpath"#"$realpath | ||
220 | elif [ -f ${KERNEL_OUTPUT_DIR}/$type ]; then | ||
221 | mv -f ${KERNEL_OUTPUT_DIR}/$type ${KERNEL_OUTPUT_DIR}/$type.bak | ||
222 | tmp_path=$tmp_path" "$type"##" | ||
223 | fi | ||
224 | done | ||
174 | use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio | 225 | use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio |
175 | kernel_do_compile | 226 | kernel_do_compile |
176 | mv -f ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}.initramfs | 227 | # Restoring kernel image |
177 | mv -f ${KERNEL_OUTPUT}.bak ${KERNEL_OUTPUT} | 228 | for tp in $tmp_path ; do |
229 | type=`echo $tp|cut -d "#" -f 1` | ||
230 | linkpath=`echo $tp|cut -d "#" -f 2` | ||
231 | realpath=`echo $tp|cut -d "#" -f 3` | ||
232 | if [ -n "$realpath" ]; then | ||
233 | mv -f $realpath $realpath.initramfs | ||
234 | mv -f $realpath.bak $realpath | ||
235 | cd ${B}/${KERNEL_OUTPUT_DIR} | ||
236 | ln -sf $linkpath.initramfs | ||
237 | else | ||
238 | mv -f ${KERNEL_OUTPUT_DIR}/$type ${KERNEL_OUTPUT_DIR}/$type.initramfs | ||
239 | mv -f ${KERNEL_OUTPUT_DIR}/$type.bak ${KERNEL_OUTPUT_DIR}/$type | ||
240 | fi | ||
241 | done | ||
178 | # Update install area | 242 | # Update install area |
179 | echo "There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT}.initramfs" | 243 | for type in ${KERNEL_IMAGETYPES} ; do |
180 | install -m 0644 ${B}/${KERNEL_OUTPUT}.initramfs ${D}/boot/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin | 244 | echo "There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT_DIR}/$type.initramfs" |
181 | echo "${B}/${KERNEL_OUTPUT}.initramfs" | 245 | install -m 0644 ${B}/${KERNEL_OUTPUT_DIR}/$type.initramfs ${D}/boot/$type-initramfs-${MACHINE}.bin |
246 | echo "${B}/${KERNEL_OUTPUT_DIR}/$type.initramfs" | ||
247 | done | ||
182 | fi | 248 | fi |
183 | } | 249 | } |
184 | 250 | ||
@@ -203,10 +269,15 @@ kernel_do_compile() { | |||
203 | copy_initramfs | 269 | copy_initramfs |
204 | use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio | 270 | use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio |
205 | fi | 271 | fi |
206 | oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd | 272 | for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do |
207 | if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then | 273 | oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd |
208 | gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}" | 274 | for type in ${KERNEL_IMAGETYPES} ; do |
209 | fi | 275 | if test "${typeformake}.gz" = "${type}"; then |
276 | gzip -9c < "${typeformake}" > "${KERNEL_OUTPUT_DIR}/${type}" | ||
277 | break; | ||
278 | fi | ||
279 | done | ||
280 | done | ||
210 | } | 281 | } |
211 | 282 | ||
212 | do_compile_kernelmodules() { | 283 | do_compile_kernelmodules() { |
@@ -247,7 +318,9 @@ kernel_do_install() { | |||
247 | # | 318 | # |
248 | install -d ${D}/${KERNEL_IMAGEDEST} | 319 | install -d ${D}/${KERNEL_IMAGEDEST} |
249 | install -d ${D}/boot | 320 | install -d ${D}/boot |
250 | install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} | 321 | for type in ${KERNEL_IMAGETYPES} ; do |
322 | install -m 0644 ${KERNEL_OUTPUT_DIR}/${type} ${D}/${KERNEL_IMAGEDEST}/${type}-${KERNEL_VERSION} | ||
323 | done | ||
251 | install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} | 324 | install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} |
252 | install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} | 325 | install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} |
253 | install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} | 326 | install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} |
@@ -375,12 +448,12 @@ EXPORT_FUNCTIONS do_compile do_install do_configure | |||
375 | PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-modules" | 448 | PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-modules" |
376 | FILES_${PN} = "" | 449 | FILES_${PN} = "" |
377 | FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin" | 450 | FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin" |
378 | FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*" | 451 | FILES_kernel-image = "" |
379 | FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build" | 452 | FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build" |
380 | FILES_kernel-vmlinux = "/boot/vmlinux*" | 453 | FILES_kernel-vmlinux = "/boot/vmlinux*" |
381 | FILES_kernel-modules = "" | 454 | FILES_kernel-modules = "" |
382 | RDEPENDS_kernel = "kernel-base" | 455 | RDEPENDS_kernel = "kernel-base" |
383 | # Allow machines to override this dependency if kernel image files are | 456 | # Allow machines to override this dependency if kernel image files are |
384 | # not wanted in images as standard | 457 | # not wanted in images as standard |
385 | RDEPENDS_kernel-base ?= "kernel-image" | 458 | RDEPENDS_kernel-base ?= "kernel-image" |
386 | PKG_kernel-image = "kernel-image-${@legitimize_package_name('${KERNEL_VERSION}')}" | 459 | PKG_kernel-image = "kernel-image-${@legitimize_package_name('${KERNEL_VERSION}')}" |
@@ -404,14 +477,6 @@ pkg_postinst_kernel-base () { | |||
404 | fi | 477 | fi |
405 | } | 478 | } |
406 | 479 | ||
407 | pkg_postinst_kernel-image () { | ||
408 | update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true | ||
409 | } | ||
410 | |||
411 | pkg_postrm_kernel-image () { | ||
412 | update-alternatives --remove ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true | ||
413 | } | ||
414 | |||
415 | PACKAGESPLITFUNCS_prepend = "split_kernel_packages " | 480 | PACKAGESPLITFUNCS_prepend = "split_kernel_packages " |
416 | 481 | ||
417 | python split_kernel_packages () { | 482 | python split_kernel_packages () { |
@@ -432,13 +497,13 @@ do_kernel_link_vmlinux() { | |||
432 | 497 | ||
433 | do_strip() { | 498 | do_strip() { |
434 | if [ -n "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}" ]; then | 499 | if [ -n "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}" ]; then |
435 | if [ "${KERNEL_IMAGETYPE}" != "vmlinux" ]; then | 500 | if ! (echo "${KERNEL_IMAGETYPES}" | grep -wq "vmlinux"); then |
436 | bbwarn "image type will not be stripped (not supported): ${KERNEL_IMAGETYPE}" | 501 | bbwarn "image type(s) will not be stripped (not supported): ${KERNEL_IMAGETYPES}" |
437 | return | 502 | return |
438 | fi | 503 | fi |
439 | 504 | ||
440 | cd ${B} | 505 | cd ${B} |
441 | headers=`"$CROSS_COMPILE"readelf -S ${KERNEL_OUTPUT} | \ | 506 | headers=`"$CROSS_COMPILE"readelf -S ${KERNEL_OUTPUT_DIR}/vmlinux | \ |
442 | grep "^ \{1,\}\[[0-9 ]\{1,\}\] [^ ]" | \ | 507 | grep "^ \{1,\}\[[0-9 ]\{1,\}\] [^ ]" | \ |
443 | sed "s/^ \{1,\}\[[0-9 ]\{1,\}\] //" | \ | 508 | sed "s/^ \{1,\}\[[0-9 ]\{1,\}\] //" | \ |
444 | gawk '{print $1}'` | 509 | gawk '{print $1}'` |
@@ -448,7 +513,7 @@ do_strip() { | |||
448 | bbwarn "Section not found: $str"; | 513 | bbwarn "Section not found: $str"; |
449 | fi | 514 | fi |
450 | 515 | ||
451 | "$CROSS_COMPILE"strip -s -R $str ${KERNEL_OUTPUT} | 516 | "$CROSS_COMPILE"strip -s -R $str ${KERNEL_OUTPUT_DIR}/vmlinux |
452 | }; done | 517 | }; done |
453 | 518 | ||
454 | bbnote "KERNEL_IMAGE_STRIP_EXTRA_SECTIONS is set, stripping sections:" \ | 519 | bbnote "KERNEL_IMAGE_STRIP_EXTRA_SECTIONS is set, stripping sections:" \ |
@@ -467,20 +532,22 @@ do_sizecheck() { | |||
467 | if [ -n "$invalid" ]; then | 532 | if [ -n "$invalid" ]; then |
468 | die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integerx (The unit is Kbytes)" | 533 | die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integerx (The unit is Kbytes)" |
469 | fi | 534 | fi |
470 | size=`du -ks ${B}/${KERNEL_OUTPUT} | awk '{ print $1}'` | 535 | for type in ${KERNEL_IMAGETYPES} ; do |
471 | if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then | 536 | size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$type | awk '{print $1}'` |
472 | die "This kernel (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device. Please reduce the size of the kernel by making more of it modular." | 537 | if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then |
473 | fi | 538 | warn "This kernel $type (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device. Please reduce the size of the kernel by making more of it modular." |
539 | fi | ||
540 | done | ||
474 | fi | 541 | fi |
475 | } | 542 | } |
476 | do_sizecheck[dirs] = "${B}" | 543 | do_sizecheck[dirs] = "${B}" |
477 | 544 | ||
478 | addtask sizecheck before do_install after do_strip | 545 | addtask sizecheck before do_install after do_strip |
479 | 546 | ||
480 | KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | 547 | KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" |
481 | # Don't include the DATETIME variable in the sstate package signatures | 548 | # Don't include the DATETIME variable in the sstate package signatures |
482 | KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME" | 549 | KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME" |
483 | KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}" | 550 | KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}" |
484 | MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | 551 | MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" |
485 | MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME" | 552 | MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME" |
486 | MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz" | 553 | MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz" |
@@ -489,28 +556,37 @@ MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz" | |||
489 | MODULE_TARBALL_DEPLOY ?= "1" | 556 | MODULE_TARBALL_DEPLOY ?= "1" |
490 | 557 | ||
491 | kernel_do_deploy() { | 558 | kernel_do_deploy() { |
492 | install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin | 559 | for type in ${KERNEL_IMAGETYPES} ; do |
560 | base_name=${type}-${KERNEL_IMAGE_BASE_NAME} | ||
561 | install -m 0644 ${KERNEL_OUTPUT_DIR}/${type} ${DEPLOYDIR}/${base_name}.bin | ||
562 | done | ||
493 | if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then | 563 | if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then |
494 | mkdir -p ${D}/lib | 564 | mkdir -p ${D}/lib |
495 | tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} lib | 565 | tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} lib |
496 | ln -sf ${MODULE_TARBALL_BASE_NAME} ${DEPLOYDIR}/${MODULE_TARBALL_SYMLINK_NAME} | 566 | ln -sf ${MODULE_TARBALL_BASE_NAME} ${DEPLOYDIR}/${MODULE_TARBALL_SYMLINK_NAME} |
497 | fi | 567 | fi |
498 | 568 | ||
499 | ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGE_SYMLINK_NAME}.bin | 569 | for type in ${KERNEL_IMAGETYPES} ; do |
500 | ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGETYPE} | 570 | base_name=${type}-${KERNEL_IMAGE_BASE_NAME} |
571 | symlink_name=${type}-${KERNEL_IMAGE_SYMLINK_NAME} | ||
572 | ln -sf ${base_name}.bin ${DEPLOYDIR}/${symlink_name}.bin | ||
573 | ln -sf ${base_name}.bin ${DEPLOYDIR}/${type} | ||
574 | done | ||
501 | 575 | ||
502 | cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt | 576 | cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt |
503 | 577 | ||
504 | cd ${B} | 578 | cd ${B} |
505 | # Update deploy directory | 579 | # Update deploy directory |
506 | if [ -e "${KERNEL_OUTPUT}.initramfs" ]; then | 580 | for type in ${KERNEL_IMAGETYPES} ; do |
507 | echo "Copying deploy kernel-initramfs image and setting up links..." | 581 | if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then |
508 | initramfs_base_name=${INITRAMFS_BASE_NAME} | 582 | echo "Copying deploy ${type} kernel-initramfs image and setting up links..." |
509 | initramfs_symlink_name=${KERNEL_IMAGETYPE}-initramfs-${MACHINE} | 583 | initramfs_base_name=${type}-${INITRAMFS_BASE_NAME} |
510 | install -m 0644 ${KERNEL_OUTPUT}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin | 584 | initramfs_symlink_name=${type}-initramfs-${MACHINE} |
511 | cd ${DEPLOYDIR} | 585 | install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin |
512 | ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin | 586 | cd ${DEPLOYDIR} |
513 | fi | 587 | ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin |
588 | fi | ||
589 | done | ||
514 | } | 590 | } |
515 | do_deploy[cleandirs] = "${DEPLOYDIR}" | 591 | do_deploy[cleandirs] = "${DEPLOYDIR}" |
516 | do_deploy[dirs] = "${DEPLOYDIR} ${B}" | 592 | do_deploy[dirs] = "${DEPLOYDIR} ${B}" |