From patchwork Thu Jul 2 02:25:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel X-Patchwork-Id: 91580 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 278C8C43458 for ; Thu, 2 Jul 2026 14:23:15 +0000 (UTC) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.60708.1782959141722044998 for ; Wed, 01 Jul 2026 19:25:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=TMeTERc8; spf=pass (domain: gmail.com, ip: 209.85.218.44, mailfrom: dchvs11@gmail.com) Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-c126eb4e003so115383666b.0 for ; Wed, 01 Jul 2026 19:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782959140; cv=none; d=google.com; s=arc-20260327; b=eZNr54RS2/875+MkwU/SN7RCsxL9J6kEgj03KlWsbJTfNqfwyxf5OvseHo8f94EC98 fG0R9hzeU1+TL/5x8TCn4kOhTVdzFUaiS/FzOAg0nhGHnbnZUfMgthQg6LUZqz4gYmsm S6wPgbgW9hnbaIIya8eolukH8zUzJs3cK/VgLsRpS6F3XB2kiLubw4nzv1oeSOSkRHw9 VJKk+bHiFqFVbEqFRTce2knm4hlCWGLG5Adt9anIttL+KJdB4jdopPycLUe2D0cRWSO5 /n0/KakQrvk6iHyjx6WZ55/0OTYrWV1v0ml3bot0cc/dhFFB5yQhkHA+n5lddkV7Z2st iicA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature; bh=+I5moibnu0Uek061+5qYhh/omIGkLha6tAeVf0VX8QM=; fh=ZYcwCaqfhSVL6aqQEereyJKILpVTA7dZeRdqvWG/C7s=; b=LNV5upe7+k8PeBJv0p1CUdXZaircThwU0mBmu62JFrqiSOEus2gnwhjIWclseMFX9z g/Zemfqt21P0VSZ5LtnQ6pDNow5OG3YO53SiZMoi1s7a6u+oGUQH2XagDMyW1sc2a3xz vMvkXR6soe+R7OKy+HVPweLnVqtkyUUJg79YLZqeHul7qdKewMwH4Uld+UgNGiZnS3r4 jfPe/cbBACGsLbdBkO22FKgRghVCCuT8JDnjXpRBiXT+ow1yAwWDvF4sdX1UiXLbgXto L3DuC3YoQrfsvcfwCIUqjdZGCZWdXNrwz0syZq2eTXeIpfL/B28wGRvkXJIDJJOKmjJw Ajzg==; darn=lists.openembedded.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782959140; x=1783563940; darn=lists.openembedded.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=+I5moibnu0Uek061+5qYhh/omIGkLha6tAeVf0VX8QM=; b=TMeTERc8s/5Ucu8RDlyQIo4IxsI0cgrb05VAIGwKwxuUjN43M5+/ltoJn7HHMuWQPW eUOnb2s7Kg0lek7lm4G3ASG5mFi+4tccNvmZOQnbKPHELgYKdHbbcLyefZYVh5pFFsFi PUIzVaL1m0WOAzJdCEY/Ic1OqwDNre5cv3xBLM+zLCrKzxs9Spvkb6AXTuSsr2r0Qw92 nm6QWW5E5nRsrx0rsKKtwDMZw9/TGCC6E0sni0Kv5VG4VRDju9T8L1px+Vd1slAWS9P7 e0twXnTHBWEs3QOR2PgObum5sYP3e6AJu8q3twxRNpN1WEi2u4Acat8pLDEqHPqQ9+WO DqIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782959140; x=1783563940; h=cc:to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+I5moibnu0Uek061+5qYhh/omIGkLha6tAeVf0VX8QM=; b=MP91zyEHCftL7G07C1HFTZOkmaFL3NJNubrK4Fu+t1gzrsXmBKUxz7LfgXe7MZtYvQ NiTmCLUjU+vSOOxbud3HK/mef4rTBiVTjgG4pQUUwUaoarFRDwWhclDKNEr8W7fENh4I pHR/rcoo3YmoAchFpt+1JWH7JDooRuYO3c9I0mCSaIJKVJTA5awi1AVXHD36Qfp1ETG0 +rtN15Q+ruHe49TIwA/DhLGK/r56Dx+ZCWEW7u5TNHzH5fpV7vK3ROerE8gDbMj1wc6t K+3qebZMXIltEwRFUSa5b2KrNgWdYcbajbcQ5EMg9cDmAURLKY9qlhIjcmZJZViYP8RZ s2DQ== X-Gm-Message-State: AOJu0YxBgVgC//jd4yxeZBgFCUoW6vGuHYVjCD2PEIEQY2u34qm5Ayfj hxwWgJe4tzmztDNuiUHBHzNe3Fq84EeEGAfRsCOpEXcjy/h6FDpa24V9JUJKEo7EBBIQj/RJHqn /KD0ezy7BHQWIy1j6aYH/7veI3bJ7FwRBOhgR X-Gm-Gg: AfdE7clT61EkTtbclaRmQilL47z1cKu0puHyoJjvVEF/cS3rOw8C2BYCDK8poe2RqRQ Xb/vgw6QSZtsO7YlFNOvN/uGd6xF7dIwbwsvYyl6VD95NjSFVmUkAOhdzvg3IWVbhXg6vcpJ2KY Zet1LuxaeWKban/741sRqEm2f/buZajPXGT8BuZJS/OtC0GxvMKwJEkAAwZOVWIloje2hPpT4kZ ucwnbGsmdv0/P7UaBD5XBFmuUJ7aVSy59FDGmFef81cgnZhblwauoqCDXs+z0BNeWlzkX+MOuuN +WuIIWRjDw== X-Received: by 2002:a17:907:9694:b0:c12:a999:ab with SMTP id a640c23a62f3a-c12aa4aca96mr209785866b.63.1782959139906; Wed, 01 Jul 2026 19:25:39 -0700 (PDT) MIME-Version: 1.0 From: "Daniel" Date: Wed, 1 Jul 2026 20:25:28 -0600 X-Gm-Features: AVVi8CevvSPrb93dQ4Ht8TxyNF33qIt6zuQ_KzSjFgCe9x0QPXX5XrNADOfqUyU Message-ID: Subject: [PATCH] bitbake-setup: support --update-bb-conf on init and fix site.conf symlink for setup-dir == top-dir #bitbake #yocto To: bitbake-devel@lists.openembedded.org Cc: Richard Purdie , alex.kanavin@gmail.com List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 02 Jul 2026 14:23:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19813 From 4728c69d682451b1b50930ccb37daedcfd12fe83 Mon Sep 17 00:00:00 2001 From: Daniel Chaves Date: Wed, 1 Jul 2026 20:01:46 -0600 Subject: [PATCH] bitbake-setup: support --update-bb-conf on init and fix site.conf for setup-dir == top-dir Two fixes that work together to let `bitbake-setup init` preserve an existing bitbake build configuration (local.conf, bblayers.conf): 1. Expose the existing `update_bb_conf` parameter through a new `--update-bb-conf` CLI flag on `init`, matching the semantics of `bitbake-setup update`. This lets downstream projects re-run init (e.g., to refresh layers via --source-overrides) without losing their tracked conf files. Default remains "yes" for backward compatibility. 2. Fix the site.conf symlink target when the setup directory is the same as the top directory. The symlink target was always computed as `setupdir/../site.conf`, which only matches the actual site.conf location (top_dir/site.conf) when the setup directory is exactly one level below the top directory. When `--setup-dir-name` is given an absolute path equal to the top directory, the symlink ends up broken, which causes `diff -uNr` to fail with exit code 2 inside setup_bitbake_build(). That exception is raised before the `update_bb_conf == 'no'` branch can restore the original conf, defeating the new flag from #1. Together, these changes make `bitbake-setup init --update-bb-conf=no` behave like Yocto's `oe-init-build-env`: the build environment is preserved across re-initializations. Signed-off-by: Daniel Chaves --- bin/bitbake-setup | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 97ea08d11..9a59a5aaa 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -371,7 +371,10 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_c _prepend_passthrough_to_init_build_env(bitbake_builddir) siteconf_symlink = os.path.join(bitbake_confdir, "site.conf") - siteconf = os.path.normpath(os.path.join(setupdir, '..', "site.conf")) + if os.path.exists(os.path.join(setupdir, "site.conf")): + siteconf = os.path.join(setupdir, "site.conf") + else: + siteconf = os.path.normpath(os.path.join(setupdir, '..', "site.conf")) if os.path.lexists(siteconf_symlink): os.remove(siteconf_symlink) os.symlink(os.path.relpath(siteconf, bitbake_confdir), siteconf_symlink) @@ -870,7 +873,7 @@ def init_config(top_dir, settings, args): bb.event.register("bb.build.TaskProgress", handle_task_progress, data=d) write_upstream_config(confdir, upstream_config) - update_build(upstream_config, confdir, setupdir, layerdir, d, update_bb_conf="yes", init_vscode=args.init_vscode) + update_build(upstream_config, confdir, setupdir, layerdir, d, update_bb_conf=args.update_bb_conf, init_vscode=args.init_vscode) bb.event.remove("bb.build.TaskProgress", None) @@ -1268,6 +1271,8 @@ def main(): help='Symlink local source into a build, instead of getting it as prescribed by a configuration (useful for local development).') parser_init.add_argument('--init-vscode', action=argparse.BooleanOptionalAction, default=bool(shutil.which('code')), help='Generate VSCode workspace configuration (default: %(default)s)') + parser_init.add_argument('--update-bb-conf', choices=['prompt', 'yes', 'no'], default='yes', + help='Update bitbake configuration files (bblayers.conf, local.conf) when re-initializing an existing setup (default: %(default)s)') parser_init.set_defaults(func=init_config) parser_status = subparsers.add_parser('status', help='Check if the setup needs to be synchronized with configuration')