diff options
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/bsp/kernel.py | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py index fc1e6bdd08..9ed6e9417c 100644 --- a/scripts/lib/bsp/kernel.py +++ b/scripts/lib/bsp/kernel.py | |||
@@ -239,22 +239,32 @@ def yocto_kernel_config_add(scripts_path, machine, config_items): | |||
239 | user-defined config fragment [${machine}-user-config.cfg]. | 239 | user-defined config fragment [${machine}-user-config.cfg]. |
240 | """ | 240 | """ |
241 | new_items = [] | 241 | new_items = [] |
242 | dup_items = [] | ||
243 | |||
244 | cur_items = read_config_items(scripts_path, machine) | ||
242 | 245 | ||
243 | for item in config_items: | 246 | for item in config_items: |
244 | if not item.startswith("CONFIG") or (not "=y" in item and not "=m" in item): | 247 | if not item.startswith("CONFIG") or (not "=y" in item and not "=m" in item): |
245 | print "Invalid config item (%s), exiting" % item | 248 | print "Invalid config item (%s), exiting" % item |
246 | sys.exit(1) | 249 | sys.exit(1) |
247 | new_items.append(item) | 250 | if item not in cur_items and item not in new_items: |
248 | 251 | new_items.append(item) | |
249 | cur_items = read_config_items(scripts_path, machine) | 252 | else: |
250 | cur_items.extend(new_items) | 253 | dup_items.append(item) |
251 | 254 | ||
252 | write_config_items(scripts_path, machine, cur_items) | 255 | if len(new_items) > 0: |
253 | 256 | cur_items.extend(new_items) | |
254 | print "Added items:" | 257 | write_config_items(scripts_path, machine, cur_items) |
255 | for n in new_items: | 258 | print "Added item%s:" % ("" if len(new_items)==1 else "s") |
256 | print "\t%s" % n | 259 | for n in new_items: |
257 | 260 | print "\t%s" % n | |
261 | |||
262 | if len(dup_items) > 0: | ||
263 | output="Below item%s already exist%s in current configuration, ignore %s" % \ | ||
264 | (("","s", "it") if len(dup_items)==1 else ("s", "", "them" )) | ||
265 | print output | ||
266 | for n in dup_items: | ||
267 | print "\t%s" % n | ||
258 | 268 | ||
259 | def find_current_kernel(bsp_layer, machine): | 269 | def find_current_kernel(bsp_layer, machine): |
260 | """ | 270 | """ |