diff options
-rw-r--r-- | meta/classes-recipe/kernel-module-split.bbclass | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/meta/classes-recipe/kernel-module-split.bbclass b/meta/classes-recipe/kernel-module-split.bbclass index 9487365eb7..a2d81f18e2 100644 --- a/meta/classes-recipe/kernel-module-split.bbclass +++ b/meta/classes-recipe/kernel-module-split.bbclass | |||
@@ -99,9 +99,12 @@ python split_kernel_module_packages () { | |||
99 | bb.warn("module_autoload_%s was replaced by KERNEL_MODULE_AUTOLOAD for cases where basename == module name, please drop it" % basename) | 99 | bb.warn("module_autoload_%s was replaced by KERNEL_MODULE_AUTOLOAD for cases where basename == module name, please drop it" % basename) |
100 | if autoload and basename not in autoloadlist: | 100 | if autoload and basename not in autoloadlist: |
101 | bb.warn("module_autoload_%s is defined but '%s' isn't included in KERNEL_MODULE_AUTOLOAD, please add it there" % (basename, basename)) | 101 | bb.warn("module_autoload_%s is defined but '%s' isn't included in KERNEL_MODULE_AUTOLOAD, please add it there" % (basename, basename)) |
102 | |||
103 | # The .conf file can either be installed by a recipe or generated from module_autoload_* | ||
104 | conf = '%s/%s.conf' % (d.getVar('modulesloaddir'), basename) | ||
105 | name = '%s%s' % (dvar, conf) | ||
106 | # If module name is in KERNEL_MODULE_AUTOLOAD, then generate the .conf file and write to `name`. | ||
102 | if basename in autoloadlist: | 107 | if basename in autoloadlist: |
103 | conf = '%s/%s.conf' % (d.getVar('modulesloaddir'), basename) | ||
104 | name = '%s%s' % (dvar, conf) | ||
105 | os.makedirs(os.path.dirname(name), exist_ok=True) | 108 | os.makedirs(os.path.dirname(name), exist_ok=True) |
106 | with open(name, 'w') as f: | 109 | with open(name, 'w') as f: |
107 | if autoload: | 110 | if autoload: |
@@ -109,6 +112,9 @@ python split_kernel_module_packages () { | |||
109 | f.write('%s\n' % m) | 112 | f.write('%s\n' % m) |
110 | else: | 113 | else: |
111 | f.write('%s\n' % basename) | 114 | f.write('%s\n' % basename) |
115 | # If the .conf file exits, then add it to FILES:* and CONFFILES:* and add postinstall hook. | ||
116 | # It doesn't matter if it was generated from module_autoload_* or installed by the recipe. | ||
117 | if os.path.exists(name): | ||
112 | conf2append = ' %s' % conf | 118 | conf2append = ' %s' % conf |
113 | d.appendVar('FILES:%s' % pkg, conf2append) | 119 | d.appendVar('FILES:%s' % pkg, conf2append) |
114 | d.appendVar('CONFFILES:%s' % pkg, conf2append) | 120 | d.appendVar('CONFFILES:%s' % pkg, conf2append) |
@@ -121,19 +127,24 @@ python split_kernel_module_packages () { | |||
121 | # Write out any modconf fragment | 127 | # Write out any modconf fragment |
122 | modconflist = (d.getVar("KERNEL_MODULE_PROBECONF") or "").split() | 128 | modconflist = (d.getVar("KERNEL_MODULE_PROBECONF") or "").split() |
123 | modconf = d.getVar('module_conf_%s' % basename) | 129 | modconf = d.getVar('module_conf_%s' % basename) |
130 | |||
131 | # The .conf file can either be installed by a recipe or generated from module_conf_* | ||
132 | conf = '%s/%s.conf' % (d.getVar('modprobedir'), basename) | ||
133 | name = '%s%s' % (dvar, conf) | ||
134 | # If module name is in KERNEL_MODULE_PROBECONF, then generate the .conf file and write to `name`. | ||
124 | if modconf and basename in modconflist: | 135 | if modconf and basename in modconflist: |
125 | conf = '%s/%s.conf' % (d.getVar('modprobedir'), basename) | ||
126 | name = '%s%s' % (dvar, conf) | ||
127 | os.makedirs(os.path.dirname(name), exist_ok=True) | 136 | os.makedirs(os.path.dirname(name), exist_ok=True) |
128 | with open(name, 'w') as f: | 137 | with open(name, 'w') as f: |
129 | f.write("%s\n" % modconf) | 138 | f.write("%s\n" % modconf) |
139 | elif modconf: | ||
140 | bb.error("Please ensure module %s is listed in KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename)) | ||
141 | # If the .conf file exits, then add it to FILES:* and CONFFILES:*. | ||
142 | # It doesn't matter if it was generated from module_conf_* or installed by the recipe. | ||
143 | if os.path.exists(name): | ||
130 | conf2append = ' %s' % conf | 144 | conf2append = ' %s' % conf |
131 | d.appendVar('FILES:%s' % pkg, conf2append) | 145 | d.appendVar('FILES:%s' % pkg, conf2append) |
132 | d.appendVar('CONFFILES:%s' % pkg, conf2append) | 146 | d.appendVar('CONFFILES:%s' % pkg, conf2append) |
133 | 147 | ||
134 | elif modconf: | ||
135 | bb.error("Please ensure module %s is listed in KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename)) | ||
136 | |||
137 | if "description" in vals: | 148 | if "description" in vals: |
138 | old_desc = d.getVar('DESCRIPTION:' + pkg) or "" | 149 | old_desc = d.getVar('DESCRIPTION:' + pkg) or "" |
139 | d.setVar('DESCRIPTION:' + pkg, old_desc + "; " + vals["description"]) | 150 | d.setVar('DESCRIPTION:' + pkg, old_desc + "; " + vals["description"]) |