Bug 6461 - split_kernel_module_packages fails for meta-intel BSPs
Summary: split_kernel_module_packages fails for meta-intel BSPs
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: kernel (show other bugs)
Version: 1.7
Hardware: x86 Multiple
: Undecided normal
Target Milestone: ---
Assignee: Darren Hart
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-06-18 04:41 UTC by Nitin Kamble
Modified: 2014-06-18 16:02 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nitin Kamble 2014-06-18 04:41:22 UTC
ERROR: Error executing a python function in /home/nitin/build-test-bsps/poky.git/meta/recipes-kernel/linux/linux-yocto_3.14.bb:

The stack trace of python calls that resulted in this exception/failure was:
File: 'split_kernel_module_packages', lineno: 164, function: <module>
     0160:        if len(os.listdir(dir)) == 0:
     0161:            os.rmdir(dir)
     0162:
     0163:
 *** 0164:split_kernel_module_packages(d)
     0165:
File: 'split_kernel_module_packages', lineno: 150, function: split_kernel_module_packages
     0146:
     0147:    postinst = d.getVar('pkg_postinst_modules', True)
     0148:    postrm = d.getVar('pkg_postrm_modules', True)
     0149:
 *** 0150:    modules = 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)))
     0151:    if modules:
     0152:        metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE', True)
     0153:        d.appendVar('RDEPENDS_' + metapkg, ' '+' '.join(modules))
     0154:
File: 'package.bbclass', lineno: 148, function: do_split_packages
     0144:                d.setVar('pkg_postrm_' + pkg, postrm)
     0145:        else:
     0146:            d.setVar('FILES_' + pkg, oldfiles + " " + newfile)
     0147:        if callable(hook):
 *** 0148:            hook(f, pkg, file_regex, output_pattern, m.group(1))
     0149:
     0150:    d.setVar('PACKAGES', ' '.join(packages))
     0151:    return split_packages
     0152:
File: 'split_kernel_module_packages', lineno: 109, function: frob_metadata
  File "split_kernel_module_packages", line 109, in frob_metadata

Exception: AttributeError: 'NoneType' object has no attribute 'split'

ERROR: Function failed: split_kernel_module_packages
ERROR: Logfile of failure stored in: /srv/home/nitin/build-test-bsps/build-common/tmp/work/corei7-64-intel-common-poky-linux/linux-yocto/3.14.4+gitAUTOINC+62f236c734_cb22733185-r0/temp/log.do_package.67449
ERROR: Task 18 (/home/nitin/build-test-bsps/poky.git/meta/recipes-kernel/linux/linux-yocto_3.14.bb, do_package) failed with exit code '1'
NOTE: Tasks Summary: Attempted 401 tasks of which 400 didn't need to be rerun and 1 failed.
No currently running tasks (390 of 404)
Comment 1 Nitin Kamble 2014-06-18 04:50:15 UTC
'bitbake -e virtual/kernel' shows this:
KERNEL_MODULE_AUTOLOAD=" uio iwlwif"
Comment 2 Nitin Kamble 2014-06-18 04:51:36 UTC
And the kernel recipe has these lines:

# For Crystalforest and Romley
KERNEL_MODULE_AUTOLOAD += "uio"

# For FRI2, NUC
KERNEL_MODULE_AUTOLOAD += "iwlwifi"
Comment 3 Nitin Kamble 2014-06-18 05:44:16 UTC
for me this is fixing the build issue:

RP, is this the right fix?

diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass
index e38a6f6..088de5f 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -137,7 +137,7 @@ python split_kernel_module_packages () {
         if basename in autoloadlist:
             name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename)
             f = open(name, 'w')
-            for m in autoload.split():
+            for m in autoloadlist:
                 f.write('%s\n' % m)
             f.close()
             postinst = d.getVar('pkg_postinst_%s' % pkg, True)
Comment 4 Nitin Kamble 2014-06-18 16:02:32 UTC
Richard commited a corrected version of my attempted of fix.


commit dae258afc85431169ff17f0a50061fc3a3ef6526
Author: Richard Purdie <richard.purdie@linuxfoundation.org>
Date:   Wed Jun 18 10:39:39 2014 +0100

    kernel-module-split: Fix KERNEL_MODULE_AUTOLOAD handling
    
    Addresses the problem:
    
    The stack trace of python calls that resulted in this exception/failure was:
    File: 'split_kernel_module_packages', lineno: 164, function: <module>
         0160:        if len(os.listdir(dir)) == 0:
         0161:            os.rmdir(dir)
         0162:
         0163:
     *** 0164:split_kernel_module_packages(d)
         0165:
    File: 'split_kernel_module_packages', lineno: 150, function: split_kernel_module_packages
         0146:     0147:    postinst = d.getVar('pkg_postinst_modules', True)
         0148:    postrm = d.getVar('pkg_postrm_modules', True)
         0149:
     *** 0150:    modules = 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)))
         0151:    if modules:
         0152:        metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE', True)
         0153:        d.appendVar('RDEPENDS_' + metapkg, ' '+' '.join(modules))
         0154:
    File: 'package.bbclass', lineno: 148, function: do_split_packages
         0144:                d.setVar('pkg_postrm_' + pkg, postrm)
         0145:        else:
         0146:            d.setVar('FILES_' + pkg, oldfiles + " " + newfile)
         0147:        if callable(hook):
     *** 0148:            hook(f, pkg, file_regex, output_pattern, m.group(1))
         0149:
         0150:    d.setVar('PACKAGES', ' '.join(packages))
         0151:    return split_packages
         0152:
    File: 'split_kernel_module_packages', lineno: 109, function: frob_metadata
    File "split_kernel_module_packages", line 109, in frob_metadata
    
    Exception: AttributeError: 'NoneType' object has no attribute 'split'
    
    ERROR: Function failed: split_kernel_module_packages
    
    [YOCTO #6461]
    
    [a revised version of a patch from Nitin Kamble]
    
    (From OE-Core rev: f30d12b4fbfe7d6b581598efa9ceca69dcfb4294)
    
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>