From patchwork Wed Mar 12 09:07:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kasturi Shekar X-Patchwork-Id: 4092 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 12 Mar 2025 10:08:19 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-wr1-f64.google.com (mail-wr1-f64.google.com [209.85.221.64]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 52C98JVY019899 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 12 Mar 2025 10:08:19 +0100 Received: by mail-wr1-f64.google.com with SMTP id ffacd0b85a97d-3912fe32a30sf2575636f8f.1 for ; Wed, 12 Mar 2025 02:08:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1741770494; cv=pass; d=google.com; s=arc-20240605; b=RIWiwm1iJuf35lP8Pm3BWtXBq8mHJUuqZjOMrENMGZfbDgck6ucZXoHSSlosI+6LAo fTB7JesAz4n3Y510N0Hz0tetoSY3m4hPNV2BmrBZyI/uUls6wdE3OLz8+hFXBAkxoWOO /lHfARjhtfWevKgAI0VElBZVEPvKGEY7j9FWWJQJKNvcaxxxkr+0QnXZFreU7tGZKR19 MNOfN9BhnMOOG7Ky2+gaciYJWjVZQlHpmt0Xsc8c01h/0p5AznNP6EXXJR5gh6ZU42Mu o/ChP2A3z3fO2tWTElHLqxPPIzUJ4vq9Hh2MQvXpKRTSjwUBjQvUPmscDsmObCA68ZXI OcKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iVcEB69bENiYYIVomfdl68XM+JnHKAA1sm6N4vGYCV0=; fh=53TIKp6LkOhQ+7BxGHXkFzlKj9IIk8QZzk1uOJv1rxY=; b=b5FvuD2LT5T4dJKh3ahsKba44yWw8rOueRwR3AxDzDZvzq4HLSvKbAqhoKAtlgfBiq cafaCEqxKvTgawtIiXEA1M5ufcFnF9Nh7jNv/XSf0Zid9s6DI2Cfnafc2G4p/QL9yBow FkRv4Pmzn64D0BJkzbmbSTPDIatSDzEa/84KyDLJrM04c3a1p4R4Lekmmay4sqoTQw74 M5Z9M2th/+G//R4LjuagAta3+GK+4TTa98L7QFZ9T193R8apsvIcyDHqdMwKSD9FGwkH 1XjhfCYCO6442FyB6XN9xsCjrzONhbNtZcr44gRof6nDIYu03GVG9nQlgtIoK7LvbBRC dF9w==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=gKUEKkaj; spf=pass (google.com: domain of fm-1328757-20250312090810d566a21fa6777804c2-xodthk@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1328757-20250312090810d566a21fa6777804c2-XODtHk@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1741770494; x=1742375294; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=iVcEB69bENiYYIVomfdl68XM+JnHKAA1sm6N4vGYCV0=; b=v1oPKahEjjtDIIZMd90OikAz6fGFptIxJV5McCuEQzCUep4sHtLlLhO/bD9chDb5J4 vP9+b9N46UqOhVVbE1PDut157kXDScOnHxqpDBDQb4RAjc8bHUtVo2k1arXr55NwiFLT fbvKix4uhSLYjzpwv0mdTKrX+ujp9x3jejsUeF5fDH6txHYyUXtVhmECnUuIRU3/feKf sBa3b3h98YPDCRAln8IsU3t+VK/HUG6cbdE1fhnalfZ4YO6HhkNgH4hjJ9vORsu4U1U1 6jB/r2MYxDKw1FMcTSeCYfEz/WLaD2+cw2pkGVvIKqkEjUP9U1kTufuKoPQJTWkziEwc FGTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741770494; x=1742375294; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iVcEB69bENiYYIVomfdl68XM+JnHKAA1sm6N4vGYCV0=; b=lUWRf3SZmEjpBq79tCAmosEWgBkSLEDYq6bjfHfXfxTom+1QMQjXRcpejr1Ai7Xllp G96vy/61ztqUllhP/WA5BQ3ImXMwneR9okbZ9eFQMdB8ca1WV3FZ1vD3qFm2lV+zv5ao 2z1Eq1eadBUf67bmoFc4xdKpdYfRbQfHDqjQhejisDhtbNcZmi8fZ0IYSX4OAltfJno/ w6dQ67wxyoV4y7m0lZ0/zLNbPmCyK1K0is5qmZxNI4JOHgnEysADn4elhaE+D0jYRJvE ppT+8oSyf6Tq77+jLMbTp64aqjrMLHp9CTjnqjRzw4YQ0ZZc6TxAxLTi+f3IBOXDYcGG Mwrw== X-Forwarded-Encrypted: i=2; AJvYcCWOGD7r4r8FqOp7n3B0+MordXuAaBBgYpzzVAbRvw8kIaFfral257ttodbKlBmnOfFyVovyFfU=@isar-build.org X-Gm-Message-State: AOJu0Yx7vMTpNuK8dbIpn3NXZYLc1VH/T4BNPsqgtNQ0MaOQYbZFT61b 3IlZskVsJWaO8QQNJ8+KGAPuoC+hYQLpSGB5LlAfJt1KkA/dH7aK X-Google-Smtp-Source: AGHT+IGDlTnxYbZzjbaAk73akhxVwWDFd+jcqnyIlnEzAaJzFhYR0m2n4J9unBAtLvaShqeIF5/+iw== X-Received: by 2002:a05:6000:1f83:b0:390:f9d0:5e3 with SMTP id ffacd0b85a97d-39263affd7amr6594285f8f.1.1741770493362; Wed, 12 Mar 2025 02:08:13 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h=Adn5yVGAJ8De7ly74d4It6Hl3KehKZTHM4W6Cc1frfyJk41tUw== Received: by 2002:a5d:59ae:0:b0:38d:ca0d:d5f9 with SMTP id ffacd0b85a97d-3912967efb9ls3672165f8f.1.-pod-prod-01-eu; Wed, 12 Mar 2025 02:08:11 -0700 (PDT) X-Received: by 2002:a05:6000:4102:b0:390:df02:47f0 with SMTP id ffacd0b85a97d-3926c1ce305mr6448146f8f.42.1741770491149; Wed, 12 Mar 2025 02:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741770491; cv=none; d=google.com; s=arc-20240605; b=BUsFGHSH7IJH9WOTqw8BBPvAsViZFIzK1c+1k8KQnf27GDnm4DclAjBRHotEALE7yF j5P8AlZsMIjp+36Jz+dH4TYTmard2sR/PT3qczm4LS9XpdtIPFgvPswW8PDx3lND+/5Z qgC93IZtnrndJbCWzGtGfkmCWdsETSrQbpfbTIJSDtOlKf1HEotrPHBW88BGGzvikjsJ WJTI1weesgs97ignzSjAwNWheHNEa7+S2LjfdzUMppa+ybjG4/BxfFBZbg3tjwgU/BXX Y5chqlDCvztI9ta+TdHF0YDxzKjxk0pXiqbeudC0/j4MspPzd7686sFVbNjAqRzmKhaz Ckug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=lKZRR96VarVGjEaAcejRB2rGIIDEJKSwV8iN/Vp6w0U=; fh=pR4tJPO4NbHlIB/rP4bIo54Z1zh5hd/ksAGQ0tcKkYM=; b=fSecqNAByv+XGH8cGq+5FMzQjO18vl0U8FxIgp/xf8aC9+E0h9PFUEOmAkC08W37Qx BDE5cj/ttVMFuSsUIPlcPEqSMYSCG3ONYvvioHjU1EippnhGwW+eAt+4k2d4mL1zDINR uvgFcPglYv09Qin9RXhV1wwXIM4Hulp3wuZUsloR4O/Y77mpNbo58lhGDWDXkt7ZmByO kN7cg2GIeGfmaEKrQFJ6IgFyegLVuNCqGLrtMQSaxl3jYxz7OHm8k1JSJE8MyY87icFL Tb0yQHieSPXEOWd9gs+W/TOZ1XNEUrFpeoAef0LgJCb14LXD5AydZlz0Dat/XtXFM5ob r9lA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=gKUEKkaj; spf=pass (google.com: domain of fm-1328757-20250312090810d566a21fa6777804c2-xodthk@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1328757-20250312090810d566a21fa6777804c2-XODtHk@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id ffacd0b85a97d-3912c081348si110527f8f.4.2025.03.12.02.08.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Mar 2025 02:08:11 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1328757-20250312090810d566a21fa6777804c2-xodthk@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20250312090810d566a21fa6777804c2 for ; Wed, 12 Mar 2025 10:08:10 +0100 X-Patchwork-Original-From: "'Kasturi Shekar' via isar-users" From: Kasturi Shekar To: isar-users@googlegroups.com Cc: Kasturi Shekar Subject: [PATCH v3] bmap-tools: Fix --psplash functionality with bmap-tools 3.6 (bookworm) Date: Wed, 12 Mar 2025 14:37:53 +0530 Message-Id: <20250312090753.566643-1-kasturi.shekar@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1328757:519-21489:flowmailer X-Original-Sender: kasturi.shekar@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=gKUEKkaj; spf=pass (google.com: domain of fm-1328757-20250312090810d566a21fa6777804c2-xodthk@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1328757-20250312090810d566a21fa6777804c2-XODtHk@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Kasturi Shekar Reply-To: Kasturi Shekar Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= - Fixed the issue where the --psplash-pipe flag was not working in bmap-tools version 3.6 (Bookworm). - Added a patch to ensure the correct handling of the --psplash-pipe flag and avoid skipping the _psplash_pipe section when _progress_file is null. - With this fix, psplash can now be used with bmap-tools(v3.6) to properly display progress updates. Debian is not going to fix it in bookworm, Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034290 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100092 Signed-off-by: Kasturi Shekar --- .../bmap-tools/bmap-tools.bb | 21 +++++ ...er-passing-error-of-set_psplash_pipe.patch | 28 +++++++ ...e-part-was-skipped-when-_progress_fi.patch | 78 +++++++++++++++++++ .../deploy-image/deploy-image_0.1.bb | 1 + 4 files changed, 128 insertions(+) create mode 100644 meta-isar/recipes-installer/bmap-tools/bmap-tools.bb create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch create mode 100644 meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch diff --git a/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb new file mode 100644 index 00000000..376ab433 --- /dev/null +++ b/meta-isar/recipes-installer/bmap-tools/bmap-tools.bb @@ -0,0 +1,21 @@ +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2025 +# +# SPDX-License-Identifier: MIT + +inherit dpkg + +SRC_URI = "apt://${BPN}" +PN = "bmap-tools" +CHANGELOG_V="+isar" + +SRC_URI += "file://0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch;apply=no \ + file://0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch;apply=no" + +do_prepare_build:append() { + deb_add_changelog + + cd ${S} + quilt import -f ${WORKDIR}/*.patch + quilt push -a +} diff --git a/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch new file mode 100644 index 00000000..a45bcbc4 --- /dev/null +++ b/meta-isar/recipes-installer/bmap-tools/files/0001-Fix-path-parameter-passing-error-of-set_psplash_pipe.patch @@ -0,0 +1,28 @@ +From 06fa51d0270f84d9553c044bd7391f01459a70e8 Mon Sep 17 00:00:00 2001 +From: Jason +Date: Wed, 26 Jan 2022 16:26:47 +0800 +Subject: [PATCH] Fix path parameter passing error of set_psplash_pipe function + +--- + bmaptools/BmapCopy.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py +index c6a2603..dba24a5 100644 +--- a/bmaptools/BmapCopy.py ++++ b/bmaptools/BmapCopy.py +@@ -228,11 +228,11 @@ def set_psplash_pipe(self, path): + a best effort. + """ + +- if os.path.exists(pipe) and stat.S_ISFIFO(os.stat(pipe).st_mode): +- self._psplash_pipe = pipe ++ if os.path.exists(path) and stat.S_ISFIFO(os.stat(path).st_mode): ++ self._psplash_pipe = path + else: + _log.warning("'%s' is not a pipe, so psplash progress will not be " +- "updated" % pipe) ++ "updated" % path) + + def set_progress_indicator(self, file_obj, format_string): + """ diff --git a/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch new file mode 100644 index 00000000..bf17a7d1 --- /dev/null +++ b/meta-isar/recipes-installer/bmap-tools/files/0002-Fix-_psplash_pipe-part-was-skipped-when-_progress_fi.patch @@ -0,0 +1,78 @@ +From 163a49259d025e220e9de4fc2a6296c2c3053500 Mon Sep 17 00:00:00 2001 +From: Jason +Date: Mon, 7 Feb 2022 17:55:16 +0800 +Subject: [PATCH] Fix _psplash_pipe part was skipped when _progress_file is + null + +--- + bmaptools/BmapCopy.py | 56 +++++++++++++++++++++---------------------- + 1 file changed, 27 insertions(+), 29 deletions(-) + +diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py +index dba24a5..ca22aba 100644 +--- a/bmaptools/BmapCopy.py ++++ b/bmaptools/BmapCopy.py +@@ -396,36 +396,34 @@ def _update_progress(self, blocks_written): + else: + _log.debug("wrote %d blocks" % blocks_written) + +- if not self._progress_file: +- return +- +- if self.mapped_cnt: +- progress = '\r' + self._progress_format % percent + '\n' +- else: +- # Do not rotate the wheel too fast +- now = datetime.datetime.now() +- min_delta = datetime.timedelta(milliseconds=250) +- if now - self._progress_time < min_delta: +- return +- self._progress_time = now +- +- progress_wheel = ('-', '\\', '|', '/') +- progress = '\r' + progress_wheel[self._progress_index % 4] + '\n' +- self._progress_index += 1 +- +- # This is a little trick we do in order to make sure that the next +- # message will always start from a new line - we switch to the new +- # line after each progress update and move the cursor up. As an +- # example, this is useful when the copying is interrupted by an +- # exception - the error message will start form new line. +- if self._progress_started: +- # The "move cursor up" escape sequence +- self._progress_file.write('\033[1A') # pylint: disable=W1401 +- else: +- self._progress_started = True ++ if self._progress_file: ++ if self.mapped_cnt: ++ progress = '\r' + self._progress_format % percent + '\n' ++ else: ++ # Do not rotate the wheel too fast ++ now = datetime.datetime.now() ++ min_delta = datetime.timedelta(milliseconds=250) ++ if now - self._progress_time < min_delta: ++ return ++ self._progress_time = now ++ ++ progress_wheel = ('-', '\\', '|', '/') ++ progress = '\r' + progress_wheel[self._progress_index % 4] + '\n' ++ self._progress_index += 1 ++ ++ # This is a little trick we do in order to make sure that the next ++ # message will always start from a new line - we switch to the new ++ # line after each progress update and move the cursor up. As an ++ # example, this is useful when the copying is interrupted by an ++ # exception - the error message will start form new line. ++ if self._progress_started: ++ # The "move cursor up" escape sequence ++ self._progress_file.write('\033[1A') # pylint: disable=W1401 ++ else: ++ self._progress_started = True + +- self._progress_file.write(progress) +- self._progress_file.flush() ++ self._progress_file.write(progress) ++ self._progress_file.flush() + + # Update psplash progress when configured. This is using a best effort + # strategy to not affect the writing process when psplash breaks, is diff --git a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb index 242ca88e..54e521b5 100644 --- a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb +++ b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb @@ -10,6 +10,7 @@ inherit dpkg-raw SRC_URI = "file://usr/bin/deploy-image-wic.sh \ file://usr/lib/deploy-image-wic/handle-config.sh \ " +DEPENDS:bookworm += "bmap-tools" DEBIAN_DEPENDS = "bmap-tools, pv, dialog, util-linux, parted, fdisk, gdisk, pigz, xz-utils, pbzip2, zstd" do_install[cleandirs] = "${D}/usr/bin/ \ ${D}/usr/lib/deploy-image-wic \