summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/insane.bbclass8
-rw-r--r--classes/kernel.bbclass16
-rw-r--r--classes/package.bbclass31
-rw-r--r--classes/package_deb.bbclass21
-rw-r--r--classes/package_ipk.bbclass10
5 files changed, 59 insertions, 27 deletions
diff --git a/classes/insane.bbclass b/classes/insane.bbclass
index d54d6c7b9e..83f8c43bba 100644
--- a/classes/insane.bbclass
+++ b/classes/insane.bbclass
@@ -101,7 +101,7 @@ def package_qa_get_elf(path, bits32):
def my_assert(expectation, result):
if not expectation == result:
#print "'%x','%x'" % (ord(expectation), ord(result))
- raise "This does not work as expected"
+ raise Exception("This does not work as expected")
my_assert = staticmethod(my_assert)
def __init__(self, name):
@@ -124,13 +124,13 @@ def package_qa_get_elf(path, bits32):
self.sex = self.data[ELFFile.EI_DATA]
if self.sex == chr(ELFFile.ELFDATANONE):
- raise "Can't be"
+ raise Exception("self.sex == ELFDATANONE")
elif self.sex == chr(ELFFile.ELFDATA2LSB):
self.sex = "<"
elif self.sex == chr(ELFFile.ELFDATA2MSB):
self.sex = ">"
else:
- raise "Even more worse"
+ raise Exception("Unknown self.sex")
def osAbi(self):
return ord(self.data[ELFFile.EI_OSABI])
@@ -376,7 +376,7 @@ def package_qa_check_rdepends(pkg, workdir, d):
bb.data.setVar('ROOT', '', localdata)
bb.data.setVar('ROOT_%s' % pkg, root, localdata)
- pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, 1)
+ pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, True)
if not pkgname:
pkgname = pkg
bb.data.setVar('PKG', pkgname, localdata)
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index b25275e702..5976f42c71 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -142,6 +142,7 @@ kernel_do_install() {
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}
install -d ${D}/etc/modutils
if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then
install -d ${D}/etc/modprobe.d
@@ -160,6 +161,18 @@ kernel_do_configure() {
yes '' | oe_runmake oldconfig
}
+do_menuconfig() {
+ export TERMWINDOWTITLE="${PN} Kernel Configuration"
+ export SHELLCMDS="make menuconfig"
+ ${TERMCMDRUN}
+ if [ $? -ne 0 ]; then
+ echo "Fatal: '${TERMCMD}' not found. Check TERMCMD variable."
+ exit 1
+ fi
+}
+do_menuconfig[nostamp] = "1"
+addtask menuconfig after do_patch
+
pkg_postinst_kernel () {
cd /${KERNEL_IMAGEDEST}; update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true
}
@@ -174,10 +187,11 @@ EXPORT_FUNCTIONS do_compile do_install do_stage do_configure
# kernel-base becomes kernel-${KERNEL_VERSION}
# kernel-image becomes kernel-image-${KERNEL_VERISON}
-PACKAGES = "kernel kernel-base kernel-image kernel-dev"
+PACKAGES = "kernel kernel-base kernel-image kernel-dev kernel-vmlinux"
FILES = ""
FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
FILES_kernel-dev = "/boot/System.map* /boot/config*"
+FILES_kernel-vmlinux = "/boot/vmlinux*"
RDEPENDS_kernel = "kernel-base"
# Allow machines to override this dependency if kernel image files are
# not wanted in images as standard
diff --git a/classes/package.bbclass b/classes/package.bbclass
index 5233fa363c..516cae823d 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -128,11 +128,12 @@ python () {
deps += " %s:do_populate_staging" % dep
bb.data.setVarFlag('do_package', 'depends', deps, d)
+ deps = (bb.data.getVarFlag('do_package', 'deptask', d) or "").split()
# shlibs requires any DEPENDS to have already packaged for the *.list files
- bb.data.setVarFlag('do_package', 'deptask', 'do_package', d)
+ deps.append("do_package")
+ bb.data.setVarFlag('do_package', 'deptask', " ".join(deps), d)
}
-
def runstrip(file, d):
# Function to strip a single file, called from populate_packages below
# A working 'file' (one which works on the target architecture)
@@ -481,6 +482,8 @@ python populate_packages () {
populate_packages[dirs] = "${D}"
python emit_pkgdata() {
+ from glob import glob
+
def write_if_exists(f, pkg, var):
def encode(str):
import codecs
@@ -492,14 +495,14 @@ python emit_pkgdata() {
f.write('%s_%s: %s\n' % (var, pkg, encode(val)))
packages = bb.data.getVar('PACKAGES', d, 1)
- if not packages:
- return
data_file = bb.data.expand("${PKGDATA_DIR}/${PN}", d)
f = open(data_file, 'w')
f.write("PACKAGES: %s\n" % packages)
f.close()
+ workdir = bb.data.getVar('WORKDIR', d, 1)
+
for pkg in packages.split():
subdata_file = bb.data.expand("${PKGDATA_DIR}/runtime/%s" % pkg, d)
sf = open(subdata_file, 'w')
@@ -519,6 +522,13 @@ python emit_pkgdata() {
write_if_exists(sf, pkg, 'pkg_preinst')
write_if_exists(sf, pkg, 'pkg_prerm')
sf.close()
+
+ allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1)
+ root = "%s/install/%s" % (workdir, pkg)
+ os.chdir(root)
+ g = glob('*')
+ if g or allow_empty == "1":
+ file(bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d), 'w').close()
}
emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime"
@@ -540,9 +550,6 @@ python package_do_shlibs() {
libdir_re = re.compile(".*/lib$")
packages = bb.data.getVar('PACKAGES', d, 1)
- if not packages:
- bb.debug(1, "no packages to build; not calculating shlibs")
- return
workdir = bb.data.getVar('WORKDIR', d, 1)
if not workdir:
@@ -678,9 +685,6 @@ python package_do_pkgconfig () {
import re, os
packages = bb.data.getVar('PACKAGES', d, 1)
- if not packages:
- bb.debug(1, "no packages to build; not calculating pkgconfig dependencies")
- return
workdir = bb.data.getVar('WORKDIR', d, 1)
if not workdir:
@@ -786,7 +790,7 @@ python package_do_pkgconfig () {
}
python read_shlibdeps () {
- packages = (bb.data.getVar('PACKAGES', d, 1) or "").split()
+ packages = bb.data.getVar('PACKAGES', d, 1).split()
for pkg in packages:
rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
shlibsfile = bb.data.expand("${PKGDEST}/" + pkg + ".shlibdeps", d)
@@ -896,6 +900,11 @@ PACKAGEFUNCS ?= "package_do_split_locales \
emit_pkgdata"
python package_do_package () {
+ packages = (bb.data.getVar('PACKAGES', d, 1) or "").split()
+ if len(packages) < 1:
+ bb.debug(1, "No packages to build, skipping do_package")
+ return
+
for f in (bb.data.getVar('PACKAGEFUNCS', d, 1) or '').split():
bb.build.exec_func(f, d)
}
diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass
index 2ab537f174..b85ffe254f 100644
--- a/classes/package_deb.bbclass
+++ b/classes/package_deb.bbclass
@@ -8,6 +8,14 @@ BOOTSTRAP_EXTRA_RDEPENDS += "dpkg"
DISTRO_EXTRA_RDEPENDS += "dpkg"
IMAGE_PKGTYPE ?= "deb"
+# Map TARGET_ARCH to Debian's ideas about architectures
+DPKG_ARCH ?= "${TARGET_ARCH}"
+DPKG_ARCH_x86 ?= "i386"
+DPKG_ARCH_i486 ?= "i386"
+DPKG_ARCH_i586 ?= "i386"
+DPKG_ARCH_i686 ?= "i386"
+DPKG_ARCH_pentium ?= "i386"
+
python package_deb_fn () {
from bb import data
bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d)
@@ -38,7 +46,7 @@ python do_package_deb_install () {
if (exitstatus != 0 ):
raise bb.build.FuncFailed(output)
- f = open(os.path.join(tmpdir, "stamps", "do_packages"), "w")
+ f = open(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"), "w")
f.close()
# NOTE: this env stuff is racy at best, we need something more capable
@@ -86,9 +94,9 @@ python do_package_deb () {
return
tmpdir = bb.data.getVar('TMPDIR', d, 1)
- # Invalidate the packages file
- if os.access(os.path.join(tmpdir, "stamps", "do_packages"),os.R_OK):
- os.unlink(os.path.join(tmpdir, "stamps", "do_packages"))
+
+ if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK):
+ os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"))
if packages == []:
bb.debug(1, "No packages; nothing to do")
@@ -141,6 +149,7 @@ python do_package_deb () {
note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
unlockfile(lf)
continue
+
controldir = os.path.join(root, 'DEBIAN')
bb.mkdirhier(controldir)
os.chmod(controldir, 0755)
@@ -161,7 +170,7 @@ python do_package_deb () {
fields.append(["Section: %s\n", ['SECTION']])
fields.append(["Priority: %s\n", ['PRIORITY']])
fields.append(["Maintainer: %s\n", ['MAINTAINER']])
- fields.append(["Architecture: %s\n", ['TARGET_ARCH']])
+ fields.append(["Architecture: %s\n", ['DPKG_ARCH']])
fields.append(["OE: %s\n", ['PN']])
fields.append(["Homepage: %s\n", ['HOMEPAGE']])
@@ -175,7 +184,7 @@ python do_package_deb () {
data = bb.data.getVar(i, d, 1)
if data is None:
raise KeyError(f)
- if i == 'TARGET_ARCH' and bb.data.getVar('PACKAGE_ARCH', d, 1) == 'all':
+ if i == 'DPKG_ARCH' and bb.data.getVar('PACKAGE_ARCH', d, 1) == 'all':
data = 'all'
l2.append(data)
return l2
diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass
index 0b7f274a96..a12899e2a1 100644
--- a/classes/package_ipk.bbclass
+++ b/classes/package_ipk.bbclass
@@ -49,11 +49,11 @@ python package_ipk_install () {
if (not os.access(os.path.join(ipkdir,"Packages"), os.R_OK) or
- not os.access(os.path.join(tmpdir, "stamps", "do_packages"),os.R_OK):
+ not os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),os.R_OK):
ret = os.system('ipkg-make-index -p %s %s ' % (os.path.join(ipkdir, "Packages"), ipkdir))
if (ret != 0 ):
raise bb.build.FuncFailed
- f=open(os.path.join(tmpdir, "stamps", "do_packages"),"w")
+ f = open(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),"w")
f.close()
ret = os.system('ipkg-cl -o %s -f %s update' % (rootfs, conffile))
@@ -143,9 +143,9 @@ python do_package_ipk () {
return
tmpdir = bb.data.getVar('TMPDIR', d, 1)
- # Invalidate the packages file
- if os.access(os.path.join(tmpdir, "stamps", "do_packages"),os.R_OK):
- os.unlink(os.path.join(tmpdir, "stamps", "do_packages"))
+
+ if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
+ os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
if packages == []:
bb.debug(1, "No packages; nothing to do")