From patchwork Fri Nov 14 11:07:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 74534 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 EF2DCCE7AB1 for ; Fri, 14 Nov 2025 11:07:58 +0000 (UTC) Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.15590.1763118471265269971 for ; Fri, 14 Nov 2025 03:07:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=BB2fR+3K; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 8E6F8C10F61 for ; Fri, 14 Nov 2025 11:07:27 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5EE7B6060E for ; Fri, 14 Nov 2025 11:07:49 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D066D10371C4F; Fri, 14 Nov 2025 12:07:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763118469; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=6qrH5V/xZ+ei9JYsuouySUsbWPE5Q7atjAKjVTOUjBA=; b=BB2fR+3KOMMwpp4XAcctMi7LXX8OT53fIj600/MFlX8g9UaTa0VhQaKG00psZ4ntZam3qS nu+PPtfTAnaDUMy6ywidrWyfdmQyEmKKE0QhKaG2Q/vgBernhuL/v7KB7QgvKTomvQiZlN dAsA12CRb0vlXFQSq8WZImu6VOWuBtkqs6ZBt5D8wyLZ/0UNN71d7HLWTj/aSgSVTpO/V+ EB/3DdNQzALFAzm5vfwhVF95CyRZMyGk3dHTexKokmbcxDSisikWB3QNphZB2KCdBm599m e1/jrJW6Ng9J0c54pA3TZFq4kM/gZIFCZ5XIqHxMdlmhTPKnOl2ugtHPGjV61A== From: Antonin Godard Date: Fri, 14 Nov 2025 12:07:32 +0100 Subject: [PATCH 1/3] bitbake-setup: fix top_dir creation in create_siteconf MIME-Version: 1.0 Message-Id: <20251114-bitbake-setup-abort-v1-1-d2f9967df3b1@bootlin.com> References: <20251114-bitbake-setup-abort-v1-0-d2f9967df3b1@bootlin.com> In-Reply-To: <20251114-bitbake-setup-abort-v1-0-d2f9967df3b1@bootlin.com> To: bitbake-devel@lists.openembedded.org Cc: Thomas Petazzoni , Antonin Godard X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=862; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=8BjhQyAiRWPDh/MyUGfHyM+dGSQ3+JXA/Bx4/WEXWJE=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBpFw2CTa7NWACQ/E1RgJ/WWTlwIVNns7bMIV8U3 3buz4RxkXCJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCaRcNggAKCRDRgEFAKaOo NnuzD/9seWgF35sDe+LM977mwZnEhU5qfyJGG4sQwchpp+TVRIxJO/kAp9hM4z+u503ZCdRnjHi j1KVoWdgClQDvsbJlHwcUNEqsPk2sPMJsMTJuqijj3II+zqpKsYQgvAmvAGfAOJh5IlxntOpG0V JBZE0tGvqH5xpWZ310m/GBtg0Rx60GRb8N7EnTFnZiWkzc37qrIi35KBXAV+TwdDAWywVXwASYS 2Jk143aM4x4qoQlnibVN+BuOLPbpqKHvgqZBM7cTNSruZUJFnYaDrbpLN8NLLLbD1OxpQeQAQJX ARTT7IhzZ7bbDpqKd+4jN94nwhDWhML8Vs2u+dd4LIG5QZillGJCNxN0lWGA3NsmzjKV0jqOZvh h5TQUWVjzeCZNcWj0JSHfp2qQ0nv9VR12HHgApUqVs0+u0Reg6bIWWJ2a93q5vtH/O8GV6/qMlp bY0Q6T7Nk9zicBUeUT05bobabsqg6H39VFa2lYR4+biByGexxvpwmxQwX+T7HbJQuVzdy1RPIDs RrkDbNu2TvufNxZ/C8qfN2c54cN/NXWur0LdFjr013zgr5acXA39htwrmDN1DSTEoI5/hSYsNAU ud/3u7u0t6/o/Sd84KHaVrWZBGkTrVO7wHPvOhTa5/KUYVW2KosQVVJiqH3P6vCB4o1ArwodzBY gkovpGVvpGnyQCw== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Fri, 14 Nov 2025 11:07:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18389 The intent of the create_siteconf() is to create the site.conf file common to all setups. For this it needs the top directory to be created. Create the top directory instead of its parent. Signed-off-by: Antonin Godard --- bin/bitbake-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 5bbe3c0fce..6410504d4f 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -677,7 +677,7 @@ def create_siteconf(top_dir, non_interactive, settings): if y_or_n != 'y': exit() - os.makedirs(os.path.dirname(top_dir), exist_ok=True) + os.makedirs(top_dir, exist_ok=True) with open(siteconfpath, 'w') as siteconffile: siteconffile.write( textwrap.dedent( From patchwork Fri Nov 14 11:07:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 74535 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 0B900CE7AB3 for ; Fri, 14 Nov 2025 11:07:59 +0000 (UTC) Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.15473.1763118471311890460 for ; Fri, 14 Nov 2025 03:07:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=wC6FT9fM; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 317F8C10F62 for ; Fri, 14 Nov 2025 11:07:28 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 015156060E for ; Fri, 14 Nov 2025 11:07:50 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 58C2B1037183F; Fri, 14 Nov 2025 12:07:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763118469; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=4h4frQ+UQWtRYQ7az1aHhxitLheYapobAmrYmkx/xLA=; b=wC6FT9fMnYa3IZs7soxNZYRofWy0c1ogbpy1TaYuSoDtcuhwhkonnO/526DpN5lm+Q9EUw gF962IqM7adWc1csgJcOxMbMlQ+dnANHlEDqwxx0O3eQeehvMphzDwqTYPIu1FPdvyP+YO DqbyTsyM+CbnQ/An6mERiBO64cCpNk3rfxzFLa//UYzZEZRKQaPjPKyP86eK7xaGdki1Z/ 0rat7zkdeUv/O5pIoOFW/F9pDGhByqDltQnoShs+m5w9FHaZ/VyFSxc4DTKtU6NCPqdbBh dEReDEOu9Bl+IH1MJCJvbwlKsTxVaIDn9lNth3xsB2nJ/YqU8BbsroAn4QV7IA== From: Antonin Godard Date: Fri, 14 Nov 2025 12:07:33 +0100 Subject: [PATCH 2/3] bitbake-setup: create top-dir later in init MIME-Version: 1.0 Message-Id: <20251114-bitbake-setup-abort-v1-2-d2f9967df3b1@bootlin.com> References: <20251114-bitbake-setup-abort-v1-0-d2f9967df3b1@bootlin.com> In-Reply-To: <20251114-bitbake-setup-abort-v1-0-d2f9967df3b1@bootlin.com> To: bitbake-devel@lists.openembedded.org Cc: Thomas Petazzoni , Antonin Godard X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2401; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=ZggVQgD1lamBTTKVAgpyRXEIqSLDwrTDxw9xjXrBiyU=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBpFw2DjCbRFzEEtF375gx/rVPPg4dxej3pzPMbX 5DQtxLA7eSJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCaRcNgwAKCRDRgEFAKaOo Nut2EACqnbaP9ZmqjBtG6V584EBv/8F3UO87kKJXGL+6McxRYZwc04GSTifYZmXfUQ88BU3Fkqn gkhFGa7PgTGEWWy2JSrsxM+KYcAnAC+FoC+CBTHeOPUe9allUYL1+EE7zIeGSrb2nY/rC3nTpsj nT/ePoyIo4dUs5faRBk3LUMXM68o5c8qP5nzOonpMgKC+auoNAI/boYn7zMikS/H+5vCDOrh2sy HxXB5ckIsF0Pyjky65USwW6fPU8VkJ8LojAIKhrvzU1bcELRbkfUG6U2D66/zc3rnYxj5RHgkk4 5w9EXN9zsENv7Ob8BczotcqUzeA44k+bD3rQSsQGc32cM2YDQf6A/AKn/iEeXXIz58vCtXtp5gN Spz7Tgn14GDZAIFtq+TAcJw1HW/NZ1Quh4xgx9AjMUf6jigxsqnOe5rKvoC5T1Uo21EcbARfiaA ZIwFPdZZFxioBtI8xUlFgv4IwD1hMtzxDi5EnJe7rjMQyBoPHWFuNP+V8PcYKjVDUr+DH4eA8W1 uwLwCr+zTT7MTG1NRjTBT31KcfhdO73H6/hqGOtk+bSacTf4N2JfZkMVKmAgJHgAFg/oS4Sqnvk bhJiRsUVXX/wsUcfDYpF3cZUIiKShc2SF9yQSmQS/AT0ISK5EkeBjsi3h7JmU08TV5yIEgNadc3 4QORHeRZP0RhmJw== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Fri, 14 Nov 2025 11:07:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18391 Calling init_bb_cache() before init_config() creates the top-directory already, before the user has accepted to proceed after the first few messages: Bitbake-setup is using as top directory ("bitbake-setup settings --help" shows how to change it). A common site.conf file will be created, please edit or replace before running builds /site.conf Proceed? (y/N): Saying N here would leave an empty top directory which is unexpected. Move the init_bb_cache() call later in init_config(). Signed-off-by: Antonin Godard --- bin/bitbake-setup | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 6410504d4f..3dc46cbbfa 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -452,14 +452,16 @@ def obtain_config(top_dir, settings, args, source_overrides, d): upstream_config['skip-selection'] = args.skip_selection return upstream_config -def init_config(top_dir, settings, args, d): +def init_config(top_dir, settings, args): + create_siteconf(top_dir, args.non_interactive, settings) + + d = init_bb_cache(top_dir, settings, args) stdout = sys.stdout def handle_task_progress(event, d): rate = event.rate if event.rate else '' progress = event.progress if event.progress > 0 else 0 print("{}% {} ".format(progress, rate), file=stdout, end='\r') - create_siteconf(top_dir, args.non_interactive, settings) source_overrides = json.load(open(args.source_overrides)) if args.source_overrides else {'sources':{}} upstream_config = obtain_config(top_dir, settings, args, source_overrides, d) print("\nRun 'bitbake-setup init --non-interactive {}' to select this configuration non-interactively.\n".format(" ".join(upstream_config['non-interactive-cmdline-options']))) @@ -898,6 +900,10 @@ def main(): print('Bitbake-setup is using {} as top directory ("bitbake-setup settings --help" shows how to change it).\n'.format(top_dir, global_settings_path(args))) + if args.func == init_config: + init_config(top_dir, all_settings, args) + return + d = init_bb_cache(top_dir, all_settings, args) args.func(top_dir, all_settings, args, d) save_bb_cache() From patchwork Fri Nov 14 11:07:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 74533 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 0A7D9CE7AB6 for ; Fri, 14 Nov 2025 11:07:59 +0000 (UTC) Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.15475.1763118471824747514 for ; Fri, 14 Nov 2025 03:07:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=tBCqONOG; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id B1C50C10F63 for ; Fri, 14 Nov 2025 11:07:28 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 820866060E for ; Fri, 14 Nov 2025 11:07:50 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EF67310371C51; Fri, 14 Nov 2025 12:07:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763118470; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ktG8LzZzQkuSLcDW49J9baAvqhS9vzHdhMmZDeW+0qc=; b=tBCqONOG9ozmZuVkx4HGY4x3c8/wbdc56cMhEwAnuKeeE0yAUdF2BKq0O25+Zp8LQRPOY+ NQ2sCCNONlMRJ3kKEXe5PPRt+n5jxB8LzDwOPeIkjc7tMD2yFD8JHz2WuH0vrpBs5NZaX7 0xF6R7yViqoNXnUl2h2QgACISHfBY+hQ6JaNvu6/7nihlhlR72fWl0bsSi4zJKiI49UHOK NN3CTot6arfWcz9WliaazkvqRZNeJO/5oZPaFFKKu+C2+RtK9VoNcdscghIrgxXaSSRZjn zVAddLgStZvVq6M2mtKx9ZU27sbF3WD1Q0oD/UjdCIoqYGp3uOsniYjNsgAIag== From: Antonin Godard Date: Fri, 14 Nov 2025 12:07:34 +0100 Subject: [PATCH 3/3] bitbake-setup: handle ctrl+c in init MIME-Version: 1.0 Message-Id: <20251114-bitbake-setup-abort-v1-3-d2f9967df3b1@bootlin.com> References: <20251114-bitbake-setup-abort-v1-0-d2f9967df3b1@bootlin.com> In-Reply-To: <20251114-bitbake-setup-abort-v1-0-d2f9967df3b1@bootlin.com> To: bitbake-devel@lists.openembedded.org Cc: Thomas Petazzoni , Antonin Godard X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1397; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=9u4QI/C3QLbh9l0zBYmCgrFBurncx7UgXGKUq7gVKcI=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBpFw2DTEyCcPPKJMHLTR0m/8l+rCyjUI9s6nOfR bt4DuHAcvaJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCaRcNgwAKCRDRgEFAKaOo NlGPD/9Y1N8wX0UekpSOl6tU1cHPgievLC/ZEwW3OnqDg5mizyHYGOcfimee6isVfeERs2c3S+X 6miy4k+cIggD/euU8bH3sqQkveZDL+A+CmB5uSFkpobp1faYt5NFjXRoqupNgZoxr/gjMTaXex0 UyHMsuYSz7pKzTFaN2XigkNgZGpU3SVPAn/p1tl5Q2kgOtJMHX1tj72BIMS/jW1NNCaDJewGKja xUi7oO/471H0M6+vas+2qHgKUS/+JHvolLaxoN+a+7fwMnIe09GknMP7IKtmIHv63qf6KuoZEFu BiCoZ8edn1lI/QLewyERN9c6OAYD7/6VPNFKMWgt5pZVrWfc3fT2UNYv86yeK2Ynh26l+BDj/lm 6HhaObLTdYNDDkMb342yw/bgH+sLmuJ8r5+Mo6J+i0rVeYpQfDS1t7bCZcO7QvS6VWaZFUs9naY ZzE+LEcGzHIknouhPxio4kgvvAHai7Lajq/1G2aDx47UzJTA70sYFunWGuUSGPsw43cvKSfROvX 63Y8K7hSrWIaKCiT0k3/3llOWSV+kXoXHdJpx3Yo2YsTPRnm9dxvlbaEeTGx5mOTIjYoJzVvIzy TuTXlO2HGb11tDHPrP46KnIH9FPWk6liQoq0fuuiBuDNKTmIFr8ihQqBrk/7x1v0VDiW8srZAj3 b8eh4r8aBSNdOsg== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Fri, 14 Nov 2025 11:07:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18392 Instead of printing the stack trace, print "Shutting down..." when the user presses Ctrl+C during the init. Mention that the top-directory's setups might be incomplete if the topdir was already created. Signed-off-by: Antonin Godard --- bin/bitbake-setup | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 3dc46cbbfa..151cb79cac 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -17,6 +17,8 @@ import glob import subprocess import copy import textwrap +import signal +import functools default_registry = os.path.normpath(os.path.dirname(__file__) + "/../default-registry") @@ -452,7 +454,15 @@ def obtain_config(top_dir, settings, args, source_overrides, d): upstream_config['skip-selection'] = args.skip_selection return upstream_config +def init_sigint_handler(sig, frame, top_dir): + print(f'\nShutting down...') + if isinstance(top_dir, str) and os.path.exists(top_dir): + print(f'{top_dir} may contain an incomplete setup!') + exit() + def init_config(top_dir, settings, args): + _handler = functools.partial(init_sigint_handler, top_dir=top_dir) + signal.signal(signal.SIGINT, _handler) create_siteconf(top_dir, args.non_interactive, settings) d = init_bb_cache(top_dir, settings, args)