summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorSimone Weiß <simone.p.weiss@posteo.com>2024-04-19 20:08:55 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-08 14:51:43 +0100
commitf6de2b033d32c0f92f19f5a4a8c4c8874a00a8f7 (patch)
tree1c6ac8c8206199fd714cb8c4b3e024df994bb5bb /bitbake
parent7eebbdb6c45149e8bf7abbf6a9f0c8068f7668f7 (diff)
downloadpoky-f6de2b033d32c0f92f19f5a4a8c4c8874a00a8f7.tar.gz
bitbake: bitbake-layers: adapt force option to not use tinfoil
Fixes [YOCTO #15417] When a layer adds a new dependency after it was added to a conf, it can not be removed w/o this dependency in the setup. Even the dependent layer can not be added, as the tinfoil setup will fail. Adapt --force to not perform the tinfoil at all, the use will be at own risk, i.e. the added layers might not parse properly afterwards. This is not merged into the force option with -F as it even changes the loading of plugins from other layers and is hence even more invasive as force. Instead force can now be speciefied multiple times and is counted. (Bitbake rev: 541fa7f582133949563e65f2d43c4b16e873e5c1) Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/bin/bitbake-layers14
-rw-r--r--bitbake/lib/bblayers/action.py4
2 files changed, 12 insertions, 6 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index d4b1d1aaf2..aebb5100c2 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -33,7 +33,7 @@ def main():
33 add_help=False) 33 add_help=False)
34 parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') 34 parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
35 parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') 35 parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
36 parser.add_argument('-F', '--force', help='Force add without recipe parse verification', action='store_true') 36 parser.add_argument('-F', '--force', help='Forced execution: can be specified multiple times. -F will force add without recipe parse verification and -FF will additionally force the run withput layer parsing.', action='count', default=0)
37 parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR') 37 parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR')
38 38
39 global_args, unparsed_args = parser.parse_known_args() 39 global_args, unparsed_args = parser.parse_known_args()
@@ -59,16 +59,20 @@ def main():
59 plugins = [] 59 plugins = []
60 tinfoil = bb.tinfoil.Tinfoil(tracking=True) 60 tinfoil = bb.tinfoil.Tinfoil(tracking=True)
61 tinfoil.logger.setLevel(logger.getEffectiveLevel()) 61 tinfoil.logger.setLevel(logger.getEffectiveLevel())
62 try: 62 if global_args.force > 1:
63 bbpaths = []
64 else:
63 tinfoil.prepare(True) 65 tinfoil.prepare(True)
64 for path in ([topdir] + 66 bbpaths = tinfoil.config_data.getVar('BBPATH').split(':')
65 tinfoil.config_data.getVar('BBPATH').split(':')): 67
68 try:
69 for path in ([topdir] + bbpaths):
66 pluginpath = os.path.join(path, 'lib', 'bblayers') 70 pluginpath = os.path.join(path, 'lib', 'bblayers')
67 bb.utils.load_plugins(logger, plugins, pluginpath) 71 bb.utils.load_plugins(logger, plugins, pluginpath)
68 72
69 registered = False 73 registered = False
70 for plugin in plugins: 74 for plugin in plugins:
71 if hasattr(plugin, 'tinfoil_init'): 75 if hasattr(plugin, 'tinfoil_init') and global_args.force <= 1:
72 plugin.tinfoil_init(tinfoil) 76 plugin.tinfoil_init(tinfoil)
73 if hasattr(plugin, 'register_commands'): 77 if hasattr(plugin, 'register_commands'):
74 registered = True 78 registered = True
diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py
index a8f2699335..a14f19948e 100644
--- a/bitbake/lib/bblayers/action.py
+++ b/bitbake/lib/bblayers/action.py
@@ -50,8 +50,8 @@ class ActionPlugin(LayerPlugin):
50 50
51 try: 51 try:
52 notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdirs, None) 52 notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdirs, None)
53 self.tinfoil.modified_files()
54 if not (args.force or notadded): 53 if not (args.force or notadded):
54 self.tinfoil.modified_files()
55 try: 55 try:
56 self.tinfoil.run_command('parseConfiguration') 56 self.tinfoil.run_command('parseConfiguration')
57 except (bb.tinfoil.TinfoilUIException, bb.BBHandledException): 57 except (bb.tinfoil.TinfoilUIException, bb.BBHandledException):
@@ -83,6 +83,8 @@ class ActionPlugin(LayerPlugin):
83 layerdir = os.path.abspath(item) 83 layerdir = os.path.abspath(item)
84 layerdirs.append(layerdir) 84 layerdirs.append(layerdir)
85 (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdirs) 85 (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdirs)
86 if args.force > 1:
87 return 0
86 self.tinfoil.modified_files() 88 self.tinfoil.modified_files()
87 if notremoved: 89 if notremoved:
88 for item in notremoved: 90 for item in notremoved: