diff options
| -rw-r--r-- | meta/classes/kernel.bbclass | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index ce4c01a81f..d459569677 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | inherit linux-kernel-base module_strip | 1 | inherit linux-kernel-base module_strip |
| 2 | 2 | ||
| 3 | PROVIDES += "virtual/kernel" | 3 | PROVIDES += "virtual/kernel" |
| 4 | DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules" | 4 | DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX}" |
| 5 | 5 | ||
| 6 | # we include gcc above, we dont need virtual/libc | 6 | # we include gcc above, we dont need virtual/libc |
| 7 | INHIBIT_DEFAULT_DEPS = "1" | 7 | INHIBIT_DEFAULT_DEPS = "1" |
| @@ -293,12 +293,17 @@ fi | |||
| 293 | pkg_postinst_modules () { | 293 | pkg_postinst_modules () { |
| 294 | if [ -z "$D" ]; then | 294 | if [ -z "$D" ]; then |
| 295 | depmod -a ${KERNEL_VERSION} | 295 | depmod -a ${KERNEL_VERSION} |
| 296 | update-modules || true | 296 | else |
| 297 | depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION} | ||
| 297 | fi | 298 | fi |
| 298 | } | 299 | } |
| 299 | 300 | ||
| 300 | pkg_postrm_modules () { | 301 | pkg_postrm_modules () { |
| 301 | update-modules || true | 302 | if [ -z "$D" ]; then |
| 303 | depmod -a ${KERNEL_VERSION} | ||
| 304 | else | ||
| 305 | depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION} | ||
| 306 | fi | ||
| 302 | } | 307 | } |
| 303 | 308 | ||
| 304 | autoload_postinst_fragment() { | 309 | autoload_postinst_fragment() { |
| @@ -403,12 +408,10 @@ python populate_packages_prepend () { | |||
| 403 | 408 | ||
| 404 | dvar = d.getVar('PKGD', True) | 409 | dvar = d.getVar('PKGD', True) |
| 405 | 410 | ||
| 406 | use_update_modules = oe.utils.contains('DISTRO_FEATURES', 'update-modules', True, False, d) | ||
| 407 | |||
| 408 | # If autoloading is requested, output /etc/modules-load.d/<name>.conf and append | 411 | # If autoloading is requested, output /etc/modules-load.d/<name>.conf and append |
| 409 | # appropriate modprobe commands to the postinst | 412 | # appropriate modprobe commands to the postinst |
| 410 | autoload = d.getVar('module_autoload_%s' % basename, True) | 413 | autoload = d.getVar('module_autoload_%s' % basename, True) |
| 411 | if autoload and use_update_modules: | 414 | if autoload: |
| 412 | name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) | 415 | name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) |
| 413 | f = open(name, 'w') | 416 | f = open(name, 'w') |
| 414 | for m in autoload.split(): | 417 | for m in autoload.split(): |
| @@ -422,16 +425,15 @@ python populate_packages_prepend () { | |||
| 422 | 425 | ||
| 423 | # Write out any modconf fragment | 426 | # Write out any modconf fragment |
| 424 | modconf = d.getVar('module_conf_%s' % basename, True) | 427 | modconf = d.getVar('module_conf_%s' % basename, True) |
| 425 | if modconf and use_update_modules: | 428 | if modconf: |
| 426 | name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename) | 429 | name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename) |
| 427 | f = open(name, 'w') | 430 | f = open(name, 'w') |
| 428 | f.write("%s\n" % modconf) | 431 | f.write("%s\n" % modconf) |
| 429 | f.close() | 432 | f.close() |
| 430 | 433 | ||
| 431 | if use_update_modules: | 434 | files = d.getVar('FILES_%s' % pkg, True) |
| 432 | files = d.getVar('FILES_%s' % pkg, True) | 435 | files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename) |
| 433 | files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename) | 436 | d.setVar('FILES_%s' % pkg, files) |
| 434 | d.setVar('FILES_%s' % pkg, files) | ||
| 435 | 437 | ||
| 436 | if vals.has_key("description"): | 438 | if vals.has_key("description"): |
| 437 | old_desc = d.getVar('DESCRIPTION_' + pkg, True) or "" | 439 | old_desc = d.getVar('DESCRIPTION_' + pkg, True) or "" |
| @@ -447,17 +449,13 @@ python populate_packages_prepend () { | |||
| 447 | module_regex = '^(.*)\.k?o$' | 449 | module_regex = '^(.*)\.k?o$' |
| 448 | module_pattern = 'kernel-module-%s' | 450 | module_pattern = 'kernel-module-%s' |
| 449 | 451 | ||
| 450 | use_update_modules = oe.utils.contains('DISTRO_FEATURES', 'update-modules', True, False, d) | 452 | postinst = d.getVar('pkg_postinst_modules', True) |
| 451 | if use_update_modules: | 453 | postrm = d.getVar('pkg_postrm_modules', True) |
| 452 | postinst = d.getVar('pkg_postinst_modules', True) | 454 | |
| 453 | postrm = d.getVar('pkg_postrm_modules', True) | ||
| 454 | else: | ||
| 455 | postinst = None | ||
| 456 | postrm = None | ||
| 457 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') | 455 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') |
| 458 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') | 456 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') |
| 459 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') | 457 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') |
| 460 | do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='%skernel-%s' % (['', 'update-modules '][use_update_modules], d.getVar("KERNEL_VERSION", True))) | 458 | 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='kernel-%s' % (d.getVar("KERNEL_VERSION", True))) |
| 461 | 459 | ||
| 462 | # If modules-load.d and modprobe.d are empty at this point, remove them to | 460 | # If modules-load.d and modprobe.d are empty at this point, remove them to |
| 463 | # avoid warnings. removedirs only raises an OSError if an empty | 461 | # avoid warnings. removedirs only raises an OSError if an empty |
