1 inherit linux-kernel-base module_strip
3 PROVIDES += "virtual/kernel"
4 DEPENDS += "virtual/${TARGET_PREFIX}depmod-${@get_kernelmajorversion('${PV}')} virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
6 KERNEL_IMAGETYPE ?= "zImage"
8 # Add dependency on mkimage for kernels that build a uImage
10 python __anonymous () {
11 kerneltype = bb.data.getVar('KERNEL_IMAGETYPE', d, 1) or ''
12 if kerneltype == 'uImage':
13 depends = bb.data.getVar("DEPENDS", d, 1)
14 depends = "%s u-boot-mkimage-openmoko-native" % depends
15 bb.data.setVar("DEPENDS", depends, d)
17 image = bb.data.getVar('INITRAMFS_IMAGE', d, True)
18 if image != '' and image is not None:
19 bb.data.setVar('INITRAMFS_TASK', '${INITRAMFS_IMAGE}:do_rootfs', d)
21 machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
24 bb.data.setVar('PR', machine_kernel_pr, d)
32 PACKAGES_DYNAMIC += "kernel-module-*"
33 PACKAGES_DYNAMIC += "kernel-image-*"
34 PACKAGES_DYNAMIC += "kernel-firmware-*"
36 export OS = "${TARGET_OS}"
37 export CROSS_COMPILE = "${TARGET_PREFIX}"
39 KERNEL_PRIORITY = "${@bb.data.getVar('PV',d,1).split('-')[0].split('.')[-1]}"
41 KERNEL_RELEASE ?= "${KERNEL_VERSION}"
46 # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
47 # specific options necessary for building the kernel and modules.
48 #FIXME: should be this: TARGET_CC_KERNEL_ARCH ?= "${TARGET_CC_ARCH}"
49 TARGET_CC_KERNEL_ARCH ?= ""
50 HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
51 TARGET_LD_KERNEL_ARCH ?= ""
52 HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
54 KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}"
55 KERNEL_LD = "${LD}${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}"
57 # Where built kernel lies in the kernel tree
58 KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
59 KERNEL_IMAGEDEST = "boot"
64 export CMDLINE_CONSOLE = "console=${@bb.data.getVar("KERNEL_CONSOLE",d,1) or "ttyS0"}"
66 KERNEL_VERSION = "${@get_kernelversion('${S}')}"
67 KERNEL_MAJOR_VERSION = "${@get_kernelmajorversion('${KERNEL_VERSION}')}"
69 KERNEL_LOCALVERSION ?= ""
71 # kernels are generally machine specific
72 PACKAGE_ARCH = "${MACHINE_ARCH}"
75 UBOOT_ENTRYPOINT ?= "20008000"
76 UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
78 # For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE.
79 # We don't want to override kernel Makefile variables from the environment
83 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
84 oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}"
85 if [ "${KERNEL_MAJOR_VERSION}" != "2.6" ]; then
86 oe_runmake dep CC="${KERNEL_CC}" LD="${KERNEL_LD}"
88 oe_runmake ${KERNEL_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}"
89 if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
90 oe_runmake modules CC="${KERNEL_CC}" LD="${KERNEL_LD}"
92 oenote "no modules to compile"
95 kernel_do_compile[depends] = "${INITRAMFS_TASK}"
98 if [ -e include/asm ] ; then
99 # This link is generated only in kernel before 2.6.33-rc1, don't stage it for newer kernels
100 ASMDIR=`readlink include/asm`
102 mkdir -p ${STAGING_KERNEL_DIR}/include/$ASMDIR
103 cp -fR include/$ASMDIR/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/
105 # Kernel 2.6.27 moved headers from includes/asm-${ARCH} to arch/${ARCH}/include/asm
106 if [ -e arch/${ARCH}/include/asm/ ] ; then
107 if [ -e include/asm ] ; then
108 cp -fR arch/${ARCH}/include/asm/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/
110 install -d ${STAGING_KERNEL_DIR}/arch/${ARCH}/include
111 cp -fR arch/${ARCH}/* ${STAGING_KERNEL_DIR}/arch/${ARCH}/
113 # Check for arch/x86 on i386
114 elif [ -d arch/x86/include/asm/ ]; then
115 if [ -e include/asm ] ; then
116 cp -fR arch/x86/include/asm/* ${STAGING_KERNEL_DIR}/include/asm-x86/
118 install -d ${STAGING_KERNEL_DIR}/arch/x86/include
119 cp -fR arch/x86/* ${STAGING_KERNEL_DIR}/arch/x86/
122 if [ -e include/asm ] ; then
123 rm -f ${STAGING_KERNEL_DIR}/include/asm
124 ln -sf $ASMDIR ${STAGING_KERNEL_DIR}/include/asm
127 mkdir -p ${STAGING_KERNEL_DIR}/include/asm-generic
128 cp -fR include/asm-generic/* ${STAGING_KERNEL_DIR}/include/asm-generic/
130 for entry in drivers/crypto drivers/media include/generated include/linux include/net include/pcmcia include/media include/acpi include/sound include/video include/scsi include/trace; do
131 if [ -d $entry ]; then
132 mkdir -p ${STAGING_KERNEL_DIR}/$entry
133 cp -fR $entry/* ${STAGING_KERNEL_DIR}/$entry/
137 if [ -d drivers/sound ]; then
138 # 2.4 alsa needs some headers from this directory
139 mkdir -p ${STAGING_KERNEL_DIR}/include/drivers/sound
140 cp -fR drivers/sound/*.h ${STAGING_KERNEL_DIR}/include/drivers/sound/
143 install -m 0644 .config ${STAGING_KERNEL_DIR}/config-${KERNEL_VERSION}
144 ln -sf config-${KERNEL_VERSION} ${STAGING_KERNEL_DIR}/.config
145 ln -sf config-${KERNEL_VERSION} ${STAGING_KERNEL_DIR}/kernel-config
146 echo "${KERNEL_VERSION}" >${STAGING_KERNEL_DIR}/kernel-abiversion
147 echo "${S}" >${STAGING_KERNEL_DIR}/kernel-source
148 echo "${KERNEL_CCSUFFIX}" >${STAGING_KERNEL_DIR}/kernel-ccsuffix
149 echo "${KERNEL_LDSUFFIX}" >${STAGING_KERNEL_DIR}/kernel-ldsuffix
150 [ -e Rules.make ] && install -m 0644 Rules.make ${STAGING_KERNEL_DIR}/
151 [ -e Makefile ] && install -m 0644 Makefile ${STAGING_KERNEL_DIR}/
153 # Check if arch/${ARCH}/Makefile exists and install it
154 if [ -e arch/${ARCH}/Makefile ]; then
155 install -d ${STAGING_KERNEL_DIR}/arch/${ARCH}
156 install -m 0644 arch/${ARCH}/Makefile* ${STAGING_KERNEL_DIR}/arch/${ARCH}
157 # Otherwise check arch/x86/Makefile for i386 and x86_64 on kernels >= 2.6.24
158 elif [ -e arch/x86/Makefile ]; then
159 install -d ${STAGING_KERNEL_DIR}/arch/x86
160 install -m 0644 arch/x86/Makefile* ${STAGING_KERNEL_DIR}/arch/x86
162 cp -fR include/config* ${STAGING_KERNEL_DIR}/include/
163 # Install kernel images and system.map to staging
164 [ -e vmlinux ] && install -m 0644 vmlinux ${STAGING_KERNEL_DIR}/
165 install -m 0644 ${KERNEL_OUTPUT} ${STAGING_KERNEL_DIR}/${KERNEL_IMAGETYPE}
166 install -m 0644 System.map ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION}
167 [ -e Module.symvers ] && install -m 0644 Module.symvers ${STAGING_KERNEL_DIR}/
169 cp -fR scripts ${STAGING_KERNEL_DIR}/
172 kernel_do_install() {
173 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
174 if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
175 oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
177 oenote "no modules to install"
180 install -d ${D}/${KERNEL_IMAGEDEST}
182 install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
183 install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
184 install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
185 install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
186 [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION}
187 install -d ${D}/etc/modutils
188 if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then
189 install -d ${D}/etc/modprobe.d
192 # Check if scripts/genksyms exists and if so, build it
193 if [ -e scripts/genksyms/ ]; then
194 oe_runmake SUBDIRS="scripts/genksyms"
197 install -d ${STAGING_KERNEL_DIR}
198 cp -fR scripts ${STAGING_KERNEL_DIR}/
201 kernel_do_configure() {
202 yes '' | oe_runmake oldconfig
203 if [ ! -z "${INITRAMFS_IMAGE}" ]; then
204 for img in cpio.gz cpio.lzo cpio.lzma; do
205 if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" ]; then
206 cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" initramfs.$img
213 export TERMWINDOWTITLE="${PN} Kernel Configuration"
214 export SHELLCMDS="make menuconfig"
216 if [ $? -ne 0 ]; then
217 echo "Fatal: '${TERMCMD}' not found. Check TERMCMD variable."
221 do_menuconfig[nostamp] = "1"
222 addtask menuconfig after do_configure
224 pkg_postinst_kernel () {
225 cd /${KERNEL_IMAGEDEST}; update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true
228 pkg_postrm_kernel () {
229 cd /${KERNEL_IMAGEDEST}; update-alternatives --remove ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true
234 EXPORT_FUNCTIONS do_compile do_install do_stage do_configure
236 # kernel-base becomes kernel-${KERNEL_VERSION}
237 # kernel-image becomes kernel-image-${KERNEL_VERISON}
238 PACKAGES = "kernel kernel-base kernel-image kernel-dev kernel-vmlinux"
240 FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
241 FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
242 FILES_kernel-vmlinux = "/boot/vmlinux*"
243 RDEPENDS_kernel = "kernel-base"
244 RRECOMMENDS_kernel-module-hostap-cs += '${@base_version_less_or_equal("KERNEL_VERSION", "2.6.17", "", "apm-wifi-suspendfix", d)}'
245 RRECOMMENDS_kernel-module-orinoco-cs += '${@base_version_less_or_equal("KERNEL_VERSION", "2.6.17", "", "apm-wifi-suspendfix", d)}'
246 # Allow machines to override this dependency if kernel image files are
247 # not wanted in images as standard
248 RDEPENDS_kernel-base ?= "kernel-image"
249 PKG_kernel-image = "kernel-image-${KERNEL_VERSION}"
250 PKG_kernel-base = "kernel-${KERNEL_VERSION}"
251 ALLOW_EMPTY_kernel = "1"
252 ALLOW_EMPTY_kernel-base = "1"
253 ALLOW_EMPTY_kernel-image = "1"
255 # Userspace workarounds for kernel modules issues
256 # This is shame, fix the kernel instead!
257 DEPENDS_kernel-module-dtl1-cs = "bluez-dtl1-workaround"
258 RDEPENDS_kernel-module-dtl1-cs = "bluez-dtl1-workaround"
261 RPROVIDES_kernel-module-aes-generic = "kernel-module-aes"
263 pkg_postinst_kernel-image () {
264 if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then
265 mkdir -p $D/lib/modules/${KERNEL_VERSION}
268 ${HOST_PREFIX}depmod-${KERNEL_MAJOR_VERSION} -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
270 depmod -a ${KERNEL_VERSION}
274 pkg_postinst_modules () {
276 ${HOST_PREFIX}depmod-${KERNEL_MAJOR_VERSION} -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
278 depmod -a ${KERNEL_VERSION}
279 update-modules || true
283 pkg_postrm_modules () {
284 update-modules || true
287 autoload_postinst_fragment() {
288 if [ x"$D" = "x" ]; then
293 # autoload defaults (alphabetically sorted)
294 module_autoload_hidp = "hidp"
295 module_autoload_ipv6 = "ipv6"
296 module_autoload_ipsec = "ipsec"
297 module_autoload_ircomm-tty = "ircomm-tty"
298 module_autoload_rfcomm = "rfcomm"
299 module_autoload_sa1100-rtc = "sa1100-rtc"
300 # sa1100-rtc was renamed in 2.6.23 onwards
301 module_autoload_rtc-sa1100 = "rtc-sa1100"
303 # alias defaults (alphabetically sorted)
304 module_conf_af_packet = "alias net-pf-17 af_packet"
305 module_conf_bluez = "alias net-pf-31 bluez"
306 module_conf_bnep = "alias bt-proto-4 bnep"
307 module_conf_hci_uart = "alias tty-ldisc-15 hci_uart"
308 module_conf_l2cap = "alias bt-proto-0 l2cap"
309 module_conf_sco = "alias bt-proto-2 sco"
310 module_conf_rfcomm = "alias bt-proto-3 rfcomm"
312 python populate_packages_prepend () {
314 def extract_modinfo(file):
316 tempfile.tempdir = bb.data.getVar("WORKDIR", d, 1)
317 tf = tempfile.mkstemp()
319 cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (bb.data.getVar("PATH", d, 1), bb.data.getVar("HOST_PREFIX", d, 1) or "", file, tmpfile)
322 l = f.read().split("\000")
326 exp = re.compile("([^=]+)=(.*)")
332 vals[m.group(1)] = m.group(2)
338 dvar = bb.data.getVar('PKGD', d, 1)
340 bb.error("D not defined")
343 kernelver = bb.data.getVar('KERNEL_VERSION', d, 1)
344 kernelver_stripped = kernelver
345 m = re.match('^(.*-hh.*)[\.\+].*$', kernelver)
347 kernelver_stripped = m.group(1)
348 path = bb.data.getVar("PATH", d, 1)
349 host_prefix = bb.data.getVar("HOST_PREFIX", d, 1) or ""
350 major_version = bb.data.getVar('KERNEL_MAJOR_VERSION', d, 1)
352 cmd = "PATH=\"%s\" %sdepmod-%s -n -a -r -b %s -F %s/boot/System.map-%s %s" % (path, host_prefix, major_version, dvar, dvar, kernelver, kernelver_stripped)
353 f = os.popen(cmd, 'r')
356 pattern0 = "^(.*\.k?o):..*$"
357 pattern1 = "^(.*\.k?o):\s*(.*\.k?o)\s*$"
358 pattern2 = "^(.*\.k?o):\s*(.*\.k?o)\s*\\\$"
359 pattern3 = "^\t(.*\.k?o)\s*\\\$"
360 pattern4 = "^\t(.*\.k?o)\s*$"
364 if not re.match(pattern0, line):
367 m1 = re.match(pattern1, line)
369 deps[m1.group(1)] = m1.group(2).split()
371 m2 = re.match(pattern2, line)
373 deps[m2.group(1)] = m2.group(2).split()
375 m3 = re.match(pattern3, line)
377 deps[m2.group(1)].extend(m3.group(1).split())
379 m3 = re.match(pattern3, line)
380 m4 = re.match(pattern4, line)
381 deps[m2.group(1)].extend(m4.group(1).split())
386 def get_dependencies(file, pattern, format):
387 file = file.replace(bb.data.getVar('PKGD', d, 1) or '', '', 1)
389 if module_deps.has_key(file):
392 for i in module_deps[file]:
393 m = re.match(pattern, os.path.basename(i))
396 on = legitimize_package_name(m.group(1))
397 dependency_pkg = format % on
398 dependencies.append(dependency_pkg)
402 def frob_metadata(file, pkg, pattern, format, basename):
404 vals = extract_modinfo(file)
406 dvar = bb.data.getVar('PKGD', d, 1)
408 # If autoloading is requested, output /etc/modutils/<name> and append
409 # appropriate modprobe commands to the postinst
410 autoload = bb.data.getVar('module_autoload_%s' % basename, d, 1)
412 # Also, try canonical name with dashes
413 autoload = bb.data.getVar('module_autoload_%s' % basename.replace('_', '-'), d, 1)
415 name = '%s/etc/modutils/%s' % (dvar, basename)
417 for m in autoload.split():
420 postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1)
422 bb.fatal("pkg_postinst_%s not defined" % pkg)
423 postinst += bb.data.getVar('autoload_postinst_fragment', d, 1) % autoload
424 bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
426 # Write out any modconf fragment
427 modconf = bb.data.getVar('module_conf_%s' % basename, d, 1)
429 if bb.data.getVar("KERNEL_MAJOR_VERSION", d, 1) == "2.6":
430 name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename)
432 name = '%s/etc/modutils/%s.conf' % (dvar, basename)
434 f.write("%s\n" % modconf)
437 files = bb.data.getVar('FILES_%s' % pkg, d, 1)
438 files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename)
439 bb.data.setVar('FILES_%s' % pkg, files, d)
441 if vals.has_key("description"):
442 old_desc = bb.data.getVar('DESCRIPTION_' + pkg, d, 1) or ""
443 bb.data.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"], d)
445 rdepends_str = bb.data.getVar('RDEPENDS_' + pkg, d, 1)
447 rdepends = rdepends_str.split()
450 rdepends.extend(get_dependencies(file, pattern, format))
451 bb.data.setVar('RDEPENDS_' + pkg, ' '.join(rdepends), d)
453 module_deps = parse_depmod()
454 module_regex = '^(.*)\.k?o$'
455 module_pattern = 'kernel-module-%s'
457 postinst = bb.data.getVar('pkg_postinst_modules', d, 1)
458 postrm = bb.data.getVar('pkg_postrm_modules', d, 1)
460 maybe_update_modules = "update-modules "
461 if bb.data.getVar("ONLINE_PACKAGE_MANAGEMENT", d) == "none":
462 maybe_update_modules = ""
464 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
465 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
466 do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='%skernel-%s' % (maybe_update_modules, bb.data.getVar("KERNEL_VERSION", d, 1)))
469 metapkg = "kernel-modules"
470 bb.data.setVar('ALLOW_EMPTY_' + metapkg, "1", d)
471 bb.data.setVar('FILES_' + metapkg, "", d)
472 blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux' ]
473 for l in module_deps.values():
475 pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))
476 blacklist.append(pkg)
477 metapkg_rdepends = []
478 packages = bb.data.getVar('PACKAGES', d, 1).split()
479 for pkg in packages[1:]:
480 if not pkg in blacklist and not pkg in metapkg_rdepends:
481 metapkg_rdepends.append(pkg)
482 bb.data.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends), d)
483 bb.data.setVar('DESCRIPTION_' + metapkg, 'Kernel modules meta package', d)
484 packages.append(metapkg)
485 bb.data.setVar('PACKAGES', ' '.join(packages), d)
488 # Support checking the kernel size since some kernels need to reside in partitions
489 # with a fixed length or there is a limit in transferring the kernel to memory
491 if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
492 size=`ls -l ${KERNEL_OUTPUT} | awk '{ print $5}'`
493 if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
495 die "This kernel (size=$size > ${KERNEL_IMAGE_MAXSIZE}) is too big for your device. Please reduce the size of the kernel by making more of it modular."
500 addtask sizecheck before do_install after do_compile
503 if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
504 ENTRYPOINT=${UBOOT_ENTRYPOINT}
505 if test -n "${UBOOT_ENTRYSYMBOL}"; then
506 ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
507 awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
509 if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
510 ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
511 uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C none -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage
514 ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
517 uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C gzip -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz arch/${ARCH}/boot/uImage
523 addtask uboot_mkimage before do_install after do_compile
525 KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}"
526 KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
527 MODULES_IMAGE_BASE_NAME ?= modules-${PV}-${PR}-${MACHINE}
530 install -d ${DEPLOY_DIR_IMAGE}
531 install -m 0644 ${KERNEL_OUTPUT} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
532 package_stagefile_shell ${S}/${KERNEL_OUTPUT}
533 package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
535 if [ -d "${PKGD}/lib" ]; then
536 fakeroot tar -cvzf ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}.tgz -C ${PKGD} lib
537 package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}.tgz
540 cd ${DEPLOY_DIR_IMAGE}
541 rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
542 ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
543 package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_SYMLINK_NAME}.bin
546 do_deploy[dirs] = "${S}"
547 do_deploy[depends] += "fakeroot-native:do_populate_staging"
549 addtask deploy before do_build after do_package