diff options
author | Phil Blundell <philb@gnu.org> | 2012-09-26 13:02:26 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-10-18 12:13:33 +0100 |
commit | 8f856918605bc634b32810e7a15a2f70b590e4de (patch) | |
tree | d5760530109b592810f2d2e735ff9d6c871c263f /meta/classes/kernel.bbclass | |
parent | 895994afd8993e06eb5c8dc0274406951cec6971 (diff) | |
download | poky-8f856918605bc634b32810e7a15a2f70b590e4de.tar.gz |
kernel.bbclass, module.bbclass: Make update-modules optional
The update-modules mechanism is something of a historical relic and it isn't
entirely clear that it has a great deal of value nowadays. Also, it causes a
problem when building a read-only rootfs since update-modules itself refuses
to configure offline.
Allow DISTROs to circumvent this whole thing by declaring (via DISTRO_FEATURES)
that they don't wish to use update-modules. This is backfilled for existing
distributions and will have to be marked as CONSIDERED by those who actually
don't want it.
(From OE-Core rev: 14bf8ed115453077b4d4042b4b70ed6b3bca2a9f)
Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r-- | meta/classes/kernel.bbclass | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 36bc3c7cf4..0df8f086ce 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -398,10 +398,12 @@ python populate_packages_prepend () { | |||
398 | 398 | ||
399 | dvar = d.getVar('PKGD', True) | 399 | dvar = d.getVar('PKGD', True) |
400 | 400 | ||
401 | use_update_modules = oe.utils.contains('DISTRO_FEATURES', 'update-modules', True, False, d) | ||
402 | |||
401 | # If autoloading is requested, output /etc/modules-load.d/<name>.conf and append | 403 | # If autoloading is requested, output /etc/modules-load.d/<name>.conf and append |
402 | # appropriate modprobe commands to the postinst | 404 | # appropriate modprobe commands to the postinst |
403 | autoload = d.getVar('module_autoload_%s' % basename, True) | 405 | autoload = d.getVar('module_autoload_%s' % basename, True) |
404 | if autoload: | 406 | if autoload and use_update_modules: |
405 | name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) | 407 | name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) |
406 | f = open(name, 'w') | 408 | f = open(name, 'w') |
407 | for m in autoload.split(): | 409 | for m in autoload.split(): |
@@ -415,15 +417,16 @@ python populate_packages_prepend () { | |||
415 | 417 | ||
416 | # Write out any modconf fragment | 418 | # Write out any modconf fragment |
417 | modconf = d.getVar('module_conf_%s' % basename, True) | 419 | modconf = d.getVar('module_conf_%s' % basename, True) |
418 | if modconf: | 420 | if modconf and use_update_modules: |
419 | name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename) | 421 | name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename) |
420 | f = open(name, 'w') | 422 | f = open(name, 'w') |
421 | f.write("%s\n" % modconf) | 423 | f.write("%s\n" % modconf) |
422 | f.close() | 424 | f.close() |
423 | 425 | ||
424 | files = d.getVar('FILES_%s' % pkg, True) | 426 | if use_update_modules: |
425 | files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename) | 427 | files = d.getVar('FILES_%s' % pkg, True) |
426 | d.setVar('FILES_%s' % pkg, files) | 428 | files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename) |
429 | d.setVar('FILES_%s' % pkg, files) | ||
427 | 430 | ||
428 | if vals.has_key("description"): | 431 | if vals.has_key("description"): |
429 | old_desc = d.getVar('DESCRIPTION_' + pkg, True) or "" | 432 | old_desc = d.getVar('DESCRIPTION_' + pkg, True) or "" |
@@ -439,12 +442,17 @@ python populate_packages_prepend () { | |||
439 | module_regex = '^(.*)\.k?o$' | 442 | module_regex = '^(.*)\.k?o$' |
440 | module_pattern = 'kernel-module-%s' | 443 | module_pattern = 'kernel-module-%s' |
441 | 444 | ||
442 | postinst = d.getVar('pkg_postinst_modules', True) | 445 | use_update_modules = oe.utils.contains('DISTRO_FEATURES', 'update-modules', True, False, d) |
443 | postrm = d.getVar('pkg_postrm_modules', True) | 446 | if use_update_modules: |
447 | postinst = d.getVar('pkg_postinst_modules', True) | ||
448 | postrm = d.getVar('pkg_postrm_modules', True) | ||
449 | else: | ||
450 | postinst = None | ||
451 | postrm = None | ||
444 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') | 452 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') |
445 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') | 453 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') |
446 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') | 454 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') |
447 | 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)) | 455 | 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))) |
448 | 456 | ||
449 | # If modules-load.d and modprobe.d are empty at this point, remove them to | 457 | # If modules-load.d and modprobe.d are empty at this point, remove them to |
450 | # avoid warnings. removedirs only raises an OSError if an empty | 458 | # avoid warnings. removedirs only raises an OSError if an empty |