All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality
@ 2012-07-16 17:38 Khem Raj
  2012-07-16 17:38 ` [RFC][meta-oe][PATCH 2/3] testlab.bbclass: Delete Khem Raj
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Khem Raj @ 2012-07-16 17:38 UTC (permalink / raw)
  To: openembedded-devel

Diffing with the OE-Core's kernel.bbclass only difference is setting of
machine kernel pr. So lets convert it to a separate class which provides
the added functionality and let everyone use kernel.bbclass from kernel

It needs the dependent layers to inherit this class in addition to
kernel.bbclass

It leaves up with one less conflict with OE-Core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-oe/classes/kernel.bbclass            |  559 -----------------------------
 meta-oe/classes/machine_kernel_pr.bbclass |    7 +
 2 files changed, 7 insertions(+), 559 deletions(-)
 delete mode 100644 meta-oe/classes/kernel.bbclass
 create mode 100644 meta-oe/classes/machine_kernel_pr.bbclass

diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
deleted file mode 100644
index b30ed36..0000000
--- a/meta-oe/classes/kernel.bbclass
+++ /dev/null
@@ -1,559 +0,0 @@
-inherit linux-kernel-base module_strip
-
-PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
-
-# we include gcc above, we dont need virtual/libc
-INHIBIT_DEFAULT_DEPS = "1"
-
-KERNEL_IMAGETYPE ?= "zImage"
-INITRAMFS_IMAGE ?= ""
-INITRAMFS_TASK ?= ""
-
-python __anonymous () {
-    kerneltype = d.getVar('KERNEL_IMAGETYPE', True) or ''
-    if kerneltype == 'uImage':
-        depends = d.getVar("DEPENDS", True)
-        depends = "%s u-boot-mkimage-native" % depends
-        d.setVar("DEPENDS", depends)
-
-    image = d.getVar('INITRAMFS_IMAGE', True)
-    if image:
-        d.setVar('INITRAMFS_TASK', '${INITRAMFS_IMAGE}:do_rootfs')
-
-    machine_kernel_pr = d.getVar('MACHINE_KERNEL_PR', True)
-
-    if machine_kernel_pr:
-        d.setVar('PR', machine_kernel_pr)
-}
-
-inherit kernel-arch deploy
-
-PACKAGES_DYNAMIC += "kernel-module-*"
-PACKAGES_DYNAMIC += "kernel-image-*"
-PACKAGES_DYNAMIC += "kernel-firmware-*"
-
-export OS = "${TARGET_OS}"
-export CROSS_COMPILE = "${TARGET_PREFIX}"
-
-KERNEL_PRIORITY ?= "${@int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[0]) * 10000 + \
-                       int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[1]) * 100 + \
-                       int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[-1])}"
-
-KERNEL_RELEASE ?= "${KERNEL_VERSION}"
-
-KERNEL_CCSUFFIX ?= ""
-KERNEL_LDSUFFIX ?= ""
-
-# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
-# specific options necessary for building the kernel and modules.
-#FIXME: should be this: TARGET_CC_KERNEL_ARCH ?= "${TARGET_CC_ARCH}"
-TARGET_CC_KERNEL_ARCH ?= ""
-HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
-TARGET_LD_KERNEL_ARCH ?= ""
-HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
-
-KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}"
-KERNEL_LD = "${HOST_PREFIX}ld${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}"
-
-# Where built kernel lies in the kernel tree
-KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
-KERNEL_IMAGEDEST = "boot"
-
-#
-# configuration
-#
-export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE",1) or "ttyS0"}"
-
-KERNEL_VERSION = "${@get_kernelversion('${B}')}"
-
-KERNEL_LOCALVERSION ?= ""
-
-# kernels are generally machine specific
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-# U-Boot support
-UBOOT_ENTRYPOINT ?= "20008000"
-UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
-
-# For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE.
-# We don't want to override kernel Makefile variables from the environment
-EXTRA_OEMAKE = ""
-
-KERNEL_ALT_IMAGETYPE ??= ""
-
-KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
-
-kernel_do_compile() {
-	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
-	oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}"
-	oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}"
-	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
-		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
-	fi
-}
-
-do_compile_kernelmodules() {
-	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
-	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-		oe_runmake ${PARALLEL_MAKE} modules CC="${KERNEL_CC}" LD="${KERNEL_LD}"
-	else
-		bbnote "no modules to compile"
-	fi
-}
-addtask compile_kernelmodules after do_compile before do_install
-
-kernel_do_install() {
-	#
-	# First install the modules
-	#
-	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
-	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-		oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
-		rm -f "${D}/lib/modules/${KERNEL_VERSION}/modules.order"
-		rm -f "${D}/lib/modules/${KERNEL_VERSION}/modules.builtin"
-		rm "${D}/lib/modules/${KERNEL_VERSION}/build"
-		rm "${D}/lib/modules/${KERNEL_VERSION}/source"
-	else
-		bbnote "no modules to install"
-	fi
-
-	#
-	# Install various kernel output (zImage, map file, config, module support files)
-	#
-	install -d ${D}/${KERNEL_IMAGEDEST}
-	install -d ${D}/boot
-	install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
-	install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
-	install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
-	install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
-	[ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION}
-	install -d ${D}/etc/modules-load.d
-	install -d ${D}/etc/modprobe.d
-
-	#
-	# Support for external module building - create a minimal copy of the
-	# kernel source tree.
-	#
-	kerneldir=${D}/kernel
-	install -d $kerneldir
-
-	#
-	# Store the kernel version in sysroots for module-base.bbclass
-	#
-
-	echo "${KERNEL_VERSION}" > $kerneldir/kernel-abiversion
-
-	#
-	# Store kernel image name to allow use during image generation
-	#
-
-	echo "${KERNEL_IMAGE_BASE_NAME}" >$kerneldir/kernel-image-name
-
-	#
-	# Copy the entire source tree. In case an external build directory is
-	# used, copy the build directory over first, then copy over the source
-	# dir. This ensures the original Makefiles are used and not the
-	# redirecting Makefiles in the build directory.
-	#
-	# work and sysroots can be on different partitions, so we can't rely on
-	# hardlinking, unfortunately.
-	#
-	cp -fR * $kerneldir
-	cp .config $kerneldir
-	if [ "${S}" != "${B}" ]; then
-		cp -fR ${S}/* $kerneldir
-	fi
-	install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE}
-	install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION}
-
-	#
-	# Clean and remove files not needed for building modules.
-	# Some distributions go through a lot more trouble to strip out
-	# unecessary headers, for now, we just prune the obvious bits.
-	#
-	# We don't want to leave host-arch binaries in /sysroots, so
-	# we clean the scripts dir while leaving the generated config
-	# and include files.
-	#
-	oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
-	make -C $kerneldir _mrproper_scripts
-	find $kerneldir -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
-	find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
-
-	# As of Linux kernel version 3.0.1, the clean target removes
-	# arch/powerpc/lib/crtsavres.o which is present in
-	# KBUILD_LDFLAGS_MODULE, making it required to build external modules.
-	if [ ${ARCH} = "powerpc" ]; then
-		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
-	fi
-
-	# Remove the following binaries which cause strip errors
-	# during do_package for cross-compiled platforms
-	bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
-	           arch/powerpc/boot/mktree"
-	for entry in $bin_files; do
-		rm -f $kerneldir/$entry
-	done
-}
-
-PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
-
-kernel_package_preprocess () {
-	rm -rf ${PKGD}/kernel
-}
-
-sysroot_stage_all_append() {
-	sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
-}
-
-kernel_do_configure() {
-	# fixes extra + in /lib/modules/2.6.37+
-	# $ scripts/setlocalversion . => +
-	# $ make kernelversion => 2.6.37
-	# $ make kernelrelease => 2.6.37+
-	touch ${B}/.scmversion ${S}/.scmversion
-
-	# Copy defconfig to .config if .config does not exist. This allows
-	# recipes to manage the .config themselves in do_configure_prepend().
-	if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
-		cp "${WORKDIR}/defconfig" "${B}/.config"
-	fi
-	yes '' | oe_runmake oldconfig
-
-	if [ ! -z "${INITRAMFS_IMAGE}" ]; then
-		for img in cpio.gz cpio.lzo cpio.lzma cpio.xz; do
-		if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" ]; then
-			cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" initramfs.$img
-		fi
-		done
-	fi
-}
-
-do_configure[depends] += "${INITRAMFS_TASK}"
-
-do_savedefconfig() {
-	oe_runmake savedefconfig
-}
-do_savedefconfig[nostamp] = "1"
-addtask savedefconfig after do_configure
-
-pkg_postinst_kernel-base () {
-	cd /${KERNEL_IMAGEDEST}; update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true
-}
-
-pkg_postrm_kernel-base () {
-	cd /${KERNEL_IMAGEDEST}; update-alternatives --remove ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true
-}
-
-inherit cml1
-
-EXPORT_FUNCTIONS do_compile do_install do_configure
-
-# kernel-base becomes kernel-${KERNEL_VERSION}
-# kernel-image becomes kernel-image-${KERNEL_VERISON}
-PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-misc"
-FILES = ""
-FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
-FILES_kernel-vmlinux = "/boot/vmlinux*"
-# misc is a package to contain files we need in staging
-FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media"
-RDEPENDS_kernel = "kernel-base"
-# Allow machines to override this dependency if kernel image files are 
-# not wanted in images as standard
-RDEPENDS_kernel-base ?= "kernel-image"
-PKG_kernel-image = "kernel-image-${@legitimize_package_name('${KERNEL_VERSION}')}"
-PKG_kernel-base = "kernel-${@legitimize_package_name('${KERNEL_VERSION}')}"
-ALLOW_EMPTY_kernel = "1"
-ALLOW_EMPTY_kernel-base = "1"
-ALLOW_EMPTY_kernel-image = "1"
-
-pkg_postinst_kernel-image () {
-if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then
-	mkdir -p $D/lib/modules/${KERNEL_VERSION}
-fi
-if [ -n "$D" ]; then
-	depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
-else
-	depmod -a ${KERNEL_VERSION}
-fi
-}
-
-pkg_postinst_modules () {
-if [ -z "$D" ]; then
-	depmod -a ${KERNEL_VERSION}
-	update-modules || true
-fi
-}
-
-pkg_postrm_modules () {
-update-modules || true
-}
-
-autoload_postinst_fragment() {
-if [ x"$D" = "x" ]; then
-	modprobe %s || true
-fi
-}
-
-# autoload defaults (alphabetically sorted)
-module_autoload_hidp = "hidp"
-module_autoload_ipv6 = "ipv6"
-module_autoload_ipsec = "ipsec"
-module_autoload_ircomm-tty = "ircomm-tty"
-module_autoload_rfcomm = "rfcomm"
-module_autoload_sa1100-rtc = "sa1100-rtc"
-# sa1100-rtc was renamed in 2.6.23 onwards
-module_autoload_rtc-sa1100 = "rtc-sa1100"
-
-# alias defaults (alphabetically sorted)
-module_conf_af_packet = "alias net-pf-17 af_packet"
-module_conf_bluez = "alias net-pf-31 bluez"
-module_conf_bnep = "alias bt-proto-4 bnep"
-module_conf_hci_uart = "alias tty-ldisc-15 hci_uart"
-module_conf_l2cap = "alias bt-proto-0 l2cap"
-module_conf_sco = "alias bt-proto-2 sco"
-module_conf_rfcomm = "alias bt-proto-3 rfcomm"
-
-python populate_packages_prepend () {
-	def extract_modinfo(file):
-		import tempfile, re
-		tempfile.tempdir = d.getVar("WORKDIR", True)
-		tf = tempfile.mkstemp()
-		tmpfile = tf[1]
-		cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("PATH", True), d.getVar("HOST_PREFIX", True) or "", file, tmpfile)
-		os.system(cmd)
-		f = open(tmpfile)
-		l = f.read().split("\000")
-		f.close()
-		os.close(tf[0])
-		os.unlink(tmpfile)
-		exp = re.compile("([^=]+)=(.*)")
-		vals = {}
-		for i in l:
-			m = exp.match(i)
-			if not m:
-				continue
-			vals[m.group(1)] = m.group(2)
-		return vals
-	
-	def parse_depmod():
-		import re
-
-		dvar = d.getVar('PKGD', True)
-		if not dvar:
-			bb.error("PKGD not defined")
-			return
-
-		kernelver = d.getVar('KERNEL_VERSION', True)
-		kernelver_stripped = kernelver
-		m = re.match('^(.*-hh.*)[\.\+].*$', kernelver)
-		if m:
-			kernelver_stripped = m.group(1)
-		path = d.getVar("PATH", True)
-
-		cmd = "PATH=\"%s\" depmod -n -a -b %s -F %s/boot/System.map-%s %s" % (path, dvar, dvar, kernelver, kernelver_stripped)
-		f = os.popen(cmd, 'r')
-
-		deps = {}
-		pattern0 = "^(.*\.k?o):..*$"
-		pattern1 = "^(.*\.k?o):\s*(.*\.k?o)\s*$"
-		pattern2 = "^(.*\.k?o):\s*(.*\.k?o)\s*\\\$"
-		pattern3 = "^\t(.*\.k?o)\s*\\\$"
-		pattern4 = "^\t(.*\.k?o)\s*$"
-
-		line = f.readline()
-		while line:
-			if not re.match(pattern0, line):
-				line = f.readline()
-				continue
-			m1 = re.match(pattern1, line)
-			if m1:
-				deps[m1.group(1)] = m1.group(2).split()
-			else:
-				m2 = re.match(pattern2, line)
-				if m2:
-					deps[m2.group(1)] = m2.group(2).split()
-					line = f.readline()
-					m3 = re.match(pattern3, line)
-					while m3:
-						deps[m2.group(1)].extend(m3.group(1).split())
-						line = f.readline()
-						m3 = re.match(pattern3, line)
-					m4 = re.match(pattern4, line)
-					deps[m2.group(1)].extend(m4.group(1).split())
-			line = f.readline()
-		f.close()
-		return deps
-	
-	def get_dependencies(file, pattern, format):
-		# file no longer includes PKGD
-		file = file.replace(d.getVar('PKGD', True) or '', '', 1)
-		# instead is prefixed with /lib/modules/${KERNEL_VERSION}
-		file = file.replace("/lib/modules/%s/" % d.getVar('KERNEL_VERSION', True) or '', '', 1)
-
-		if module_deps.has_key(file):
-			import re
-			dependencies = []
-			for i in module_deps[file]:
-				m = re.match(pattern, os.path.basename(i))
-				if not m:
-					continue
-				on = legitimize_package_name(m.group(1))
-				dependency_pkg = format % on
-				dependencies.append(dependency_pkg)
-			return dependencies
-		return []
-
-	def frob_metadata(file, pkg, pattern, format, basename):
-		import re
-		vals = extract_modinfo(file)
-
-		dvar = d.getVar('PKGD', True)
-
-		# If autoloading is requested, output /etc/modules-load.d/<name>.conf and append
-		# appropriate modprobe commands to the postinst
-		autoload = d.getVar('module_autoload_%s' % basename, True)
-		if autoload:
-			name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename)
-			f = open(name, 'w')
-			for m in autoload.split():
-				f.write('%s\n' % m)
-			f.close()
-			postinst = d.getVar('pkg_postinst_%s' % pkg, True)
-			if not postinst:
-				bb.fatal("pkg_postinst_%s not defined" % pkg)
-			postinst += d.getVar('autoload_postinst_fragment', True) % autoload
-			d.setVar('pkg_postinst_%s' % pkg, postinst)
-
-		# Write out any modconf fragment
-		modconf = d.getVar('module_conf_%s' % basename, True)
-		if modconf:
-			name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename)
-			f = open(name, 'w')
-			f.write("%s\n" % modconf)
-			f.close()
-
-		files = d.getVar('FILES_%s' % pkg, True)
-		files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename)
-		d.setVar('FILES_%s' % pkg, files)
-
-		if vals.has_key("description"):
-			old_desc = d.getVar('DESCRIPTION_' + pkg, True) or ""
-			d.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"])
-
-		rdepends_str = d.getVar('RDEPENDS_' + pkg, True)
-		if rdepends_str:
-			rdepends = rdepends_str.split()
-		else:
-			rdepends = []
-		rdepends.extend(get_dependencies(file, pattern, format))
-		d.setVar('RDEPENDS_' + pkg, ' '.join(rdepends))
-
-	module_deps = parse_depmod()
-	module_regex = '^(.*)\.k?o$'
-	module_pattern = 'kernel-module-%s'
-
-	postinst = d.getVar('pkg_postinst_modules', True)
-	postrm = d.getVar('pkg_postrm_modules', True)
-	do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
-	do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
-	do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
-	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='update-modules kernel-%s' % d.getVar("KERNEL_VERSION", True))
-
-	# If modules-load.d and modprobe.d are empty at this point, remove them to
-	# avoid warnings. removedirs only raises an OSError if an empty
-	# directory cannot be removed.
-	dvar = d.getVar('PKGD', True)
-	for dir in ["%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar), "%s/etc" % (dvar)]:
-		if len(os.listdir(dir)) == 0:
-			os.rmdir(dir)
-
-	import re
-	metapkg = "kernel-modules"
-	d.setVar('ALLOW_EMPTY_' + metapkg, "1")
-	d.setVar('FILES_' + metapkg, "")
-	blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'perf', 'perf-dbg', 'kernel-misc' ]
-	for l in module_deps.values():
-		for i in l:
-			pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))
-			blacklist.append(pkg)
-	metapkg_rdepends = []
-	packages = d.getVar('PACKAGES', True).split()
-	for pkg in packages[1:]:
-		if not pkg in blacklist and not pkg in metapkg_rdepends:
-			metapkg_rdepends.append(pkg)
-	d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
-	d.setVar('DESCRIPTION_' + metapkg, 'Kernel modules meta package')
-	packages.append(metapkg)
-	d.setVar('PACKAGES', ' '.join(packages))
-}
-
-# Support checking the kernel size since some kernels need to reside in partitions
-# with a fixed length or there is a limit in transferring the kernel to memory
-do_sizecheck() {
-	if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
-		size=`ls -l ${KERNEL_OUTPUT} | awk '{ print $5}'`
-		if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
-			rm ${KERNEL_OUTPUT}
-			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."
-		fi
-	fi
-}
-
-addtask sizecheck before do_install after do_compile
-
-KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
-# Don't include the DATETIME variable in the sstate package signatures
-KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
-KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
-
-do_uboot_mkimage() {
-	if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then 
-		if test "x${KEEPUIMAGE}" = "x" ; then
-			ENTRYPOINT=${UBOOT_ENTRYPOINT}
-			if test -n "${UBOOT_ENTRYSYMBOL}"; then
-				ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
-					awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
-			fi
-			if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
-				${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
-				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
-				rm -f linux.bin
-			else
-				${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
-				rm -f linux.bin.gz
-				gzip -9 linux.bin
-				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
-				rm -f linux.bin.gz
-			fi
-		fi
-	fi
-}
-
-addtask uboot_mkimage before do_install after do_compile
-
-kernel_do_deploy() {
-	install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
-	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-		tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_VERSION}-${PR}-${MACHINE}.tgz -C ${D} lib
-	fi
-
-	cd ${DEPLOYDIR}
-	rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
-	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
-
-	cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
-}
-do_deploy[dirs] = "${DEPLOYDIR} ${B}"
-
-addtask deploy before do_build after do_install
-
-EXPORT_FUNCTIONS do_deploy
-
-# perf must be enabled in individual kernel recipes
-PACKAGES =+ "perf-dbg perf"
-FILES_perf = "${bindir}/* \
-              ${libexecdir}"
-FILES_perf-dbg = "${FILES_${PN}-dbg}"
diff --git a/meta-oe/classes/machine_kernel_pr.bbclass b/meta-oe/classes/machine_kernel_pr.bbclass
new file mode 100644
index 0000000..7f03af5
--- /dev/null
+++ b/meta-oe/classes/machine_kernel_pr.bbclass
@@ -0,0 +1,7 @@
+python __anonymous () {
+
+    machine_kernel_pr = d.getVar('MACHINE_KERNEL_PR', True)
+
+    if machine_kernel_pr:
+        d.setVar('PR', machine_kernel_pr)
+}
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [RFC][meta-oe][PATCH 2/3] testlab.bbclass: Delete
  2012-07-16 17:38 [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Khem Raj
@ 2012-07-16 17:38 ` Khem Raj
  2012-07-16 17:38 ` [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom Khem Raj
  2012-07-16 17:50 ` [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Martin Jansa
  2 siblings, 0 replies; 19+ messages in thread
From: Khem Raj @ 2012-07-16 17:38 UTC (permalink / raw)
  To: openembedded-devel

This functionality is now provided by buildhistory as well.
so lets remove it in favor of that

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-oe/classes/testlab.bbclass |  114 ---------------------------------------
 1 file changed, 114 deletions(-)
 delete mode 100644 meta-oe/classes/testlab.bbclass

diff --git a/meta-oe/classes/testlab.bbclass b/meta-oe/classes/testlab.bbclass
deleted file mode 100644
index c097e9e..0000000
--- a/meta-oe/classes/testlab.bbclass
+++ /dev/null
@@ -1,114 +0,0 @@
-#
-# Performs various tests and analysises on images
-#
-# Copyright (C) 2007, 2008 Koen Kooi <koen@openembedded.org> 
-
-# The current features are:
-# 1) dump a list of installed packages
-# 2) dump a list of sizes of installed packages
-# 3) dependency graphs of installed packages
-
-# See 
-#  * http://dominion.thruhere.net/koen/cms/the-testlab-strikes-again
-#  * http://dominion.thruhere.net/koen/cms/package-relations-inside-images
-#  for use cases
-
-# TODO: 
-# * log information to a server for safekeeping
-# * use git notes to record this info into the scm
-# * add test suite to run on the target device 
-
-
-# Needs 'dot', 'opkg-cl'
-
-do_testlab() {
-if [ -e  ${IMAGE_ROOTFS}/etc/opkg ] && [ "${ONLINE_PACKAGE_MANAGEMENT}" = "full" ] ; then
-
-	IPKG_TMP_DIR="${IMAGE_ROOTFS}-tmp"
-	IPKG_ARGS="-f ${STAGING_ETCDIR_NATIVE}/opkg.conf -o ${IMAGE_ROOTFS} -t ${IPKG_TMP_DIR}"
-
-	TESTLAB_DIR="${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-testlab"
-        mkdir -p ${TESTLAB_DIR}/
-        mkdir -p ${IPKG_TMP_DIR}/
-	ls -laR ${IMAGE_ROOTFS} > ${TESTLAB_DIR}/files-in-image.txt 	
-     
-	echo > ${TESTLAB_DIR}/installed-packages.txt
-	echo -e "digraph depends {\n    node [shape=plaintext]" > ${TESTLAB_DIR}/depends.dot
-
-	for pkg in $(opkg-cl ${IPKG_ARGS} list_installed | awk '{print $1}') ; do 
-		name=`opkg-cl ${IPKG_ARGS} info $pkg | grep -B 7 -A 7 "^Status.* \(\(installed\)\|\(unpacked\)\)" | awk '/^Package/ {printf $2"_"}'`
-		name=$name`opkg-cl ${IPKG_ARGS} info $pkg | grep -B 7 -A 7 "^Status.* \(\(installed\)\|\(unpacked\)\)" | awk -F: '/^Version/ {printf $NF"_"}' | sed 's/^\s*//g'`
-		name=$name`opkg-cl ${IPKG_ARGS} info $pkg | grep -B 7 -A 7 "^Status.* \(\(installed\)\|\(unpacked\)\)" | awk '/^Archi/ {print $2".ipk"}'`
-		echo $name >>${TESTLAB_DIR}/installed-packages.txt
-
-    		for depends in $(opkg-cl ${IPKG_ARGS} info $pkg | grep ^Depends) ; do 
-        		echo "$pkg OPP $depends;" | grep -v "(" | grep -v ")" | grep -v "$pkg OPP Depends" | sed -e 's:,::g' -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' |sed 's:OPP:->:g' >> ${TESTLAB_DIR}/depends.dot
-    		done
-    		
-		for recommends in $(opkg-cl ${IPKG_ARGS} info $pkg | grep ^Recom) ; do
-        		echo "$pkg OPP $recommends [style=dotted];" | grep -v "(" | grep -v ")" | grep -v "$pkg OPP Recom" | sed -e 's:,::g' -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' |sed 's:OPP:->:g' >> ${TESTLAB_DIR}/depends.dot
-    		done
-	done
-
-	echo "}" >>  ${TESTLAB_DIR}/depends.dot
-	rm -rf ${IPKG_TMP_DIR}
-	
-	grep -v kernel_2 ${TESTLAB_DIR}/depends.dot | grep -v kernel_image > ${TESTLAB_DIR}/depends-nokernel.dot
-	grep -v libc6 ${TESTLAB_DIR}/depends-nokernel.dot | grep -v libgcc > ${TESTLAB_DIR}/depends-nokernel-nolibc.dot
-	grep -v update_ ${TESTLAB_DIR}/depends-nokernel-nolibc.dot > ${TESTLAB_DIR}/depends-nokernel-nolibc-noupdate.dot
-        grep -v kernel_module ${TESTLAB_DIR}/depends-nokernel-nolibc-noupdate.dot > ${TESTLAB_DIR}/depends-nokernel-nolibc-noupdate-nomodules.dot
-
-	#dot has some library troubles when run under fakeroot, uncomment at your own risk
-	#dot -Tpng -o ${TESTLAB_DIR}/image-dependencies.png  ${TESTLAB_DIR}/depends.dot
-	#dot -Tpng -o ${TESTLAB_DIR}/image-dependencies-nokernel-nolibc.png ${TESTLAB_DIR}/depends-nokernel-nolibc.dot
-	#dot -Tpng -o ${TESTLAB_DIR}/image-dependencies-nokernel-nolibc-noupdate.png ${TESTLAB_DIR}/depends-nokernel-nolibc-noupdate.dot
-	#dot -Tpng -o ${TESTLAB_DIR}/image-dependencies-nokernel-nolibc-noupdate-nomodules.png ${TESTLAB_DIR}/depends-nokernel-nolibc-noupdate-nomodules.dot
-
-	for file in $(cat ${TESTLAB_DIR}/installed-packages.txt) ; do 
-     		du -k $(find ${DEPLOY_DIR_IPK} -name "$file") | head -n1
-	done | grep "\.ipk" | sed -e s:${DEPLOY_DIR_IPK}::g | sort -n -r | awk '{print $1 "\tKiB " $2}' > ${TESTLAB_DIR}/installed-package-sizes.txt
-
-	for file in $(cat ${TESTLAB_DIR}/installed-packages.txt) ; do
-		echo "`find ${DEPLOY_DIR_IPK} -name "$file" | xargs opkg-list-fields | grep ^License | sed -e 's/^.*:[ \t]*//g'`" '=' $(echo $file | awk -F_ '{print $1}')
-	done | awk -F= '{printf("%50s:%s\n", $1, $2)}' > ${TESTLAB_DIR}/installed-package-licenses.txt
-	# Log results to a git controlled directory structure than can be pushed to a remote location
-	if [ "${TESTLABLOG}" = "remote" ] && [ -n "${TESTLABREMOTEDIR}" ] ; then
-		TESTLABLOGDIR="${MACHINE_ARCH}/${TCLIBC}/${IMAGE_BASENAME}"
-		mkdir -p ${TESTLABREMOTEDIR}/${TESTLABLOGDIR}
-		cp ${TESTLAB_DIR}/*package* ${TESTLAB_DIR}/depends.dot ${TESTLABREMOTEDIR}/${TESTLABLOGDIR}
-		# force change to record builds where the testlab contents didn't change, but other things (e.g. git rev) did
-		echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION}" > ${TESTLABREMOTEDIR}/${TESTLABLOGDIR}/build-id
-		echo "${@testlab_get_layers(bb, d)}" >> ${TESTLABREMOTEDIR}/${TESTLABLOGDIR}/build-id
-		# This runs inside fakeroot, so the git author is listed as root (or whatever root configured it to be) :(
-		( cd ${TESTLABREMOTEDIR}/
-		  git add ${TESTLABLOGDIR}/*
-		  git commit ${TESTLABLOGDIR}/ -m "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION} using branch ${METADATA_BRANCH} and revision ${METADATA_REVISION}" --author "testlab <testlab@${DISTRO}>" || true)
-	fi
-fi
-}
-
-IMAGE_POSTPROCESS_COMMAND += "  do_testlab ;"
-
-def testlab_get_layers(bb, d):
-	layers = (bb.data.getVar("BBLAYERS", d, 1) or "").split()
-	layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
-		base_get_metadata_git_branch(i, None).strip().strip('()'), \
-		base_get_metadata_git_revision(i, None)) \
-			for i in layers]
-	i = len(layers_branch_rev)-1
-	p1 = layers_branch_rev[i].find("=")
-	s1= layers_branch_rev[i][p1:]
-	while i > 0:
-		p2 = layers_branch_rev[i-1].find("=")
-		s2= layers_branch_rev[i-1][p2:]
-		if s1 == s2:
-			layers_branch_rev[i-1] = layers_branch_rev[i-1][0:p2]
-			i -= 1
-		else:
-			i -= 1
-			p1 = layers_branch_rev[i].find("=")
-			s1= layers_branch_rev[i][p1:]
-
-	layertext = "Configured Openembedded layers:\n%s\n" % '\n'.join(layers_branch_rev)
-	return layertext
-
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom
  2012-07-16 17:38 [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Khem Raj
  2012-07-16 17:38 ` [RFC][meta-oe][PATCH 2/3] testlab.bbclass: Delete Khem Raj
@ 2012-07-16 17:38 ` Khem Raj
  2012-07-16 17:46   ` Martin Jansa
  2012-07-16 17:50 ` [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Martin Jansa
  2 siblings, 1 reply; 19+ messages in thread
From: Khem Raj @ 2012-07-16 17:38 UTC (permalink / raw)
  To: openembedded-devel

This class is angstrom specific so lets move it to more
appropriate layer

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-oe/classes/blacklist.bbclass |   20 --------------------
 1 file changed, 20 deletions(-)
 delete mode 100644 meta-oe/classes/blacklist.bbclass

diff --git a/meta-oe/classes/blacklist.bbclass b/meta-oe/classes/blacklist.bbclass
deleted file mode 100644
index 7bf4a73..0000000
--- a/meta-oe/classes/blacklist.bbclass
+++ /dev/null
@@ -1,20 +0,0 @@
-# anonymous support class from angstrom
-# 
-# Features:
-#
-# * blacklist handling, set ANGSTROM_BLACKLIST_pn-blah = "message"
-#
-
-python () {
-    import bb
-
-    blacklist = bb.data.getVar("ANGSTROM_BLACKLIST", d, 1)
-    pkgnm = bb.data.getVar("PN", d, 1)
-    distro = bb.data.getVar("DISTRO", d, 1)
-
-    if blacklist:
-	bb.note("%s DOES NOT support %s because %s" % (distro,pkgnm, blacklist))
-        raise bb.parse.SkipPackage("%s DOES NOT support %s because %s" % (distro,pkgnm, blacklist))
-
-}
-
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom
  2012-07-16 17:38 ` [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom Khem Raj
@ 2012-07-16 17:46   ` Martin Jansa
  2012-07-16 17:50     ` Khem Raj
  0 siblings, 1 reply; 19+ messages in thread
From: Martin Jansa @ 2012-07-16 17:46 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 1672 bytes --]

On Mon, Jul 16, 2012 at 10:38:36AM -0700, Khem Raj wrote:
> This class is angstrom specific so lets move it to more
> appropriate layer

This is also used by SHR, that's why I've asked Koen to move blacklist
from meta-angstrom to meta-oe before
http://git.openembedded.org/meta-openembedded/commit/?id=68c15845d087df0a6f66c58a9fd80548a9bb3a59

Cheers,

> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta-oe/classes/blacklist.bbclass |   20 --------------------
>  1 file changed, 20 deletions(-)
>  delete mode 100644 meta-oe/classes/blacklist.bbclass
> 
> diff --git a/meta-oe/classes/blacklist.bbclass b/meta-oe/classes/blacklist.bbclass
> deleted file mode 100644
> index 7bf4a73..0000000
> --- a/meta-oe/classes/blacklist.bbclass
> +++ /dev/null
> @@ -1,20 +0,0 @@
> -# anonymous support class from angstrom
> -# 
> -# Features:
> -#
> -# * blacklist handling, set ANGSTROM_BLACKLIST_pn-blah = "message"
> -#
> -
> -python () {
> -    import bb
> -
> -    blacklist = bb.data.getVar("ANGSTROM_BLACKLIST", d, 1)
> -    pkgnm = bb.data.getVar("PN", d, 1)
> -    distro = bb.data.getVar("DISTRO", d, 1)
> -
> -    if blacklist:
> -	bb.note("%s DOES NOT support %s because %s" % (distro,pkgnm, blacklist))
> -        raise bb.parse.SkipPackage("%s DOES NOT support %s because %s" % (distro,pkgnm, blacklist))
> -
> -}
> -
> -- 
> 1.7.9.5
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality
  2012-07-16 17:38 [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Khem Raj
  2012-07-16 17:38 ` [RFC][meta-oe][PATCH 2/3] testlab.bbclass: Delete Khem Raj
  2012-07-16 17:38 ` [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom Khem Raj
@ 2012-07-16 17:50 ` Martin Jansa
  2012-07-16 17:55   ` Khem Raj
  2012-07-17 12:37   ` [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning Martin Jansa
  2 siblings, 2 replies; 19+ messages in thread
From: Martin Jansa @ 2012-07-16 17:50 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 23470 bytes --]

On Mon, Jul 16, 2012 at 10:38:34AM -0700, Khem Raj wrote:
> Diffing with the OE-Core's kernel.bbclass only difference is setting of
> machine kernel pr. So lets convert it to a separate class which provides
> the added functionality and let everyone use kernel.bbclass from kernel

There is also this change
http://lists.linuxtogo.org/pipermail/openembedded-core/2012-April/021608.html
which never made it to oe-core version..

Cheers,

> 
> It needs the dependent layers to inherit this class in addition to
> kernel.bbclass
> 
> It leaves up with one less conflict with OE-Core
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta-oe/classes/kernel.bbclass            |  559 -----------------------------
>  meta-oe/classes/machine_kernel_pr.bbclass |    7 +
>  2 files changed, 7 insertions(+), 559 deletions(-)
>  delete mode 100644 meta-oe/classes/kernel.bbclass
>  create mode 100644 meta-oe/classes/machine_kernel_pr.bbclass
> 
> diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
> deleted file mode 100644
> index b30ed36..0000000
> --- a/meta-oe/classes/kernel.bbclass
> +++ /dev/null
> @@ -1,559 +0,0 @@
> -inherit linux-kernel-base module_strip
> -
> -PROVIDES += "virtual/kernel"
> -DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
> -
> -# we include gcc above, we dont need virtual/libc
> -INHIBIT_DEFAULT_DEPS = "1"
> -
> -KERNEL_IMAGETYPE ?= "zImage"
> -INITRAMFS_IMAGE ?= ""
> -INITRAMFS_TASK ?= ""
> -
> -python __anonymous () {
> -    kerneltype = d.getVar('KERNEL_IMAGETYPE', True) or ''
> -    if kerneltype == 'uImage':
> -        depends = d.getVar("DEPENDS", True)
> -        depends = "%s u-boot-mkimage-native" % depends
> -        d.setVar("DEPENDS", depends)
> -
> -    image = d.getVar('INITRAMFS_IMAGE', True)
> -    if image:
> -        d.setVar('INITRAMFS_TASK', '${INITRAMFS_IMAGE}:do_rootfs')
> -
> -    machine_kernel_pr = d.getVar('MACHINE_KERNEL_PR', True)
> -
> -    if machine_kernel_pr:
> -        d.setVar('PR', machine_kernel_pr)
> -}
> -
> -inherit kernel-arch deploy
> -
> -PACKAGES_DYNAMIC += "kernel-module-*"
> -PACKAGES_DYNAMIC += "kernel-image-*"
> -PACKAGES_DYNAMIC += "kernel-firmware-*"
> -
> -export OS = "${TARGET_OS}"
> -export CROSS_COMPILE = "${TARGET_PREFIX}"
> -
> -KERNEL_PRIORITY ?= "${@int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[0]) * 10000 + \
> -                       int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[1]) * 100 + \
> -                       int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[-1])}"
> -
> -KERNEL_RELEASE ?= "${KERNEL_VERSION}"
> -
> -KERNEL_CCSUFFIX ?= ""
> -KERNEL_LDSUFFIX ?= ""
> -
> -# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
> -# specific options necessary for building the kernel and modules.
> -#FIXME: should be this: TARGET_CC_KERNEL_ARCH ?= "${TARGET_CC_ARCH}"
> -TARGET_CC_KERNEL_ARCH ?= ""
> -HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
> -TARGET_LD_KERNEL_ARCH ?= ""
> -HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
> -
> -KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}"
> -KERNEL_LD = "${HOST_PREFIX}ld${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}"
> -
> -# Where built kernel lies in the kernel tree
> -KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
> -KERNEL_IMAGEDEST = "boot"
> -
> -#
> -# configuration
> -#
> -export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE",1) or "ttyS0"}"
> -
> -KERNEL_VERSION = "${@get_kernelversion('${B}')}"
> -
> -KERNEL_LOCALVERSION ?= ""
> -
> -# kernels are generally machine specific
> -PACKAGE_ARCH = "${MACHINE_ARCH}"
> -
> -# U-Boot support
> -UBOOT_ENTRYPOINT ?= "20008000"
> -UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
> -
> -# For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE.
> -# We don't want to override kernel Makefile variables from the environment
> -EXTRA_OEMAKE = ""
> -
> -KERNEL_ALT_IMAGETYPE ??= ""
> -
> -KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
> -
> -kernel_do_compile() {
> -	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
> -	oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}"
> -	oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}"
> -	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
> -		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
> -	fi
> -}
> -
> -do_compile_kernelmodules() {
> -	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
> -	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
> -		oe_runmake ${PARALLEL_MAKE} modules CC="${KERNEL_CC}" LD="${KERNEL_LD}"
> -	else
> -		bbnote "no modules to compile"
> -	fi
> -}
> -addtask compile_kernelmodules after do_compile before do_install
> -
> -kernel_do_install() {
> -	#
> -	# First install the modules
> -	#
> -	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
> -	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
> -		oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
> -		rm -f "${D}/lib/modules/${KERNEL_VERSION}/modules.order"
> -		rm -f "${D}/lib/modules/${KERNEL_VERSION}/modules.builtin"
> -		rm "${D}/lib/modules/${KERNEL_VERSION}/build"
> -		rm "${D}/lib/modules/${KERNEL_VERSION}/source"
> -	else
> -		bbnote "no modules to install"
> -	fi
> -
> -	#
> -	# Install various kernel output (zImage, map file, config, module support files)
> -	#
> -	install -d ${D}/${KERNEL_IMAGEDEST}
> -	install -d ${D}/boot
> -	install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
> -	install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
> -	install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
> -	install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
> -	[ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION}
> -	install -d ${D}/etc/modules-load.d
> -	install -d ${D}/etc/modprobe.d
> -
> -	#
> -	# Support for external module building - create a minimal copy of the
> -	# kernel source tree.
> -	#
> -	kerneldir=${D}/kernel
> -	install -d $kerneldir
> -
> -	#
> -	# Store the kernel version in sysroots for module-base.bbclass
> -	#
> -
> -	echo "${KERNEL_VERSION}" > $kerneldir/kernel-abiversion
> -
> -	#
> -	# Store kernel image name to allow use during image generation
> -	#
> -
> -	echo "${KERNEL_IMAGE_BASE_NAME}" >$kerneldir/kernel-image-name
> -
> -	#
> -	# Copy the entire source tree. In case an external build directory is
> -	# used, copy the build directory over first, then copy over the source
> -	# dir. This ensures the original Makefiles are used and not the
> -	# redirecting Makefiles in the build directory.
> -	#
> -	# work and sysroots can be on different partitions, so we can't rely on
> -	# hardlinking, unfortunately.
> -	#
> -	cp -fR * $kerneldir
> -	cp .config $kerneldir
> -	if [ "${S}" != "${B}" ]; then
> -		cp -fR ${S}/* $kerneldir
> -	fi
> -	install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE}
> -	install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION}
> -
> -	#
> -	# Clean and remove files not needed for building modules.
> -	# Some distributions go through a lot more trouble to strip out
> -	# unecessary headers, for now, we just prune the obvious bits.
> -	#
> -	# We don't want to leave host-arch binaries in /sysroots, so
> -	# we clean the scripts dir while leaving the generated config
> -	# and include files.
> -	#
> -	oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
> -	make -C $kerneldir _mrproper_scripts
> -	find $kerneldir -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
> -	find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
> -
> -	# As of Linux kernel version 3.0.1, the clean target removes
> -	# arch/powerpc/lib/crtsavres.o which is present in
> -	# KBUILD_LDFLAGS_MODULE, making it required to build external modules.
> -	if [ ${ARCH} = "powerpc" ]; then
> -		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
> -	fi
> -
> -	# Remove the following binaries which cause strip errors
> -	# during do_package for cross-compiled platforms
> -	bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
> -	           arch/powerpc/boot/mktree"
> -	for entry in $bin_files; do
> -		rm -f $kerneldir/$entry
> -	done
> -}
> -
> -PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
> -
> -kernel_package_preprocess () {
> -	rm -rf ${PKGD}/kernel
> -}
> -
> -sysroot_stage_all_append() {
> -	sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
> -}
> -
> -kernel_do_configure() {
> -	# fixes extra + in /lib/modules/2.6.37+
> -	# $ scripts/setlocalversion . => +
> -	# $ make kernelversion => 2.6.37
> -	# $ make kernelrelease => 2.6.37+
> -	touch ${B}/.scmversion ${S}/.scmversion
> -
> -	# Copy defconfig to .config if .config does not exist. This allows
> -	# recipes to manage the .config themselves in do_configure_prepend().
> -	if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
> -		cp "${WORKDIR}/defconfig" "${B}/.config"
> -	fi
> -	yes '' | oe_runmake oldconfig
> -
> -	if [ ! -z "${INITRAMFS_IMAGE}" ]; then
> -		for img in cpio.gz cpio.lzo cpio.lzma cpio.xz; do
> -		if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" ]; then
> -			cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" initramfs.$img
> -		fi
> -		done
> -	fi
> -}
> -
> -do_configure[depends] += "${INITRAMFS_TASK}"
> -
> -do_savedefconfig() {
> -	oe_runmake savedefconfig
> -}
> -do_savedefconfig[nostamp] = "1"
> -addtask savedefconfig after do_configure
> -
> -pkg_postinst_kernel-base () {
> -	cd /${KERNEL_IMAGEDEST}; update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true
> -}
> -
> -pkg_postrm_kernel-base () {
> -	cd /${KERNEL_IMAGEDEST}; update-alternatives --remove ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true
> -}
> -
> -inherit cml1
> -
> -EXPORT_FUNCTIONS do_compile do_install do_configure
> -
> -# kernel-base becomes kernel-${KERNEL_VERSION}
> -# kernel-image becomes kernel-image-${KERNEL_VERISON}
> -PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-misc"
> -FILES = ""
> -FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
> -FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
> -FILES_kernel-vmlinux = "/boot/vmlinux*"
> -# misc is a package to contain files we need in staging
> -FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media"
> -RDEPENDS_kernel = "kernel-base"
> -# Allow machines to override this dependency if kernel image files are 
> -# not wanted in images as standard
> -RDEPENDS_kernel-base ?= "kernel-image"
> -PKG_kernel-image = "kernel-image-${@legitimize_package_name('${KERNEL_VERSION}')}"
> -PKG_kernel-base = "kernel-${@legitimize_package_name('${KERNEL_VERSION}')}"
> -ALLOW_EMPTY_kernel = "1"
> -ALLOW_EMPTY_kernel-base = "1"
> -ALLOW_EMPTY_kernel-image = "1"
> -
> -pkg_postinst_kernel-image () {
> -if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then
> -	mkdir -p $D/lib/modules/${KERNEL_VERSION}
> -fi
> -if [ -n "$D" ]; then
> -	depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
> -else
> -	depmod -a ${KERNEL_VERSION}
> -fi
> -}
> -
> -pkg_postinst_modules () {
> -if [ -z "$D" ]; then
> -	depmod -a ${KERNEL_VERSION}
> -	update-modules || true
> -fi
> -}
> -
> -pkg_postrm_modules () {
> -update-modules || true
> -}
> -
> -autoload_postinst_fragment() {
> -if [ x"$D" = "x" ]; then
> -	modprobe %s || true
> -fi
> -}
> -
> -# autoload defaults (alphabetically sorted)
> -module_autoload_hidp = "hidp"
> -module_autoload_ipv6 = "ipv6"
> -module_autoload_ipsec = "ipsec"
> -module_autoload_ircomm-tty = "ircomm-tty"
> -module_autoload_rfcomm = "rfcomm"
> -module_autoload_sa1100-rtc = "sa1100-rtc"
> -# sa1100-rtc was renamed in 2.6.23 onwards
> -module_autoload_rtc-sa1100 = "rtc-sa1100"
> -
> -# alias defaults (alphabetically sorted)
> -module_conf_af_packet = "alias net-pf-17 af_packet"
> -module_conf_bluez = "alias net-pf-31 bluez"
> -module_conf_bnep = "alias bt-proto-4 bnep"
> -module_conf_hci_uart = "alias tty-ldisc-15 hci_uart"
> -module_conf_l2cap = "alias bt-proto-0 l2cap"
> -module_conf_sco = "alias bt-proto-2 sco"
> -module_conf_rfcomm = "alias bt-proto-3 rfcomm"
> -
> -python populate_packages_prepend () {
> -	def extract_modinfo(file):
> -		import tempfile, re
> -		tempfile.tempdir = d.getVar("WORKDIR", True)
> -		tf = tempfile.mkstemp()
> -		tmpfile = tf[1]
> -		cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("PATH", True), d.getVar("HOST_PREFIX", True) or "", file, tmpfile)
> -		os.system(cmd)
> -		f = open(tmpfile)
> -		l = f.read().split("\000")
> -		f.close()
> -		os.close(tf[0])
> -		os.unlink(tmpfile)
> -		exp = re.compile("([^=]+)=(.*)")
> -		vals = {}
> -		for i in l:
> -			m = exp.match(i)
> -			if not m:
> -				continue
> -			vals[m.group(1)] = m.group(2)
> -		return vals
> -	
> -	def parse_depmod():
> -		import re
> -
> -		dvar = d.getVar('PKGD', True)
> -		if not dvar:
> -			bb.error("PKGD not defined")
> -			return
> -
> -		kernelver = d.getVar('KERNEL_VERSION', True)
> -		kernelver_stripped = kernelver
> -		m = re.match('^(.*-hh.*)[\.\+].*$', kernelver)
> -		if m:
> -			kernelver_stripped = m.group(1)
> -		path = d.getVar("PATH", True)
> -
> -		cmd = "PATH=\"%s\" depmod -n -a -b %s -F %s/boot/System.map-%s %s" % (path, dvar, dvar, kernelver, kernelver_stripped)
> -		f = os.popen(cmd, 'r')
> -
> -		deps = {}
> -		pattern0 = "^(.*\.k?o):..*$"
> -		pattern1 = "^(.*\.k?o):\s*(.*\.k?o)\s*$"
> -		pattern2 = "^(.*\.k?o):\s*(.*\.k?o)\s*\\\$"
> -		pattern3 = "^\t(.*\.k?o)\s*\\\$"
> -		pattern4 = "^\t(.*\.k?o)\s*$"
> -
> -		line = f.readline()
> -		while line:
> -			if not re.match(pattern0, line):
> -				line = f.readline()
> -				continue
> -			m1 = re.match(pattern1, line)
> -			if m1:
> -				deps[m1.group(1)] = m1.group(2).split()
> -			else:
> -				m2 = re.match(pattern2, line)
> -				if m2:
> -					deps[m2.group(1)] = m2.group(2).split()
> -					line = f.readline()
> -					m3 = re.match(pattern3, line)
> -					while m3:
> -						deps[m2.group(1)].extend(m3.group(1).split())
> -						line = f.readline()
> -						m3 = re.match(pattern3, line)
> -					m4 = re.match(pattern4, line)
> -					deps[m2.group(1)].extend(m4.group(1).split())
> -			line = f.readline()
> -		f.close()
> -		return deps
> -	
> -	def get_dependencies(file, pattern, format):
> -		# file no longer includes PKGD
> -		file = file.replace(d.getVar('PKGD', True) or '', '', 1)
> -		# instead is prefixed with /lib/modules/${KERNEL_VERSION}
> -		file = file.replace("/lib/modules/%s/" % d.getVar('KERNEL_VERSION', True) or '', '', 1)
> -
> -		if module_deps.has_key(file):
> -			import re
> -			dependencies = []
> -			for i in module_deps[file]:
> -				m = re.match(pattern, os.path.basename(i))
> -				if not m:
> -					continue
> -				on = legitimize_package_name(m.group(1))
> -				dependency_pkg = format % on
> -				dependencies.append(dependency_pkg)
> -			return dependencies
> -		return []
> -
> -	def frob_metadata(file, pkg, pattern, format, basename):
> -		import re
> -		vals = extract_modinfo(file)
> -
> -		dvar = d.getVar('PKGD', True)
> -
> -		# If autoloading is requested, output /etc/modules-load.d/<name>.conf and append
> -		# appropriate modprobe commands to the postinst
> -		autoload = d.getVar('module_autoload_%s' % basename, True)
> -		if autoload:
> -			name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename)
> -			f = open(name, 'w')
> -			for m in autoload.split():
> -				f.write('%s\n' % m)
> -			f.close()
> -			postinst = d.getVar('pkg_postinst_%s' % pkg, True)
> -			if not postinst:
> -				bb.fatal("pkg_postinst_%s not defined" % pkg)
> -			postinst += d.getVar('autoload_postinst_fragment', True) % autoload
> -			d.setVar('pkg_postinst_%s' % pkg, postinst)
> -
> -		# Write out any modconf fragment
> -		modconf = d.getVar('module_conf_%s' % basename, True)
> -		if modconf:
> -			name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename)
> -			f = open(name, 'w')
> -			f.write("%s\n" % modconf)
> -			f.close()
> -
> -		files = d.getVar('FILES_%s' % pkg, True)
> -		files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename)
> -		d.setVar('FILES_%s' % pkg, files)
> -
> -		if vals.has_key("description"):
> -			old_desc = d.getVar('DESCRIPTION_' + pkg, True) or ""
> -			d.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"])
> -
> -		rdepends_str = d.getVar('RDEPENDS_' + pkg, True)
> -		if rdepends_str:
> -			rdepends = rdepends_str.split()
> -		else:
> -			rdepends = []
> -		rdepends.extend(get_dependencies(file, pattern, format))
> -		d.setVar('RDEPENDS_' + pkg, ' '.join(rdepends))
> -
> -	module_deps = parse_depmod()
> -	module_regex = '^(.*)\.k?o$'
> -	module_pattern = 'kernel-module-%s'
> -
> -	postinst = d.getVar('pkg_postinst_modules', True)
> -	postrm = d.getVar('pkg_postrm_modules', True)
> -	do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
> -	do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
> -	do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
> -	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='update-modules kernel-%s' % d.getVar("KERNEL_VERSION", True))
> -
> -	# If modules-load.d and modprobe.d are empty at this point, remove them to
> -	# avoid warnings. removedirs only raises an OSError if an empty
> -	# directory cannot be removed.
> -	dvar = d.getVar('PKGD', True)
> -	for dir in ["%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar), "%s/etc" % (dvar)]:
> -		if len(os.listdir(dir)) == 0:
> -			os.rmdir(dir)
> -
> -	import re
> -	metapkg = "kernel-modules"
> -	d.setVar('ALLOW_EMPTY_' + metapkg, "1")
> -	d.setVar('FILES_' + metapkg, "")
> -	blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'perf', 'perf-dbg', 'kernel-misc' ]
> -	for l in module_deps.values():
> -		for i in l:
> -			pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))
> -			blacklist.append(pkg)
> -	metapkg_rdepends = []
> -	packages = d.getVar('PACKAGES', True).split()
> -	for pkg in packages[1:]:
> -		if not pkg in blacklist and not pkg in metapkg_rdepends:
> -			metapkg_rdepends.append(pkg)
> -	d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
> -	d.setVar('DESCRIPTION_' + metapkg, 'Kernel modules meta package')
> -	packages.append(metapkg)
> -	d.setVar('PACKAGES', ' '.join(packages))
> -}
> -
> -# Support checking the kernel size since some kernels need to reside in partitions
> -# with a fixed length or there is a limit in transferring the kernel to memory
> -do_sizecheck() {
> -	if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
> -		size=`ls -l ${KERNEL_OUTPUT} | awk '{ print $5}'`
> -		if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
> -			rm ${KERNEL_OUTPUT}
> -			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."
> -		fi
> -	fi
> -}
> -
> -addtask sizecheck before do_install after do_compile
> -
> -KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
> -# Don't include the DATETIME variable in the sstate package signatures
> -KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
> -KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
> -
> -do_uboot_mkimage() {
> -	if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then 
> -		if test "x${KEEPUIMAGE}" = "x" ; then
> -			ENTRYPOINT=${UBOOT_ENTRYPOINT}
> -			if test -n "${UBOOT_ENTRYSYMBOL}"; then
> -				ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
> -					awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
> -			fi
> -			if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
> -				${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
> -				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
> -				rm -f linux.bin
> -			else
> -				${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
> -				rm -f linux.bin.gz
> -				gzip -9 linux.bin
> -				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
> -				rm -f linux.bin.gz
> -			fi
> -		fi
> -	fi
> -}
> -
> -addtask uboot_mkimage before do_install after do_compile
> -
> -kernel_do_deploy() {
> -	install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
> -	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
> -		tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_VERSION}-${PR}-${MACHINE}.tgz -C ${D} lib
> -	fi
> -
> -	cd ${DEPLOYDIR}
> -	rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
> -	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
> -
> -	cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
> -}
> -do_deploy[dirs] = "${DEPLOYDIR} ${B}"
> -
> -addtask deploy before do_build after do_install
> -
> -EXPORT_FUNCTIONS do_deploy
> -
> -# perf must be enabled in individual kernel recipes
> -PACKAGES =+ "perf-dbg perf"
> -FILES_perf = "${bindir}/* \
> -              ${libexecdir}"
> -FILES_perf-dbg = "${FILES_${PN}-dbg}"
> diff --git a/meta-oe/classes/machine_kernel_pr.bbclass b/meta-oe/classes/machine_kernel_pr.bbclass
> new file mode 100644
> index 0000000..7f03af5
> --- /dev/null
> +++ b/meta-oe/classes/machine_kernel_pr.bbclass
> @@ -0,0 +1,7 @@
> +python __anonymous () {
> +
> +    machine_kernel_pr = d.getVar('MACHINE_KERNEL_PR', True)
> +
> +    if machine_kernel_pr:
> +        d.setVar('PR', machine_kernel_pr)
> +}
> -- 
> 1.7.9.5
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom
  2012-07-16 17:46   ` Martin Jansa
@ 2012-07-16 17:50     ` Khem Raj
  2012-07-16 17:58       ` Martin Jansa
  0 siblings, 1 reply; 19+ messages in thread
From: Khem Raj @ 2012-07-16 17:50 UTC (permalink / raw)
  To: openembedded-devel

On Mon, Jul 16, 2012 at 10:46 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Mon, Jul 16, 2012 at 10:38:36AM -0700, Khem Raj wrote:
>> This class is angstrom specific so lets move it to more
>> appropriate layer
>
> This is also used by SHR, that's why I've asked Koen to move blacklist
> from meta-angstrom to meta-oe before
> http://git.openembedded.org/meta-openembedded/commit/?id=68c15845d087df0a6f66c58a9fd80548a9bb3a59
>

OK, OE-Core also has blacklist implementation. Have you given a
thought to use it ?

> Cheers,
>
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta-oe/classes/blacklist.bbclass |   20 --------------------
>>  1 file changed, 20 deletions(-)
>>  delete mode 100644 meta-oe/classes/blacklist.bbclass
>>
>> diff --git a/meta-oe/classes/blacklist.bbclass b/meta-oe/classes/blacklist.bbclass
>> deleted file mode 100644
>> index 7bf4a73..0000000
>> --- a/meta-oe/classes/blacklist.bbclass
>> +++ /dev/null
>> @@ -1,20 +0,0 @@
>> -# anonymous support class from angstrom
>> -#
>> -# Features:
>> -#
>> -# * blacklist handling, set ANGSTROM_BLACKLIST_pn-blah = "message"
>> -#
>> -
>> -python () {
>> -    import bb
>> -
>> -    blacklist = bb.data.getVar("ANGSTROM_BLACKLIST", d, 1)
>> -    pkgnm = bb.data.getVar("PN", d, 1)
>> -    distro = bb.data.getVar("DISTRO", d, 1)
>> -
>> -    if blacklist:
>> -     bb.note("%s DOES NOT support %s because %s" % (distro,pkgnm, blacklist))
>> -        raise bb.parse.SkipPackage("%s DOES NOT support %s because %s" % (distro,pkgnm, blacklist))
>> -
>> -}
>> -
>> --
>> 1.7.9.5
>>
>>
>> _______________________________________________
>> Openembedded-devel mailing list
>> Openembedded-devel@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>
> --
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality
  2012-07-16 17:50 ` [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Martin Jansa
@ 2012-07-16 17:55   ` Khem Raj
  2012-07-17 12:39     ` Martin Jansa
  2012-07-17 12:37   ` [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning Martin Jansa
  1 sibling, 1 reply; 19+ messages in thread
From: Khem Raj @ 2012-07-16 17:55 UTC (permalink / raw)
  To: openembedded-devel

On Mon, Jul 16, 2012 at 10:50 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
>
> There is also this change
> http://lists.linuxtogo.org/pipermail/openembedded-core/2012-April/021608.html
> which never made it to oe-core version..

I missed that part. That would need an enhancement in OE-Core to
provide a variable to override uImage if a machine asks for.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom
  2012-07-16 17:50     ` Khem Raj
@ 2012-07-16 17:58       ` Martin Jansa
  2012-07-16 18:00         ` Khem Raj
  0 siblings, 1 reply; 19+ messages in thread
From: Martin Jansa @ 2012-07-16 17:58 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 2826 bytes --]

On Mon, Jul 16, 2012 at 10:50:58AM -0700, Khem Raj wrote:
> On Mon, Jul 16, 2012 at 10:46 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> > On Mon, Jul 16, 2012 at 10:38:36AM -0700, Khem Raj wrote:
> >> This class is angstrom specific so lets move it to more
> >> appropriate layer
> >
> > This is also used by SHR, that's why I've asked Koen to move blacklist
> > from meta-angstrom to meta-oe before
> > http://git.openembedded.org/meta-openembedded/commit/?id=68c15845d087df0a6f66c58a9fd80548a9bb3a59
> >
> 
> OK, OE-Core also has blacklist implementation. Have you given a
> thought to use it ?

Yes, but that would require distro config to be updated from
ANGSTROM_BLACKLIST_PN to PNBLACKLIST[pn] at the same time this class is
moved or duplicate all blacklist entries now and then remove
ANGSTROM_BLACKLIST_PN after it's moved..

Cheers,

> 
> > Cheers,
> >
> >>
> >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> >> ---
> >>  meta-oe/classes/blacklist.bbclass |   20 --------------------
> >>  1 file changed, 20 deletions(-)
> >>  delete mode 100644 meta-oe/classes/blacklist.bbclass
> >>
> >> diff --git a/meta-oe/classes/blacklist.bbclass b/meta-oe/classes/blacklist.bbclass
> >> deleted file mode 100644
> >> index 7bf4a73..0000000
> >> --- a/meta-oe/classes/blacklist.bbclass
> >> +++ /dev/null
> >> @@ -1,20 +0,0 @@
> >> -# anonymous support class from angstrom
> >> -#
> >> -# Features:
> >> -#
> >> -# * blacklist handling, set ANGSTROM_BLACKLIST_pn-blah = "message"
> >> -#
> >> -
> >> -python () {
> >> -    import bb
> >> -
> >> -    blacklist = bb.data.getVar("ANGSTROM_BLACKLIST", d, 1)
> >> -    pkgnm = bb.data.getVar("PN", d, 1)
> >> -    distro = bb.data.getVar("DISTRO", d, 1)
> >> -
> >> -    if blacklist:
> >> -     bb.note("%s DOES NOT support %s because %s" % (distro,pkgnm, blacklist))
> >> -        raise bb.parse.SkipPackage("%s DOES NOT support %s because %s" % (distro,pkgnm, blacklist))
> >> -
> >> -}
> >> -
> >> --
> >> 1.7.9.5
> >>
> >>
> >> _______________________________________________
> >> Openembedded-devel mailing list
> >> Openembedded-devel@lists.openembedded.org
> >> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
> >
> > --
> > Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> >
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel@lists.openembedded.org
> > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
> >
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom
  2012-07-16 17:58       ` Martin Jansa
@ 2012-07-16 18:00         ` Khem Raj
  2012-07-16 18:04           ` Martin Jansa
  0 siblings, 1 reply; 19+ messages in thread
From: Khem Raj @ 2012-07-16 18:00 UTC (permalink / raw)
  To: openembedded-devel

On Mon, Jul 16, 2012 at 10:58 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
>
> Yes, but that would require distro config to be updated from
> ANGSTROM_BLACKLIST_PN to PNBLACKLIST[pn] at the same time this class is
> moved or duplicate all blacklist entries now and then remove
> ANGSTROM_BLACKLIST_PN after it's moved..

synchronisation can be worked out if you are willing.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom
  2012-07-16 18:00         ` Khem Raj
@ 2012-07-16 18:04           ` Martin Jansa
  2012-07-18 11:25             ` Martin Jansa
  0 siblings, 1 reply; 19+ messages in thread
From: Martin Jansa @ 2012-07-16 18:04 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

On Mon, Jul 16, 2012 at 11:00:37AM -0700, Khem Raj wrote:
> On Mon, Jul 16, 2012 at 10:58 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> >
> > Yes, but that would require distro config to be updated from
> > ANGSTROM_BLACKLIST_PN to PNBLACKLIST[pn] at the same time this class is
> > moved or duplicate all blacklist entries now and then remove
> > ANGSTROM_BLACKLIST_PN after it's moved..
> 
> synchronisation can be worked out if you are willing.

Yes, it can and I'm willing to do it.. that's why haven't responded just
with NACK :).

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning
  2012-07-16 17:50 ` [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Martin Jansa
  2012-07-16 17:55   ` Khem Raj
@ 2012-07-17 12:37   ` Martin Jansa
  2012-07-17 12:37     ` [meta-oe][PATCH 2/7] recipes-kernel: make perf a standalone package Martin Jansa
                       ` (5 more replies)
  1 sibling, 6 replies; 19+ messages in thread
From: Martin Jansa @ 2012-07-17 12:37 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Bruce Ashfield, Richard Purdie

From: Bruce Ashfield <bruce.ashfield@windriver.com>

The kernel source tree in the sysroot has all unecessary source
code removed. The existing use case is to support module building
out of the sysroot, but as more toolsa are moved into the kernel
tree itself there are new use cases for the kernel sysroot source.

To avoid putting dependencies on the kernel, and to be able to
individually build and package these tools out of the source tree,
we can save $kerndir/tools and $kernddir/lib from being removed.
This enables tools like perf to be built our of the kernel source
in the sysroot, without significantly increasing the amount of
source in the sysroot.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/classes/kernel.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index b30ed36..a784f08 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -178,7 +178,7 @@ kernel_do_install() {
 	#
 	oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
 	make -C $kerneldir _mrproper_scripts
-	find $kerneldir -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
+	find $kerneldir -path $kerneldir/lib -prune -o -path $kerneldir/tools -prune -o -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
 	find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
 
 	# As of Linux kernel version 3.0.1, the clean target removes
-- 
1.7.8.6




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [meta-oe][PATCH 2/7] recipes-kernel: make perf a standalone package
  2012-07-17 12:37   ` [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning Martin Jansa
@ 2012-07-17 12:37     ` Martin Jansa
  2012-07-17 12:37     ` [meta-oe][PATCH 3/7] kernel: Add kernel headers to kernel-dev package Martin Jansa
                       ` (4 subsequent siblings)
  5 siblings, 0 replies; 19+ messages in thread
From: Martin Jansa @ 2012-07-17 12:37 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Bruce Ashfield, Richard Purdie, Liang Li

From: Liang Li <liang.li@windriver.com>

perf has been coupled to the kernel packages via kernel.bbclass.
While maintaining the build of perf out of the kernel source tree
is desired the package coupling has proved to be awkward in
several situations such as:

  - when a kernel recipe doesn't want to build/provide perf
  - when licensing of dependencies would prohibit perf and hence
    the kernel from being built.

To solve some of these problems, this recipe is the extraction of
the linux-tools.inc provided perf compilation into a standalone
perf recipe that builds out of the kernel source, but is otherwise
independent.

No new functionality is provided above what the linux-tools.inc
variant provided, but the separate recipe provides baseline for
adding new functionality.

Signed-off-by: Liang Li <liang.li@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/classes/kernel.bbclass |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index a784f08..722c928 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -474,7 +474,7 @@ python populate_packages_prepend () {
 	metapkg = "kernel-modules"
 	d.setVar('ALLOW_EMPTY_' + metapkg, "1")
 	d.setVar('FILES_' + metapkg, "")
-	blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'perf', 'perf-dbg', 'kernel-misc' ]
+	blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'kernel-misc' ]
 	for l in module_deps.values():
 		for i in l:
 			pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))
@@ -552,8 +552,3 @@ addtask deploy before do_build after do_install
 
 EXPORT_FUNCTIONS do_deploy
 
-# perf must be enabled in individual kernel recipes
-PACKAGES =+ "perf-dbg perf"
-FILES_perf = "${bindir}/* \
-              ${libexecdir}"
-FILES_perf-dbg = "${FILES_${PN}-dbg}"
-- 
1.7.8.6




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [meta-oe][PATCH 3/7] kernel: Add kernel headers to kernel-dev package
  2012-07-17 12:37   ` [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning Martin Jansa
  2012-07-17 12:37     ` [meta-oe][PATCH 2/7] recipes-kernel: make perf a standalone package Martin Jansa
@ 2012-07-17 12:37     ` Martin Jansa
  2012-07-17 12:37     ` [meta-oe][PATCH 4/7] kernel.bbclass: add non-santized kernel provides Martin Jansa
                       ` (3 subsequent siblings)
  5 siblings, 0 replies; 19+ messages in thread
From: Martin Jansa @ 2012-07-17 12:37 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Bruce Ashfield, Tom Zanussi, Darren Hart

From: Darren Hart <dvhart@linux.intel.com>

[YOCTO #1614]

Add the kernel headers to the kernel-dev package. This packages what was
already built and kept in sysroots for building modules with bitbake.
Making this available on the target requires removing some additional
host binaries.

Move the location to /usr/src/kernel

Before use on the target, the user will need to:

    # cd /usr/src/kernel
    # make scripts

This renders the kernel-misc recipe empty, so remove it.

As we use /usr/src/kernel in several places (and I missed one in the
previous version), add a KERNEL_SRC_DIR variable and use that throughout
the class to avoid update errors in the future.

Now that we package the kernel headers, drop the
kernel_package_preprocess function which removed them from PKGD.

All *-sdk image recipes include dev-pkgs, so the kernel-dev package will
be installed by default on all such images.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Bruce Ashfield <bruce.ashfield@windriver.com>
CC: Tom Zanussi <tom.zanussi@intel.com>
CC: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/classes/kernel.bbclass |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index 722c928..4a6f660 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -82,6 +82,10 @@ EXTRA_OEMAKE = ""
 
 KERNEL_ALT_IMAGETYPE ??= ""
 
+# Define where the kernel headers are installed on the target as well as where
+# they are staged.
+KERNEL_SRC_PATH = "/usr/src/kernel"
+
 KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
 
 kernel_do_compile() {
@@ -135,7 +139,7 @@ kernel_do_install() {
 	# Support for external module building - create a minimal copy of the
 	# kernel source tree.
 	#
-	kerneldir=${D}/kernel
+	kerneldir=${D}${KERNEL_SRC_PATH}
 	install -d $kerneldir
 
 	#
@@ -188,23 +192,18 @@ kernel_do_install() {
 		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
 	fi
 
-	# Remove the following binaries which cause strip errors
+	# Remove the following binaries which cause strip or arch QA errors
 	# during do_package for cross-compiled platforms
 	bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
-	           arch/powerpc/boot/mktree"
+	           arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \
+		   scripts/kconfig/conf.o"
 	for entry in $bin_files; do
 		rm -f $kerneldir/$entry
 	done
 }
 
-PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
-
-kernel_package_preprocess () {
-	rm -rf ${PKGD}/kernel
-}
-
 sysroot_stage_all_append() {
-	sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
+	sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
 }
 
 kernel_do_configure() {
@@ -252,13 +251,11 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
 
 # kernel-base becomes kernel-${KERNEL_VERSION}
 # kernel-image becomes kernel-image-${KERNEL_VERISON}
-PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-misc"
+PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
 FILES = ""
 FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
 FILES_kernel-vmlinux = "/boot/vmlinux*"
-# misc is a package to contain files we need in staging
-FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media"
 RDEPENDS_kernel = "kernel-base"
 # Allow machines to override this dependency if kernel image files are 
 # not wanted in images as standard
@@ -474,7 +471,7 @@ python populate_packages_prepend () {
 	metapkg = "kernel-modules"
 	d.setVar('ALLOW_EMPTY_' + metapkg, "1")
 	d.setVar('FILES_' + metapkg, "")
-	blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'kernel-misc' ]
+	blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux' ]
 	for l in module_deps.values():
 		for i in l:
 			pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))
-- 
1.7.8.6




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [meta-oe][PATCH 4/7] kernel.bbclass: add non-santized kernel provides
  2012-07-17 12:37   ` [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning Martin Jansa
  2012-07-17 12:37     ` [meta-oe][PATCH 2/7] recipes-kernel: make perf a standalone package Martin Jansa
  2012-07-17 12:37     ` [meta-oe][PATCH 3/7] kernel: Add kernel headers to kernel-dev package Martin Jansa
@ 2012-07-17 12:37     ` Martin Jansa
  2012-07-17 12:37     ` [meta-oe][PATCH 5/7] kernel.bbclass: Dont package kxgettext.o Martin Jansa
                       ` (2 subsequent siblings)
  5 siblings, 0 replies; 19+ messages in thread
From: Martin Jansa @ 2012-07-17 12:37 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Bruce Ashfield

From: Bruce Ashfield <bruce.ashfield@windriver.com>

If the kernel version string uses characters or symbols that
need to be santized for the package name, we can end up with a
mismatch between module requirements and what the kernel
provides.

The kernel version is pulled from utsrelease.h, which contains
the exact string that was passed to the kernel build, not
one that is santized, this can result in:

 echo "CONFIG_LOCALVERSION="\"MYVER+snapshot_standard\" >> ${B}/.config

 <build>

 % rpm -qp kernel-module-uvesafb-3.4-r0.qemux86.rpm --requires
update-modules
kernel-3.4.3-MYVER+snapshot_standard
 % rpm -qp kernel-3.4.3-myver+snapshot-standard-3.4-r0.qemux86.rpm --provides
kernel-3.4.3-myver+snapshot-standard = 3.4-r0

At rootfs assembly time, we'll have a dependency issue with the kernel
providing the santizied string and the modules requiring the utsrelease.h
string.

To not break existing use cases, we can add a second provides to the
kernel packaging with the unsantized version string, and allowing the
kernel module packaging to be unchanged.

   RPROVIDES_kernel-base += "kernel-${KERNEL_VERSION}"

 % rpm -qp kernel-3.4.3-myver+snapshot-standard-3.4-r0.qemux86.rpm --provides
kernel-3.4.3-MYVER+snapshot_standard
kernel-3.4.3-myver+snapshot-standard = 3.4-r0

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/classes/kernel.bbclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index 4a6f660..de43550 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -262,6 +262,7 @@ RDEPENDS_kernel = "kernel-base"
 RDEPENDS_kernel-base ?= "kernel-image"
 PKG_kernel-image = "kernel-image-${@legitimize_package_name('${KERNEL_VERSION}')}"
 PKG_kernel-base = "kernel-${@legitimize_package_name('${KERNEL_VERSION}')}"
+RPROVIDES_kernel-base += "kernel-${KERNEL_VERSION}"
 ALLOW_EMPTY_kernel = "1"
 ALLOW_EMPTY_kernel-base = "1"
 ALLOW_EMPTY_kernel-image = "1"
-- 
1.7.8.6




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [meta-oe][PATCH 5/7] kernel.bbclass: Dont package kxgettext.o
  2012-07-17 12:37   ` [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning Martin Jansa
                       ` (2 preceding siblings ...)
  2012-07-17 12:37     ` [meta-oe][PATCH 4/7] kernel.bbclass: add non-santized kernel provides Martin Jansa
@ 2012-07-17 12:37     ` Martin Jansa
  2012-07-17 12:37     ` [meta-oe][PATCH 6/7] kernel.bbclass: add deploy link to KERNEL_IMAGETYPE Martin Jansa
  2012-07-17 12:38     ` [meta-oe][PATCH 7/7] kernel.bbclass: replace os.system with subprocess.call Martin Jansa
  5 siblings, 0 replies; 19+ messages in thread
From: Martin Jansa @ 2012-07-17 12:37 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Richard Purdie

From: Khem Raj <raj.khem@gmail.com>

kxgettext.o is generated when building ppc kernels
so we end up with packaging errors like

> ERROR: QA Issue: Architecture did not match (20 to 62) on
> /work/virtex5-poky-linux/linux-xilinx-2.6.38-r00/packages-split/kernel-dev/usr/src/kernel/scripts/kconfig/kxgettext.o

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/classes/kernel.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index de43550..433dd30 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -196,7 +196,7 @@ kernel_do_install() {
 	# during do_package for cross-compiled platforms
 	bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
 	           arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \
-		   scripts/kconfig/conf.o"
+		   scripts/kconfig/conf.o scripts/kconfig/kxgettext.o"
 	for entry in $bin_files; do
 		rm -f $kerneldir/$entry
 	done
-- 
1.7.8.6




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [meta-oe][PATCH 6/7] kernel.bbclass: add deploy link to KERNEL_IMAGETYPE
  2012-07-17 12:37   ` [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning Martin Jansa
                       ` (3 preceding siblings ...)
  2012-07-17 12:37     ` [meta-oe][PATCH 5/7] kernel.bbclass: Dont package kxgettext.o Martin Jansa
@ 2012-07-17 12:37     ` Martin Jansa
  2012-07-17 12:38     ` [meta-oe][PATCH 7/7] kernel.bbclass: replace os.system with subprocess.call Martin Jansa
  5 siblings, 0 replies; 19+ messages in thread
From: Martin Jansa @ 2012-07-17 12:37 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Christopher Larson

From: Christopher Larson <chris_larson@mentor.com>

It's common to provide a non-machine-suffixed link in DEPLOY_DIR_IMAGE, so
let's be consistent and do so here as well.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/classes/kernel.bbclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index 433dd30..248cd28 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -541,6 +541,7 @@ kernel_do_deploy() {
 	cd ${DEPLOYDIR}
 	rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
 	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
+	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGETYPE}
 
 	cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
 }
-- 
1.7.8.6




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [meta-oe][PATCH 7/7] kernel.bbclass: replace os.system with subprocess.call
  2012-07-17 12:37   ` [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning Martin Jansa
                       ` (4 preceding siblings ...)
  2012-07-17 12:37     ` [meta-oe][PATCH 6/7] kernel.bbclass: add deploy link to KERNEL_IMAGETYPE Martin Jansa
@ 2012-07-17 12:38     ` Martin Jansa
  5 siblings, 0 replies; 19+ messages in thread
From: Martin Jansa @ 2012-07-17 12:38 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Richard Purdie

From: Robert Yang <liezhi.yang@windriver.com>

Replace os.system with subprocess.call since the older function would
fail (more or less) silently if the executed program cannot be found

More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements

[YOCTO #2454]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/classes/kernel.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index 248cd28..810d6de 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -316,12 +316,12 @@ module_conf_rfcomm = "alias bt-proto-3 rfcomm"
 
 python populate_packages_prepend () {
 	def extract_modinfo(file):
-		import tempfile, re
+		import tempfile, re, subprocess
 		tempfile.tempdir = d.getVar("WORKDIR", True)
 		tf = tempfile.mkstemp()
 		tmpfile = tf[1]
 		cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("PATH", True), d.getVar("HOST_PREFIX", True) or "", file, tmpfile)
-		os.system(cmd)
+		subprocess.call(cmd, shell=True)
 		f = open(tmpfile)
 		l = f.read().split("\000")
 		f.close()
-- 
1.7.8.6




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality
  2012-07-16 17:55   ` Khem Raj
@ 2012-07-17 12:39     ` Martin Jansa
  0 siblings, 0 replies; 19+ messages in thread
From: Martin Jansa @ 2012-07-17 12:39 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]

On Mon, Jul 16, 2012 at 10:55:44AM -0700, Khem Raj wrote:
> On Mon, Jul 16, 2012 at 10:50 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> >
> > There is also this change
> > http://lists.linuxtogo.org/pipermail/openembedded-core/2012-April/021608.html
> > which never made it to oe-core version..
> 
> I missed that part. That would need an enhancement in OE-Core to
> provide a variable to override uImage if a machine asks for.

I've sent kernel.bbclass patches from oe-core to update meta-oe copy, so
that the diff will be smaller again.. then we can try to replace it with
machine_kernel_pr.bbclass..

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom
  2012-07-16 18:04           ` Martin Jansa
@ 2012-07-18 11:25             ` Martin Jansa
  0 siblings, 0 replies; 19+ messages in thread
From: Martin Jansa @ 2012-07-18 11:25 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

On Mon, Jul 16, 2012 at 08:04:30PM +0200, Martin Jansa wrote:
> On Mon, Jul 16, 2012 at 11:00:37AM -0700, Khem Raj wrote:
> > On Mon, Jul 16, 2012 at 10:58 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> > >
> > > Yes, but that would require distro config to be updated from
> > > ANGSTROM_BLACKLIST_PN to PNBLACKLIST[pn] at the same time this class is
> > > moved or duplicate all blacklist entries now and then remove
> > > ANGSTROM_BLACKLIST_PN after it's moved..
> > 
> > synchronisation can be worked out if you are willing.
> 
> Yes, it can and I'm willing to do it.. that's why haven't responded just
> with NACK :).

meta-shr layer was updated yesterday to cope with both blacklist
implemntations.. 

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-07-18 11:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-16 17:38 [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Khem Raj
2012-07-16 17:38 ` [RFC][meta-oe][PATCH 2/3] testlab.bbclass: Delete Khem Raj
2012-07-16 17:38 ` [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom Khem Raj
2012-07-16 17:46   ` Martin Jansa
2012-07-16 17:50     ` Khem Raj
2012-07-16 17:58       ` Martin Jansa
2012-07-16 18:00         ` Khem Raj
2012-07-16 18:04           ` Martin Jansa
2012-07-18 11:25             ` Martin Jansa
2012-07-16 17:50 ` [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Martin Jansa
2012-07-16 17:55   ` Khem Raj
2012-07-17 12:39     ` Martin Jansa
2012-07-17 12:37   ` [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning Martin Jansa
2012-07-17 12:37     ` [meta-oe][PATCH 2/7] recipes-kernel: make perf a standalone package Martin Jansa
2012-07-17 12:37     ` [meta-oe][PATCH 3/7] kernel: Add kernel headers to kernel-dev package Martin Jansa
2012-07-17 12:37     ` [meta-oe][PATCH 4/7] kernel.bbclass: add non-santized kernel provides Martin Jansa
2012-07-17 12:37     ` [meta-oe][PATCH 5/7] kernel.bbclass: Dont package kxgettext.o Martin Jansa
2012-07-17 12:37     ` [meta-oe][PATCH 6/7] kernel.bbclass: add deploy link to KERNEL_IMAGETYPE Martin Jansa
2012-07-17 12:38     ` [meta-oe][PATCH 7/7] kernel.bbclass: replace os.system with subprocess.call Martin Jansa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.