summaryrefslogtreecommitdiffstats
path: root/meta-oe/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/classes')
-rw-r--r--meta-oe/classes/kernel.bbclass46
1 files changed, 23 insertions, 23 deletions
diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index e6f1bfa83..c6fc197aa 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -11,9 +11,9 @@ INITRAMFS_IMAGE ?= ""
11INITRAMFS_TASK ?= "" 11INITRAMFS_TASK ?= ""
12 12
13python __anonymous () { 13python __anonymous () {
14 kerneltype = d.getVar('KERNEL_IMAGETYPE', 1) or '' 14 kerneltype = d.getVar('KERNEL_IMAGETYPE', True) or ''
15 if kerneltype == 'uImage': 15 if kerneltype == 'uImage':
16 depends = d.getVar("DEPENDS", 1) 16 depends = d.getVar("DEPENDS", True)
17 depends = "%s u-boot-mkimage-native" % depends 17 depends = "%s u-boot-mkimage-native" % depends
18 d.setVar("DEPENDS", depends) 18 d.setVar("DEPENDS", depends)
19 19
@@ -80,7 +80,7 @@ EXTRA_OEMAKE = ""
80 80
81KERNEL_ALT_IMAGETYPE ??= "" 81KERNEL_ALT_IMAGETYPE ??= ""
82 82
83KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', 1))}" 83KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
84 84
85kernel_do_compile() { 85kernel_do_compile() {
86 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE 86 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
@@ -311,10 +311,10 @@ module_conf_rfcomm = "alias bt-proto-3 rfcomm"
311python populate_packages_prepend () { 311python populate_packages_prepend () {
312 def extract_modinfo(file): 312 def extract_modinfo(file):
313 import tempfile, re 313 import tempfile, re
314 tempfile.tempdir = d.getVar("WORKDIR", 1) 314 tempfile.tempdir = d.getVar("WORKDIR", True)
315 tf = tempfile.mkstemp() 315 tf = tempfile.mkstemp()
316 tmpfile = tf[1] 316 tmpfile = tf[1]
317 cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("PATH", 1), d.getVar("HOST_PREFIX", 1) or "", file, tmpfile) 317 cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("PATH", True), d.getVar("HOST_PREFIX", True) or "", file, tmpfile)
318 os.system(cmd) 318 os.system(cmd)
319 f = open(tmpfile) 319 f = open(tmpfile)
320 l = f.read().split("\000") 320 l = f.read().split("\000")
@@ -333,18 +333,18 @@ python populate_packages_prepend () {
333 def parse_depmod(): 333 def parse_depmod():
334 import re 334 import re
335 335
336 dvar = d.getVar('PKGD', 1) 336 dvar = d.getVar('PKGD', True)
337 if not dvar: 337 if not dvar:
338 bb.error("PKGD not defined") 338 bb.error("PKGD not defined")
339 return 339 return
340 340
341 kernelver = d.getVar('KERNEL_VERSION', 1) 341 kernelver = d.getVar('KERNEL_VERSION', True)
342 kernelver_stripped = kernelver 342 kernelver_stripped = kernelver
343 m = re.match('^(.*-hh.*)[\.\+].*$', kernelver) 343 m = re.match('^(.*-hh.*)[\.\+].*$', kernelver)
344 if m: 344 if m:
345 kernelver_stripped = m.group(1) 345 kernelver_stripped = m.group(1)
346 path = d.getVar("PATH", 1) 346 path = d.getVar("PATH", True)
347 host_prefix = d.getVar("HOST_PREFIX", 1) or "" 347 host_prefix = d.getVar("HOST_PREFIX", True) or ""
348 348
349 cmd = "PATH=\"%s\" %sdepmod -n -a -r -b %s -F %s/boot/System.map-%s %s" % (path, host_prefix, dvar, dvar, kernelver, kernelver_stripped) 349 cmd = "PATH=\"%s\" %sdepmod -n -a -r -b %s -F %s/boot/System.map-%s %s" % (path, host_prefix, dvar, dvar, kernelver, kernelver_stripped)
350 f = os.popen(cmd, 'r') 350 f = os.popen(cmd, 'r')
@@ -382,9 +382,9 @@ python populate_packages_prepend () {
382 382
383 def get_dependencies(file, pattern, format): 383 def get_dependencies(file, pattern, format):
384 # file no longer includes PKGD 384 # file no longer includes PKGD
385 file = file.replace(d.getVar('PKGD', 1) or '', '', 1) 385 file = file.replace(d.getVar('PKGD', True) or '', '', 1)
386 # instead is prefixed with /lib/modules/${KERNEL_VERSION} 386 # instead is prefixed with /lib/modules/${KERNEL_VERSION}
387 file = file.replace("/lib/modules/%s/" % d.getVar('KERNEL_VERSION', 1) or '', '', 1) 387 file = file.replace("/lib/modules/%s/" % d.getVar('KERNEL_VERSION', True) or '', '', 1)
388 388
389 if module_deps.has_key(file): 389 if module_deps.has_key(file):
390 import re 390 import re
@@ -403,40 +403,40 @@ python populate_packages_prepend () {
403 import re 403 import re
404 vals = extract_modinfo(file) 404 vals = extract_modinfo(file)
405 405
406 dvar = d.getVar('PKGD', 1) 406 dvar = d.getVar('PKGD', True)
407 407
408 # If autoloading is requested, output /etc/modutils/<name> and append 408 # If autoloading is requested, output /etc/modutils/<name> and append
409 # appropriate modprobe commands to the postinst 409 # appropriate modprobe commands to the postinst
410 autoload = d.getVar('module_autoload_%s' % basename, 1) 410 autoload = d.getVar('module_autoload_%s' % basename, True)
411 if autoload: 411 if autoload:
412 name = '%s/etc/modutils/%s' % (dvar, basename) 412 name = '%s/etc/modutils/%s' % (dvar, basename)
413 f = open(name, 'w') 413 f = open(name, 'w')
414 for m in autoload.split(): 414 for m in autoload.split():
415 f.write('%s\n' % m) 415 f.write('%s\n' % m)
416 f.close() 416 f.close()
417 postinst = d.getVar('pkg_postinst_%s' % pkg, 1) 417 postinst = d.getVar('pkg_postinst_%s' % pkg, True)
418 if not postinst: 418 if not postinst:
419 bb.fatal("pkg_postinst_%s not defined" % pkg) 419 bb.fatal("pkg_postinst_%s not defined" % pkg)
420 postinst += d.getVar('autoload_postinst_fragment', 1) % autoload 420 postinst += d.getVar('autoload_postinst_fragment', True) % autoload
421 d.setVar('pkg_postinst_%s' % pkg, postinst) 421 d.setVar('pkg_postinst_%s' % pkg, postinst)
422 422
423 # Write out any modconf fragment 423 # Write out any modconf fragment
424 modconf = d.getVar('module_conf_%s' % basename, 1) 424 modconf = d.getVar('module_conf_%s' % basename, True)
425 if modconf: 425 if modconf:
426 name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename) 426 name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename)
427 f = open(name, 'w') 427 f = open(name, 'w')
428 f.write("%s\n" % modconf) 428 f.write("%s\n" % modconf)
429 f.close() 429 f.close()
430 430
431 files = d.getVar('FILES_%s' % pkg, 1) 431 files = d.getVar('FILES_%s' % pkg, True)
432 files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename) 432 files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename)
433 d.setVar('FILES_%s' % pkg, files) 433 d.setVar('FILES_%s' % pkg, files)
434 434
435 if vals.has_key("description"): 435 if vals.has_key("description"):
436 old_desc = d.getVar('DESCRIPTION_' + pkg, 1) or "" 436 old_desc = d.getVar('DESCRIPTION_' + pkg, True) or ""
437 d.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"]) 437 d.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"])
438 438
439 rdepends_str = d.getVar('RDEPENDS_' + pkg, 1) 439 rdepends_str = d.getVar('RDEPENDS_' + pkg, True)
440 if rdepends_str: 440 if rdepends_str:
441 rdepends = rdepends_str.split() 441 rdepends = rdepends_str.split()
442 else: 442 else:
@@ -448,12 +448,12 @@ python populate_packages_prepend () {
448 module_regex = '^(.*)\.k?o$' 448 module_regex = '^(.*)\.k?o$'
449 module_pattern = 'kernel-module-%s' 449 module_pattern = 'kernel-module-%s'
450 450
451 postinst = d.getVar('pkg_postinst_modules', 1) 451 postinst = d.getVar('pkg_postinst_modules', True)
452 postrm = d.getVar('pkg_postrm_modules', 1) 452 postrm = d.getVar('pkg_postrm_modules', True)
453 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') 453 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
454 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') 454 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
455 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') 455 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
456 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", 1)) 456 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))
457 457
458 import re 458 import re
459 metapkg = "kernel-modules" 459 metapkg = "kernel-modules"
@@ -465,7 +465,7 @@ python populate_packages_prepend () {
465 pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1)) 465 pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))
466 blacklist.append(pkg) 466 blacklist.append(pkg)
467 metapkg_rdepends = [] 467 metapkg_rdepends = []
468 packages = d.getVar('PACKAGES', 1).split() 468 packages = d.getVar('PACKAGES', True).split()
469 for pkg in packages[1:]: 469 for pkg in packages[1:]:
470 if not pkg in blacklist and not pkg in metapkg_rdepends: 470 if not pkg in blacklist and not pkg in metapkg_rdepends:
471 metapkg_rdepends.append(pkg) 471 metapkg_rdepends.append(pkg)