summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel.bbclass
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2012-03-07 00:06:46 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-08 11:55:39 -0800
commit31a03ed08d7e9985c4d5f5693ca7e5e31354708f (patch)
treee7671e487aaf615634730c6f40d12502e114c558 /meta/classes/kernel.bbclass
parent8cef3e58cda49d2396ccc69f480a283fad1938a1 (diff)
downloadpoky-31a03ed08d7e9985c4d5f5693ca7e5e31354708f.tar.gz
kernel.bbclass: Remove warnings for modutils and modprobe.d
Fixes [Yocto #2036] The source and build directories are unused, remove them. The modutils and modprobe.d directories may be used if modules are built that are either autoloaded or have modprobe.d entries. This isn't known at install time, so check after the package split if these directories are empty and remove them if they are. (From OE-Core rev: 6068f3229397baf561b1e84a22b570a803d95c49) Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: Paul Eggleton <paul.eggleton@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.bbclass10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 8fbec90ef1..169df33b31 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -105,6 +105,8 @@ kernel_do_install() {
105 oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install 105 oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
106 rm -f "${D}/lib/modules/${KERNEL_VERSION}/modules.order" 106 rm -f "${D}/lib/modules/${KERNEL_VERSION}/modules.order"
107 rm -f "${D}/lib/modules/${KERNEL_VERSION}/modules.builtin" 107 rm -f "${D}/lib/modules/${KERNEL_VERSION}/modules.builtin"
108 rm "${D}/lib/modules/${KERNEL_VERSION}/build"
109 rm "${D}/lib/modules/${KERNEL_VERSION}/source"
108 else 110 else
109 bbnote "no modules to install" 111 bbnote "no modules to install"
110 fi 112 fi
@@ -450,6 +452,14 @@ python populate_packages_prepend () {
450 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') 452 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
451 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)) 453 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))
452 454
455 # If modutils and modprobe.d are empty at this point, remove them to
456 # avoid warnings. removedirs only raises an OSError if an empty
457 # directory cannot be removed.
458 dvar = d.getVar('PKGD', True)
459 for dir in ["%s/etc/modutils" % (dvar), "%s/etc/modprobe.d" % (dvar)]:
460 if len(os.listdir(dir)) == 0:
461 os.rmdir(dir)
462
453 import re 463 import re
454 metapkg = "kernel-modules" 464 metapkg = "kernel-modules"
455 d.setVar('ALLOW_EMPTY_' + metapkg, "1") 465 d.setVar('ALLOW_EMPTY_' + metapkg, "1")